Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
484b62a4
Commit
484b62a4
authored
Apr 16, 2015
by
Guillaume Pasero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: replace deprecated Edison meanshift in Examples
parent
5b035c87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
19 deletions
+22
-19
Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx
Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx
+12
-11
Examples/Segmentation/StreamingMeanShiftSegmentation.cxx
Examples/Segmentation/StreamingMeanShiftSegmentation.cxx
+10
-8
No files found.
Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx
View file @
484b62a4
...
...
@@ -25,7 +25,7 @@
// Software Guide : BeginLatex
//
// This example shows the basic approach to perform object based analysis on a image.
// The input image is firstly segmented using the \doxygen{otb}{MeanShift
Image
Filter}
// The input image is firstly segmented using the \doxygen{otb}{MeanShift
Segmentation
Filter}
// Then each segmented region is converted to a Map of labeled objects.
// Afterwards the \doxygen{otb}{otbMultiChannelRAndNIRIndexImageFilter} computes
// radiometric attributes for each object. In this example the NDVI is computed.
...
...
@@ -41,7 +41,7 @@
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "otbMeanShift
VectorImage
Filter.h"
#include "otbMeanShift
Segmentation
Filter.h"
#include "itkLabelImageToLabelMapFilter.h"
#include "otbShapeAttributesLabelMapFilter.h"
#include "otbBandsStatisticsAttributesLabelMapFilter.h"
...
...
@@ -137,13 +137,14 @@ int main(int argc, char * argv[])
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef
otb
::
MeanShift
VectorImage
Filter
<
VectorImageType
,
VectorImageType
,
Labeled
ImageType
>
FilterType
;
typedef
otb
::
MeanShift
Segmentation
Filter
<
VectorImageType
,
LabeledImageType
,
Vector
ImageType
>
FilterType
;
FilterType
::
Pointer
filter
=
FilterType
::
New
();
filter
->
SetSpatialRadius
(
spatialRadius
);
filter
->
SetRangeRadius
(
rangeRadius
);
filter
->
SetMinimumRegionSize
(
minRegionSize
);
filter
->
SetScale
(
scale
);
filter
->
SetSpatialBandwidth
(
spatialRadius
);
filter
->
SetRangeBandwidth
(
rangeRadius
);
filter
->
SetMinRegionSize
(
minRegionSize
);
filter
->
SetThreshold
(
0.1
);
filter
->
SetMaxIterationNumber
(
100
);
// Software Guide : EndCodeSnippet
// For non regression tests, set the number of threads to 1
...
...
@@ -152,7 +153,7 @@ int main(int argc, char * argv[])
// Software Guide : BeginLatex
//
// The \doxygen{otb}{MeanShift
Image
Filter} type is instantiated using the image
// The \doxygen{otb}{MeanShift
Segmentation
Filter} type is instantiated using the image
// types.
//
// Software Guide : EndLatex
...
...
@@ -164,13 +165,13 @@ int main(int argc, char * argv[])
// Software Guide : BeginLatex
//
// The \doxygen{itk}{LabelImageToLabelMapFilter} type is instantiated using the output
// of the \doxygen{otb}{MeanShift
Image
Filter}. This filter produces a labeled image
// of the \doxygen{otb}{MeanShift
Segmentation
Filter}. This filter produces a labeled image
// where each segmented region has a unique label.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
LabelMapFilterType
::
Pointer
labelMapFilter
=
LabelMapFilterType
::
New
();
labelMapFilter
->
SetInput
(
filter
->
GetLabel
edClustered
Output
());
labelMapFilter
->
SetInput
(
filter
->
GetLabelOutput
());
labelMapFilter
->
SetBackgroundValue
(
itk
::
NumericTraits
<
LabelType
>::
min
());
ShapeLabelMapFilterType
::
Pointer
shapeLabelMapFilter
=
...
...
Examples/Segmentation/StreamingMeanShiftSegmentation.cxx
View file @
484b62a4
...
...
@@ -25,7 +25,7 @@
// The following example illustrates how to segment very large images
// using the \doxygen{otb}{StreamingImageToOGRLayerSegmentationFilter}. This filter is
// templated over the segmentation filter that will be used to segment each tile
// of the input image. In this example we will use the \doxygen{otb}{MeanShift
VectorImage
Filter}.
// of the input image. In this example we will use the \doxygen{otb}{MeanShift
Segmentation
Filter}.
// The labeled output image of each tile is then vectorized (using a filter based on GDALPolygonize)
// and stored into a \doxygen{otb}{ogr}{Layer} within the \doxygen{otb}{ogr}{DataSource}
// set as input. Finally a fusion filter, \doxygen{otb}{OGRLayerStreamStitchingFilter}, is used to merge polygons
...
...
@@ -39,7 +39,7 @@
// Software Guide : BeginCodeSnippet
#include "otbStreamingImageToOGRLayerSegmentationFilter.h"
#include "otbOGRLayerStreamStitchingFilter.h"
#include "otbMeanShift
VectorImage
Filter.h"
#include "otbMeanShift
Segmentation
Filter.h"
// Software Guide : EndCodeSnippet
#include "otbVectorImage.h"
...
...
@@ -93,7 +93,7 @@ int main(int argc, char *argv[])
// Software Guide : BeginCodeSnippet
//typedef otb::MeanShiftSmoothingImageFilter<ImageType, ImageType> MeanShiftImageFilterType;
typedef
otb
::
MeanShift
VectorImageFilter
<
ImageType
,
ImageType
,
Label
ImageType
>
SegmentationFilterType
;
typedef
otb
::
MeanShift
SegmentationFilter
<
ImageType
,
LabelImageType
,
ImageType
>
SegmentationFilterType
;
typedef
otb
::
StreamingImageToOGRLayerSegmentationFilter
<
ImageType
,
SegmentationFilterType
>
StreamingVectorizedSegmentationType
;
// Software Guide : EndCodeSnippet
...
...
@@ -174,15 +174,17 @@ int main(int argc, char *argv[])
// Software Guide : BeginLatex
//
// Now we set the parameters to the segmentation filter.The \doxygen{otb}{MeanShift
VectorImage
Filter}
//
required three
parameters, the spatial radius, the range radius and the minimum object size.
// Now we set the parameters to the segmentation filter.The \doxygen{otb}{MeanShift
Segmentation
Filter}
//
has three main
parameters, the spatial radius, the range radius and the minimum object size.
// We use the \code{GetSegmentationFilter()} method on the \doxygen{otb}{StreamingVectorizedSegmentation}
// to get a pointer to the segmentation filter.
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
filter
->
GetSegmentationFilter
()
->
SetSpatialRadius
(
spatialRadius
);
filter
->
GetSegmentationFilter
()
->
SetRangeRadius
(
rangeRadius
);
filter
->
GetSegmentationFilter
()
->
SetMinimumRegionSize
(
minimumObjectSize
);
filter
->
GetSegmentationFilter
()
->
SetSpatialBandwidth
(
spatialRadius
);
filter
->
GetSegmentationFilter
()
->
SetRangeBandwidth
(
rangeRadius
);
filter
->
GetSegmentationFilter
()
->
SetMinRegionSize
(
minimumObjectSize
);
filter
->
GetSegmentationFilter
()
->
SetThreshold
(
0.1
);
filter
->
GetSegmentationFilter
()
->
SetMaxIterationNumber
(
100
);
// Software Guide : EndCodeSnippet
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment