Skip to content
Snippets Groups Projects
Commit 200ea26e authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH : add flags to test the input and the output rpc model estimation

parent ee21beb2
No related branches found
No related tags found
No related merge requests found
......@@ -621,6 +621,7 @@ ADD_TEST(prTvotbGenericRSResampleImageFilter ${PROJECTIONS_TESTS4}
1000
15
0
1
${TEMP}/prTvotbGenericRSResampleImageFilterOutput.tif
)
ENDIF(OTB_DATA_USE_LARGEINPUT)
......
......@@ -49,10 +49,11 @@ int otbGenericRSResampleImageFilter(int argc, char* argv[])
if (argc > 1)
{
const char * infname = argv[1];
const char * outfname = argv[5];
const char * outfname = argv[6];
unsigned int isize = atoi(argv[2]);
double iGridSpacing = atof(argv[3]);
int useRpc = atoi(argv[4]);
int useInRpc = atoi(argv[4]);
int useOutRpc = atoi(argv[5]);
typedef otb::ImageFileReader<ImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
......@@ -95,12 +96,18 @@ int otbGenericRSResampleImageFilter(int argc, char* argv[])
resampler->SetOutputProjectionRef(utmRef);
resampler->SetInputProjectionRef(reader->GetOutput()->GetProjectionRef());
resampler->SetInputKeywordList(reader->GetOutput()->GetImageKeywordlist());
if (useRpc)
if (useInRpc)
{
resampler->SetGridSpacing(1000);
resampler->SetInputGridSpacing(1000);
resampler->EstimateInputRpcModelOn();
}
if (useOutRpc)
{
resampler->SetOutputGridSpacing(50);
resampler->EstimateOutputRpcModelOn();
}
// Write the resampled image
typedef otb::StreamingImageFileWriter<ImageType> WriterType;
WriterType::Pointer writer= WriterType::New();
......
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