[GRASS-SVN] r57011 - grass/trunk/imagery/i.segment
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 4 05:10:48 PDT 2013
Author: mmetz
Date: 2013-07-04 05:10:47 -0700 (Thu, 04 Jul 2013)
New Revision: 57011
Modified:
grass/trunk/imagery/i.segment/create_isegs.c
Log:
i.segment: fail-safe check for minsize merging
Modified: grass/trunk/imagery/i.segment/create_isegs.c
===================================================================
--- grass/trunk/imagery/i.segment/create_isegs.c 2013-07-04 11:18:45 UTC (rev 57010)
+++ grass/trunk/imagery/i.segment/create_isegs.c 2013-07-04 12:10:47 UTC (rev 57011)
@@ -308,7 +308,7 @@
/* Rk is now complete */
G_debug(4, "Rk is now complete");
- if (Ri_nn == 0) {
+ if (Rk.id == 0) {
/* this can only happen if only one segment is left */
G_debug(4, "Segment had no valid neighbors");
pathflag = FALSE;
@@ -607,15 +607,16 @@
&Ri_similarity, 1,
globals);
}
+ do_merge = 0;
- if (Ri_nn > 0 && Rk.id != 0) {
+ if (Rk.id != 0) {
/* merge Ri with Rk */
/* do not clear candidate flag for Rk */
merge_regions(&Ri, &Ri_rs, &Rk, &Rk_rs, 0, globals);
n_merges++;
- if (Ri_nn <= 0 || Ri.count >= globals->min_segment_size)
- do_merge = 0;
+ if (Ri.count < globals->min_segment_size)
+ do_merge = 1;
}
}
}
More information about the grass-commit
mailing list