diff --git a/Code/FeatureExtraction/otbMeanTextureFunctor.h b/Code/FeatureExtraction/otbMeanTextureFunctor.h index eec3d3f07d21195c3e1690e242b1df64d66204c7..22359f3f5213d70240bd1bac35cdfc706942d62f 100644 --- a/Code/FeatureExtraction/otbMeanTextureFunctor.h +++ b/Code/FeatureExtraction/otbMeanTextureFunctor.h @@ -66,7 +66,10 @@ public: for (unsigned s = 0; s < this->GetHisto()[r].size(); ++s) { double p = static_cast<double>(this->GetHisto()[r][s]); - out += (static_cast<double>(s) + 0.5) * this->GetNeighBinLength() * p; + double pixProd = + ((static_cast<double>(r) + 0.5) * this->GetOffsetBinLength()) + * ((static_cast<double>(s) + 0.5) * this->GetNeighBinLength()); + out += pixProd * p; } }