1i.smap(1) GRASS GIS User's Manual i.smap(1)
2
3
4
6 i.smap - Performs contextual image classification using sequential
7 maximum a posteriori (SMAP) estimation.
8
10 imagery, classification, supervised classification, segmentation, SMAP
11
13 i.smap
14 i.smap --help
15 i.smap [-m] group=name subgroup=name signaturefile=name output=name
16 [goodness=name] [blocksize=integer] [--overwrite] [--help]
17 [--verbose] [--quiet] [--ui]
18
19 Flags:
20 -m
21 Use maximum likelihood estimation (instead of smap)
22
23 --overwrite
24 Allow output files to overwrite existing files
25
26 --help
27 Print usage summary
28
29 --verbose
30 Verbose module output
31
32 --quiet
33 Quiet module output
34
35 --ui
36 Force launching GUI dialog
37
38 Parameters:
39 group=name [required]
40 Name of input imagery group
41
42 subgroup=name [required]
43 Name of input imagery subgroup
44
45 signaturefile=name [required]
46 Name of input file containing signatures
47 Generated by i.gensigset
48
49 output=name [required]
50 Name for output raster map holding classification results
51
52 goodness=name
53 Name for output raster map holding goodness of fit (lower is bet‐
54 ter)
55
56 blocksize=integer
57 Size of submatrix to process at one time
58 Default: 1024
59
61 The i.smap program is used to segment multispectral images using a
62 spectral class model known as a Gaussian mixture distribution. Since
63 Gaussian mixture distributions include conventional multivariate Gauss‐
64 ian distributions, this program may also be used to segment multispec‐
65 tral images based on simple spectral mean and covariance parameters.
66
67 i.smap has two modes of operation. The first mode is the sequential
68 maximum a posteriori (SMAP) mode [1,2]. The SMAP segmentation algo‐
69 rithm attempts to improve segmentation accuracy by segmenting the image
70 into regions rather than segmenting each pixel separately (see NOTES).
71
72 The second mode is the more conventional maximum likelihood (ML) clas‐
73 sification which classifies each pixel separately, but requires some‐
74 what less computation. This mode is selected with the -m flag (see be‐
75 low).
76
78 Flags:
79 -m
80 Use maximum likelihood estimation (instead of smap). Normal opera‐
81 tion is to use SMAP estimation (see NOTES).
82
83 Parameters:
84 group=name
85 imagery group
86 The imagery group that defines the image to be classified.
87
88 subgroup=name
89 imagery subgroup
90 The subgroup within the group specified that specifies the subset
91 of the band files that are to be used as image data to be classi‐
92 fied.
93
94 signaturefile=name
95 imagery signaturefile
96 The signature file that contains the spectral signatures (i.e., the
97 statistics) for the classes to be identified in the image. This
98 signature file is produced by the program i.gensigset (see NOTES).
99
100 blocksize=value
101 size of submatrix to process at one time
102 default: 1024
103 This option specifies the size of the "window" to be used when
104 reading the image data.
105
106 This program was written to be nice about memory usage without influ‐
107 encing the resultant classification. This option allows the user to
108 control how much memory is used. More memory may mean faster (or
109 slower) operation depending on how much real memory your machine has
110 and how much virtual memory the program uses.
111
112 The size of the submatrix used in segmenting the image has a principle
113 function of controlling memory usage; however, it also can have a sub‐
114 tle effect on the quality of the segmentation in the smap mode. The
115 smoothing parameters for the smap segmentation are estimated separately
116 for each submatrix. Therefore, if the image has regions with qualita‐
117 tively different behavior, (e.g., natural woodlands and man-made agri‐
118 cultural fields) it may be useful to use a submatrix small enough so
119 that different smoothing parameters may be used for each distinctive
120 region of the image.
121
122 The submatrix size has no effect on the performance of the ML segmenta‐
123 tion method.
124
125 output=name
126 output raster map.
127 The name of a raster map that will contain the classification re‐
128 sults. This new raster map layer will contain categories that can
129 be related to landcover categories on the ground.
130
132 The SMAP algorithm exploits the fact that nearby pixels in an image are
133 likely to have the same class. It works by segmenting the image at
134 various scales or resolutions and using the coarse scale segmentations
135 to guide the finer scale segmentations. In addition to reducing the
136 number of misclassifications, the SMAP algorithm generally produces
137 segmentations with larger connected regions of a fixed class which may
138 be useful in some applications.
139
140 The amount of smoothing that is performed in the segmentation is depen‐
141 dent of the behaviour of the data in the image. If the data suggests
142 that the nearby pixels often change class, then the algorithm will
143 adaptively reduce the amount of smoothing. This ensures that exces‐
144 sively large regions are not formed.
145
146 The degree of misclassifications can be investigated with the goodness
147 of fit output map. Lower values indicate a better fit. The largest 5 to
148 15% of the goodness values may need some closer inspection.
149
150 The module i.smap does not support MASKed or NULL cells. Therefore it
151 might be necessary to create a copy of the classification results using
152 e.g. r.mapcalc:
153
154 r.mapcalc "MASKed_map = classification_results"
155
157 Supervised classification of LANDSAT scene (complete NC location)
158 # Align computation region to the scene
159 g.region raster=lsat7_2002_10 -p
160 # store VIZ, NIR, MIR into group/subgroup
161 i.group group=lsat7_2002 subgroup=res_30m \
162 input=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50,lsat7_2002_70
163 # Now digitize training areas "training" with the digitizer
164 # and convert to raster model with v.to.rast
165 v.to.rast input=training output=training use=cat label_column=label
166 # If you are just playing around and do not care about the accuracy of outcome,
167 # just use one of existing maps instead e.g.
168 # g.copy rast=landuse96_28m,training
169 # Create a signature file with statistics for each class
170 i.gensigset trainingmap=training group=lsat7_2002 subgroup=res_30m \
171 signaturefile=lsat7_2002_30m maxsig=5
172 # Predict classes based on whole LANDSAT scene
173 i.smap group=lsat7_2002 subgroup=res_30m signaturefile=lsat7_2002_30m \
174 output=lsat7_2002_smap_classes
175 # Visually check result
176 d.mon wx0
177 d.rast.leg lsat7_2002_smap_classes
178 # Statistically check result
179 r.kappa -w classification=lsat7_2002_smap_classes reference=training
180
181 The signature file obtained in the example above will allow to classify
182 the current imagery group only (lsat7_2002). If the user would like to
183 re-use the signature file for the classification of different imagery
184 group(s), they can set semantic labels for each group member before‐
185 hand, i.e., before generating the signature files. Semantic labels are
186 set by means of r.support as shown below:
187 # Define semantic labels for all LANDSAT bands
188 r.support map=lsat7_2002_10 semantic_label=TM7_1
189 r.support map=lsat7_2002_20 semantic_label=TM7_2
190 r.support map=lsat7_2002_30 semantic_label=TM7_3
191 r.support map=lsat7_2002_40 semantic_label=TM7_4
192 r.support map=lsat7_2002_50 semantic_label=TM7_5
193 r.support map=lsat7_2002_61 semantic_label=TM7_61
194 r.support map=lsat7_2002_62 semantic_label=TM7_62
195 r.support map=lsat7_2002_70 semantic_label=TM7_7
196 r.support map=lsat7_2002_80 semantic_label=TM7_8
197
199 • C. Bouman and M. Shapiro, "Multispectral Image Segmentation us‐
200 ing a Multiscale Image Model", Proc. of IEEE Int’l Conf. on
201 Acoust., Speech and Sig. Proc., pp. III-565 - III-568, San
202 Francisco, California, March 23-26, 1992.
203
204 • C. Bouman and M. Shapiro 1994, "A Multiscale Random Field Model
205 for Bayesian Image Segmentation", IEEE Trans. on Image Process‐
206 ing., 3(2), 162-177" (PDF)
207
208 • McCauley, J.D. and B.A. Engel 1995, "Comparison of Scene Seg‐
209 mentations: SMAP, ECHO and Maximum Likelyhood", IEEE Trans. on
210 Geoscience and Remote Sensing, 33(6): 1313-1316.
211
213 r.support for setting semantic labels,
214 i.group for creating groups and subgroups
215 r.mapcalc to copy classification result in order to cut out MASKed sub‐
216 areas
217 i.gensigset to generate the signature file required by this program
218
219 g.gui.iclass, i.maxlik, r.kappa
220
222 Charles Bouman, School of Electrical Engineering, Purdue University
223 Michael Shapiro, U.S.Army Construction Engineering Research Laboratory
224 Semantic label support: Maris Nartiss, University of Latvia
225
227 Available at: i.smap source code (history)
228
229 Accessed: Saturday Jan 21 20:40:50 2023
230
231 Main index | Imagery index | Topics index | Keywords index | Graphical
232 index | Full index
233
234 © 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual
235
236
237
238GRASS 8.2.1 i.smap(1)