diff --git a/Testing/Code/Projections/CMakeLists.txt b/Testing/Code/Projections/CMakeLists.txt index dd8ed1c1217d6fd9e5f13fd17ce6e436c069f147..4d58d4944dcaac00914999c16f4ea120ed1fa1a0 100644 --- a/Testing/Code/Projections/CMakeLists.txt +++ b/Testing/Code/Projections/CMakeLists.txt @@ -393,7 +393,7 @@ ADD_TEST(prTlOrthoRectificationSPOT5 ${PROJECTIONS_TESTS2} ) ADD_TEST(prTlOrthoRectificationMonoThreadSPOT5 ${PROJECTIONS_TESTS2} - --compare-image ${EPSILON_4} ${BASELINE}/prTvOrthoRectificationSPOT5_UTM.tif + --compare-image ${EPSILON_4} ${BASELINE}/prTvOrthoRectificationSPOT5_UTM_band1.tif ${TEMP}/prTvOrthoRectificationMonoThreadSPOT5_UTM.tif otbOrthoRectificationMonoThreadFilter ${LARGEINPUT}/SPOT5/TEHERAN/IMAGERY.TIF diff --git a/Testing/Code/Projections/otbOrthoRectificationMonoThreadFilter.cxx b/Testing/Code/Projections/otbOrthoRectificationMonoThreadFilter.cxx index 649b021cf3d032a6afa77d7ecbdfc1a0c5fa3824..7e3334f2d6d1e996eb7d966e536854ab1840a909 100644 --- a/Testing/Code/Projections/otbOrthoRectificationMonoThreadFilter.cxx +++ b/Testing/Code/Projections/otbOrthoRectificationMonoThreadFilter.cxx @@ -25,10 +25,12 @@ #include "otbMacro.h" #include "otbImage.h" +#include "otbVectorImage.h" #include "otbImageFileReader.h" #include "otbStreamingImageFileWriter.h" #include "otbInverseSensorModel.h" #include "otbStreamingResampleImageFilter.h" +#include "otbMultiToMonoChannelExtractROI.h" #include "otbOrthoRectificationFilter.h" #include "otbMapProjections.h" @@ -47,15 +49,21 @@ int otbOrthoRectificationMonoThreadFilter(int argc, char* argv[]) return EXIT_FAILURE; } - typedef otb::Image<double, 2> ImageType; - typedef otb::ImageFileReader<ImageType> ReaderType; - typedef otb::StreamingImageFileWriter<ImageType> WriterType; + typedef double PixelType; + typedef otb::Image<PixelType, 2> ImageType; + typedef otb::VectorImage<PixelType, 2> VectorImageType; + typedef otb::ImageFileReader<VectorImageType> ReaderType; + typedef otb::StreamingImageFileWriter<ImageType> WriterType; + + typedef otb::MultiToMonoChannelExtractROI<PixelType, PixelType> ExtractorType; typedef otb::UtmInverseProjection UtmMapProjectionType; typedef otb::OrthoRectificationFilter<ImageType, ImageType, UtmMapProjectionType> OrthoRectifFilterType; + //Allocate pointer ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); + ExtractorType::Pointer extractor = ExtractorType::New(); OrthoRectifFilterType::Pointer orthoRectifFilter = OrthoRectifFilterType::New(); UtmMapProjectionType::Pointer utmMapProjection = UtmMapProjectionType::New(); @@ -65,9 +73,12 @@ int otbOrthoRectificationMonoThreadFilter(int argc, char* argv[]) writer->SetFileName(argv[2]); reader->GenerateOutputInformation(); - std::cout << reader->GetOutput() << std::endl; - orthoRectifFilter->SetInput(reader->GetOutput()); + // Extract the first channel of the image + extractor->SetInput(reader->GetOutput()); + extractor->SetChannel(1); + + orthoRectifFilter->SetInput(extractor->GetOutput()); ImageType::IndexType start; start[0] = 0;