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
Container Registry
Model registry
Operate
Environments
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
Antoine Belvire
otb
Commits
7b8929e7
Commit
7b8929e7
authored
18 years ago
by
Jordi Inglada
Browse files
Options
Downloads
Patches
Plain Diff
Harris pointset pour les exemples
parent
52d063dd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Examples/FeatureExtraction/HarrisExample.cxx
+88
-1
88 additions, 1 deletion
Examples/FeatureExtraction/HarrisExample.cxx
with
88 additions
and
1 deletion
Examples/FeatureExtraction/HarrisExample.cxx
+
88
−
1
View file @
7b8929e7
...
...
@@ -36,6 +36,7 @@
// Software Guide : BeginCodeSnippet
#include
"otbHarrisImageFilter.h"
// Software Guide : EndCodeSnippet
#include
"otbHarrisImageToPointSetFilter.h"
#include
"itkRescaleIntensityImageFilter.h"
int
main
(
int
argc
,
char
**
argv
)
...
...
@@ -131,12 +132,98 @@ int main(int argc, char ** argv )
// \includegraphics[width=0.25\textwidth]{ROISpot5.eps}
// \includegraphics[width=0.25\textwidth]{ROISpot5Harris.eps}
// \itkcaption[Lee Filter Application]{Result of applying the
// \doxygen{HarrisImageFilter} to a Spot 5 image.}
// \doxygen{
otb::
HarrisImageFilter} to a Spot 5 image.}
// \label{fig:Harris}
// \end{figure}
//
// The output of the \doxygen{otb::HarrisImageFilter} is an image
// where,for each pixel, we obtain the intensity of the
// detection. Often, the user may want to get access to the set of
// points for which the output of the detector is higher than a
// given threshold. This can be obtained by using the
// \doxygen{otb::HarrisImageToPointSetFilter}. This filter is only
// templated over the input image type, the output being a
// \doxygen{itk::PointSet} with pixel type equal to the image pixel type.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef
otb
::
HarrisImageToPointSetFilter
<
InputImageType
>
FunctionType
;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We declare now the filter and a pointer to the output point set.
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef
FunctionType
::
OutputPointSetType
OutputPointSetType
;
FunctionType
::
Pointer
harrisPoints
=
FunctionType
::
New
();
OutputPointSetType
::
Pointer
pointSet
=
OutputPointSetType
::
New
();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The \doxygen{otb::HarrisImageToPointSetFilter} takes the same
// parameters as the \doxygen{otb::HarrisImageFilter} and an
// additional parameter : the threshold for the point selection.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
harrisPoints
->
SetInput
(
0
,
reader
->
GetOutput
()
);
harrisPoints
->
SetSigmaD
(
SigmaD
);
harrisPoints
->
SetSigmaI
(
SigmaI
);
harrisPoints
->
SetAlpha
(
Alpha
);
harrisPoints
->
SetThreshold
(
10
);
pointSet
=
harrisPoints
->
GetOutput
();
// Software Guide : EndCodeSnippet
harrisPoints
->
Update
();
// Software Guide : BeginLatex
//
// We can now iterate through the obtained pointset and access
// the coordinates of the points. We start by accessing the
// container of the points which is encapsulated into the point
// set (see section \ref{sec:PointSetSection} for more
// information on using \doxygen{itk::PointSet}s) and declaring
// an iterator to it.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef
OutputPointSetType
::
PointsContainer
ContainerType
;
ContainerType
*
pointsContainer
=
pointSet
->
GetPoints
();
typedef
ContainerType
::
Iterator
IteratorType
;
IteratorType
itList
=
pointsContainer
->
Begin
();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// And we get the points coordinates
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
while
(
itList
!=
pointsContainer
->
End
()
)
{
typedef
OutputPointSetType
::
PointType
OutputPointType
;
OutputPointType
pCoordinate
=
(
itList
.
Value
());
std
::
cout
<<
pCoordinate
<<
std
::
endl
;
++
itList
;
}
// Software Guide : EndCodeSnippet
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