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
Main Repositories
otb
Commits
779c9818
Commit
779c9818
authored
15 years ago
by
Manuel Grizonnet
Browse files
Options
Downloads
Patches
Plain Diff
DOC:update affine transformation with lesat square example
parent
62e650f0
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/DisparityMap/EstimateAffineTransformationExample.cxx
+21
-33
21 additions, 33 deletions
...ples/DisparityMap/EstimateAffineTransformationExample.cxx
Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx
+3
-3
3 additions, 3 deletions
Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx
with
24 additions
and
36 deletions
Examples/DisparityMap/EstimateAffineTransformationExample.cxx
+
21
−
33
View file @
779c9818
...
...
@@ -140,7 +140,7 @@ int main (int argc, char* argv[])
ImageToSIFTKeyPointSetFilterType
;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
// Software Guide : BeginLatex
//
// Although many choices for evaluating the distances during the
// matching procedure exist, we choose here to use a simple
...
...
@@ -245,8 +245,7 @@ int main (int argc, char* argv[])
filter2
->
SetDoGThreshold
(
threshold
);
filter2
->
SetEdgeThreshold
(
ratio
);
// Software Guide : EndCodeSnippet
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
...
...
@@ -262,7 +261,7 @@ int main (int argc, char* argv[])
euclideanMatcher
->
SetDistanceThreshold
(
secondOrderThreshold
);
euclideanMatcher
->
SetUseBackMatching
(
useBackMatching
);
//std::cout << "Update euclidian distance" << std::endl;
euclideanMatcher
->
Update
();
// Software Guide : EndCodeSnippet
...
...
@@ -279,7 +278,7 @@ int main (int argc, char* argv[])
LandmarkListType
::
Pointer
landmarkList
;
landmarkList
=
euclideanMatcher
->
GetOutput
();
//std::cout << "Get landmarkList" << std::endl;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
...
...
@@ -287,11 +286,12 @@ int main (int argc, char* argv[])
// Apply Mean square algorithm
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
typedef
itk
::
Point
<
double
,
2
>
MyPointType
;
typedef
otb
::
LeastSquareAffineTransformEstimator
<
MyPointType
>
EstimatorType
;
// instantiation
// instantiation
of the estimator of the affine transformation
EstimatorType
::
Pointer
estimator
=
EstimatorType
::
New
();
std
::
cout
<<
"landmark list size "
<<
landmarkList
->
Size
()
<<
std
::
endl
;
for
(
LandmarkListType
::
Iterator
it
=
landmarkList
->
Begin
();
...
...
@@ -303,7 +303,7 @@ int main (int argc, char* argv[])
// Trigger computation
estimator
->
Compute
();
// Software Guide : EndCodeSnippet
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
...
...
@@ -316,10 +316,7 @@ int main (int argc, char* argv[])
// the resulting transform to map the moving image into the fixed
// image space. This is easily done with the
// \doxygen{itk}{ResampleImageFilter}. First, a ResampleImageFilter
// type is instantiated using the image types. It is convenient to
// use the fixed image type as the output type since it is likely
// that the transformed moving image will be compared with the
// fixed image.
// type is instantiated using the image types.
//
// Software Guide : EndLatex
...
...
@@ -340,20 +337,13 @@ int main (int argc, char* argv[])
ResampleFilterType
::
Pointer
resampler
=
ResampleFilterType
::
New
();
resampler
->
SetInput
(
movingReader
->
GetOutput
()
);
//typedef itk::ImageRegistrationMethod<
//ImageType,
//ImageType > RegistrationType;
//RegistrationType::Pointer registration = RegistrationType::New();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The Transform that is produced as output need to be inversed to
// We apply here the resampling algorithm to the "fixed" image
// to produce the moving image. Or apply to the moving image
//
// The Transform that is produced as output do not need to be inversed because
// we apply here the resampling algorithm to the "moving" image
// to produce the fixed image.
//
// Software Guide : EndLatex
...
...
@@ -364,7 +354,7 @@ int main (int argc, char* argv[])
// Set floatfield to format properly
ofs
.
setf
(
std
::
ios
::
fixed
,
std
::
ios
::
floatfield
);
ofs
.
precision
(
10
);
ofs
<<
"Transformation"
<<
std
::
endl
;
ofs
<<
"Estimated affine matrix: "
<<
std
::
endl
;
ofs
<<
estimator
->
GetMatrix
()
<<
std
::
endl
;
ofs
<<
"Estimated affine offset: "
<<
std
::
endl
;
...
...
@@ -373,18 +363,16 @@ int main (int argc, char* argv[])
ofs
<<
estimator
->
GetRMSError
()
<<
std
::
endl
;
ofs
<<
"Relative residual: "
<<
std
::
endl
;
ofs
<<
estimator
->
GetRelativeResidual
()
<<
std
::
endl
;
ofs
.
close
();
// Software Guide : BeginCodeSnippet
// Get the output transform
typedef
EstimatorType
::
AffineTransformType
AffineTransformType
;
AffineTransformType
::
Pointer
transform
=
AffineTransformType
::
New
();
transform
->
GetInverse
(
estimator
->
GetAffineTransform
()
);
resampler
->
SetTransform
(
transform
);
resampler
->
SetSize
(
fixedReader
->
GetOutput
()
->
GetLargestPossibleRegion
().
GetSize
()
);
resampler
->
SetOutputOrigin
(
fixedReader
->
GetOutput
()
->
GetOrigin
()
);
resampler
->
SetOutputSpacing
(
fixedReader
->
GetOutput
()
->
GetSpacing
()
);
ImageType
::
Pointer
fixedImage
=
fixedReader
->
GetOutput
();
resampler
->
SetTransform
(
estimator
->
GetAffineTransform
()
);
resampler
->
SetSize
(
fixedImage
->
GetLargestPossibleRegion
().
GetSize
()
);
resampler
->
SetOutputOrigin
(
fixedImage
->
GetOrigin
()
);
resampler
->
SetOutputSpacing
(
fixedImage
->
GetSpacing
()
);
resampler
->
SetDefaultPixelValue
(
100
);
// Software Guide : EndCodeSnippet
...
...
@@ -414,7 +402,7 @@ int main (int argc, char* argv[])
// \includegraphics[width=0.40\textwidth]{QB_Suburb.eps}
// \includegraphics[width=0.40\textwidth]{QB_SuburbR10X13Y17.eps}
// \includegraphics[width=0.40\textwidth]{AffineTransformationOutput.eps}
// \itkcaption[Estimation of affine transformation from SIFT ]{From left
// \itkcaption[Estimation of affine transformation
using least square optimisation
from SIFT
points
]{From left
// to right and top to bottom: fixed input image, moving image,
// resampled moving image.}
// \label{fig:SIFTDME}
...
...
This diff is collapsed.
Click to expand it.
Examples/OBIA/RadiometricAttributesLabelMapFilterExample.cxx
+
3
−
3
View file @
779c9818
...
...
@@ -17,9 +17,9 @@
=========================================================================*/
// Software Guide : BeginCommandLineArgs
// INPUTS: {qb_RoadExtract
2
.tif}
// INPUTS: {qb_RoadExtract.tif}
// OUTPUTS: {OBIARadiometricAttribute1.tif}
// STATS::Ndvi::Mean 0 -0.3 16 16 10 1.0
// STATS::Ndvi::Mean 0 -0.3 16 16 10
0
1.0
// Software Guide : EndCommandLineArgs
// Software Guide : BeginLatex
...
...
@@ -243,7 +243,7 @@ int main(int argc, char * argv[])
// Figure~\ref{fig:RADIOMETRIC_LABEL_MAP_FILTER} shows the result of applying
// the object selection based on radiometric attributes.
// \begin{figure} \center
// \includegraphics[width=0.44\textwidth]{qb_RoadExtract
2
.eps}
// \includegraphics[width=0.44\textwidth]{qb_RoadExtract.eps}
// \includegraphics[width=0.44\textwidth]{OBIARadiometricAttribute1.eps}
// \itkcaption[Object based extraction based on ]{From left to right : original image, vegetation mask resulting from processing.}
// \label{fig:RADIOMETRIC_LABEL_MAP_FILTER}
...
...
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