Commit 0290d845 authored by Cyrille Valladeau's avatar Cyrille Valladeau

ENH : change TSX brightness and calib functors : 1 functor for scalar and complex

parent 0bd9d86c
......@@ -24,7 +24,7 @@
#include "otbUnaryFunctorWithIndexImageFilter.h"
#include "otbRadarFunctors.h"
#include "otbTerraSarFunctors.h"
#include "itkMetaDataDictionary.h"
//#include "itkConstNeighborhoodIterator.h"
#include "otbMath.h"
......
......@@ -26,7 +26,7 @@
#include "itkUnaryFunctorImageFilter.h"
#include "itkMetaDataDictionary.h"
#include "otbMath.h"
#include "otbRadarFunctors.h"
#include "otbTerraSarFunctors.h"
namespace otb
{
......
......@@ -1056,38 +1056,8 @@ ADD_TEST(raTvTerraSarRadarBrightnessImageFilterTest ${RADIOMETRY_TESTS9}
${TEMP}/raTvTerraSarRadarBrightnessImageFilterTest.tif
)
# ------- TerraSarRadarBrightnessComplexImageFilter ------------------------------
ADD_TEST(raTuTerraSarRadarBrightnessComplexImageFilterNew ${RADIOMETRY_TESTS9}
otbTerraSarRadarBrightnessComplexImageFilterNew
)
ADD_TEST(raTvTerraSarRadarBrightnessComplexImageFilterTest ${RADIOMETRY_TESTS9}
--compare-image ${EPSILON}
${BASELINE}/raTvTerraSarRadarBrightnessComplexImageFilterTest.tif
${TEMP}/raTvTerraSarRadarBrightnessComplexImageFilterTest.tif
otbTerraSarRadarBrightnessComplexImageFilterTest
# complex image
${INPUTDATA}/ExtractIMAGE_HH_SRA_spot_074.tif
${TEMP}/raTvTerraSarRadarBrightnessComplexImageFilterTest.tif
)
# ------- TerraSarCalibrationCplxImageFilter ------------------------------
ADD_TEST(raTuTerraSarCalibrationCplxImageFilterNew ${RADIOMETRY_TESTS9}
otbTerraSarCalibrationCplxImageFilterNew
)
ADD_TEST(raTvTerraSarCalibrationCplxImageFilterTest ${RADIOMETRY_TESTS9}
# TEST GIVE NULL OUTPUT, DON'T HAVE TIME TO CORRECT, SORRY
# --compare-image ${EPSILON}
# ${BASELINE}/raTvTerraSarCalibrationClxImageFilterTest.tif
# ${TEMP}/raTvTerraSarCalibrationCplxImageFilterTest.tif
otbTerraSarCalibrationCplxImageFilterTest
# complex image
${INPUTDATA}/ExtractIMAGE_HH_SRA_spot_074.tif
${TEMP}/raTvTerraSarCalibrationCplxImageFilterTest.tif
)
# A enrichir
SET(Radiometry_SRCS1
otbRadiometryTests1.cxx
......@@ -1184,10 +1154,6 @@ otbTerraSarCalibrationImageFilterNew.cxx
otbTerraSarCalibrationImageFilterTest.cxx
otbTerraSarRadarBrightnessImageFilterNew.cxx
otbTerraSarRadarBrightnessImageFilterTest.cxx
otbTerraSarRadarBrightnessComplexImageFilterNew.cxx
otbTerraSarRadarBrightnessComplexImageFilterTest.cxx
otbTerraSarCalibrationCplxImageFilterNew.cxx
otbTerraSarCalibrationCplxImageFilterTest.cxx
)
......
......@@ -31,10 +31,6 @@ void RegisterTests()
REGISTER_TEST(otbTerraSarCalibrationImageFilterTest);
REGISTER_TEST(otbTerraSarRadarBrightnessImageFilterNew);
REGISTER_TEST(otbTerraSarRadarBrightnessImageFilterTest);
REGISTER_TEST(otbTerraSarRadarBrightnessComplexImageFilterNew);
REGISTER_TEST(otbTerraSarRadarBrightnessComplexImageFilterTest);
REGISTER_TEST(otbTerraSarCalibrationCplxImageFilterNew);
REGISTER_TEST(otbTerraSarCalibrationCplxImageFilterTest);
}
......
/*=========================================================================
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 "itkExceptionObject.h"
#include "otbImage.h"
#include "otbUnaryFunctorWithIndexImageFilter.h"
#include "otbRadarFunctors.h"
int otbTerraSarCalibrationCplxImageFilterNew(int argc, char * argv[])
{
typedef std::complex<double> CplxType;
typedef otb::Image<CplxType, 2> CplxImageType;
typedef otb::Functor::TerraSarCalibrationComplexImageFunctor< CplxType, CplxType > FunctorType;
typedef otb::UnaryFunctorWithIndexImageFilter< CplxImageType,CplxImageType, FunctorType> CplxFilterType;
CplxFilterType::Pointer filterCplx = CplxFilterType::New();
return EXIT_SUCCESS;
}
/*=========================================================================
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 "itkExceptionObject.h"
#include "otbRadarFunctors.h"
#include "otbUnaryFunctorWithIndexImageFilter.h"
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
int otbTerraSarCalibrationCplxImageFilterTest(int argc, char * argv[])
{
const char * inputFileName = argv[1];
const char * outputFileName = argv[2];
typedef std::complex<double> CplxType;
typedef otb::Image<CplxType, 2> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef otb::ImageFileWriter<ImageType> WriterType;
typedef otb::Functor::TerraSarCalibrationComplexImageFunctor< CplxType, CplxType > FunctorType;
typedef otb::UnaryFunctorWithIndexImageFilter< ImageType,ImageType, FunctorType> FilterType;
typedef FunctorType::DoubleVectorType DoubleVectorType;
typedef FunctorType::DoubleVectorVectorType DoubleVectorVectorType;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
FilterType::Pointer filter = FilterType::New();
reader->SetFileName(inputFileName);
writer->SetFileName(outputFileName);
reader->UpdateOutputInformation();
DoubleVectorType coefs;
coefs.push_back(1.);
coefs.push_back(0.5);
coefs.push_back(1.);
coefs.push_back(0.1);
DoubleVectorVectorType coefVect(1, coefs);
coefs.clear();
coefs.push_back(10.);
coefs.push_back(5);
coefs.push_back(10);
coefs.push_back(1);
coefVect.push_back( coefs );
coefs.clear();
coefs.push_back(100);
coefs.push_back(50);
coefs.push_back(100);
coefs.push_back(10);
coefVect.push_back( coefs );
filter->GetFunctor().SetNoisePolynomialCoefficientsList(coefVect);
filter->GetFunctor().SetCalFactor( 10 );
filter->GetFunctor().SetNoiseRangeValidityMin( 0 );
filter->GetFunctor().SetNoiseRangeValidityMax( 1 );
filter->GetFunctor().SetNoiseRangeValidityRef( 0.5 );
filter->GetFunctor().SetLocalIncidentAngle( 15 );
filter->GetFunctor().SetLocalIncidentAngle( 15 );
std::vector<long int> timeUtc;
timeUtc.push_back(1);
timeUtc.push_back(2);
timeUtc.push_back(3);
filter->GetFunctor().SetTimeUTC(timeUtc);
filter->GetFunctor().SetPRF(50);
filter->GetFunctor().SetUseFastCalibrationMethod( false );
filter->SetInput(reader->GetOutput());
writer->SetInput(filter->GetOutput());
writer->Update();
return EXIT_SUCCESS;
}
/*=========================================================================
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 "itkExceptionObject.h"
#include "otbRadarFunctors.h"
#include "itkUnaryFunctorImageFilter.h"
#include "otbImage.h"
int otbTerraSarRadarBrightnessComplexImageFilterNew(int argc, char * argv[])
{
typedef std::complex<double> ComplexPixelType;
typedef otb::Image< ComplexPixelType > ComplexImageType;
typedef otb::Functor::TerraSarRadarBrightnessComplexImageFunctor< ComplexPixelType, ComplexPixelType > FunctorType;
typedef itk::UnaryFunctorImageFilter<ComplexImageType, ComplexImageType, FunctorType > FilterType;
FilterType::Pointer filter = FilterType::New();
return EXIT_SUCCESS;
}
/*=========================================================================
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 "itkExceptionObject.h"
#include "otbRadarFunctors.h"
#include "itkUnaryFunctorImageFilter.h"
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
int otbTerraSarRadarBrightnessComplexImageFilterTest(int argc, char * argv[])
{
const char * inputFileName = argv[1];
const char * outputFileName = argv[2];
typedef std::complex<double> ComplexPixelType;
typedef otb::Image< ComplexPixelType > ComplexImageType;
typedef otb::Functor::TerraSarRadarBrightnessComplexImageFunctor< ComplexPixelType, ComplexPixelType > FunctorType;
typedef itk::UnaryFunctorImageFilter<ComplexImageType, ComplexImageType, FunctorType > FilterType;
typedef otb::ImageFileReader<ComplexImageType> ReaderType;
typedef otb::ImageFileWriter<ComplexImageType> WriterType;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
FilterType::Pointer filter = FilterType::New();
reader->SetFileName(inputFileName);
writer->SetFileName(outputFileName);
reader->UpdateOutputInformation();
filter->GetFunctor().SetCalFactor( 10 );
filter->SetInput(reader->GetOutput());
writer->SetInput(filter->GetOutput());
// writer->SetNumberOfStreamDivisions(1);
writer->Update();
return EXIT_SUCCESS;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment