Skip to content
Snippets Groups Projects
Commit 5fb358ef authored by Patrick Imbo's avatar Patrick Imbo
Browse files

otbForwardFourierMellinTransformImageFilter : implémentation de la classe + tests

parent bcf6cd8e
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,7 @@ const double
ForwardFourierMellinTransformImageFilter<TPixel, TInterpol, Dimension >
::GetAngularStep()
{
return m_LogPolarResample->GetAngularStep();
return static_cast<const double>(m_LogPolarResample->GetAngularStep() );
}
......@@ -104,7 +104,7 @@ const double
ForwardFourierMellinTransformImageFilter<TPixel, TInterpol, Dimension >
::GetRadialNumberOfSamples( )
{
return m_LogPolarResample->GetRadialNumberOfSamples();
return static_cast<const double>(m_LogPolarResample->GetRadialNumberOfSamples() );
}
template < class TPixel,class TInterpol,unsigned int Dimension >
......
......@@ -385,6 +385,11 @@ ADD_TEST(feTvExtractSegments ${FEATUREEXTRACTION_TESTS}
ADD_TEST(feTuForwardFourierMellinImageFilterNew ${FEATUREEXTRACTION_TESTS}
otbFourierMellinImageFilterNew)
ADD_TEST(feTuForwardFourierMellinImageFilter ${FEATUREEXTRACTION_TESTS}
otbFourierMellinImageFilter
${INPUTDATA}/DeuxCercles.hdr
${TEMP}/feTuForwardFourierMellinImageFilter.hdr)
# -----------------------------------------------------------------------
......@@ -441,6 +446,7 @@ otbLocalHoughDraw.cxx
otbExtractSegmentsNew.cxx
otbExtractSegments.cxx
otbFourierMellinImageFilterNew.cxx
otbFourierMellinImageFilter.cxx
)
......
......@@ -77,4 +77,5 @@ REGISTER_TEST(otbLocalHoughDraw);
REGISTER_TEST(otbExtractSegmentsNew);
REGISTER_TEST(otbExtractSegments);
REGISTER_TEST(otbFourierMellinImageFilterNew);
REGISTER_TEST(otbFourierMellinImageFilter);
}
/*=========================================================================
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
#define MAIN
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "otbForwardFourierMellinTransformImageFilter.h"
#include "itkLinearInterpolateImageFunction.h"
int otbFourierMellinImageFilter(int argc, char* argv[])
{
try
{
const char * inputFilename = argv[1];
const char * outputFilename = argv[2];
typedef double InputPixelType;
typedef std::complex<double> OutputPixelType;
const unsigned int Dimension = 2;
typedef otb::Image< InputPixelType, Dimension > InputImageType;
typedef otb::Image< OutputPixelType, Dimension > OutputImageType;
typedef otb::ImageFileReader< InputImageType > ReaderType;
typedef otb::ImageFileWriter< OutputImageType > WriterType;
typedef itk::LinearInterpolateImageFunction< InputImageType, double > InterpolatorType;
typedef otb::ForwardFourierMellinTransformImageFilter<InputPixelType,
InterpolatorType,Dimension> FourierMellinTransformType;
FourierMellinTransformType::Pointer FourierMellinTransform = FourierMellinTransformType::New();
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName( inputFilename );
writer->SetFileName( outputFilename );
FourierMellinTransform->SetInput( reader->GetOutput() );
// FourierMellinTransform->SetIsOriginAtCenter(true);
// FourierMellinTransform->SetAngularNumberOfSamples(512);
// FourierMellinTransform->SetRadialNumberOfSamples(513);
writer->SetInput( FourierMellinTransform->GetOutput() );
writer->Update();
}
catch( itk::ExceptionObject & err )
{
std::cerr << "itk::Exception detected: " << err.GetDescription();
return EXIT_FAILURE;
}
catch( ... )
{
std::cout << "unknown exception detected !" << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
......@@ -23,8 +23,6 @@
#define MAIN
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "otbForwardFourierMellinTransformImageFilter.h"
#include "itkLinearInterpolateImageFunction.h"
......
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