From 116ae81231b27a9f2a31ab72e1a8160fe399bd34 Mon Sep 17 00:00:00 2001 From: Julien Malik <julien.malik@c-s.fr> Date: Fri, 29 Oct 2010 22:22:41 +0200 Subject: [PATCH] BUG: solve system also with one coef --- Code/Radiometry/otbSarParametricMapFunction.txx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Code/Radiometry/otbSarParametricMapFunction.txx b/Code/Radiometry/otbSarParametricMapFunction.txx index 91f7971e99..c39ca20444 100644 --- a/Code/Radiometry/otbSarParametricMapFunction.txx +++ b/Code/Radiometry/otbSarParametricMapFunction.txx @@ -133,6 +133,8 @@ SarParametricMapFunction<TInputImage, TCoordRep> this->GetPointSet()->GetPoint(i, &point); this->GetPointSet()->GetPointData(i, &pointValue); b(i) = pointValue; + //std::cout << "point = " << point << std::endl; + //std::cout << "b(" << i << ") = " << pointValue << std::endl; for (unsigned int pointId = 0; pointId < nbCoef; ++pointId) { @@ -141,6 +143,7 @@ SarParametricMapFunction<TInputImage, TCoordRep> this->GetCoeff()->GetPoint(pointId, &powerCoef); a(i, pointId) = vcl_pow(point[0], powerCoef[0]); a(i, pointId) *= vcl_pow(point[1], powerCoef[1]); + //std::cout << "a(" << i << "," << pointId << ") = " << a(i, pointId) << std::endl; } } @@ -149,13 +152,11 @@ SarParametricMapFunction<TInputImage, TCoordRep> vnl_lsqr linearSystemSolver(linearSystem); // And solve it - if (this->GetCoeff()->GetNumberOfPoints() > 1) - { - linearSystemSolver.minimize(bestParams); - } + linearSystemSolver.minimize(bestParams); for (unsigned int pointId = 0; pointId < nbCoef; ++pointId) { + //std::cout << "bestParams(" << pointId << ") = " << bestParams[pointId] << std::endl; this->GetCoeff()->SetPointData(pointId, bestParams[pointId]); } } -- GitLab