Skip to content
Snippets Groups Projects
Commit 69fbc70a authored by Jordi Inglada's avatar Jordi Inglada
Browse files

DOC: Latex added to EdgeDensityExample

parent 022f5b4d
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ PURPOSE. See the above copyright notices for more information.
#include "itkRescaleIntensityImageFilter.h"
// Software Guide : BeginCommandLineArgs
// INPUTS: {amst.png}
// INPUTS: {suburb2.jpeg}
// OUTPUTS: {EdgeDensityOutput.png}, {PrettyEdgeDensityOutput.png}
// 3 30 10 1.0 0.01
// Software Guide : EndCommandLineArgs
......@@ -118,12 +118,12 @@ int main(int argc, char* argv[] )
typedef itk::CannyEdgeDetectionImageFilter<ImageType, ImageType>
CannyDetectorType;
// Software Guide : BeginCodeSnippet
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Finally, we can define the type for the edge density filter which
// takes as template the input image type, the edge detector type,
// the count fucntion type and the output image type.
// takes as template the input and output image types, the edge
// detector type, and the count fucntion type..
//
// Software Guide : EndLatex
......@@ -131,29 +131,81 @@ int main(int argc, char* argv[] )
typedef otb::EdgeDensityImageFilter<ImageType, ImageType, CannyDetectorType,
CountFunctionType> EdgeDensityFilterType;
/**Instancitation of an object*/
EdgeDensityFilterType::Pointer filter = EdgeDensityFilterType::New();
ReaderType::Pointer reader = ReaderType::New();
CannyDetectorType::Pointer CannyFilter = CannyDetectorType::New();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We can now instantiate the different processing objects of the
// pipeline using the \code{New()} method.
//
// Software Guide : EndLatex
/** Set The input*/
reader->SetFileName(infname);
filter->SetInput(reader->GetOutput());
/** Update the Canny Filter Information*/
CannyFilter->SetUpperThreshold(upperThreshold);
CannyFilter->SetLowerThreshold(lowerThreshold);
CannyFilter->SetVariance(variance);
CannyFilter->SetMaximumError(maximumError);
// Software Guide : BeginCodeSnippet
ReaderType::Pointer reader = ReaderType::New();
EdgeDensityFilterType::Pointer filter = EdgeDensityFilterType::New();
CannyDetectorType::Pointer cannyFilter = CannyDetectorType::New();
WriterType::Pointer writer = WriterType::New();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The edge detection filter needs to be instantiated because we
// need to set its parameters. This is what we do here for the Canny
// filter.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
cannyFilter->SetUpperThreshold(upperThreshold);
cannyFilter->SetLowerThreshold(lowerThreshold);
cannyFilter->SetVariance(variance);
cannyFilter->SetMaximumError(maximumError);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// After that, we can pass the edge detector to the filter which
// will use it internally.
//
// Software Guide : EndLatex
filter->SetDetector(CannyFilter);
// Software Guide : BeginCodeSnippet
filter->SetDetector(cannyFilter);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Finally, we set the file names for the input and the output
// images and we plug the pipeline. The \code{Update()} method of
// the writer will trigger the processing.
//
// Software Guide : EndLatex
/** Write the output*/
WriterType::Pointer writer = WriterType::New();
// Software Guide : BeginCodeSnippet
reader->SetFileName(infname);
writer->SetFileName(outfname);
filter->SetInput(reader->GetOutput());
writer->SetInput(filter->GetOutput());
writer->Update();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
// Figure~\ref{fig:EDGEDENSITY_FILTER} shows the result of applying
// the edge density filter to an image.
// \begin{figure}
// \center
// \includegraphics[width=0.25\textwidth]{suburb2.eps}
// \includegraphics[width=0.25\textwidth]{PrettyEdgeDensityOutput.eps}
// \itkcaption[Edge Density Filter]{Result of applying the
// \doxygen{otb}{EdgeDensityImageFilter} to an image. From left to right :
// original image, edge density.}
// \label{fig:EDGEDENSITY_FILTER}
// \end{figure}
//
// Software Guide : EndLatex
/************* Image for printing **************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment