From 8f9482daa2b0e28b9d4e9a12f141b5a90b1c404e Mon Sep 17 00:00:00 2001
From: Manuel Grizonnet <manuel.grizonnet@gmail.com>
Date: Fri, 18 Jun 2010 17:57:35 +0200
Subject: [PATCH] ENH:add pixprod multiplication in mean texture computation

---
 Code/FeatureExtraction/otbMeanTextureFunctor.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Code/FeatureExtraction/otbMeanTextureFunctor.h b/Code/FeatureExtraction/otbMeanTextureFunctor.h
index eec3d3f07d..22359f3f52 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;
         }
       }
 
-- 
GitLab