瀏覽代碼

r.texture: fix f2_contrast

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@69866 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 8 年之前
父節點
當前提交
7b6bfb950e
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      raster/r.texture/h_measure.c

+ 2 - 4
raster/r.texture/h_measure.c

@@ -427,10 +427,8 @@ float f2_contrast(void)
 
     /* 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]);
 	}
     }