Browse Source

i.segment: fix manhattan distance

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68555 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 9 years ago
parent
commit
15d9bd9a87
1 changed files with 1 additions and 1 deletions
  1. 1 1
      imagery/i.segment/create_isegs.c

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

@@ -176,7 +176,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 */