diff --git a/Code/DisparityMap/otbStreamingWarpImageFilter.txx b/Code/DisparityMap/otbStreamingWarpImageFilter.txx index 19bb5aeec7ea9a42928c0ce99433054a49ab8fd6..e9469a498ad7dc316550b8200a66e4d20505a518 100644 --- a/Code/DisparityMap/otbStreamingWarpImageFilter.txx +++ b/Code/DisparityMap/otbStreamingWarpImageFilter.txx @@ -90,6 +90,9 @@ StreamingWarpImageFilter<TInputImage, TOutputImage, TDeformationField> deformationRequestedRegion.SetIndex(defRequestedIndex); deformationRequestedRegion.SetSize(defRequestedSize); + // Avoid extrapolation + deformationRequestedRegion.PadByRadius(1); + // crop the input requested region at the input's largest possible region if (deformationRequestedRegion.Crop(deformationPtr->GetLargestPossibleRegion())) { @@ -171,15 +174,12 @@ StreamingWarpImageFilter<TInputImage, TOutputImage, TDeformationField> inputRequestedRegion.SetIndex(inputFinalIndex); inputRequestedRegion.SetSize(inputFinalSize); - // Compute the security margin radius - typename InputImageType::SizeType radius; - // Compute the padding due to the interpolator unsigned int interpolatorRadius = StreamingTraits<typename Superclass::InputImageType>::CalculateNeededRadiusForInterpolator(this->GetInterpolator()); // pad the input requested region by the operator radius - inputRequestedRegion.PadByRadius(radius); + inputRequestedRegion.PadByRadius(interpolatorRadius); // crop the input requested region at the input's largest possible region if (inputRequestedRegion.Crop(inputPtr->GetLargestPossibleRegion()))