Skip to content
Snippets Groups Projects
Commit dcd2b240 authored by Aurélien Bricier's avatar Aurélien Bricier
Browse files

TEST: added tests for the RadiometricMomentsImageFilter

parent 17721369
No related branches found
No related tags found
No related merge requests found
...@@ -1543,6 +1543,20 @@ ADD_TEST(feTvHistogramOfOrientedGradientCovariantImageFunction ${FEATUREEXTRACTI ...@@ -1543,6 +1543,20 @@ ADD_TEST(feTvHistogramOfOrientedGradientCovariantImageFunction ${FEATUREEXTRACTI
5 273 64 5 273 64
) )
# ------ otb::RadiometricMomentsImageFilter --------
ADD_TEST(feTuRadiometricMomentsImageFilterNew ${FEATUREEXTRACTION_TESTS16}
otbRadiometricMomentsImageFilterNew)
ADD_TEST(feTvRadiometricMomentsImageFilter ${FEATUREEXTRACTION_TESTS16}
--compare-image ${EPSILON_8}
${BASELINE}/feTvRadiometricMomentsImageFilter.tif
${TEMP}/feTvRadiometricMomentsImageFilter.tif
otbRadiometricMomentsImageFilter
${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif
${TEMP}/feTvRadiometricMomentsImageFilter.tif
3 #radius
)
# A enrichir # A enrichir
SET(BasicFeatureExtraction_SRCS1 SET(BasicFeatureExtraction_SRCS1
otbFeatureExtractionTests1.cxx otbFeatureExtractionTests1.cxx
...@@ -1742,6 +1756,7 @@ otbImageFunctionAdaptor.cxx ...@@ -1742,6 +1756,7 @@ otbImageFunctionAdaptor.cxx
otbMetaImageFunction.cxx otbMetaImageFunction.cxx
otbHaralickTexturesImageFunction.cxx otbHaralickTexturesImageFunction.cxx
otbHistogramOfOrientedGradientCovariantImageFunction.cxx otbHistogramOfOrientedGradientCovariantImageFunction.cxx
otbRadiometricMomentsImageFilter.cxx
) )
......
...@@ -38,4 +38,6 @@ void RegisterTests() ...@@ -38,4 +38,6 @@ void RegisterTests()
REGISTER_TEST(otbHaralickTexturesImageFunction); REGISTER_TEST(otbHaralickTexturesImageFunction);
REGISTER_TEST(otbHistogramOfOrientedGradientCovariantImageFunctionNew); REGISTER_TEST(otbHistogramOfOrientedGradientCovariantImageFunctionNew);
REGISTER_TEST(otbHistogramOfOrientedGradientCovariantImageFunction); REGISTER_TEST(otbHistogramOfOrientedGradientCovariantImageFunction);
REGISTER_TEST(otbRadiometricMomentsImageFilterNew);
REGISTER_TEST(otbRadiometricMomentsImageFilter);
} }
/*=========================================================================
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.
=========================================================================*/
#include "otbImage.h"
#include "otbVectorImage.h"
#include "otbImageFileReader.h"
#include "otbStreamingImageFileWriter.h"
#include "otbRadiometricMomentsImageFilter.h"
int otbRadiometricMomentsImageFilterNew(int argc, char * argv[])
{
typedef float InputPixelType;
const unsigned int Dimension = 2;
/** Typedefs */
typedef otb::Image<InputPixelType, Dimension> ImageType;
typedef otb::VectorImage<InputPixelType, Dimension> VectorImageType;
typedef otb::RadiometricMomentsImageFilter<ImageType, VectorImageType> FilterType;
FilterType::Pointer filter = FilterType::New();
std::cout << filter << std::endl;
return EXIT_SUCCESS;
}
int otbRadiometricMomentsImageFilter(int argc, char * argv[])
{
typedef float InputPixelType;
const unsigned int Dimension = 2;
// Typedefs
typedef otb::Image<InputPixelType, Dimension> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef otb::VectorImage<InputPixelType, Dimension> VectorImageType;
typedef otb::StreamingImageFileWriter<VectorImageType> WriterType;
typedef otb::RadiometricMomentsImageFilter<ImageType, VectorImageType> FilterType;
ReaderType::Pointer reader = ReaderType::New();
FilterType::Pointer filter = FilterType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName(argv[1]);
reader->GenerateOutputInformation();
filter->SetInput(reader->GetOutput());
filter->SetRadius(atoi(argv[3]));
filter->SetNumberOfThreads(1);
writer->SetFileName(argv[2]);
writer->SetInput(filter->GetOutput());
writer->Update();
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