[GRASS-SVN] r53107 - grass-addons/grass7/imagery/i.segment

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 6 06:30:19 PDT 2012


Author: neteler
Date: 2012-09-06 06:30:18 -0700 (Thu, 06 Sep 2012)
New Revision: 53107

Modified:
   grass-addons/grass7/imagery/i.segment/i.segment.html
Log:
HTML standardized (see SUBMITTING_*)

Modified: grass-addons/grass7/imagery/i.segment/i.segment.html
===================================================================
--- grass-addons/grass7/imagery/i.segment/i.segment.html	2012-09-06 08:23:36 UTC (rev 53106)
+++ grass-addons/grass7/imagery/i.segment/i.segment.html	2012-09-06 13:30:18 UTC (rev 53107)
@@ -1,73 +1,157 @@
 <h2>DESCRIPTION</h2>
-Image segmentation is the process of grouping similar pixels into unique segments.  Boundary and region based algorithms are described in the literature, currently a region growing and merging algorithm is implemented.  Each object found during the segmentation process is given a unique ID and is a collection of contiguous pixels meeting some criteria.  (Note the contrast with image classification, where continuity and spatial characteristics are not important, but rather only the spectral similarity.)  The results can be useful on their own, or used as a preprocessing step for image classification.  The segmentation preprocessing step can reduce noise and speed up the classification.
+Image segmentation is the process of grouping similar pixels into 
+unique segments. Boundary and region based algorithms are described in 
+the literature, currently a region growing and merging algorithm is 
+implemented.  Each object found during the segmentation process is 
+given a unique ID and is a collection of contiguous pixels meeting some 
+criteria.  (Note the contrast with image classification, where 
+continuity and spatial characteristics are not important, but rather 
+only the spectral similarity.)  The results can be useful on their own, 
+or used as a preprocessing step for image classification.  The 
+segmentation preprocessing step can reduce noise and speed up the 
+classification.
 
 <H2>NOTES</h2>
 
 <h3>Region Growing and Merging</h3>
-This segmentation algorithm sequentially examines all current segments in the map.  The similarity between the current segment and each of its neighbors is calculated according to the given distance formula.  Segments will be merged if they meet a number of criteria, including: 1.  The pair is mutually most similar to each other (the similarity distance will be smaller then all other neighbors), and 2. The similarity must be lower then the input threshold.  All segments are checked once per pass.  The process is repeated until no merges are made during a complete pass.
+This segmentation algorithm sequentially examines all current segments 
+in the map.  The similarity between the current segment and each of its 
+neighbors is calculated according to the given distance formula.  
+Segments will be merged if they meet a number of criteria, including: 
+1.  The pair is mutually most similar to each other (the similarity 
+distance will be smaller then all other neighbors), and 2. The 
+similarity must be lower then the input threshold.  All segments are 
+checked once per pass.  The process is repeated until no merges are 
+made during a complete pass.
 
 <h3>Similarity and Threshold</h3>
-Similarity between objects is used to determine what objects are merged.  The current implementation uses only the radiometric distance between the two objects, but eventually region properties will be included as well.  Thus a lower value for the similarity is a closer match, with a similarity score of zero for identical pixels.
+Similarity between objects is used to determine what objects are 
+merged.  The current implementation uses only the radiometric distance 
+between the two objects, but eventually region properties will be 
+included as well.  Thus a lower value for the similarity is a closer 
+match, with a similarity score of zero for identical pixels.
 <p>
-During normal processing, merges are only allowed when the similarity between two segments is lower then the calculated threshold value.  During the final pass, however, if a minimum segment size of 2 or larger is given with the <em>minsize</em> parameter, segments with a smaller pixel count will be merged with their most similar neighbor even if the similarity is greater then the threshold.
-</p><p>
-Unless the <em>-w</em> flag for weighted data is used, the threshold should be set by the user between 0 and 1.0. A threshold of 0 would allow only identical valued pixels to be merged, while a threshold of 1 would allow everything to be merged.
-</p><p>
-The threshold will be multiplied by the number of rasters included in the image group.  This will allow the same threshold to achieve similar segmentation results when the number of rasters in the image group varies.
-</p>
+During normal processing, merges are only allowed when the similarity 
+between two segments is lower then the calculated threshold value.  
+During the final pass, however, if a minimum segment size of 2 or 
+larger is given with the <em>minsize</em> parameter, segments with a 
+smaller pixel count will be merged with their most similar neighbor 
+even if the similarity is greater then the threshold.
+<p>
+Unless the <em>-w</em> flag for weighted data is used, the threshold 
+should be set by the user between 0 and 1.0. A threshold of 0 would 
+allow only identical valued pixels to be merged, while a threshold of 1 
+would allow everything to be merged.
+<p>
+The threshold will be multiplied by the number of rasters included in 
+the image group.  This will allow the same threshold to achieve similar 
+segmentation results when the number of rasters in the image group varies.
+
 <h3>Seeds</h3>
-The seeds map can be used to provide either seed pixels (random or selected points from which to start the segmentation process) or seed segments (results of previous segmentations or classifications).  The different approaches are automatically detected by the program: any pixels that have identical seed values and are contiguous will be lumped into a single segment ID.
+The seeds map can be used to provide either seed pixels (random or 
+selected points from which to start the segmentation process) or seed 
+segments (results of previous segmentations or classifications).  The 
+different approaches are automatically detected by the program: any 
+pixels that have identical seed values and are contiguous will be 
+lumped into a single segment ID.
 <p>
-It is expected that the <em>minsize</em> will be set to 1 if a seed map is used, but the program will allow other values to be used.  If both options are used, the final iteration that ignores the threshold also will ignore the seed map and force merges for all pixels (not just segments that have grown/merged from the seeds).
-</p>
+It is expected that the <em>minsize</em> will be set to 1 if a seed map 
+is used, but the program will allow other values to be used.  If both 
+options are used, the final iteration that ignores the threshold also 
+will ignore the seed map and force merges for all pixels (not just 
+segments that have grown/merged from the seeds).
+
 <h3>Maximum number of starting segments</h3>
-For the region growing algorithm without starting seeds, each pixel is sequentially numbered.  The current limit with CELL storage is 2 billion starting segment ID's.  If the initial map has a larger number of non-null pixels, there are two workarounds:
+For the region growing algorithm without starting seeds, each pixel is 
+sequentially numbered.  The current limit with CELL storage is 2 
+billion starting segment ID's.  If the initial map has a larger number 
+of non-null pixels, there are two workarounds:
 <p>
-1.  Use starting seed pixels.  (Maximum 2 billion pixels can be labeled with positive integers.)
-</p><p>
-2.  Use starting seed segments.  (By initial classification or other methods.)
-</p>
+1.  Use starting seed pixels.  (Maximum 2 billion pixels can be labeled 
+with positive integers.)
+<p>
+2.  Use starting seed segments.  (By initial classification or other 
+methods.)
+
 <h3>Boundary Constraints</h3>
-Boundary constraints limit the adjacency of pixels and segments.  Each unique value present in the <em>bounds</em> raster are considered as a MASK.  Thus no segments in the final segmentated map will cross a boundary, even if their spectral data is very similar.
+Boundary constraints limit the adjacency of pixels and segments.  Each 
+unique value present in the <em>bounds</em> raster are considered as a 
+MASK.  Thus no segments in the final segmentated map will cross a 
+boundary, even if their spectral data is very similar.
 
 <h3>Minimum Segment Size</h3>
-To reduce the salt and pepper affect, a <em>minsize</em> greater than 1 will add one additional pass to the processing.  During the final pass, the threshold is ignored for any segments smaller then the set size, thus forcing very small segments to merge with their most similar neighbor.
+To reduce the salt and pepper affect, a <em>minsize</em> greater than 1 
+will add one additional pass to the processing.  During the final pass, 
+the threshold is ignored for any segments smaller then the set size, 
+thus forcing very small segments to merge with their most similar 
+neighbor.
 
-<H2>EXAMPLES</h2>
-This example uses the ortho photograph included in the NC Sample Dataset.  Set up an imagery group:<br>
-<blockquote>i.group group=ortho_group input=ortho_2001_t792_1m at PERMANENT</blockquote>
+<h2>EXAMPLES</h2>
+This example uses the ortho photograph included in the NC Sample 
+Dataset.  Set up an imagery group:<br>
+<div class="code"><pre>
+i.group group=ortho_group input=ortho_2001_t792_1m at PERMANENT
+</pre></div>
 
-<p>Because the segmentation process is computationally expensive, start with a small processing area to confirm if the segmentation results meet your requirements.  Some manual adjustment of the threshold may be required. <br>
+<p>Because the segmentation process is computationally expensive, start 
+with a small processing area to confirm if the segmentation results 
+meet your requirements.  Some manual adjustment of the threshold may be 
+required. <br>
 
-<blockquote>g.region rast=ortho_2001_t792_1m at PERMANENT n=220400 s=220200 e=639000 w=638800</blockquote>
-<p></p>
+<div class="code"><pre>
+g.region rast=ortho_2001_t792_1m at PERMANENT n=220400 s=220200 e=639000 w=638800
+</pre></div>
+
 Try out a first threshold and check the results.<br>
-<blockquote>i.segment -w -l group=ortho_group output=ortho_segs threshold=4 method=region_growing</blockquote>
+<div class="code"><pre>
+i.segment -w -l group=ortho_group output=ortho_segs threshold=4 \
+          method=region_growing 
+</pre></div>
 <p></p>
-From a visual inspection, it seems this results in oversegmentation.  Increasing the threshold: <br>
-<blockquote>i.segment -w -l --overwrite group=ortho_group output=ortho_segs threshold=10 method=region_growing</blockquote>
+From a visual inspection, it seems this results in oversegmentation.  
+Increasing the threshold: <br>
+<div class="code"><pre>
+i.segment -w -l --overwrite group=ortho_group output=ortho_segs \
+          threshold=10 method=region_growing
+</pre></div>
 <p></p>
-This looks better.  There is some noise in the image, lets next force all segments smaller then 5 pixels to be merged into their most similar neighbor (even if they are less similar then required by our threshold):<br>
-<blockquote>i.segment -w -l --overwrite group=ortho_group output=ortho_segs threshold=10 method=region_growing minsize=5</blockquote>
+This looks better.  There is some noise in the image, lets next force 
+all segments smaller then 5 pixels to be merged into their most similar 
+neighbor (even if they are less similar then required by our 
+threshold):<br>
+<div class="code"><pre>
+i.segment -w -l --overwrite group=ortho_group output=ortho_segs \
+          threshold=10 method=region_growing minsize=5
+</pre></div>
 <p></p>
-Each of these segmentation steps took less then 1 minute on a decent machine.  Now that we are satisfied with the settings, we'll process the entire image:
-<blockquote>g.region rast=ortho_2001_t792_1m at PERMANENT<br>
-i.segment -w -l --overwrite group=ortho_group output=ortho_segs threshold=10 method=region_growing minsize=5 endt=5000</blockquote>
-<p></p>
+Each of these segmentation steps took less then 1 minute on a decent 
+machine.  Now that we are satisfied with the settings, we'll process 
+the entire image:
+<div class="code"><pre>
+g.region rast=ortho_2001_t792_1m at PERMANENT<br>
+i.segment -w -l --overwrite group=ortho_group output=ortho_segs \
+          threshold=10 method=region_growing minsize=5 endt=5000
+</pre></div>
+<p>
 Processing the entire ortho image (over 9 million cells) took about a day.
 
 <h2>TODO</h2>
 <h3>Functionality</h3>
 <ul>
-<li>Add shape characteristics (smoothness, compactness) to the similarity measurement.  This will add two input parameters (weight of radiometric to shape, and weight of compactness to smoothness.)</li>
+<li>Add shape characteristics (smoothness, compactness) to the 
+similarity measurement.  This will add two input parameters (weight of 
+radiometric to shape, and weight of compactness to smoothness.)</li>
 <li>Malahanobis distance for the similarity calculation.</li>
-<li>Estimating the threshold value. (1 to 5% of the max difference gave me subjectively good results.)</li>
+<li>Estimating the threshold value. (1 to 5% of the max difference gave 
+me subjectively good results.)</li>
 </ul>
 <h3>Use of Segmentation Results</h3>
 <ul>
-<li>Improve the optional output from this module, or better yet, add a module for i.segment.metrics.</li>
-<li>Providing updates to i.maxlik to ensure the segmentation output can be used as input for the existing classification functionality.</li>
-<li>Integration/workflow for r.fuzzy.</li>
+<li>Improve the optional output from this module, or better yet, add a 
+module for <em>i.segment.metrics</em>.</li>
+<li>Providing updates to i.maxlik to ensure the segmentation output can 
+be used as input for the existing classification functionality.</li>
+<li>Integration/workflow for <em>r.fuzzy</em>.</li>
 </ul>
 <h3>Speed</h3>
 <ul>
@@ -76,15 +160,28 @@
 <h3>Memory</h3>
 <ul>
 <li>User input for how much RAM can be used.</li>
-<li>Check input map type(s), currently storing in DCELL sized SEG file, could reduce this dynamically depending on input map time. (Could only reduce to FCELL, since will be storing mean we can't use CELL. Might not be worth the added code complexity.)</li>
+<li>Check input map type(s), currently storing in DCELL sized SEG file, 
+could reduce this dynamically depending on input map time. (Could only 
+reduce to FCELL, since will be storing mean we can't use CELL. Might 
+not be worth the added code complexity.)</li>
 </ul>
 <h2>BUGS</h2>
-If the seeds map is used to give starting seed segments, the segments are renumbered starting from 1.  There is a chance a segment could be renumbered to a seed value that has not yet been processed.  If they happen to be adjacent, they would be merged.  (Possible fixes: a.  use a processing flag to make sure the pixels hasn't been previously used, or b. use negative segment ID's as a placeholder and negate all values after the seed map has been processed.)
+If the seeds map is used to give starting seed segments, the segments 
+are renumbered starting from 1.  There is a chance a segment could be 
+renumbered to a seed value that has not yet been processed.  If they 
+happen to be adjacent, they would be merged.  (Possible fixes: a.  use 
+a processing flag to make sure the pixels hasn't been previously used, 
+or b. use negative segment ID's as a placeholder and negate all values 
+after the seed map has been processed.)
 <H2>REFERENCES</h2>
-This project was first developed during GSoC 2012.  Project documentation, Image Segmentation references, and other information is at the <a href="http://grass.osgeo.org/wiki/GRASS_GSoC_2012_Image_Segmentation">project wiki</a>.
+This project was first developed during GSoC 2012.  Project 
+documentation, Image Segmentation references, and other information is 
+at the <a href="http://grass.osgeo.org/wiki/GRASS_GSoC_2012_Image_Segmentation">project wiki</a>.
 <p>
-Information about <a href="http://grass.osgeo.org/wiki/Image_classification">classification in GRASS</a> is at available on the wiki.
-</p>
+Information about
+<a href="http://grass.osgeo.org/wiki/Image_classification">classification 
+in GRASS GIS</a> is at available on the wiki.
+
 <h2>SEE ALSO</h2>
 <em>
 <a href="i.group.html">i.group</a>, 
@@ -96,3 +193,8 @@
 
 <h2>AUTHORS</h2>
 Eric Momsen - North Dakota State University
+<p>
+GSoC mentor: Markus Metz
+
+<p>
+<i>Last changed: $Date$



More information about the grass-commit mailing list