Commit b5527446 authored by Victor Poughon's avatar Victor Poughon
Browse files

DOC: review HillShadingExample

No related merge requests found
Showing with 31 additions and 41 deletions
+31 -41
Data/Output/HillShadingColorExample.png

131 Bytes

Data/Output/HillShadingExample.png

131 Bytes

...@@ -24,18 +24,6 @@ ...@@ -24,18 +24,6 @@
*/ */
// Visualization of digital elevation models (DEM) is often more intuitive by simulating a
// lighting source and generating the corresponding shadows. This principle is called
// hill shading.
//
// Using a simple functor \doxygen{otb}{HillShadingFunctor} and the DEM image generated
// using the \doxygen{otb}{DEMToImageGenerator} (refer to \ref{sec:ReadDEM}), you can easily
// obtain a representation of the DEM. Better yet, using the
// \doxygen{otb}{ScalarToRainbowRGBPixelFunctor}, combined with the
// \doxygen{otb}{ReliefColormapFunctor} you can easily generate the classic elevation maps.
//
// This example will focus on the shading itself.
#include "otbImageFileReader.h" #include "otbImageFileReader.h"
#include "otbImageFileWriter.h" #include "otbImageFileWriter.h"
...@@ -50,7 +38,6 @@ ...@@ -50,7 +38,6 @@
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
if (argc < 10) if (argc < 10)
{ {
std::cout << argv[0] << " <output_filename> <output_color_filename> " std::cout << argv[0] << " <output_filename> <output_color_filename> "
...@@ -162,21 +149,8 @@ int main(int argc, char* argv[]) ...@@ -162,21 +149,8 @@ int main(int argc, char* argv[])
writer2->SetInput(multiply->GetOutput()); writer2->SetInput(multiply->GetOutput());
try writer->Update();
{ writer2->Update();
writer->Update();
writer2->Update();
}
catch (itk::ExceptionObject& excep)
{
std::cerr << "Exception caught !" << std::endl;
std::cerr << excep << std::endl;
}
catch (...)
{
std::cout << "Unknown exception !" << std::endl;
return EXIT_FAILURE;
}
otb::WorldFile::Pointer worldFile = otb::WorldFile::New(); otb::WorldFile::Pointer worldFile = otb::WorldFile::New();
worldFile->SetLonOrigin(origin[0]); worldFile->SetLonOrigin(origin[0]);
...@@ -188,17 +162,4 @@ int main(int argc, char* argv[]) ...@@ -188,17 +162,4 @@ int main(int argc, char* argv[])
worldFile->Update(); worldFile->Update();
worldFile->SetImageFilename(argv[2]); worldFile->SetImageFilename(argv[2]);
worldFile->Update(); worldFile->Update();
// Figure~\ref{fig:HILL_SHADING} shows the hill shading result from SRTM data.
//
// \begin{figure}
// \center
// \includegraphics[width=0.44\textwidth]{HillShadingExample.eps}
// \includegraphics[width=0.44\textwidth]{HillShadingColorExample.eps}
// \itkcaption[Hill shading]{Hill shading obtained from SRTM data (left) and combined with
// the color representation (right)}
// \label{fig:HILL_SHADING}
// \end{figure}
return EXIT_SUCCESS;
} }
Visualization of digital elevation models (DEM) is often more intuitive by
simulating a lighting source and generating the corresponding shadows. This
principle is called hill shading.
Using :doxygen:`HillShadingFilter` and the DEM image generated
using the :doxygen:`DEMToImageGenerator`, you can easily obtain a representation
of the DEM. Better yet, using the :doxygen-itk:`ScalarToRGBColormapImageFilter`
combined with the ``ReliefColormapFunctor`` you can easily generate the
classic elevation maps.
This example will focus on the shading itself.
.. |image1| image:: /Output/HillShadingExample.png
.. |image2| image:: /Output/HillShadingColorExample.png
.. _Figure1:
+--------------------------+-------------------------+
| |image1| | |image2| |
+--------------------------+-------------------------+
Hill shading obtained from SRTM data (left) and combined with the color representation (right)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment