Commit 6049cb61 authored by Cyrille Valladeau's avatar Cyrille Valladeau

Suppression de traces.

parent 12176e2d
......@@ -22,6 +22,7 @@
#include "otbMacro.h"
#include "otbMath.h"
namespace otb
{
/**
......@@ -95,24 +96,24 @@ typename InverseLogPolarTransform<TScalarType>
double rho =vcl_sqrt(vcl_pow(point[0]-m_Center[0],2)+vcl_pow(point[1]-m_Center[1],2));
if(rho>0)
{
result[0]=(1/m_Scale[0])*vcl_asin((point[1]-m_Center[1])/rho);
result[0]=(1./m_Scale[0])*vcl_asin((point[1]-m_Center[1])/rho);
// degree conversion
result[0]=result[0]*(180/M_PI);
result[0]=result[0]*(180./M_PI);
// Deplacing the range to [0,90], [270,360]
result[0]= result[0]>0 ? result[0] : result[0]+360;
result[0]= result[0]>0. ? result[0] : result[0]+360.;
// Avoiding asin indetermination
if((point[0]-m_Center[0])>=0)
{
result[0]=result[0]<90 ? result[0]+90 : result[0]-90;
result[0]=result[0]<90. ? result[0]+90. : result[0]-90.;
}
result[1]=(1/m_Scale[1])*vcl_log(rho);
result[1]=(1./m_Scale[1])*vcl_log(rho);
// otbMsgDebugMacro(<<vcl_log(vcl_pow(point[0]-m_Center[0],2)+vcl_pow(point[1]-m_Center[1],2)));
}
else
{
// for rho=0, reject the point outside the angular range to avoid nan error
result[0]=400;
result[1]=0;
result[0]=400.;
result[1]=0.;
}
return result;
}
......
......@@ -128,7 +128,7 @@ ADD_TEST(bfTvInverseLogPolarTransform ${BASICFILTERS_TESTS}
${BASELINE_FILES}/bfInverseLogPolarTransformResults.txt
${TEMP}/bfInverseLogPolarTransformResults.txt
otbInverseLogPolarTransform
1 1
1. 1.
${TEMP}/bfInverseLogPolarTransformResults.txt
6 0 0 10 20 45 60 3.14 3.14 1 0 0 1
)
......
......@@ -66,21 +66,21 @@ try
if(rho>0)
{
pprime[0]=(1/angularStep)*vcl_asin((*it)[1]/rho);
pprime[0]=pprime[0]*(180/M_PI);
pprime[0]=(1./angularStep)*vcl_asin((*it)[1]/rho);
pprime[0]=pprime[0]*(180./M_PI);
// Deplacing the range to [0,90], [270,360]
pprime[0]= pprime[0]>0 ? pprime[0] : pprime[0]+360;
pprime[0]= pprime[0]>0. ? pprime[0] : pprime[0]+360.;
// Avoiding asin indetermination
if(p[0]>=0)
{
pprime[0]=pprime[0]<90 ? pprime[0]+90 : pprime[0]-90;
pprime[0]=pprime[0]<90. ? pprime[0]+90. : pprime[0]-90.;
}
pprime[1]=(1/radialStep)*vcl_log(rho);
pprime[1]=(1./radialStep)*vcl_log(rho);
}
else
{
pprime[0]=400;
pprime[1]=0;
pprime[0]=400.;
pprime[1]=0.;
}
file <<"Original Point: "<<(*it)<<", Reference point: "<<pprime<<", Transformed point: "<<p<<std::endl;
......
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