[GRASS-SVN] r52354 - grass-addons/grass7/imagery/i.segment
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 9 08:42:51 PDT 2012
Author: momsen
Date: 2012-07-09 08:42:50 -0700 (Mon, 09 Jul 2012)
New Revision: 52354
Modified:
grass-addons/grass7/imagery/i.segment/create_isegs.c
grass-addons/grass7/imagery/i.segment/iseg.h
grass-addons/grass7/imagery/i.segment/times.txt
Log:
changed the find neighbor no_check flag from raster wide array to a tree. (with ifdef DEBUG commented out)
Modified: grass-addons/grass7/imagery/i.segment/create_isegs.c
===================================================================
--- grass-addons/grass7/imagery/i.segment/create_isegs.c 2012-07-09 12:30:15 UTC (rev 52353)
+++ grass-addons/grass7/imagery/i.segment/create_isegs.c 2012-07-09 15:42:50 UTC (rev 52354)
@@ -45,18 +45,19 @@
for (files->current_bound = lower_bound; files->current_bound <= upper_bound; files->current_bound++) { /* outer processing loop for polygon constraints */
G_debug(1, "current_bound = %d", files->current_bound);
- if (functions->method == 0)
- successflag = io_debug(files, functions); /* TODO: why does it want `&files` in main, but `files` here ??? */
- else if (functions->method == 1) {
+ if (functions->method == 1) {
G_debug(1, "starting region_growing()");
successflag = region_growing(files, functions);
}
+ #ifdef DEBUG
+ else if (functions->method == 0)
+ successflag = io_debug(files, functions); /* TODO: why does it want `&files` in main, but `files` here ??? */
else if (functions->method == 2)
successflag = ll_test(files, functions);
else if (functions->method == 3)
successflag = seg_speed_test(files, functions);
-
+ #endif
} /* end outer loop for processing polygons */
/* clean up? */
@@ -609,18 +610,18 @@
files->candidate_count);
/*process candidate pixels */
- G_verbose_message("Pass %d: ", t);
+ G_message("Pass %d: ", t);
/*check each pixel, start the processing only if it is a candidate pixel */
/* for validation, select one of the two... could make this IFDEF or input parameter */
/* reverse order
*/
#ifdef REVERSE
for (row = files->nrows - 1; row >= 0; row--) {
- G_percent(files->nrows - row, files->nrows, 1);
+ G_percent(files->nrows - row, files->nrows, 5);
for (col = files->ncols - 1; col >= 0; col--) {
#else
for (row = 0; row < files->nrows; row++) {
- G_percent(row, files->nrows, 1); /* TODO, can a message be included with G_percent? */
+ G_percent(row, files->nrows, 5); /* TODO, can a message be included with G_percent? */
for (col = 0; col < files->ncols; col++) {
#endif
@@ -838,9 +839,9 @@
} /*end if pixel is candidate pixel */
} /*next column */
#ifdef REVERSE
- G_percent(files->nrows - row, files->nrows, 1);
+ G_percent(files->nrows - row, files->nrows, 5);
#else
- G_percent(row, files->nrows-1, 1); /* TODO, can a message be included with G_percent? */
+ G_percent(row, files->nrows-1, 5); /* TODO, can a message be included with G_percent? */
#endif
/* TODO, the REVERSE version gets printed on a new line, and isnt' covered. The else version is. ? */
/* TODO, shows up in CLI, not in GUI */
@@ -1053,7 +1054,7 @@
}
} /*end if pixel is candidate pixel */
} /*next column */
- G_percent(row, files->nrows-1, 1);
+ G_percent(row, files->nrows-1, 5);
} /*next row */
} /* end if for force merge */
else
Modified: grass-addons/grass7/imagery/i.segment/iseg.h
===================================================================
--- grass-addons/grass7/imagery/i.segment/iseg.h 2012-07-09 12:30:15 UTC (rev 52353)
+++ grass-addons/grass7/imagery/i.segment/iseg.h 2012-07-09 15:42:50 UTC (rev 52354)
@@ -16,7 +16,7 @@
#include <grass/linkm.h>
#include "flag.h"
-#define DEBUG
+/* #define DEBUG */
/* pixel stack */
struct pixels
Modified: grass-addons/grass7/imagery/i.segment/times.txt
===================================================================
--- grass-addons/grass7/imagery/i.segment/times.txt 2012-07-09 12:30:15 UTC (rev 52353)
+++ grass-addons/grass7/imagery/i.segment/times.txt 2012-07-09 15:42:50 UTC (rev 52354)
@@ -1,3 +1,11 @@
+Machine specifications:
+
+Virtual Machine, 12 cores. (Only 1 is ever used at a time for i.segment)
+
+>> is an AMD quadcore at 4GhZ, 32 GB RAM, SSD for OS, SATA 7200rpm with
+>> 4000 MB/sec cached reads for data:
+
+
Segment ID storage - RAM vs SEG and speed access.
i.segment -w --overwrite --verbose group=landsat_1band at samples output=temp threshold=5 method=seg_time min=1
@@ -57,6 +65,17 @@
So the processing time is sensitive to the size of the segments.
+
+Turning "debug" mode off (gets rid of some loops with G_debug statements)
+
+time i.segment --overwrite --verbose group=landsat_1band at samples output=val threshold=.02 method=region_growing min=1 final_mean=val_mean
+Pass 878:
+real 13m15.149s
+
+
+
+
+
g.region s=222000 e=637000
cells: 56334
< 5 minutes
More information about the grass-commit
mailing list