| 1 |
<h2>DESCRIPTION</h2> |
| 2 |
|
| 3 |
<em>i.maxlik</em> is a maximum-likelihood discriminant |
| 4 |
analysis classifier. It can be used to perform the second |
| 5 |
step in either an unsupervised or a supervised image |
| 6 |
classification. |
| 7 |
|
| 8 |
<p> |
| 9 |
Either image classification methods are performed in two |
| 10 |
steps. The first step in an unsupervised image |
| 11 |
classification is performed by |
| 12 |
<em><a href="i.cluster.html">i.cluster</a></em>; the first step in a |
| 13 |
supervised classification is executed by the GRASS |
| 14 |
program <em><a href="g.gui.iclass.html">g.gui.iclass</a></em> |
| 15 |
(or by providing any other raster map with already existing |
| 16 |
training areas). In both cases, the second step in |
| 17 |
the image classification procedure is |
| 18 |
performed by <em>i.maxlik</em>. |
| 19 |
|
| 20 |
<p> |
| 21 |
In an unsupervised classification, the maximum-likelihood |
| 22 |
classifier uses the cluster means and covariance matrices |
| 23 |
from the <em><a href="i.cluster.html">i.cluster</a></em> |
| 24 |
signature file to determine to which category (spectral |
| 25 |
class) each cell in the image has the highest probability |
| 26 |
of belonging. In a supervised image classification, the |
| 27 |
maximum-likelihood classifier uses the region means and |
| 28 |
covariance matrices from the spectral signature file |
| 29 |
generated by <em> |
| 30 |
<a href="g.gui.iclass.html">g.gui.iclass</a></em>, based on regions |
| 31 |
(groups of image pixels) chosen by the user, to determine |
| 32 |
to which category each cell in the image has the highest |
| 33 |
probability of belonging. |
| 34 |
|
| 35 |
<p> |
| 36 |
In either case, the raster map output by |
| 37 |
<em>i.maxlik</em> is a classified image in which each cell |
| 38 |
has been assigned to a spectral class (i.e., a category). |
| 39 |
The spectral classes (categories) can be related to |
| 40 |
specific land cover types on the ground. |
| 41 |
|
| 42 |
<h2>NOTES</h2> |
| 43 |
|
| 44 |
The maximum-likelihood classifier assumes that the spectral |
| 45 |
signatures for each class (category) in each band file |
| 46 |
are normally distributed (i.e., Gaussian in nature). |
| 47 |
Algorithms, such as |
| 48 |
<em><a href="i.cluster.html">i.cluster</a></em>, |
| 49 |
<em><a href="g.gui.iclass.html">g.gui.iclass</a></em>, |
| 50 |
or <em><a href="i.gensig.html">i.gensig</a></em>, |
| 51 |
however, can create signatures that are not valid |
| 52 |
distributed (more likely with |
| 53 |
<em><a href="g.gui.iclass.html">g.gui.iclass</a>).</em> |
| 54 |
If this occurs, |
| 55 |
<em>i.maxlik</em> |
| 56 |
will reject them and display a warning message. |
| 57 |
|
| 58 |
<p> |
| 59 |
The signature file (<b>signaturefile</b>) contains the cluster and |
| 60 |
covariance matrices that were calculated by the GRASS |
| 61 |
program <em><a href="i.cluster.html">i.cluster</a></em> (or the region |
| 62 |
means and covariance matrices generated by |
| 63 |
<em><a href="g.gui.iclass.html">g.gui.iclass</a></em>, if the user |
| 64 |
runs a supervised classification). These spectral signatures are what |
| 65 |
determine the categories (classes) to which image pixels will be |
| 66 |
assigned during the classification process. |
| 67 |
|
| 68 |
<p> |
| 69 |
The optional name of a <b>reject</b> raster map holds the reject |
| 70 |
threshold results. This is the result of a chi square test on each |
| 71 |
discriminant result at various threshold levels of confidence to |
| 72 |
determine at what confidence level each cell classified |
| 73 |
(categorized). It is the reject threshold map layer, and contains the |
| 74 |
index to one calculated confidence level for each classified cell in |
| 75 |
the classified image. 16 confidence intervals are predefined, and the |
| 76 |
reject map is to be interpreted as 1 = keep and 16 = reject. One of |
| 77 |
the possible uses for this map layer is as a mask, to identify cells |
| 78 |
in the classified image that have a low probability (high reject |
| 79 |
index) of being assigned to the correct class. |
| 80 |
|
| 81 |
<h2>EXAMPLE</h2> |
| 82 |
|
| 83 |
Second part of the unsupervised classification of a LANDSAT subscene |
| 84 |
(VIZ, NIR, MIR channels) in North Carolina (see |
| 85 |
<em><a href="i.cluster.html">i.cluster</a></em> manual page for the first |
| 86 |
part of the example): |
| 87 |
|
| 88 |
<div class="code"><pre> |
| 89 |
# using here the signaturefile created by i.cluster |
| 90 |
i.maxlik group=lsat7_2002 subgroup=res_30m \ |
| 91 |
signaturefile=cluster_lsat2002 \ |
| 92 |
output=lsat7_2002_cluster_classes reject=lsat7_2002_cluster_reject |
| 93 |
|
| 94 |
# visually check result |
| 95 |
d.mon wx0 |
| 96 |
d.rast.leg lsat7_2002_cluster_classes |
| 97 |
d.rast.leg lsat7_2002_cluster_reject |
| 98 |
|
| 99 |
# see how many pixels were rejected at given levels |
| 100 |
r.report lsat7_2002_cluster_reject units=k,p |
| 101 |
|
| 102 |
# optionally, filter out pixels with high level of rejection |
| 103 |
# here we remove pixels of at least 90% of rejection probability, i.e. categories 12-16 |
| 104 |
r.mapcalc "lsat7_2002_cluster_classes_filtered = \ |
| 105 |
if(lsat7_2002_cluster_reject <= 12, lsat7_2002_cluster_classes, null())" |
| 106 |
</pre></div> |
| 107 |
|
| 108 |
<!-- |
| 109 |
saved using d.mon wx0; d.rast lsat7_2002_cluster_classes; and save |
| 110 |
then trimmed using mogrify -trim *.png |
| 111 |
--> |
| 112 |
<p> |
| 113 |
<center> |
| 114 |
<img src="i_maxlik_rgb.png"><br> |
| 115 |
RGB composite of input data |
| 116 |
<p> |
| 117 |
<img src="i_maxlik_classes.png"><br> |
| 118 |
Output raster map with pixels classified (10 classes) |
| 119 |
<p> |
| 120 |
<img src="i_maxlik_rejection.png"><br> |
| 121 |
Output raster map with rejection probability values (pixel classification confidence levels) |
| 122 |
</center> |
| 123 |
|
| 124 |
<h2>SEE ALSO</h2> |
| 125 |
|
| 126 |
<a href="https://grasswiki.osgeo.org/wiki/Image_processing">Image processing</a> |
| 127 |
and |
| 128 |
<a href="https://grasswiki.osgeo.org/wiki/Image_classification">Image classification</a> |
| 129 |
wiki pages and for historical reference also |
| 130 |
the GRASS GIS 4<em> |
| 131 |
<a href="https://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image |
| 132 |
Processing manual</a></em> |
| 133 |
|
| 134 |
<p> |
| 135 |
<em> |
| 136 |
<a href="g.gui.iclass.html">g.gui.iclass</a>, |
| 137 |
<a href="i.cluster.html">i.cluster</a>, |
| 138 |
<a href="i.gensig.html">i.gensig</a>, |
| 139 |
<a href="i.group.html">i.group</a>, |
| 140 |
<a href="i.segment.html">i.segment</a>, |
| 141 |
<a href="i.smap.html">i.smap</a>, |
| 142 |
<a href="r.kappa.html">r.kappa</a> |
| 143 |
</em> |
| 144 |
|
| 145 |
<h2>AUTHORS</h2> |
| 146 |
|
| 147 |
Michael Shapiro, |
| 148 |
U.S.Army Construction Engineering |
| 149 |
Research Laboratory |
| 150 |
<br> |
| 151 |
Tao Wen, |
| 152 |
University of Illinois at Urbana-Champaign, |
| 153 |
Illinois |
| 154 |
<br> |
| 155 |
Semantic label support: Maris Nartiss, |
| 156 |
University of Latvia |