Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
80c774e0
Commit
80c774e0
authored
16 years ago
by
Jordi Inglada
Browse files
Options
Downloads
Patches
Plain Diff
DOC: added file for mean shift example
parent
506b91a6
Branches
Branches containing commit
Tags
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Examples/BasicFilters/MeanShiftVectorImageFilterExample.cxx
+101
-0
101 additions, 0 deletions
Examples/BasicFilters/MeanShiftVectorImageFilterExample.cxx
with
101 additions
and
0 deletions
Examples/BasicFilters/MeanShiftVectorImageFilterExample.cxx
0 → 100644
+
101
−
0
View file @
80c774e0
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#ifdef __BORLANDC__
#define ITK_LEAN_AND_MEAN
#endif
// Software Guide : BeginCommandLineArgs
// INPUTS: {}
// OUTPUTS: {}, {}
// Software Guide : EndCommandLineArgs
// Software Guide : BeginLatex
//
#include
"itkExceptionObject.h"
#include
"otbVectorImage.h"
#include
"otbImageFileReader.h"
#include
"otbStreamingImageFileWriter.h"
#include
"otbMeanShiftVectorImageFilter.h"
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
!=
10
)
{
std
::
cerr
<<
"Usage: "
<<
argv
[
0
]
<<
" infname filteredfname clusteredfname labeledclusteredfname clusterboundariesfname spatialRadius rangeRadius minregionsize scale"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
const
char
*
infname
=
argv
[
1
];
const
char
*
filteredfname
=
argv
[
2
];
const
char
*
clusteredfname
=
argv
[
3
];
const
char
*
labeledclusteredfname
=
argv
[
4
];
const
char
*
clusterboundariesfname
=
argv
[
5
];
const
unsigned
int
spatialRadius
=
atoi
(
argv
[
6
]);
const
double
rangeRadius
=
atof
(
argv
[
7
]);
const
unsigned
int
minRegionSize
=
atoi
(
argv
[
8
]);
const
double
scale
=
atoi
(
argv
[
9
]);
const
unsigned
int
Dimension
=
2
;
typedef
float
PixelType
;
typedef
otb
::
VectorImage
<
PixelType
,
Dimension
>
ImageType
;
typedef
otb
::
ImageFileReader
<
ImageType
>
ReaderType
;
typedef
otb
::
StreamingImageFileWriter
<
ImageType
>
WriterType
;
typedef
otb
::
MeanShiftVectorImageFilter
<
ImageType
,
ImageType
>
FilterType
;
typedef
FilterType
::
LabeledOutputType
LabeledImageType
;
typedef
otb
::
StreamingImageFileWriter
<
LabeledImageType
>
LabeledWriterType
;
// Instantiating object
FilterType
::
Pointer
filter
=
FilterType
::
New
();
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
WriterType
::
Pointer
writer1
=
WriterType
::
New
();
WriterType
::
Pointer
writer2
=
WriterType
::
New
();
LabeledWriterType
::
Pointer
writer3
=
LabeledWriterType
::
New
();
LabeledWriterType
::
Pointer
writer4
=
LabeledWriterType
::
New
();
reader
->
SetFileName
(
infname
);
writer1
->
SetFileName
(
filteredfname
);
writer2
->
SetFileName
(
clusteredfname
);
writer3
->
SetFileName
(
labeledclusteredfname
);
writer4
->
SetFileName
(
clusterboundariesfname
);
filter
->
SetSpatialRadius
(
spatialRadius
);
filter
->
SetRangeRadius
(
rangeRadius
);
filter
->
SetMinimumRegionSize
(
minRegionSize
);
filter
->
SetScale
(
scale
);
filter
->
SetInput
(
reader
->
GetOutput
());
writer1
->
SetInput
(
filter
->
GetOutput
());
writer2
->
SetInput
(
filter
->
GetClusteredOutput
());
writer3
->
SetInput
(
filter
->
GetLabeledClusteredOutput
());
writer4
->
SetInput
(
filter
->
GetClusterBoundariesOutput
());
writer1
->
Update
();
writer2
->
Update
();
writer3
->
Update
();
writer4
->
Update
();
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment