.TH i.smap 1grass "" "GRASS 8.3.2" "GRASS GIS User's Manual" .SH NAME \fI\fBi.smap\fR\fR \- Performs contextual image classification using sequential maximum a posteriori (SMAP) estimation. .SH KEYWORDS imagery, classification, supervised classification, segmentation, SMAP .SH SYNOPSIS \fBi.smap\fR .br \fBi.smap \-\-help\fR .br \fBi.smap\fR [\-\fBm\fR] \fBgroup\fR=\fIname\fR \fBsubgroup\fR=\fIname\fR \fBsignaturefile\fR=\fIname\fR \fBoutput\fR=\fIname\fR [\fBgoodness\fR=\fIname\fR] [\fBblocksize\fR=\fIinteger\fR] [\-\-\fBoverwrite\fR] [\-\-\fBhelp\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] [\-\-\fBui\fR] .SS Flags: .IP "\fB\-m\fR" 4m .br Use maximum likelihood estimation (instead of smap) .IP "\fB\-\-overwrite\fR" 4m .br Allow output files to overwrite existing files .IP "\fB\-\-help\fR" 4m .br Print usage summary .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .IP "\fB\-\-ui\fR" 4m .br Force launching GUI dialog .SS Parameters: .IP "\fBgroup\fR=\fIname\fR \fB[required]\fR" 4m .br Name of input imagery group .IP "\fBsubgroup\fR=\fIname\fR \fB[required]\fR" 4m .br Name of input imagery subgroup .IP "\fBsignaturefile\fR=\fIname\fR \fB[required]\fR" 4m .br Name of input file containing signatures .br Generated by i.gensigset .IP "\fBoutput\fR=\fIname\fR \fB[required]\fR" 4m .br Name for output raster map holding classification results .IP "\fBgoodness\fR=\fIname\fR" 4m .br Name for output raster map holding goodness of fit (lower is better) .IP "\fBblocksize\fR=\fIinteger\fR" 4m .br Size of submatrix to process at one time .br Default: \fI1024\fR .SH DESCRIPTION The \fIi.smap\fR program is used to segment multispectral images using a spectral class model known as a Gaussian mixture distribution. Since Gaussian mixture distributions include conventional multivariate Gaussian distributions, this program may also be used to segment multispectral images based on simple spectral mean and covariance parameters. .PP \fIi.smap\fR has two modes of operation. The first mode is the sequential maximum a posteriori (SMAP) mode [1,2]. The SMAP segmentation algorithm attempts to improve segmentation accuracy by segmenting the image into regions rather than segmenting each pixel separately (see NOTES). .PP The second mode is the more conventional maximum likelihood (ML) classification which classifies each pixel separately, but requires somewhat less computation. This mode is selected with the \fB\-m\fR flag (see below). .SH OPTIONS .SS Flags: .IP "\fB\-m\fR " 4m .br Use maximum likelihood estimation (instead of smap). Normal operation is to use SMAP estimation (see NOTES). .SS Parameters: .IP "\fBgroup=\fR\fIname\fR " 4m .br imagery group .br The imagery group that defines the image to be classified. .IP "\fBsubgroup=\fR\fIname\fR " 4m .br imagery subgroup .br The subgroup within the group specified that specifies the subset of the band files that are to be used as image data to be classified. .IP "\fBsignaturefile=\fR\fIname\fR " 4m .br imagery signaturefile .br The signature file that contains the spectral signatures (i.e., the statistics) for the classes to be identified in the image. This signature file is produced by the program \fIi.gensigset\fR (see NOTES). .IP "\fBblocksize=\fR\fIvalue\fR " 4m .br size of submatrix to process at one time .br default: 1024 .br This option specifies the size of the \(dqwindow\(dq to be used when reading the image data. .PP This program was written to be nice about memory usage without influencing the resultant classification. This option allows the user to control how much memory is used. More memory may mean faster (or slower) operation depending on how much real memory your machine has and how much virtual memory the program uses. .PP The size of the submatrix used in segmenting the image has a principle function of controlling memory usage; however, it also can have a subtle effect on the quality of the segmentation in the smap mode. The smoothing parameters for the smap segmentation are estimated separately for each submatrix. Therefore, if the image has regions with qualitatively different behavior, (e.g., natural woodlands and man\-made agricultural fields) it may be useful to use a submatrix small enough so that different smoothing parameters may be used for each distinctive region of the image. .PP The submatrix size has no effect on the performance of the ML segmentation method. .IP "\fBoutput=\fR\fIname\fR " 4m .br output raster map. .br The name of a raster map that will contain the classification results. This new raster map layer will contain categories that can be related to landcover categories on the ground. .SH NOTES The SMAP algorithm exploits the fact that nearby pixels in an image are likely to have the same class. It works by segmenting the image at various scales or resolutions and using the coarse scale segmentations to guide the finer scale segmentations. In addition to reducing the number of misclassifications, the SMAP algorithm generally produces segmentations with larger connected regions of a fixed class which may be useful in some applications. .PP The amount of smoothing that is performed in the segmentation is dependent of the behaviour of the data in the image. If the data suggests that the nearby pixels often change class, then the algorithm will adaptively reduce the amount of smoothing. This ensures that excessively large regions are not formed. .PP The degree of misclassifications can be investigated with the goodness of fit output map. Lower values indicate a better fit. The largest 5 to 15% of the goodness values may need some closer inspection. .PP The module \fIi.smap\fR 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: .PP .br .nf \fC r.mapcalc \(dqMASKed_map = classification_results\(dq \fR .fi .SH EXAMPLE Supervised classification of LANDSAT scene (complete NC location) .br .nf \fC # Align computation region to the scene g.region raster=lsat7_2002_10 \-p # store VIZ, NIR, MIR into group/subgroup i.group group=lsat7_2002 subgroup=res_30m \(rs input=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50,lsat7_2002_70 # Now digitize training areas \(dqtraining\(dq with the digitizer # and convert to raster model with v.to.rast v.to.rast input=training output=training use=cat label_column=label # If you are just playing around and do not care about the accuracy of outcome, # just use one of existing maps instead e.g. # g.copy rast=landuse96_28m,training # Create a signature file with statistics for each class i.gensigset trainingmap=training group=lsat7_2002 subgroup=res_30m \(rs signaturefile=lsat7_2002_30m maxsig=5 # Predict classes based on whole LANDSAT scene i.smap group=lsat7_2002 subgroup=res_30m signaturefile=lsat7_2002_30m \(rs 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 \fR .fi .PP The signature file obtained in the example above will allow to classify the current imagery group only (lsat7_2002). If the user would like to re\-use the signature file for the classification of different imagery group(s), they can set semantic labels for each group member beforehand, i.e., before generating the signature files. Semantic labels are set by means of \fIr.support\fR as shown below: .br .nf \fC # Define semantic labels for all LANDSAT bands r.support map=lsat7_2002_10 semantic_label=TM7_1 r.support map=lsat7_2002_20 semantic_label=TM7_2 r.support map=lsat7_2002_30 semantic_label=TM7_3 r.support map=lsat7_2002_40 semantic_label=TM7_4 r.support map=lsat7_2002_50 semantic_label=TM7_5 r.support map=lsat7_2002_61 semantic_label=TM7_61 r.support map=lsat7_2002_62 semantic_label=TM7_62 r.support map=lsat7_2002_70 semantic_label=TM7_7 r.support map=lsat7_2002_80 semantic_label=TM7_8 \fR .fi .SH REFERENCES .RS 4n .IP \(bu 4n C. Bouman and M. Shapiro, \(dqMultispectral Image Segmentation using a Multiscale Image Model\(dq, \fIProc. of IEEE Int\(cql Conf. on Acoust., Speech and Sig. Proc.,\fR pp. III\-565 \- III\-568, San Francisco, California, March 23\-26, 1992. .IP \(bu 4n C. Bouman and M. Shapiro 1994, \(dqA Multiscale Random Field Model for Bayesian Image Segmentation\(dq, \fIIEEE Trans. on Image Processing., 3(2), 162\-177\(dq (PDF)\fR .IP \(bu 4n McCauley, J.D. and B.A. Engel 1995, \(dqComparison of Scene Segmentations: SMAP, ECHO and Maximum Likelihood\(dq, \fIIEEE Trans. on Geoscience and Remote Sensing, 33(6): 1313\-1316.\fR .RE .SH SEE ALSO \fI r.support\fR for setting semantic labels, .br \fI i.group\fR for creating groups and subgroups .br \fIr.mapcalc\fR to copy classification result in order to cut out MASKed subareas .br \fIi.gensigset\fR to generate the signature file required by this program .PP \fI g.gui.iclass, i.maxlik, r.kappa \fR .SH AUTHORS Charles Bouman, School of Electrical Engineering, Purdue University .br Michael Shapiro, U.S.Army Construction Engineering Research Laboratory .br Semantic label support: Maris Nartiss, University of Latvia .SH SOURCE CODE .PP Available at: i.smap source code (history) .PP Accessed: Friday Mar 08 07:35:29 2024 .PP Main index | Imagery index | Topics index | Keywords index | Graphical index | Full index .PP © 2003\-2024 GRASS Development Team, GRASS GIS 8.3.2 Reference Manual