Skip to content
Snippets Groups Projects
Commit 5ea9da6f authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH : modification in ceil for Px+y Px+y in textures

parent 40ec6089
Branches
Tags
No related merge requests found
......@@ -120,7 +120,7 @@ public:
double rVal = (static_cast<double>(r)+0.5)*binsLength[1];
for (unsigned s = 0; s<histo[r].size(); s++)
{
if( vcl_abs( rVal - (static_cast<double>(s)+0.5)*binsLength[0]) < nCeil )
if( vcl_abs( rVal - (static_cast<double>(s)+0.5)*binsLength[0] - nCeil) < vcl_abs(binsLength[0]-binsLength[1]) )
{
double p = static_cast<double>(histo[r][s])*areaInv;
out += nCeilSquare * p;
......@@ -135,7 +135,7 @@ public:
};
} // namespace Functor
} // namespace otb
......
......@@ -121,7 +121,7 @@ public:
double rVal = (static_cast<double>(r)+0.5)*binsLength[1];
for (unsigned s = 0; s<histo[r].size(); s++)
{
if( vcl_abs( rVal - (static_cast<double>(s)+0.5)*binsLength[0]) < nCeil )
if( vcl_abs( rVal - (static_cast<double>(s)+0.5)*binsLength[0] - nCeil ) < vcl_abs( binsLength[0]+binsLength[1]) )
{
Px_y += static_cast<double>(histo[r][s])*areaInv;
}
......
......@@ -122,7 +122,7 @@ public:
double sVal = (static_cast<double>(s)+0.5)*binsLength[0];
// In theory don't have the abs but will deals with neighborhood and offset without the same histo
// thus loop over 2*Ng don't have sense
if( vcl_abs(rVal + sVal - nCeil)<binsLength[1] || vcl_abs(rVal + sVal - 2*nCeil)<binsLength[1] )
if( vcl_abs(rVal + sVal - nCeil) < vcl_abs(binsLength[0]+binsLength[1]) || vcl_abs(rVal + sVal - 2*nCeil) < vcl_abs(binsLength[0]+binsLength[1]) )
{
double p = static_cast<double>(histo[r][s])*areaInv;
out += sVal * p;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment