Skip to content
Snippets Groups Projects
Commit 327d36b8 authored by Caroline Ruffel's avatar Caroline Ruffel
Browse files

nomsg

parent bb22fd3f
No related branches found
No related tags found
No related merge requests found
......@@ -166,6 +166,9 @@ ADD_TEST(feTvMultiplyByScalarImage ${FEATUREEXTRACTION_TESTS}
ADD_TEST(feTuThresholdImageToPointSetTest ${FEATUREEXTRACTION_TESTS}
otbThresholdImageToPointSetTest
${INPUTDATA}/TeteAToto.png)
ADD_TEST(feTuPixelSuppressionByDirectionNew ${FEATUREEXTRACTION_TESTS}
otbPixelSuppressionByDirectionNew)
#ADD_TEST(tvFEPatrick2 ${FEATUREEXTRACTION_TESTS}
# --compare-image ${TOL} ${BASELINE}/otbExtractROI_cthead1_26_97_209_100.png
......@@ -208,6 +211,7 @@ otbAssymetricFusionOfLineDetector.cxx
otbHarrisImage.cxx
otbMultiplyByScalarImageTest.cxx
otbThresholdImageToPointSetTest.cxx
otbPixelSuppressionByDirectionNew.cxx
)
......
......@@ -40,5 +40,5 @@ REGISTER_TEST(otbAssymetricFusionOfLineDetector);
REGISTER_TEST(otbHarrisImage);
REGISTER_TEST(otbMultiplyByScalarImageFilterTest);
REGISTER_TEST(otbThresholdImageToPointSetTest);
REGISTER_TEST(otbPixelSuppressionByDirectionNew);
}
/*=========================================================================
Programme : OTB (ORFEO ToolBox)
Auteurs : CS - C.Ruffel
Language : C++
Date : 14 mars 2006
Version :
Role : Test du filtre de suppression par direction des pixels isoles
$Id$
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#define MAIN
#include "itkExceptionObject.h"
#include "itkImage.h"
#include "itkImageFileWriter.h"
#include <iostream>
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "otbPixelSuppressionByDirectionImageFilter.h"
int otbPixelSuppressionByDirection( int argc, char* argv[] )
{
try
{
const char * inputFilename1 = argv[1];
const char * inputFilename2 = argv[2];
const char * outputFilename = argv[3];
unsigned int RadiusX((unsigned int)::atoi(argv[3]));
double AngularBeam((double)::atof(argv[4]));
typedef double InputPixelType;
typedef double OutputPixelType;
const unsigned int Dimension = 2;
typedef itk::Image< InputPixelType, Dimension > InputImageType1;
typedef itk::Image< OutputPixelType, Dimension > OutputImageType;
typedef otb::ImageFileReader< InputImageType1 > ReaderType1;
typedef otb::ImageFileReader< InputImageType1 > ReaderType2;
typedef otb::ImageFileWriter< OutputImageType > WriterType;
typedef otb::PixelSuppressionByDirection< InputImageType1, OutputImageType > FilterType;
FilterType::Pointer filter = FilterType::New();
FilterType::SizeType Radius;
Radius[0] = RadiusX;
Radius[1] = RadiusX;
filter->SetRadius( Radius );
filter->SetAngularBeam( static_cast<FilterType::InputRealType>( AngularBeam ));
ReaderType1::Pointer reader1 = ReaderType1::New();
ReaderType2::Pointer reader2 = ReaderType2::New();
WriterType::Pointer writer = WriterType::New();
reader1->SetFileName( inputFilename1 );
reader2->SetFileName( inputFilename2 );
writer->SetFileName( outputFilename );
filter->SetInputImage( reader1->GetOutput() );
filter->SetInputImageDirection( reader2->GetOutput() );
writer->SetInput( filter->GetOutput() );
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;
}
/*=========================================================================
Programme : OTB (ORFEO ToolBox)
Auteurs : CS - C.Ruffel
Language : C++
Date : 14 mars 2006
Version :
Role : Test d'instanciation du filtre de suppression par direction des pixels isoles
$Id$
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#define MAIN
#include "itkExceptionObject.h"
#include "itkImage.h"
#include "itkImageFileWriter.h"
#include <iostream>
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "otbPixelSuppressionByDirectionImageFilter.h"
int otbPixelSuppressionByDirectionNew( int argc, char* argv[] )
{
try
{
typedef double InputPixelType;
typedef double OutputPixelType;
const unsigned int Dimension = 2;
typedef itk::Image< InputPixelType, Dimension > InputImageType;
typedef itk::Image< OutputPixelType, Dimension > OutputImageType;
typedef otb::ImageFileReader< InputImageType > ReaderType1;
typedef otb::ImageFileReader< InputImageType > ReaderType2;
typedef otb::ImageFileWriter< OutputImageType > WriterType;
typedef otb::PixelSuppressionByDirectionImageFilter< InputImageType, OutputImageType > FilterType;
FilterType::Pointer filter = FilterType::New();
}
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;
}
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