[GRASS-SVN] r69866 - grass/trunk/raster/r.texture

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Nov 22 07:54:28 PST 2016


Author: mmetz
Date: 2016-11-22 07:54:27 -0800 (Tue, 22 Nov 2016)
New Revision: 69866

Modified:
   grass/trunk/raster/r.texture/h_measure.c
Log:
r.texture: fix f2_contrast

Modified: grass/trunk/raster/r.texture/h_measure.c
===================================================================
--- grass/trunk/raster/r.texture/h_measure.c	2016-11-22 06:35:34 UTC (rev 69865)
+++ grass/trunk/raster/r.texture/h_measure.c	2016-11-22 15:54:27 UTC (rev 69866)
@@ -427,10 +427,8 @@
 
     /* two-loop version */
     for (i = 0; i < Ng; i++) {
-	for (j = 0; j < Ng; j++) {
-	    if (i != j) {
-		sum += P[i][j] * (tone[i] - tone[j]) * (tone[i] - tone[j]);
-	    }
+	for (j = 0; j < i; j++) {
+	    bigsum += 2 * P[i][j] * (tone[i] - tone[j]) * (tone[i] - tone[j]);
 	}
     }
 



More information about the grass-commit mailing list