diff --git a/Testing/Code/FeatureExtraction/CMakeLists.txt b/Testing/Code/FeatureExtraction/CMakeLists.txt index 9fa19168b92c647c15e9e7739bca2b533c8ecdbe..25d9b964f7faaf7b8562733b1c4dd6fcb124f15b 100755 --- a/Testing/Code/FeatureExtraction/CMakeLists.txt +++ b/Testing/Code/FeatureExtraction/CMakeLists.txt @@ -29,27 +29,6 @@ ADD_TEST(feTvAlignMV2ITK ${FEATUREEXTRACTION_TESTS} # ------- otb::Draw ------------------------------ -ADD_TEST(feTvDrawSegmentIntoImage ${FEATUREEXTRACTION_TESTS} - --compare-image ${TOL} ${BASELINE}/feDrawPathIntoPoupees.png - ${TEMP}/feDrawPathIntoPoupees.png - otbDrawPathList - ${INPUTDATA}/poupees.hdr - ${TEMP}/feDrawPathIntoPoupees.png) - -ADD_TEST(feTvDrawSegmentIntoImageLine ${FEATUREEXTRACTION_TESTS} - --compare-image ${TOL} ${BASELINE}/feDrawDeuxLignes.png - ${TEMP}/feDrawDeuxLignes.png - otbDrawPathListTracerLignes - ${INPUTDATA}/DeuxTraits.png - ${TEMP}/feDrawDeuxLignes.png) - -ADD_TEST(feTvDrawSegmentIntoImage ${FEATUREEXTRACTION_TESTS} - --compare-image ${TOL} ${BASELINE}/feDrawPathIntoDeuxTraits.png - ${TEMP}/feDrawPathIntoDeuxTraits.png - otbDrawPathList - ${INPUTDATA}/DeuxTraits.png - ${TEMP}/feDrawPathIntoDeuxTraits.png) - ADD_TEST(feTvDrawPathTestCarre ${FEATUREEXTRACTION_TESTS} --compare-image ${TOL} ${BASELINE}/feDrawPathDessinCarre.png ${TEMP}/feDrawPathDessinCarre.png @@ -554,8 +533,6 @@ ADD_TEST(feTvNonMaxRemovalByDirectionFilter ${FEATUREEXTRACTION_TESTS} # A enrichir SET(BasicFeatureExtraction_SRCS otbAlignImageToPath.cxx -otbDrawPathList.cxx -otbDrawPathListTracerLignes.cxx otbDrawPath.cxx otbDrawPathAlign.cxx otbComplexMomentImage.cxx diff --git a/Testing/Code/FeatureExtraction/otbDrawPathList.cxx b/Testing/Code/FeatureExtraction/otbDrawPathList.cxx deleted file mode 100644 index 5673027ba68b4ea5cfb271a4d75b5e3948552881..0000000000000000000000000000000000000000 --- a/Testing/Code/FeatureExtraction/otbDrawPathList.cxx +++ /dev/null @@ -1,96 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#if defined(_MSC_VER) -#pragma warning ( disable : 4786 ) -#endif - -#include "itkExceptionObject.h" -#include "itkPolyLineParametricPath.h" - -#include "otbImage.h" -#include "otbPathListSource.h" -#include "otbImageToPathListAlignFilter.h" -#include "otbDrawPathListFilter.h" -#include "otbImageFileReader.h" -#include "otbImageFileWriter.h" - - -int otbDrawPathList( int argc, char * argv[] ) -{ - try - { - const char * inputFilename = argv[1]; - const char * outputFilename = argv[2]; - - - typedef unsigned char InputPixelType; - typedef unsigned char OutputPixelType; - const unsigned int Dimension = 2; - - typedef otb::Image< InputPixelType, Dimension > InputImageType; - typedef otb::Image< OutputPixelType, Dimension > OutputImageType; - - typedef itk::PolyLineParametricPath< Dimension > PathType; - typedef PathType::Pointer PathPointerType; - - typedef otb::ImageFileReader< InputImageType > ReaderType; - typedef otb::ImageFileWriter< OutputImageType > WriterType; - - typedef otb::DrawPathListFilter<InputImageType,PathType,OutputImageType> DrawPathListFilterType; - - typedef otb::ImageToPathListAlignFilter<InputImageType,PathType> PathListType; - - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - - DrawPathListFilterType::Pointer DrawPath = DrawPathListFilterType::New(); - - PathListType::Pointer testList = PathListType::New(); - - reader->SetFileName( inputFilename ); - writer->SetFileName( outputFilename ); - -//OTB-FA-00010-CS - testList->SetInput( reader->GetOutput() ); - testList->Update(); - - DrawPath->SetImageInput(reader->GetOutput() ); - DrawPath->SetPathInput( testList->GetOutput()); - DrawPath->Update(); - - writer->SetInput(DrawPath->GetImageOutput()); - writer->Update(); - - } - catch( itk::ExceptionObject & err ) - { - std::cout << "Exception itk::ExceptionObject levee !" << std::endl; - std::cout << err << std::endl; - return EXIT_FAILURE; - } - catch( ... ) - { - std::cout << "Exception levee inconnue !" << std::endl; - return EXIT_FAILURE; - } - // Software Guide : EndCodeSnippet - -//#endif - return EXIT_SUCCESS; -} diff --git a/Testing/Code/FeatureExtraction/otbDrawPathListTracerLignes.cxx b/Testing/Code/FeatureExtraction/otbDrawPathListTracerLignes.cxx deleted file mode 100644 index df0b897201dad8de31483c6ae49db4f62eb2c706..0000000000000000000000000000000000000000 --- a/Testing/Code/FeatureExtraction/otbDrawPathListTracerLignes.cxx +++ /dev/null @@ -1,194 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#if defined(_MSC_VER) -#pragma warning ( disable : 4786 ) -#endif - -#include "itkExceptionObject.h" -#include "itkImage.h" -#include "itkImageFileWriter.h" -#include "itkPolyLineParametricPath.h" - -#include "otbImageFileReader.h" -#include "otbPathListSource.h" -#include "otbImageToPathListAlignFilter.h" -#include "otbDrawPathListFilter.h" -#include "otbImageFileWriter.h" - - -int otbDrawPathListTracerLignes( int argc, char * argv[] ) -{ - try - { - const char * inputFilename = argv[1]; - const char * outputFilename = argv[2]; - - typedef unsigned char InputPixelType; - typedef unsigned char OutputPixelType; - const unsigned int Dimension = 2; - - typedef itk::Image< InputPixelType, Dimension > InputImageType; - typedef itk::Image< OutputPixelType, Dimension > OutputImageType; - - typedef itk::PolyLineParametricPath< Dimension > PathType; - typedef PathType::Pointer PathPointerType; - - typedef otb::ImageFileReader< InputImageType > ReaderType; - typedef itk::ImageFileWriter< OutputImageType > WriterType; - typedef otb::PathListSource<PathType> PathListType; - - typedef otb::DrawPathListFilter<InputImageType,PathType,OutputImageType> DrawPathListFilterType; - - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - - reader->SetFileName( inputFilename ); - writer->SetFileName( outputFilename ); - - InputImageType::ConstPointer image = reader->GetOutput(); - typedef InputImageType::PointType ImagePointType; - - PathListType::Pointer testList = PathListType::New(); - PathListType::OutputPathListType * path = testList->GetOutput(); - - - ImagePointType pos; - PathType::ContinuousIndexType cindex; - - - /*1er Segment*/ - PathType::Pointer pathElt1 = PathType::New(); - pathElt1->Initialize(); - - pos[0]=30; - pos[1]=30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt1->AddVertex(cindex); - pos[0]= 30; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt1->AddVertex(cindex); - - path->PushBack(pathElt1); - - /*2eme Segment*/ - PathType::Pointer pathElt2 = PathType::New(); - pathElt2->Initialize(); - pos[0]= 30; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt2->AddVertex(cindex); - pos[0]=130; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt2->AddVertex(cindex); - - path->PushBack(pathElt2); - - /*3eme Segment*/ - PathType::Pointer pathElt3 = PathType::New(); - pathElt3->Initialize(); - pos[0]=130; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt3->AddVertex(cindex); - pos[0]=130; - pos[1]= 30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt3->AddVertex(cindex); - - path->PushBack(pathElt3); - - /*4eme Segment*/ - PathType::Pointer pathElt4 = PathType::New(); - - pathElt4->Initialize(); - pos[0]=130; - pos[1]= 30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt4->AddVertex(cindex); - pos[0]=30; - pos[1]=30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt4->AddVertex(cindex); - - path->PushBack(pathElt4); - - /*5eme Segment*/ - PathType::Pointer pathElt5 = PathType::New(); - pathElt5->Initialize(); - pos[0]= 30; - pos[1]= 30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt5->AddVertex(cindex); - pos[0]=130; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt5->AddVertex(cindex); - - path->PushBack(pathElt5); - - /*6eme Segment*/ - PathType::Pointer pathElt6 = PathType::New(); - - pathElt6->Initialize(); - pos[0]=130; - pos[1]= 30; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt6->AddVertex(cindex); - pos[0]= 30; - pos[1]=130; - image->TransformPhysicalPointToContinuousIndex(pos,cindex); - pathElt6->AddVertex(cindex); - - path->PushBack(pathElt6); - - - -#if 0 - testList->SetImageInput( reader->GetOutput() ); - testList->Update(); -#endif - DrawPathListFilterType::Pointer DrawPath = DrawPathListFilterType::New(); - - DrawPath->SetImageInput(reader->GetOutput() ); - DrawPath->SetPathInput( testList->GetOutput()); -// DrawPath->SetImageOutput(); - DrawPath->Update(); - - writer->SetInput(DrawPath->GetImageOutput()); - writer->Update(); - - } - catch( itk::ExceptionObject & err ) - { - std::cout << "Exception itk::ExceptionObject levee !" << std::endl; - std::cout << err << std::endl; - return EXIT_FAILURE; - } - catch( ... ) - { - std::cout << "Exception levee inconnue !" << std::endl; - return EXIT_FAILURE; - } - // Software Guide : EndCodeSnippet - -//#endif - return EXIT_SUCCESS; -} diff --git a/Testing/Code/FeatureExtraction/otbFeatureExtractionTests.cxx b/Testing/Code/FeatureExtraction/otbFeatureExtractionTests.cxx index 36495876ae3cb12665e5393475d107377ad6e54a..f82a98e13431b86cde52cfb4324eb5dc3ef442e9 100755 --- a/Testing/Code/FeatureExtraction/otbFeatureExtractionTests.cxx +++ b/Testing/Code/FeatureExtraction/otbFeatureExtractionTests.cxx @@ -28,8 +28,6 @@ void RegisterTests() { REGISTER_TEST(otbAlignImageToPath); -REGISTER_TEST(otbDrawPathList); -REGISTER_TEST(otbDrawPathListTracerLignes); REGISTER_TEST(otbDrawPathDessinCarre); REGISTER_TEST(otbDrawPathAlign); REGISTER_TEST(otbComplexMomentImage);