[GRASS-SVN] r66939 - in grass/branches/releasebranch_6_4/imagery: i.cluster i.maxlik

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 27 01:47:53 PST 2015


Author: neteler
Date: 2015-11-27 01:47:53 -0800 (Fri, 27 Nov 2015)
New Revision: 66939

Modified:
   grass/branches/releasebranch_6_4/imagery/i.cluster/description.html
   grass/branches/releasebranch_6_4/imagery/i.maxlik/description.html
Log:
i.cluster + i.maxlik manual: partial sync to trunk

Modified: grass/branches/releasebranch_6_4/imagery/i.cluster/description.html
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.cluster/description.html	2015-11-26 23:10:47 UTC (rev 66938)
+++ grass/branches/releasebranch_6_4/imagery/i.cluster/description.html	2015-11-27 09:47:53 UTC (rev 66939)
@@ -1,21 +1,19 @@
 <h2>DESCRIPTION</h2>
 
-<em>i.cluster</em>
-performs the first pass in the GRASS two-pass unsupervised 
-classification of imagery, while the GRASS program <em>
-<a href="i.maxlik.html">i.maxlik</a></em> executes 
-the second pass. Both programs must be run to complete the unsupervised 
-classification.
+<em>i.cluster</em> performs the first pass in the two-pass
+unsupervised classification of imagery, while the GRASS module <em>
+<a href="i.maxlik.html">i.maxlik</a></em> executes the second pass.
+Both commands must be run to complete the unsupervised classification.
 
 <p>
-<em>i.cluster</em> is a clustering algorithm that reads
-through the (raster) imagery data and builds pixel clusters
-based on the spectral reflectances of the pixels (see Figure).
+<em>i.cluster</em> is a clustering algorithm (a modification of the
+<i>k</i>-means clustering algorithm) that reads through the (raster) imagery
+data and builds pixel clusters based on the spectral reflectances of the
+pixels (see Figure).
 The pixel clusters are imagery categories that can be related
-to land cover types on the ground.  The spectral
-distributions of the clusters (which will be the land cover
-spectral signatures) are influenced by six parameters set
-by the user.  The first parameter set by the user is the
+to land cover types on the ground. The spectral distributions of the
+clusters (e.g., land cover spectral signatures) are influenced by six
+parameters set by the user. A relevant parameter set by the user is the
 initial number of clusters to be discriminated.
 
 <p>
@@ -27,8 +25,8 @@
 </center></td></tr>
 </table>
 </center>
+
 <p>
-
 <em>i.cluster</em> starts by generating spectral signatures
 for this number of clusters and "attempts" to end up with
 this number of clusters during the clustering process.  The
@@ -40,9 +38,7 @@
 the percent convergence, the maximum number of iterations,
 and the row and column sampling intervals.
 
-
 <p>
-
 The cluster spectral signatures that result are composed of
 cluster means and covariance matrices.  These cluster means
 and covariance matrices are used in the second pass 
@@ -160,7 +156,7 @@
 
 Default: 30
 
-<A NAME="convergence"></a>
+<a name="convergence"></a>
 <dt><b>convergence=</b><em>value</em>
 
 <dd>A high percent convergence is the point at which
@@ -229,7 +225,49 @@
 overwrite the output signature file and reportfile (if
 required by the user) without prompting if the files
 existed.
+-->
 
+<h3>Sampling method</h3>
+
+<em>i.cluster</em> does not cluster all pixels, but only a sample (see
+parameter <b>sample</b>). The result of that clustering is not that all
+pixels are assigned to a given cluster; essentially, only signatures which are
+representative of a given cluster are generated. When running <em>i.cluster</em>
+on the same data asking for the same number of classes, but with different
+sample sizes, likely slightly different signatures for each cluster are
+obtained at each run.
+
+<h3>Algorithm used for i.cluster</h3>
+
+<!-- cited after Harini Nagendra, "algorithm used for i.cluster"
+     http://lists.osgeo.org/pipermail/grass-user/1997-December/000912.html
+-->
+
+The algorithm uses input parameters set by the user on the
+initial number of clusters, the minimum distance between clusters, and the
+correspondence between iterations which is desired, and minimum size for
+each cluster. It also asks if all pixels to be clustered, or every "x"th row
+and "y"th column (sampling), the correspondence between iterations
+desired, and the maximum number of iterations to be carried out.
+<p>
+In the 1st pass, initial cluster means for each band are defined by giving
+the first cluster a value equal to the band mean minus its standard
+deviation, and the last cluster a value equal to the band mean plus its
+standard deviation, with all other cluster means distributed equally
+spaced in between these. Each pixel is then assigned to the class which it
+is closest to, distance being measured as Euclidean distance. All clusters
+less than the user-specified minimum distance are then merged. If a
+cluster has less than the user-specified minimum number of pixels, all those
+pixels are again reassigned to the next nearest cluster. New cluster means
+are calculated for each band as the average of raster pixel values in that
+band for all pixels present in that cluster.
+<p>
+In the 2nd pass, pixels are then again reassigned to clusters based on new
+cluster means. The cluster means are then again recalculated.  This
+process is repeated until the correspondence between iterations reaches a
+user-specified level, or till the maximum number of iterations specified is
+over, whichever comes first.
+
 <h2>EXAMPLE</h2>
 
 Preparing the statistics for unsupervised classification of
@@ -238,7 +276,7 @@
 <div class="code"><pre>
 g.region rast=lsat7_2002_10 -p
 
-# store VIZ, NIR, MIR into group/subgroup
+# store VIZ, NIR, MIR into group/subgroup (leaving out TIR)
 i.group group=my_lsat7_2002 subgroup=my_lsat7_2002 \
   input=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50,lsat7_2002_70
 
@@ -247,15 +285,19 @@
 </pre></div>
 
 To complete the unsupervised classification, <em>i.maxlik</em> is subsequently used.
+See example in its manual page.
 
 <h2>SEE ALSO</h2>
 
-The GRASS 4 <em>
-<a href="http://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image
-Processing manual</a></em>
+<ul>
+<li> <a href="http://grasswiki.osgeo.org/wiki/Image_classification">Image classification</a> wiki page</li>
+<li> Historical reference also the GRASS GIS 4 
+     <a href="http://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image Processing manual</a> (PDF)</li>
+<li> <a href="https://en.wikipedia.org/wiki/K-means_clustering">Wikipedia article on <i>k</i>-means clustering</a>
+     (note that <em>i.cluster</em> uses a modification of the <i>k</i>-means clustering algorithm)</li>
+</ul>
 
 <p>
-
 <em>
 <a href="i.class.html">i.class</a>,
 <a href="i.group.html">i.group</a>,
@@ -266,13 +308,10 @@
 <h2>AUTHORS</h2>
 
 Michael Shapiro,
-U.S.Army Construction Engineering 
-Research Laboratory
+U.S. Army Construction Engineering Research Laboratory
 
 <br>
 Tao Wen, 
-University of Illinois at 
-Urbana-Champaign, 
-Illinois
-<p>
-<i>Last changed: $Date$</i>
+University of Illinois at Urbana-Champaign, Illinois
+
+<p><i>Last changed: $Date$</i>

Modified: grass/branches/releasebranch_6_4/imagery/i.maxlik/description.html
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.maxlik/description.html	2015-11-26 23:10:47 UTC (rev 66938)
+++ grass/branches/releasebranch_6_4/imagery/i.maxlik/description.html	2015-11-27 09:47:53 UTC (rev 66939)
@@ -145,25 +145,52 @@
 classified raster map without prompting if this map
 existed.
 
+<p>
+The optional name of a <b>reject</b> raster map holds the reject
+threshold results. This is the result of a chi square test on each
+discriminant result at various threshold levels of confidence to
+determine at what confidence level each cell classified
+(categorized). It is the reject threshold map layer, and contains the
+index to one calculated confidence level for each classified cell in
+the classified image. 16 confidence intervals are predefined, and the
+reject map is to be interpreted as 1 = keep and 16 = reject. One of
+the possible uses for this map layer is as a mask, to identify cells
+in the classified image that have a low probability (high reject
+index) of being assigned to the correct class.
+
 <h2>EXAMPLE</h2>
 
-Completion of the unsupervised classification of
-a LANDSAT subscene (VIZ, NIR, MIR channels) in North Carolina
-(see <em>i.cluster</em> manual page for the first part):
+Second part of the unsupervised classification of a LANDSAT subscene
+(VIZ, NIR, MIR channels) in North Carolina (see
+<em><a href="i.cluster.html">i.cluster</a></em> manual page for the first
+part of the example):
 
 <div class="code"><pre>
+# using here the signaturefile created by i.cluster
 i.maxlik group=my_lsat7_2002 subgroup=my_lsat7_2002 sigfile=sig_clust_lsat2002 \
           class=lsat7_2002_clust_classes reject=lsat7_2002_clust_classes.rej
 
-# Visually check result
+# visually check result
 d.mon x0
 d.rast.leg lsat7_2002_clust_classes
 d.rast.leg lsat7_2002_clust_classes.rej
+
+# see how many pixels were rejected at given levels
+r.report lsat7_2002_clust_classes.rej units=k,p
+
+# optionally, filter out pixels with high level of rejection
+# here we remove pixels of at least 90% of rejection probability, i.e. categories 12-16
+r.mapcalc "lsat7_2002_cluster_classes_filtered = \
+           if(lsat7_2002_clust_classes.rej\ <= 12, lsat7_2002_cluster_classes, null())"
 </pre></div>
 
 <h2>SEE ALSO</h2>
 
-The GRASS 4 <em>
+<a href="http://grasswiki.osgeo.org/wiki/Image_processing">Image processing</a>
+and
+<a href="http://grasswiki.osgeo.org/wiki/Image_classification">Image classification</a>
+wiki pages and for historical reference also
+the GRASS GIS 4<em>
 <a href="http://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image
 Processing manual</a></em>
 



More information about the grass-commit mailing list