Skip to content
Snippets Groups Projects
Commit 0d050042 authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

MRG

parents 0cd8d944 1d9af078
Branches
Tags
No related merge requests found
/*=========================================================================
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);
}
/*=========================================================================
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;
}
/*=========================================================================
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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment