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
21e12102
Commit
21e12102
authored
12 years ago
by
Manuel Grizonnet
Browse files
Options
Downloads
Patches
Plain Diff
DOC: add output DEM estimation figure in stereo reconstruction example
parent
e6641fc2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Examples/DisparityMap/CMakeLists.txt
+1
-0
1 addition, 0 deletions
Examples/DisparityMap/CMakeLists.txt
Examples/DisparityMap/StereoReconstructionExample.cxx
+39
-5
39 additions, 5 deletions
Examples/DisparityMap/StereoReconstructionExample.cxx
with
40 additions
and
5 deletions
Examples/DisparityMap/CMakeLists.txt
+
1
−
0
View file @
21e12102
...
...
@@ -52,6 +52,7 @@ ADD_TEST(dmTeStereoReconstructionExampleTest ${EXE_TESTS}
${
INPUTDATA
}
/sensor_stereo_left.tif
${
INPUTDATA
}
/sensor_stereo_right.tif
${
TEMP
}
/elevationOutput.tif
${
TEMP
}
/elevationOutputPrintable.png
140
)
...
...
This diff is collapsed.
Click to expand it.
Examples/DisparityMap/StereoReconstructionExample.cxx
+
39
−
5
View file @
21e12102
...
...
@@ -19,7 +19,7 @@
// Software Guide : BeginCommandLineArgs
// INPUTS: {sensor_stereo_left.tif}, {sensor_stereo_right.tif}
// OUTPUTS: {elevationOutput.tif}
// OUTPUTS: {elevationOutput.tif}
,{elevationOutputPrintable.png}
// 140
// Software Guide : EndCommandLineArgs
...
...
@@ -58,15 +58,16 @@
#include
"itkVectorCastImageFilter.h"
#include
"otbImageList.h"
#include
"otbImageListToVectorImageFilter.h"
#include
"itkRescaleIntensityImageFilter.h"
// Software Guide : EndCodeSnippet
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
!=
5
)
if
(
argc
!=
6
)
{
std
::
cerr
<<
"Usage: "
<<
argv
[
0
];
std
::
cerr
<<
" sensorImage1 sensorImage2 outputDEM "
;
std
::
cerr
<<
" sensorImage1 sensorImage2 outputDEM
outputDEMPNG
"
;
std
::
cerr
<<
"averageElevation "
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
...
...
@@ -86,6 +87,14 @@ int main(int argc, char* argv[])
typedef
otb
::
StreamingImageFileWriter
<
FloatImageType
>
WriterType
;
typedef
unsigned
char
OutputPixelType
;
typedef
otb
::
Image
<
OutputPixelType
,
2
>
OutputImageType
;
typedef
itk
::
RescaleIntensityImageFilter
<
FloatImageType
,
OutputImageType
>
RescalerType
;
typedef
otb
::
StreamingImageFileWriter
<
OutputImageType
>
OutputWriterType
;
// Software Guide : BeginLatex
// This example demonstrates the use of the following filters :
// \begin{itemize}
...
...
@@ -150,7 +159,7 @@ int main(int argc, char* argv[])
FloatImageType
>
DisparityToElevationFilterType
;
// Software Guide : EndCodeSnippet
double
avgElevation
=
atof
(
argv
[
4
]);
double
avgElevation
=
atof
(
argv
[
5
]);
ImageReaderType
::
Pointer
leftReader
=
ImageReaderType
::
New
();
ImageReaderType
::
Pointer
rightReader
=
ImageReaderType
::
New
();
...
...
@@ -382,7 +391,32 @@ int main(int argc, char* argv[])
m_DEMWriter
->
SetInput
(
m_DispToElev
->
GetOutput
());
m_DEMWriter
->
SetFileName
(
argv
[
3
]);
m_DEMWriter
->
Update
();
// Software Guide : EndCodeSnippet
RescalerType
::
Pointer
fieldRescaler
=
RescalerType
::
New
();
fieldRescaler
->
SetInput
(
m_DispToElev
->
GetOutput
());
fieldRescaler
->
SetOutputMaximum
(
255
);
fieldRescaler
->
SetOutputMinimum
(
0
);
OutputWriterType
::
Pointer
fieldWriter
=
OutputWriterType
::
New
();
fieldWriter
->
SetInput
(
fieldRescaler
->
GetOutput
());
fieldWriter
->
SetFileName
(
argv
[
4
]);
fieldWriter
->
Update
();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Figure~\ref{fig:STEREORECONSTRUCTIONOUTPUT} shows the result of applying
// terrain reconstruction based using pixel-wise block matching, sub-pixel
// interpolation and DEM estimation using a pair of Pleiades images over the
// \textit{Stadium} in Toulouse, France.
// \begin{figure}
// \center
// \includegraphics[width=0.4\textwidth]{elevationOutputPrintable.eps}
// \itkcaption[From stereo pair to elevation]{DEM image estimated from the disparity.}
// \label{fig:STEREORECONSTRUCTIONOUTPUT}
// \end{figure}
//
// Software Guide : EndLatex
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