[GRASS-SVN] r73513 - grass/branches/releasebranch_7_6/imagery/i.segment
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 9 11:04:13 PDT 2018
Author: mmetz
Date: 2018-10-09 11:04:13 -0700 (Tue, 09 Oct 2018)
New Revision: 73513
Modified:
grass/branches/releasebranch_7_6/imagery/i.segment/create_isegs.c
grass/branches/releasebranch_7_6/imagery/i.segment/iseg.h
grass/branches/releasebranch_7_6/imagery/i.segment/write_output.c
Log:
i.segment: fix writing out goodness of fit (backport trunk r73512)
Modified: grass/branches/releasebranch_7_6/imagery/i.segment/create_isegs.c
===================================================================
--- grass/branches/releasebranch_7_6/imagery/i.segment/create_isegs.c 2018-10-09 18:03:41 UTC (rev 73512)
+++ grass/branches/releasebranch_7_6/imagery/i.segment/create_isegs.c 2018-10-09 18:04:13 UTC (rev 73513)
@@ -113,17 +113,7 @@
globals->max_rid = max_id;
G_debug(1, "Largest renumbered ID: %d", globals->max_rid);
- for (row = 0; row < globals->nrows; row++) {
- for (col = 0; col < globals->ncols; col++) {
- Segment_get(&globals->rid_seg, &rid, row, col);
- if (!Rast_is_c_null_value(&rid)) {
- rid = new_id[rid];
- Segment_put(&globals->rid_seg, &rid, row, col);
- }
- }
- }
-
- G_free(new_id);
+ globals->new_id = new_id;
}
return successflag;
Modified: grass/branches/releasebranch_7_6/imagery/i.segment/iseg.h
===================================================================
--- grass/branches/releasebranch_7_6/imagery/i.segment/iseg.h 2018-10-09 18:03:41 UTC (rev 73512)
+++ grass/branches/releasebranch_7_6/imagery/i.segment/iseg.h 2018-10-09 18:04:13 UTC (rev 73513)
@@ -80,6 +80,7 @@
/* region growing */
int min_segment_size; /* smallest number of pixels/cells allowed in a final segment */
+ int *new_id;
/* inactive options for region growing */
double radio_weight; /* weighing factor radiometric - shape */
Modified: grass/branches/releasebranch_7_6/imagery/i.segment/write_output.c
===================================================================
--- grass/branches/releasebranch_7_6/imagery/i.segment/write_output.c 2018-10-09 18:03:41 UTC (rev 73512)
+++ grass/branches/releasebranch_7_6/imagery/i.segment/write_output.c 2018-10-09 18:04:13 UTC (rev 73513)
@@ -34,7 +34,8 @@
Segment_get(&globals->rid_seg, (void *) &rid, row, col);
if (rid > 0) {
- outbuf[col] = rid;
+ if (globals->method == ORM_RG)
+ rid = globals->new_id[rid];
if (maxid < rid)
maxid = rid;
}
More information about the grass-commit
mailing list