Commit e51cdaed authored by Victor Poughon's avatar Victor Poughon

REFAC: fix and enable lsd and angle examples

parent 142ba690
......@@ -301,8 +301,8 @@ SET( OTB_EXAMPLES_SRCS
${OTB_SOURCE_DIR}/Examples/FeatureExtraction/CorrelationLineDetectorExample.cxx
${OTB_SOURCE_DIR}/Examples/FeatureExtraction/AsymmetricFusionOfLineDetectorExample.cxx
${OTB_SOURCE_DIR}/Examples/FeatureExtraction/LocalHoughExample.cxx
#${OTB_SOURCE_DIR}/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx
#${OTB_SOURCE_DIR}/Examples/FeatureExtraction/RightAngleDetectionExample.cxx
${OTB_SOURCE_DIR}/Examples/FeatureExtraction/LineSegmentDetectorExample.cxx
${OTB_SOURCE_DIR}/Examples/FeatureExtraction/RightAngleDetectionExample.cxx
${OTB_SOURCE_DIR}/Examples/FeatureExtraction/ExtractSegmentsByStepsExample.cxx
${OTB_SOURCE_DIR}/Examples/FeatureExtraction/ExtractSegmentsExample.cxx
${OTB_SOURCE_DIR}/Examples/FeatureExtraction/ParallelLineDetectionExample.cxx
......
......@@ -105,12 +105,13 @@ More features are available in \doxygen{otb}{ScalarImageToAdvancedTexturesFilter
\input{LocalHoughExample}
%\input{ExtractSegmentsByStepsExample}
%\input{ExtractSegmentsExample}
%\subsubsection{Line Segment Detector}
%\label{sec:LSD}
%\input{LineSegmentDetectorExample}
%\subsection{Right Angle Detector}
%\label{sec:RightAngleDetector}
%\input{RightAngleDetectionExample}
\subsubsection{Line Segment Detector}
\label{sec:LSD}
\input{LineSegmentDetectorExample}
\subsection{Right Angle Detector}
\label{sec:RightAngleDetector}
\input{RightAngleDetectionExample}
\section{Density Features}
......
......@@ -26,7 +26,7 @@
// Software Guide : BeginCommandLineArgs
// INPUTS: {Scene.png}
// OUTPUTS: {LSDOutput.png}
// OUTPUTS: {LSDOutput.shp}
// Software Guide : EndCommandLineArgs
// Software Guide : BeginLatex
......@@ -137,19 +137,5 @@ int main(int argc, char * argv[])
writer->Update();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
// Figure~\ref{fig:LSD} shows the result of applying the line segment
// detection to an image.
// \begin{figure}
// \center
// \includegraphics[width=0.35\textwidth]{Scene.eps}
// \includegraphics[width=0.35\textwidth]{LSDOutput.eps}
// \itkcaption[LSD Application]{Result of applying the
// \doxygen{otb}{LineSegmentDetector} to an image.}
// \label{fig:LSD}
// \end{figure}
//
// Software Guide : EndLatex
return EXIT_SUCCESS;
}
......@@ -24,11 +24,9 @@
#include "otbLineSegmentDetector.h"
#include "otbVectorDataFileWriter.h"
#include "itkRescaleIntensityImageFilter.h"
// Software Guide : BeginCommandLineArgs
// INPUTS: {Scene.png}
// OUTPUTS: {RighAngleOutput.tif}, {PrettyRighAngleInput.png}, {PrettyRighAngleOutput.png}
// OUTPUTS: {rightAngleOutput.tif}
// 0.1 20
// Software Guide : EndCommandLineArgs
......@@ -52,17 +50,16 @@
int main(int argc, char * argv[])
{
if (argc != 6)
if (argc != 5)
{
std::cerr << "Usage: ./RightAngleDetectionExample input lsdOutput rightAngleOutput angleThreshold distanceThreshold\n";
std::cerr << "Usage: ./RightAngleDetectionExample input rightAngleOutput angleThreshold distanceThreshold\n";
return EXIT_FAILURE;
}
const char* infname = argv[1];
const char* lsdOutputFilename = argv[2];
const char* rightAngleOutputFilename = argv[3];
double angleThreshold = atof(argv[4]);
double distanceThreshold = atof(argv[5]);
const char* rightAngleOutputFilename = argv[2];
double angleThreshold = atof(argv[3]);
double distanceThreshold = atof(argv[4]);
const unsigned int Dimension = 2;
typedef unsigned char PixelType;
......@@ -151,12 +148,8 @@ int main(int argc, char * argv[])
typedef otb::VectorDataFileWriter<LsdFilterType::VectorDataType> WriterType;
auto lsdWriter = WriterType::New();
auto rightAngleWriter = WriterType::New();
lsdWriter->SetInput(lsdFilter->GetOutput());
lsdWriter->SetFileName(lsdOutputFilename);
rightAngleWriter->SetInput(rightAngleFilter->GetOutput());
rightAngleWriter->SetFileName(rightAngleOutputFilename);
......@@ -171,7 +164,6 @@ int main(int argc, char * argv[])
// Software Guide : BeginCodeSnippet
reader->GenerateOutputInformation();
lsdWriter->Update();
rightAngleWriter->Update();
// Software Guide : EndCodeSnippet
......
Markdown is supported
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