Commit 106ae978 authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Ensure that the Superimpose and BundleToPerfectSensor app reports the...

BUG: Ensure that the Superimpose and BundleToPerfectSensor app reports the correcte geometry information (mantis #1153)
No related merge requests found
Showing with 21 additions and 3 deletions
+21 -3
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "otbMultiToMonoChannelExtractROI.h" #include "otbMultiToMonoChannelExtractROI.h"
#include "otbGenericRSResampleImageFilter.h" #include "otbGenericRSResampleImageFilter.h"
#include "otbImportGeoInformationImageFilter.h"
#include "otbBCOInterpolateImageFunction.h" #include "otbBCOInterpolateImageFunction.h"
#include "otbSimpleRcsPanSharpeningFusionImageFilter.h" #include "otbSimpleRcsPanSharpeningFusionImageFilter.h"
#include "itkFixedArray.h" #include "itkFixedArray.h"
...@@ -133,6 +134,7 @@ private: ...@@ -133,6 +134,7 @@ private:
typedef otb::BCOInterpolateImageFunction<FloatVectorImageType> InterpolatorType; typedef otb::BCOInterpolateImageFunction<FloatVectorImageType> InterpolatorType;
typedef otb::GenericRSResampleImageFilter<FloatVectorImageType, FloatVectorImageType> ResamplerType; typedef otb::GenericRSResampleImageFilter<FloatVectorImageType, FloatVectorImageType> ResamplerType;
typedef otb::StreamingResampleImageFilter<FloatVectorImageType, FloatVectorImageType> BasicResamplerType; typedef otb::StreamingResampleImageFilter<FloatVectorImageType, FloatVectorImageType> BasicResamplerType;
typedef otb::ImportGeoInformationImageFilter<FloatVectorImageType,InternalImageType> ImportGeoInformationFilterType;
typedef otb::SimpleRcsPanSharpeningFusionImageFilter<InternalImageType, FloatVectorImageType, FloatVectorImageType> FusionFilterType; typedef otb::SimpleRcsPanSharpeningFusionImageFilter<InternalImageType, FloatVectorImageType, FloatVectorImageType> FusionFilterType;
// Resample filter // Resample filter
...@@ -142,6 +144,9 @@ private: ...@@ -142,6 +144,9 @@ private:
BasicResamplerType::Pointer basicResampler = BasicResamplerType::New(); BasicResamplerType::Pointer basicResampler = BasicResamplerType::New();
m_Ref.push_back(basicResampler.GetPointer()); m_Ref.push_back(basicResampler.GetPointer());
ImportGeoInformationFilterType::Pointer geoImport = ImportGeoInformationFilterType::New();
m_Ref.push_back(geoImport.GetPointer());
InterpolatorType::Pointer interpolator = InterpolatorType::New(); InterpolatorType::Pointer interpolator = InterpolatorType::New();
resampler->SetInterpolator(interpolator); resampler->SetInterpolator(interpolator);
basicResampler->SetInterpolator(interpolator); basicResampler->SetInterpolator(interpolator);
...@@ -209,8 +214,11 @@ private: ...@@ -209,8 +214,11 @@ private:
basicResampler->SetOutputSize(size); basicResampler->SetOutputSize(size);
basicResampler->SetOutputStartIndex(start); basicResampler->SetOutputStartIndex(start);
basicResampler->SetEdgePaddingValue(defaultValue); basicResampler->SetEdgePaddingValue(defaultValue);
fusionFilter->SetXsInput(basicResampler->GetOutput()); geoImport->SetInput(basicResampler->GetOutput());
geoImport->SetSource(panchro);
fusionFilter->SetXsInput(geoImport->GetOutput());
// Set the profRef & Keywordlist from Pan into the resampled XS image // Set the profRef & Keywordlist from Pan into the resampled XS image
basicResampler->UpdateOutputInformation(); basicResampler->UpdateOutputInformation();
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "otbWrapperApplicationFactory.h" #include "otbWrapperApplicationFactory.h"
#include "otbGenericRSResampleImageFilter.h" #include "otbGenericRSResampleImageFilter.h"
#include "otbImportGeoInformationImageFilter.h"
#include "otbBCOInterpolateImageFunction.h" #include "otbBCOInterpolateImageFunction.h"
#include "itkNearestNeighborInterpolateImageFunction.h" #include "itkNearestNeighborInterpolateImageFunction.h"
...@@ -66,6 +67,8 @@ public: ...@@ -66,6 +67,8 @@ public:
typedef otb::GenericRSResampleImageFilter<FloatVectorImageType, typedef otb::GenericRSResampleImageFilter<FloatVectorImageType,
FloatVectorImageType> ResamplerType; FloatVectorImageType> ResamplerType;
typedef otb::ImportGeoInformationImageFilter<FloatVectorImageType,
FloatVectorImageType> ImportGeoInformationFilterType;
typedef itk::ScalableAffineTransform<double, 2> TransformType; typedef itk::ScalableAffineTransform<double, 2> TransformType;
...@@ -165,6 +168,8 @@ private: ...@@ -165,6 +168,8 @@ private:
m_BasicResampler = BasicResamplerType::New(); m_BasicResampler = BasicResamplerType::New();
m_GeoImport = ImportGeoInformationFilterType::New();
// Get Interpolator // Get Interpolator
switch ( GetParameterInt("interpolator") ) switch ( GetParameterInt("interpolator") )
{ {
...@@ -261,8 +266,11 @@ private: ...@@ -261,8 +266,11 @@ private:
m_BasicResampler->SetEdgePaddingValue(defaultValue); m_BasicResampler->SetEdgePaddingValue(defaultValue);
m_GeoImport->SetInput(m_BasicResampler->GetOutput());
m_GeoImport->SetSource(refImage);
// Set the output image // Set the output image
SetParameterOutputImage("out", m_BasicResampler->GetOutput()); SetParameterOutputImage("out", m_GeoImport->GetOutput());
} }
else else
{ {
...@@ -273,6 +281,8 @@ private: ...@@ -273,6 +281,8 @@ private:
ResamplerType::Pointer m_Resampler; ResamplerType::Pointer m_Resampler;
BasicResamplerType::Pointer m_BasicResampler; BasicResamplerType::Pointer m_BasicResampler;
ImportGeoInformationFilterType::Pointer m_GeoImport;
}; };
......
Supports Markdown
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