Browse Source

examples added; HTML cosmetics

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54316 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 12 years ago
parent
commit
f6ca3b2cdf
4 changed files with 112 additions and 62 deletions
  1. 25 22
      imagery/i.cluster/i.cluster.html
  2. 31 21
      imagery/i.maxlik/i.maxlik.html
  3. 40 14
      imagery/i.smap/i.smap.html
  4. 16 5
      raster/r.kappa/r.kappa.html

+ 25 - 22
imagery/i.cluster/i.cluster.html

@@ -7,7 +7,8 @@ classification of imagery, while the GRASS program <em>
 the second pass. Both programs must be run to complete the unsupervised 
 classification.
 
-<p><em>i.cluster</em> is a clustering algorithm that reads
+<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).
 The pixel clusters are imagery categories that can be related
@@ -17,7 +18,8 @@ spectral signatures) are influenced by six parameters set
 by the user.  The first parameter set by the user is the
 initial number of clusters to be discriminated.
 
-<p><center>
+<p>
+<center>
 <img src="landsat_cluster.png" border=1><br>
 <table border=0 width=590>
 <tr><td><center>
@@ -25,6 +27,7 @@ initial number of clusters to be discriminated.
 </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
@@ -37,7 +40,6 @@ are:  the minimum cluster size, minimum cluster separation,
 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
@@ -71,24 +73,9 @@ The classes value is the initial number of clusters to be
 discriminated; any parameter values left unspecified are
 set to their default values.
 
-<h3>Flags:</h3>
-
-<dl>
-
-<dt><b>-q</b> 
-
-<dd>Run quietly.  Suppresses output of program
-percent-complete messages and the time elapsed from the
-beginning of the program. If this flag is not used, these
-messages are printed out.
-
-</dl>
-
 <h3>Parameters:</h3>
 
 <dl>
-
-
 <dt><b>group=</b><em>name</em> 
 
 <dd>The name of the group file which contains the imagery
@@ -156,7 +143,7 @@ rerun <em>i.cluster</em> with a higher number of iterations
 
 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
@@ -197,7 +184,6 @@ convergence
 (see <a href="#convergence"><em>convergence</em></a>).
 
 <br>
-
 Default: 0.0
 
 <dt><b>min_size=</b><em>value</em> 
@@ -208,7 +194,6 @@ pixels for which means and covariance matrices will be
 calculated.
 
 <br>
-
 Default: 17
 
 <A NAME="reportfile"></a>
@@ -221,7 +206,6 @@ clusters, the number of iterations that was required to
 achieve the convergence, and the separability matrix.
 </dl>
 
-
 <h2>NOTES</h2>
 
 Running in command line mode, <em>i.cluster</em> will
@@ -229,6 +213,24 @@ overwrite the output signature file and reportfile (if
 required by the user) without prompting if the files
 existed.
 
+<h2>EXAMPLE</h2>
+
+Preparing the statistics for unsupervised classification of
+a LANDSAT subscene in North Carolina:
+
+<div class="code"><pre>
+g.region rast=lsat7_2002_10 -p
+
+# store VIZ, NIR, MIR into group/subgroup
+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
+
+i.cluster group=my_lsat7_2002 subgroup=my_lsat7_2002 sigfile=sig_clust_lsat2002 \
+          classes=10 report=rep_clust_lsat2002.txt
+</pre></div>
+
+To complete the unsupervised classification, <em>i.maxlik</em> is subsequently used.
+
 <h2>SEE ALSO</h2>
 
 The GRASS 4 <em>
@@ -236,6 +238,7 @@ The GRASS 4 <em>
 Processing manual</a></em>
 
 <p>
+
 <em>
 <a href="i.class.html">i.class</a>,
 <a href="i.group.html">i.group</a>,

+ 31 - 21
imagery/i.maxlik/i.maxlik.html

@@ -5,7 +5,8 @@ analysis classifier.  It can be used to perform the second
 step in either an unsupervised or a supervised image
 classification.
 
-<p>Either image classification methods are performed in two
+<p>
+Either image classification methods are performed in two
 steps.  The first step in an unsupervised image
 classification is performed by
 <em><a href="i.cluster.html">i.cluster</a></em>; the
@@ -15,7 +16,8 @@ the GRASS program <em>
 the second step in the image classification procedure is
 performed by <em>i.maxlik</em>.
 
-<p>In an unsupervised classification, the maximum-likelihood
+<p>
+In an unsupervised classification, the maximum-likelihood
 classifier uses the cluster means and covariance matrices
 from the <em><a href="i.cluster.html">i.cluster</a></em>
 signature file to determine to which category (spectral
@@ -29,13 +31,15 @@ generated by <em>
 to which category each cell in the image has the highest
 probability of belonging.
 
-<p>In either case, the raster map layer output by
+<p>
+In either case, the raster map layer output by
 <em>i.maxlik</em> is a classified image in which each cell
 has been assigned to a spectral class (i.e., a category).
 The spectral classes (categories) can be related to
 specific land cover types on the ground.
 
-<p>The program will run non-interactively if the user
+<p>
+The program will run non-interactively if the user
 specifies the names of raster map layers, i.e., group and
 subgroup names, seed signature file name, result
 classification file name, and any combination of
@@ -57,20 +61,8 @@ in the command line without program arguments. In this case
 the user will be prompted for the program parameter
 settings; the program will run foreground.
 
-
 <h2>OPTIONS</h2>
 
-
-<h3>Flags:</h3>
-
-<dl>
-
-<dt><b>-q</b> 
-
-<dd>Run quietly, without printing program messages to standard output.
-
-</dl>
-
 <h3>Parameters:</h3>
 
 <dl>
@@ -120,7 +112,6 @@ each classified cell in the classified image. One of the
 possible uses for this map layer is as a mask, to identify
 cells in the classified image that have the lowest
 probability of being assigned to the correct class.
-
 </dl>
 
 
@@ -140,12 +131,28 @@ If this occurs,
 <em>i.maxlik</em>
 will reject them and display a warning message.
 
-<p>This program runs interactively if the user types
+<p>
+This program runs interactively if the user types
 <em>i.maxlik</em> only. If the user types <em>i.maxlik</em>
 along with all required options, it will overwrite the
 classified raster map without prompting if this map
 existed.
 
+<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):
+
+<div class="code"><pre>
+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
+d.mon wx0
+d.rast.leg lsat7_2002_clust_classes
+d.rast.leg lsat7_2002_clust_classes.rej
+</pre></div>
 
 <h2>SEE ALSO</h2>
 
@@ -153,11 +160,13 @@ The GRASS 4 <em>
 <a href="http://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image
 Processing manual</a></em>
 
-<p><em>
+<p>
+<em>
 <a href="i.class.html">i.class</a>,
 <a href="i.cluster.html">i.cluster</a>,
 <a href="i.gensig.html">i.gensig</a>,
-<a href="i.group.html">i.group</a>
+<a href="i.group.html">i.group</a>,
+<a href="r.kappa.html">r.kappa</a>
 </em>
 
 <h2>AUTHORS</h2>
@@ -171,4 +180,5 @@ Tao Wen,
 University of Illinois at Urbana-Champaign,
 Illinois
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>

+ 40 - 14
imagery/i.smap/i.smap.html

@@ -1,6 +1,5 @@
 <h2>DESCRIPTION</h2>
 
-
 The <em>i.smap</em> program is used to segment
 multispectral images using a spectral class model known as
 a Gaussian mixture distribution.  Since Gaussian mixture
@@ -10,7 +9,7 @@ multispectral images based on simple spectral mean and
 covariance parameters.
 
 <p>
-<em>i.smap</em> has two modes of operation.  The first mode
+<em>i.smap</em> has two modes of operation. The first mode
 is the sequential maximum a posteriori (SMAP) mode
 [<a href="#ref1">1</a>,<a href="#ref2">2</a>].  The SMAP
 segmentation algorithm attempts to improve segmentation
@@ -18,7 +17,6 @@ accuracy by segmenting the image into regions rather than
 segmenting each pixel separately 
 (see <a href="#notes">NOTES</a>).
 
-
 <p>
 The second mode is the more conventional maximum likelihood (ML)
 classification which classifies each pixel separately,
@@ -30,22 +28,17 @@ the <b>-m</b> flag (see <a href="#mflag.html">below</a>).
 <h3>Flags:</h3>
 
 <dl>
-
 <dt><b>-m</b>
-
 <dd>Use maximum likelihood estimation (instead of smap).
 Normal operation is to use SMAP estimation (see
 <a href="#notes">NOTES</a>).
 
 <dt><b>-q</b> 
-
 <dd>Run quietly, without printing messages about program
 progress.  Without this flag, messages will be printed (to
 stderr) as the program progresses.
-
 </dl>
 
-
 <h3>Parameters:</h3>
 
 <dl>
@@ -118,7 +111,7 @@ If none of the arguments are specified on the command line,
 <em>i.smap</em> will interactively prompt for the names of
 the maps and files.
 
-<A NAME="notes"></a><h2>NOTES</h2>
+<a name="notes"></a><h2>NOTES</h2>
 
 The SMAP algorithm exploits the fact that nearby pixels in
 an image are likely to have the same class.  It works by
@@ -138,10 +131,42 @@ reduce the amount of smoothing.  This ensures that
 excessively large regions are not formed.
 
 <p>
-The module i.smap does not support MASKed or NULL cells. Therefore 
+The module <em>i.smap</em> does not support MASKed or NULL cells. Therefore 
 it might be necessary to create a copy of the classification results 
-using e.g. r.mapcalc. 
-<p>r.mapcalc  MASKed_map=classification results 
+using e.g. r.mapcalc:
+<p><div class="code"><pre>
+r.mapcalc "MASKed_map = classification_results"
+</pre></div>
+
+<h2>EXAMPLE</h2>
+
+Supervised classification of LANDSAT
+
+<div class="code"><pre>
+g.region rast=lsat7_2002_10 -p
+
+# store VIZ, NIR, MIR into group/subgroup
+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
+
+# Now digitize training areas "training" with the digitizer
+# and convert to raster model with v.to.rast
+v.to.rast training out=training use=cat labelcolumn=label
+
+# calculate statistics
+i.gensigset trainingmap=training group=my_lsat7_2002 subgroup=my_lsat7_2002 \
+            signaturefile=my_smap_lsat7_2002 maxsig=5
+
+i.smap group=my_lsat7_2002 subgroup=my_lsat7_2002 signaturefile=my_smap_lsat7_2002 \
+       output=lsat7_2002_smap_classes
+
+# Visually check result
+d.mon wx0
+d.rast.leg lsat7_2002_smap_classes
+
+# Statistically check result
+r.kappa -w classification=lsat7_2002_smap_classes reference=training
+</pre></div>
 
 <h2>REFERENCES</h2>
 
@@ -179,9 +204,10 @@ to generate the signature file required by this program
 <a href="http://dynamo.ecn.purdue.edu/~bouman/software/segmentation/">Charles Bouman, 
 School of Electrical Engineering, Purdue University</a>
 
-<br>
+<p>
 Michael Shapiro,
 U.S.Army Construction Engineering 
 Research Laboratory
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>

+ 16 - 5
raster/r.kappa/r.kappa.html

@@ -5,7 +5,8 @@ crossing classified map layer with respect to reference map layer.  Both
 overall <em>kappa</em> (accompanied by its <em>variance</em>) and
 conditional <em>kappa</em> values are calculated.  This analysis program
 respects the current geographic region and mask settings.
-<p><em>r.kappa</em> calculates the error matrix of the
+<p>
+<em>r.kappa</em> calculates the error matrix of the
 two map layers and prepares the table from which the report
 is to be created.  <em>kappa</em> values for overall and
 each classes are computed along with their variances. Also
@@ -14,12 +15,13 @@ classified result by pixel counts, total area in pixel
 counts and percentage of overall correctly classified
 pixels are tabulated.
 
-<p>The report will be write to an output file which is in
+<p>
+The report will be write to an output file which is in
 plain text format and named by user at prompt of running
 the program.
 
-
-<p>The body of the report is arranged in panels.  The
+<p>
+The body of the report is arranged in panels.  The
 classified result map layer categories is arranged along
 the vertical axis of the table, while the reference map
 layer categories along the horizontal axis.  Each panel has
@@ -44,6 +46,14 @@ information for each and every category.
 <em>NA</em>'s in output file mean non-applicable in case
 <em>MASK</em> exists.
 
+<H2>EXAMPLE</H2>
+
+Verification of classified LANDSAT scene against training areas:
+
+<div class="code"><pre>
+r.kappa -w classification=lsat7_2002_classes reference=training
+</pre></div>
+
 <h2>SEE ALSO</h2>
 
 <em><a href="g.region.html">g.region</a></em>,
@@ -58,4 +68,5 @@ information for each and every category.
 
 Tao Wen, University of Illinois at Urbana-Champaign, Illinois
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>