diff --git a/Testing/Code/Radiometry/otbRadiometryTests9.cxx b/Testing/Code/Radiometry/otbRadiometryTests9.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a29214fdc917546171ca8f61e97af583c7c0167b --- /dev/null +++ b/Testing/Code/Radiometry/otbRadiometryTests9.cxx @@ -0,0 +1,35 @@ +/*========================================================================= + + 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. + +=========================================================================*/ + +// this file defines the otbCommonTest for the test driver +// and all it expects is that you have a function called RegisterTests +#if defined(_MSC_VER) +#pragma warning ( disable : 4786 ) +#endif + + +#include "otbTestMain.h" + +void RegisterTests() +{ +REGISTER_TEST(otbTerraSarIntraCalibrationImageFilterNew); +REGISTER_TEST(otbTerraSarIntraCalibrationImageFilterTest); +} + + + diff --git a/Testing/Code/Radiometry/otbTerraSarIntraCalibrationImageFilterNew.cxx b/Testing/Code/Radiometry/otbTerraSarIntraCalibrationImageFilterNew.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e1d552fa926bcb61a88afd3d5f97bfb740a80b7a --- /dev/null +++ b/Testing/Code/Radiometry/otbTerraSarIntraCalibrationImageFilterNew.cxx @@ -0,0 +1,31 @@ +/*========================================================================= + + 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 "otbTerraSarIntraCalibrationImageFilter.h" +#include "otbImage.h" + +int otbTerraSarIntraCalibrationImageFilterNew(int argc, char * argv[]) +{ + typedef otb::Image<double, 2> ImageType; + typedef otb::TerraSarIntraCalibrationImageFilter<ImageType, ImageType> FilterType; + + FilterType::Pointer filter = FilterType::New(); + + return EXIT_SUCCESS; +} diff --git a/Testing/Code/Radiometry/otbTerraSarIntraCalibrationImageFilterTest.cxx b/Testing/Code/Radiometry/otbTerraSarIntraCalibrationImageFilterTest.cxx new file mode 100644 index 0000000000000000000000000000000000000000..e232dcc721a6d0156c3729440d46678f31121572 --- /dev/null +++ b/Testing/Code/Radiometry/otbTerraSarIntraCalibrationImageFilterTest.cxx @@ -0,0 +1,74 @@ +/*========================================================================= + + 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 "otbTerraSarIntraCalibrationImageFilter.h" +#include "otbImage.h" +#include "otbVectorImage.h" +#include "otbImageFileReader.h" +#include "otbImageFileWriter.h" +#include "otbVectorImageToAmplitudeImageFilter.h" + +int otbTerraSarIntraCalibrationImageFilterTest(int argc, char * argv[]) +{ + const char * inputFileName = argv[1]; + const char * outputFileName = argv[2]; + + typedef otb::Image<double, 2> ImageType; + typedef otb::VectorImage<double, 2> VectorImageType; + typedef otb::ImageFileReader<VectorImageType> ReaderType; + typedef otb::ImageFileWriter<ImageType> WriterType; + typedef otb::VectorImageToAmplitudeImageFilter<VectorImageType, ImageType> AmplitudeFilterType; + typedef otb::TerraSarIntraCalibrationImageFilter<ImageType, ImageType> FilterType; + typedef FilterType::DoubleVectorType DoubleVectorType; + typedef FilterType::DoubleVectorVectorType DoubleVectorVectorType; + + ReaderType::Pointer reader = ReaderType::New(); + WriterType::Pointer writer = WriterType::New(); + AmplitudeFilterType::Pointer ampli = AmplitudeFilterType::New(); + FilterType::Pointer filter = FilterType::New(); + + reader->SetFileName(inputFileName); + writer->SetFileName(outputFileName); + std::cout<<"ouiiiiiiiii"<<std::endl; + reader->UpdateOutputInformation(); + //unsigned int nbChannel = reader->GetOutput()->GetNumberOfComponentsPerPixel(); + std::cout<<reader->GetOutput()->GetNumberOfComponentsPerPixel()<<std::endl; + + DoubleVectorType coefs; + coefs.push_back(1.); + coefs.push_back(0.5); + coefs.push_back(1.); + coefs.push_back(0.1); + DoubleVectorVectorType coefVect(1, coefs); + + filter->SetNoisePolynomialCoefficientsList(coefVect); + filter->SetCalFactor( 10 ); + filter->SetNoiseRangeValidityMin( 0 ); + filter->SetNoiseRangeValidityMax( 1 ); + filter->SetNoiseRangeValidityRef( 0.5 ); + filter->SetLocalIncidentAngle( 15 ); + + ampli->SetInput(reader->GetOutput()); + filter->SetInput(ampli->GetOutput()); + writer->SetInput(filter->GetOutput()); + writer->SetNumberOfStreamDivisions(1); + writer->Update(); + + return EXIT_SUCCESS; +}