From 1123495e2fcca96425b4cc356367872a8f46c7cc Mon Sep 17 00:00:00 2001 From: Julien Michel <julien.michel@c-s.fr> Date: Thu, 12 Apr 2007 15:44:57 +0000 Subject: [PATCH] =?UTF-8?q?Maj=20de=20la=20g=C3=A9n=C3=A9ration=20des=20ch?= =?UTF-8?q?amps=20de=20d=C3=A9formation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...earestPointsLinearInterpolateDeformationFieldGenerator.txx | 4 ++-- ...stTransformsLinearInterpolateDeformationFieldGenerator.txx | 4 ++-- .../DisparityMap/otbNearestPointDeformationFieldGenerator.txx | 4 ++-- .../otbNearestTransformDeformationFieldGenerator.txx | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Code/DisparityMap/otbNNearestPointsLinearInterpolateDeformationFieldGenerator.txx b/Code/DisparityMap/otbNNearestPointsLinearInterpolateDeformationFieldGenerator.txx index 7c07470625..bfc25090fd 100644 --- a/Code/DisparityMap/otbNNearestPointsLinearInterpolateDeformationFieldGenerator.txx +++ b/Code/DisparityMap/otbNNearestPointsLinearInterpolateDeformationFieldGenerator.txx @@ -68,8 +68,8 @@ NNearestPointsLinearInterpolateDeformationFieldGenerator<TPointSet, TDeformation if(normalization>0) { - pixel[0] = static_cast<ValueType>(xdeformation/normalization); - pixel[1] = static_cast<ValueType>(ydeformation/normalization); + pixel[0] = static_cast<ValueType>(-xdeformation/normalization); + pixel[1] = static_cast<ValueType>(-ydeformation/normalization); } else { diff --git a/Code/DisparityMap/otbNNearestTransformsLinearInterpolateDeformationFieldGenerator.txx b/Code/DisparityMap/otbNNearestTransformsLinearInterpolateDeformationFieldGenerator.txx index 564231c762..557454c34b 100644 --- a/Code/DisparityMap/otbNNearestTransformsLinearInterpolateDeformationFieldGenerator.txx +++ b/Code/DisparityMap/otbNNearestTransformsLinearInterpolateDeformationFieldGenerator.txx @@ -72,8 +72,8 @@ NNearestTransformsLinearInterpolateDeformationFieldGenerator<TPointSet, TDeforma outputPtr->TransformIndexToPhysicalPoint(it.GetIndex(),sourcePoint); targetPoint = this->GetTransform()->TransformPoint(sourcePoint); - xdeformation += (targetPoint[0]-sourcePoint[0])/distance; - ydeformation += (targetPoint[1]-sourcePoint[1]) /distance; + xdeformation += (sourcePoint[0]-targetPoint[0])/distance; + ydeformation += (sourcePoint[1]-targetPoint[1]) /distance; normalization+=1/distance; } diff --git a/Code/DisparityMap/otbNearestPointDeformationFieldGenerator.txx b/Code/DisparityMap/otbNearestPointDeformationFieldGenerator.txx index c0e865f9b1..7789d4c34d 100644 --- a/Code/DisparityMap/otbNearestPointDeformationFieldGenerator.txx +++ b/Code/DisparityMap/otbNearestPointDeformationFieldGenerator.txx @@ -45,8 +45,8 @@ NearestPointDeformationFieldGenerator<TPointSet, TDeformationField> PixelType p(2); if(indexVector.size()>=1) { - p[0] = static_cast<ValueType>(this->GetPointSet()->GetPointData()->GetElement(indexVector[0])[1]); - p[1] = static_cast<ValueType>(this->GetPointSet()->GetPointData()->GetElement(indexVector[0])[2]); + p[0] = -static_cast<ValueType>(this->GetPointSet()->GetPointData()->GetElement(indexVector[0])[1]); + p[1] = -static_cast<ValueType>(this->GetPointSet()->GetPointData()->GetElement(indexVector[0])[2]); } else { diff --git a/Code/DisparityMap/otbNearestTransformDeformationFieldGenerator.txx b/Code/DisparityMap/otbNearestTransformDeformationFieldGenerator.txx index d48353e75c..06ec270784 100644 --- a/Code/DisparityMap/otbNearestTransformDeformationFieldGenerator.txx +++ b/Code/DisparityMap/otbNearestTransformDeformationFieldGenerator.txx @@ -55,8 +55,8 @@ NearestTransformDeformationFieldGenerator<TPointSet, TDeformationField> outputPtr->TransformIndexToPhysicalPoint(it.GetIndex(),sourcePoint); targetPoint = this->GetTransform()->TransformPoint(sourcePoint); - pixel[0] = static_cast<ValueType>(targetPoint[0]-sourcePoint[0]); - pixel[1] = static_cast<ValueType>(targetPoint[1]-sourcePoint[1]); + pixel[0] = static_cast<ValueType>(sourcePoint[0]-targetPoint[0]); + pixel[1] = static_cast<ValueType>(sourcePoint[1]-targetPoint[1]); } else { -- GitLab