[GRASS-SVN] r55038 - grass/trunk/imagery/i.segment

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 13 09:37:00 PST 2013


Author: mmetz
Date: 2013-02-13 09:37:00 -0800 (Wed, 13 Feb 2013)
New Revision: 55038

Modified:
   grass/trunk/imagery/i.segment/create_isegs.c
   grass/trunk/imagery/i.segment/open_files.c
Log:
i.segment: faster default, code comments

Modified: grass/trunk/imagery/i.segment/create_isegs.c
===================================================================
--- grass/trunk/imagery/i.segment/create_isegs.c	2013-02-13 17:36:24 UTC (rev 55037)
+++ grass/trunk/imagery/i.segment/create_isegs.c	2013-02-13 17:37:00 UTC (rev 55038)
@@ -1031,8 +1031,6 @@
 
 int update_band_vals(int row, int col, struct reg_stats *rs,
                      struct globals *globals) {
-    /* update band values with sum */
-    /* rs->id must be set */
     struct RB_TREE *rc_check_tree;	/* cells already checked */
     struct rclist rlist;
     struct rc next, ngbr_rc;
@@ -1040,6 +1038,8 @@
     int rid, count, n;
     int no_check;
     
+    /* update band values with sum */
+    /* rs->id must be set */
     G_debug(4, "update_band_vals()");
 
     if (rs->count >= globals->min_reg_size) {
@@ -1053,6 +1053,8 @@
 	G_fatal_error(_("Region ids are different"));
     }
 
+    /* TODO: add fast version for globals->min_reg_size == 3 */
+
     /* go through region, spreading outwards from head */
     rclist_init(&rlist);
 

Modified: grass/trunk/imagery/i.segment/open_files.c
===================================================================
--- grass/trunk/imagery/i.segment/open_files.c	2013-02-13 17:36:24 UTC (rev 55037)
+++ grass/trunk/imagery/i.segment/open_files.c	2013-02-13 17:37:00 UTC (rev 55038)
@@ -485,7 +485,7 @@
 
     /* calculate number of region stats that can be kept in memory */
     reg_size_count = (globals->mb - segs_mb) / reg_size_mb;
-    globals->min_reg_size = 4;
+    globals->min_reg_size = 3;
     if (reg_size_count < (double) globals->nrows * globals->ncols / globals->min_reg_size) {
 	globals->min_reg_size = (double) globals->nrows * globals->ncols / reg_size_count;
     }



More information about the grass-commit mailing list