Переглянути джерело

i.segment: fix manhattan distance (https://trac.osgeo.org/grass/changeset/68555)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@68590 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 9 роки тому
батько
коміт
a94b5005c0
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      imagery/i.segment/create_isegs.c

+ 1 - 1
imagery/i.segment/create_isegs.c

@@ -907,7 +907,7 @@ double calculate_manhattan_similarity(struct ngbr_stats *Ri,
 
     /* squared manhattan distance, sum the differences for each dimension */
     do {
-	val += Ri->mean[n] - Rk->mean[n];
+	val += fabs(Ri->mean[n] - Rk->mean[n]);
     } while (n--);
 
     /* the return value should always be in the range 0 - 1 */