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
c580136b
Commit
c580136b
authored
17 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
Dernière corrections extraction de route.
parent
38ca096b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Examples/FeatureExtraction/ExtractRoadByStepsExample.cxx
+16
-9
16 additions, 9 deletions
Examples/FeatureExtraction/ExtractRoadByStepsExample.cxx
Examples/FeatureExtraction/ExtractRoadExample.cxx
+30
-7
30 additions, 7 deletions
Examples/FeatureExtraction/ExtractRoadExample.cxx
with
46 additions
and
16 deletions
Examples/FeatureExtraction/ExtractRoadByStepsExample.cxx
+
16
−
9
View file @
c580136b
...
...
@@ -188,7 +188,7 @@ int main( int argc, char * argv[] )
// Software Guide : BeginCodeSnippet
double
sigma
=
alpha
*
(
1.2
/
resolution
+
1
);
typedef
itk
::
GradientRecursiveGaussianImageFilter
<
InternalImageType
,
VectorImageType
>
GradientFilterType
;
VectorImageType
>
GradientFilterType
;
GradientFilterType
::
Pointer
gradientFilter
=
GradientFilterType
::
New
();
gradientFilter
->
SetSigma
(
sigma
);
gradientFilter
->
SetInput
(
sqrtFilter
->
GetOutput
());
...
...
@@ -207,7 +207,8 @@ int main( int argc, char * argv[] )
// Software Guide : BeginCodeSnippet
typedef
otb
::
NeighborhoodScalarProductFilter
<
VectorImageType
,
InternalImageType
,
InternalImageType
>
NeighborhoodScalarProductType
;
NeighborhoodScalarProductType
::
Pointer
scalarFilter
=
NeighborhoodScalarProductType
::
New
();
NeighborhoodScalarProductType
::
Pointer
scalarFilter
=
NeighborhoodScalarProductType
::
New
();
scalarFilter
->
SetInput
(
gradientFilter
->
GetOutput
());
// Software Guide : EndCodeSnippet
...
...
@@ -227,7 +228,8 @@ int main( int argc, char * argv[] )
RemoveIsolatedByDirectionType
::
Pointer
removeIsolatedByDirectionFilter
=
RemoveIsolatedByDirectionType
::
New
();
removeIsolatedByDirectionFilter
->
SetInput
(
scalarFilter
->
GetOutput
());
removeIsolatedByDirectionFilter
->
SetInputDirection
(
scalarFilter
->
GetOutputDirection
());
removeIsolatedByDirectionFilter
->
SetInputDirection
(
scalarFilter
->
GetOutputDirection
());
// Software Guide : EndCodeSnippet
...
...
@@ -242,7 +244,8 @@ int main( int argc, char * argv[] )
// Software Guide : BeginCodeSnippet
typedef
otb
::
RemoveWrongDirectionFilter
<
InternalImageType
,
InternalImageType
,
InternalImageType
>
RemoveWrongDirectionType
;
RemoveWrongDirectionType
::
Pointer
removeWrongDirectionFilter
=
RemoveWrongDirectionType
::
New
();
RemoveWrongDirectionType
::
Pointer
removeWrongDirectionFilter
=
RemoveWrongDirectionType
::
New
();
removeWrongDirectionFilter
->
SetInput
(
removeIsolatedByDirectionFilter
->
GetOutput
());
removeWrongDirectionFilter
->
SetInputDirection
(
scalarFilter
->
GetOutputDirection
());
...
...
@@ -261,7 +264,8 @@ int main( int argc, char * argv[] )
NonMaxRemovalByDirectionType
::
Pointer
nonMaxRemovalByDirectionFilter
=
NonMaxRemovalByDirectionType
::
New
();
nonMaxRemovalByDirectionFilter
->
SetInput
(
removeWrongDirectionFilter
->
GetOutput
());
nonMaxRemovalByDirectionFilter
->
SetInputDirection
(
scalarFilter
->
GetOutputDirection
());
nonMaxRemovalByDirectionFilter
->
SetInputDirection
(
scalarFilter
->
GetOutputDirection
());
// Software Guide : EndCodeSnippet
...
...
@@ -274,7 +278,8 @@ int main( int argc, char * argv[] )
// Software Guide : BeginCodeSnippet
typedef
otb
::
VectorizationPathListFilter
<
InternalImageType
,
InternalImageType
,
PathType
>
VectorizationFilterType
;
VectorizationFilterType
::
Pointer
vectorizationFilter
=
VectorizationFilterType
::
New
();
VectorizationFilterType
::
Pointer
vectorizationFilter
=
VectorizationFilterType
::
New
();
vectorizationFilter
->
SetInput
(
nonMaxRemovalByDirectionFilter
->
GetOutput
());
vectorizationFilter
->
SetInputDirection
(
scalarFilter
->
GetOutputDirection
());
vectorizationFilter
->
SetAmplitudeThreshold
(
atof
(
argv
[
8
]));
...
...
@@ -299,7 +304,8 @@ int main( int argc, char * argv[] )
simplifyPathListFilter
->
SetInput
(
vectorizationFilter
->
GetOutput
());
typedef
otb
::
BreakAngularPathListFilter
<
PathType
>
BreakAngularPathType
;
BreakAngularPathType
::
Pointer
breakAngularPathListFilter
=
BreakAngularPathType
::
New
();
BreakAngularPathType
::
Pointer
breakAngularPathListFilter
=
BreakAngularPathType
::
New
();
breakAngularPathListFilter
->
SetMaxAngle
(
M_PI
/
8.
);
breakAngularPathListFilter
->
SetInput
(
simplifyPathListFilter
->
GetOutput
());
...
...
@@ -323,7 +329,7 @@ int main( int argc, char * argv[] )
// Software Guide : BeginCodeSnippet
typedef
otb
::
LinkPathListFilter
<
PathType
>
LinkPathType
;
LinkPathType
::
Pointer
linkPathListFilter
=
LinkPathType
::
New
();
linkPathListFilter
->
SetDistanceThreshold
(
25.0
/
resolution
);
//research area of 25 m
linkPathListFilter
->
SetDistanceThreshold
(
25.0
/
resolution
);
linkPathListFilter
->
SetAngularThreshold
(
M_PI
/
8
);
linkPathListFilter
->
SetInput
(
removeTortuousPathListFilter
->
GetOutput
());
...
...
@@ -366,7 +372,8 @@ int main( int argc, char * argv[] )
// Software Guide : BeginCodeSnippet
InternalImageType
::
Pointer
output
=
InternalImageType
::
New
();
output
->
SetRegions
(
multispectralReader
->
GetOutput
()
->
GetLargestPossibleRegion
());
output
->
SetRegions
(
multispectralReader
->
GetOutput
()
->
GetLargestPossibleRegion
());
output
->
Allocate
();
output
->
FillBuffer
(
0.0
);
...
...
This diff is collapsed.
Click to expand it.
Examples/FeatureExtraction/ExtractRoadExample.cxx
+
30
−
7
View file @
c580136b
...
...
@@ -60,6 +60,10 @@
#include
"itkRescaleIntensityImageFilter.h"
#include
"otbMath.h"
#include
"itkInvertIntensityImageFilter.h"
#include
"itkGrayscaleDilateImageFilter.h"
#include
"itkBinaryBallStructuringElement.h"
int
main
(
int
argc
,
char
*
argv
[]
)
{
...
...
@@ -370,30 +374,49 @@ int main( int argc, char * argv[] )
//
// Software Guide : EndLatex
writer
->
SetFileName
(
argv
[
2
]);
// Software Guide : BeginCodeSnippet
roadExtractionFilter
->
SetInput
(
reader
->
GetOutput
());
drawingFilter
->
SetInput
(
blackBackground
);
drawingFilter
->
SetInputPath
(
roadExtractionFilter
->
GetOutput
());
rescaleFilter
->
SetInput
(
drawingFilter
->
GetOutput
());
writer
->
SetInput
(
rescaleFilter
->
GetOutput
());
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The update of the pipeline is triggered by the \code{Update()} method
// of the
writing
filter.
// of the
rescale intensity
filter.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
wri
ter
->
Update
();
rescaleFil
ter
->
Update
();
// Software Guide : EndCodeSnippet
// output image enhancement
typedef
itk
::
BinaryBallStructuringElement
<
OutputPixelType
,
Dimension
>
StructuringElementType
;
typedef
itk
::
GrayscaleDilateImageFilter
<
OutputImageType
,
OutputImageType
,
StructuringElementType
>
DilateFilterType
;
typedef
itk
::
InvertIntensityImageFilter
<
OutputImageType
,
OutputImageType
>
InvertFilterType
;
StructuringElementType
se
;
se
.
SetRadius
(
1
);
se
.
CreateStructuringElement
();
DilateFilterType
::
Pointer
dilater
=
DilateFilterType
::
New
();
dilater
->
SetInput
(
rescaleFilter
->
GetOutput
());
dilater
->
SetKernel
(
se
);
InvertFilterType
::
Pointer
invertFilter
=
InvertFilterType
::
New
();
invertFilter
->
SetInput
(
dilater
->
GetOutput
());
writer
->
SetFileName
(
argv
[
2
]);
writer
->
SetInput
(
invertFilter
->
GetOutput
());
writer
->
Update
();
// Software Guide : BeginLatex
//
...
...
@@ -401,8 +424,8 @@ int main( int argc, char * argv[] )
// the road extraction filter to a fusionned Quickbird image.
// \begin{figure}
// \center
// \includegraphics[width=0.
25
\textwidth]{qb_ExtractRoad_pretty.eps}
// \includegraphics[width=0.
25
\textwidth]{ExtractRoadOutput.eps}
// \includegraphics[width=0.
44
\textwidth]{qb_ExtractRoad_pretty.eps}
// \includegraphics[width=0.
44
\textwidth]{ExtractRoadOutput.eps}
// \itkcaption[Road extraction filter application]{Result of applying
// the \doxygen{otb}{RoadExtractionFilter} to a fusionned Quickbird
// image. From left to right : original image, extracted road with their
...
...
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