Skip to content
Snippets Groups Projects
Commit c3a45ba4 authored by Julien Michel's avatar Julien Michel
Browse files

Maj du RoadExtraction pour la racine carrée,

Correction d'une erreur dans un test de draw
parent 7f3c0520
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@ PURPOSE. See the above copyright notices for more information.
#include "otbVectorImage.h"
#include "otbImageToPathListFilter.h"
#include "otbSpectralAngleDistanceImageFilter.h"
#include "itkSqrtImageFilter.h"
#include "otbNeighborhoodScalarProductFilter.h"
#include "otbNonMaxRemovalByDirectionFilter.h"
#include "otbVectorizationPathListFilter.h"
......@@ -43,6 +44,7 @@ namespace otb
* \brief This class performs the extraction of roads from an image.
*
* \sa SpectralAngleDistanceImageFilter
* \sa itk::SqrtImageFilter
* \sa itk::GradientRecursiveGaussianImageFilter
* \sa NeighborhoodScalarProductFilter
* \sa RemoveIsolatedByDirectionFilter
......@@ -90,6 +92,10 @@ template <class TInputImage, class TOutputPath>
InputImageType,
SpectralAngleType> SpectralAngleDistanceImageFilterType;
typedef itk::SqrtImageFilter<
SpectralAngleType,
SpectralAngleType> SquareRootImageFilterType;
typedef itk::GradientRecursiveGaussianImageFilter<
SpectralAngleType,
CovariantVectorImageType> GradientFilterType;
......@@ -188,6 +194,7 @@ template <class TInputImage, class TOutputPath>
/** SpectralAngleDistanceImageFilter use by the composite filter */
typename SpectralAngleDistanceImageFilterType::Pointer m_SpectralAngleDistanceImageFilter;
typename SquareRootImageFilterType::Pointer m_SquareRootImageFilter;
typename GradientFilterType::Pointer m_GradientFilter;
typename NeighborhoodScalarProductFilterType::Pointer m_NeighborhoodScalarProductFilter;
typename RemoveIsolatedByDirectionFilterType::Pointer m_RemoveIsolatedByDirectionFilter;
......
......@@ -34,6 +34,7 @@ RoadExtractionFilter<TInputImage, TOutputPath>
this->SetNumberOfRequiredOutputs(1);
m_SpectralAngleDistanceImageFilter = SpectralAngleDistanceImageFilterType::New();
m_SquareRootImageFilter = SquareRootImageFilterType::New();
m_GradientFilter = GradientFilterType::New();
m_NeighborhoodScalarProductFilter = NeighborhoodScalarProductFilterType::New();
m_RemoveIsolatedByDirectionFilter = RemoveIsolatedByDirectionFilterType::New();
......@@ -109,8 +110,10 @@ RoadExtractionFilter<TInputImage, TOutputPath>
//
m_SpectralAngleDistanceImageFilter->SetInput(inputImage);
m_SpectralAngleDistanceImageFilter->SetReferencePixel(m_ReferencePixel);
m_SquareRootImageFilter->SetInput(m_SpectralAngleDistanceImageFilter->GetOutput());
m_GradientFilter->SetInput(m_SpectralAngleDistanceImageFilter->GetOutput());
m_GradientFilter->SetInput(m_SquareRootImageFilter->GetOutput());
/** Sigma calculated with the alpha and image resolution parameters */
m_GradientFilter->SetSigma(static_cast<SigmaType>(m_Alpha * (1.2/m_Resolution + 1.) ));
......
......@@ -364,7 +364,7 @@ ADD_TEST(coTvDrawPathListFilterWithValue ${COMMON_TESTS}
${TEMP}/coTvDrawPathListFilterWithValueOutput.png
)
# ------- otb::DrawListFilter -------------------------------------------
# ------- otb::DrawPathFilter -------------------------------------------
ADD_TEST(coTuDrawPatFilterNew ${COMMON_TESTS}
otbDrawPathFilterNew
......
......@@ -78,14 +78,14 @@ int otbDrawPathDessinCarre( int argc, char * argv[] )
VertexList->AddVertex(cindex);
/*2eme Segment*/
pos[0]=130;
pos[0]=90;
pos[1]=130;
image->TransformPhysicalPointToContinuousIndex(pos,cindex);
VertexList->AddVertex(cindex);
/*3eme Segment*/
pos[0]=130;
pos[0]=90;
pos[1]= 30;
image->TransformPhysicalPointToContinuousIndex(pos,cindex);
VertexList->AddVertex(cindex);
......
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