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

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)
parent 7f6aff76
......@@ -19,6 +19,7 @@
#include "otbMultiToMonoChannelExtractROI.h"
#include "otbGenericRSResampleImageFilter.h"
#include "otbImportGeoInformationImageFilter.h"
#include "otbBCOInterpolateImageFunction.h"
#include "otbSimpleRcsPanSharpeningFusionImageFilter.h"
#include "itkFixedArray.h"
......@@ -133,6 +134,7 @@ private:
typedef otb::BCOInterpolateImageFunction<FloatVectorImageType> InterpolatorType;
typedef otb::GenericRSResampleImageFilter<FloatVectorImageType, FloatVectorImageType> ResamplerType;
typedef otb::StreamingResampleImageFilter<FloatVectorImageType, FloatVectorImageType> BasicResamplerType;
typedef otb::ImportGeoInformationImageFilter<FloatVectorImageType,InternalImageType> ImportGeoInformationFilterType;
typedef otb::SimpleRcsPanSharpeningFusionImageFilter<InternalImageType, FloatVectorImageType, FloatVectorImageType> FusionFilterType;
// Resample filter
......@@ -142,6 +144,9 @@ private:
BasicResamplerType::Pointer basicResampler = BasicResamplerType::New();
m_Ref.push_back(basicResampler.GetPointer());
ImportGeoInformationFilterType::Pointer geoImport = ImportGeoInformationFilterType::New();
m_Ref.push_back(geoImport.GetPointer());
InterpolatorType::Pointer interpolator = InterpolatorType::New();
resampler->SetInterpolator(interpolator);
basicResampler->SetInterpolator(interpolator);
......@@ -209,8 +214,11 @@ private:
basicResampler->SetOutputSize(size);
basicResampler->SetOutputStartIndex(start);
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
basicResampler->UpdateOutputInformation();
......
......@@ -18,6 +18,7 @@
#include "otbWrapperApplicationFactory.h"
#include "otbGenericRSResampleImageFilter.h"
#include "otbImportGeoInformationImageFilter.h"
#include "otbBCOInterpolateImageFunction.h"
#include "itkNearestNeighborInterpolateImageFunction.h"
......@@ -66,6 +67,8 @@ public:
typedef otb::GenericRSResampleImageFilter<FloatVectorImageType,
FloatVectorImageType> ResamplerType;
typedef otb::ImportGeoInformationImageFilter<FloatVectorImageType,
FloatVectorImageType> ImportGeoInformationFilterType;
typedef itk::ScalableAffineTransform<double, 2> TransformType;
......@@ -165,6 +168,8 @@ private:
m_BasicResampler = BasicResamplerType::New();
m_GeoImport = ImportGeoInformationFilterType::New();
// Get Interpolator
switch ( GetParameterInt("interpolator") )
{
......@@ -261,8 +266,11 @@ private:
m_BasicResampler->SetEdgePaddingValue(defaultValue);
m_GeoImport->SetInput(m_BasicResampler->GetOutput());
m_GeoImport->SetSource(refImage);
// Set the output image
SetParameterOutputImage("out", m_BasicResampler->GetOutput());
SetParameterOutputImage("out", m_GeoImport->GetOutput());
}
else
{
......@@ -273,6 +281,8 @@ private:
ResamplerType::Pointer m_Resampler;
BasicResamplerType::Pointer m_BasicResampler;
ImportGeoInformationFilterType::Pointer m_GeoImport;
};
......
Markdown is supported
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