Commit e841e5b2 authored by Julien Michel's avatar Julien Michel

ENH: Using the new, faster filter for zooming xs image in phr mode (in...

ENH: Using the new, faster filter for zooming xs image in phr mode (in applications Superimpose and BundleToPerfectSensor)
parent 678b4000
......@@ -19,6 +19,7 @@
#include "otbMultiToMonoChannelExtractROI.h"
#include "otbGenericRSResampleImageFilter.h"
#include "otbGridResampleImageFilter.h"
#include "otbImportGeoInformationImageFilter.h"
#include "otbBCOInterpolateImageFunction.h"
#include "otbSimpleRcsPanSharpeningFusionImageFilter.h"
......@@ -133,7 +134,7 @@ private:
typedef otb::BCOInterpolateImageFunction<FloatVectorImageType> InterpolatorType;
typedef otb::GenericRSResampleImageFilter<FloatVectorImageType, FloatVectorImageType> ResamplerType;
typedef otb::StreamingResampleImageFilter<FloatVectorImageType, FloatVectorImageType> BasicResamplerType;
typedef otb::GridResampleImageFilter<FloatVectorImageType, FloatVectorImageType> BasicResamplerType;
typedef otb::ImportGeoInformationImageFilter<FloatVectorImageType,InternalImageType> ImportGeoInformationFilterType;
typedef otb::SimpleRcsPanSharpeningFusionImageFilter<InternalImageType, FloatVectorImageType, FloatVectorImageType> FusionFilterType;
......@@ -204,13 +205,22 @@ private:
{
otbAppLogINFO("Using the PHR mode");
otb::PleiadesPToXSAffineTransformCalculator::TransformType::Pointer transform
= otb::PleiadesPToXSAffineTransformCalculator::Compute(panchro, xs);
otb::PleiadesPToXSAffineTransformCalculator::TransformType::OffsetType offset
= otb::PleiadesPToXSAffineTransformCalculator::ComputeOffset(GetParameterImage("inp"),
GetParameterImage("inxs"));
origin+=offset;
origin[0]=origin[0]/4;
origin[1]=origin[1]/4;
basicResampler->SetOutputOrigin(origin);
basicResampler->SetInput(xs);
basicResampler->SetTransform(transform);
basicResampler->SetOutputOrigin(origin);
basicResampler->SetOutputSpacing(spacing);
FloatVectorImageType::SpacingType xsSpacing = GetParameterImage("inxs")->GetSpacing();
xsSpacing*=0.25;
basicResampler->SetOutputSpacing(xsSpacing);
basicResampler->SetOutputSize(size);
basicResampler->SetOutputStartIndex(start);
basicResampler->SetEdgePaddingValue(defaultValue);
......
......@@ -18,6 +18,7 @@
#include "otbWrapperApplicationFactory.h"
#include "otbGenericRSResampleImageFilter.h"
#include "otbGridResampleImageFilter.h"
#include "otbImportGeoInformationImageFilter.h"
#include "otbBCOInterpolateImageFunction.h"
......@@ -72,7 +73,7 @@ public:
typedef itk::ScalableAffineTransform<double, 2> TransformType;
typedef otb::StreamingResampleImageFilter
typedef otb::GridResampleImageFilter
<FloatVectorImageType,
FloatVectorImageType> BasicResamplerType;
......@@ -251,19 +252,23 @@ private:
{
otbAppLogINFO("Using the PHR mode");
otb::PleiadesPToXSAffineTransformCalculator::TransformType::Pointer transform
= otb::PleiadesPToXSAffineTransformCalculator::Compute(GetParameterImage("inr"),
GetParameterImage("inm"));
m_BasicResampler->SetTransform(transform);
otb::PleiadesPToXSAffineTransformCalculator::TransformType::OffsetType offset
= otb::PleiadesPToXSAffineTransformCalculator::ComputeOffset(GetParameterImage("inr"),
GetParameterImage("inm"));
m_BasicResampler->SetInput(movingImage);
origin+=offset;
origin[0]=origin[0]/4;
origin[1]=origin[1]/4;
m_BasicResampler->SetOutputOrigin(origin);
m_BasicResampler->SetOutputSpacing(spacing);
m_BasicResampler->SetOutputSize(size);
m_BasicResampler->SetOutputStartIndex(start);
FloatVectorImageType::SpacingType xsSpacing = GetParameterImage("inm")->GetSpacing();
xsSpacing*=0.25;
m_BasicResampler->SetOutputSpacing(xsSpacing);
m_BasicResampler->SetOutputSize(size);
m_Resampler->SetOutputStartIndex(start);
m_BasicResampler->SetEdgePaddingValue(defaultValue);
m_GeoImport->SetInput(m_BasicResampler->GetOutput());
......
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