Image processing

For simplicity, we skip all the steps such as atmospheric and topographic corrections.

Unsupervised image classification

Set the computation region to the one of the raster maps we will work with:
g.region rast=lsat7_2002_10 -p
List the raster maps we have:
g.list type=rast
Imagery group holds a group of raster, usually different bands which will be our case, too. Subgroups works in the same way as groups and are used to organize rasters inside a grpup. Now, use to register Landsat images to a group and subgroup with the same name: group=lsat7_2002 subgroup=lsat7_2002 input=lsat7_2002_10,lsat7_2002_20,lsat7_2002_30,lsat7_2002_40,lsat7_2002_50,lsat7_2002_70
Use wxGUI histogram tool in Map Display to compare different channels in the group. Now, generate spectral signatures using a clustering algorithm. It is not needed to specify all the rasters, we just refer to them using group and subgroup. The signatures are stored within the subgroup.
i.cluster group=lsat7_2002 subgroup=lsat7_2002 signaturefile=sig_cluster_lsat2002 classes=10
Now we have signatures which can be used for a maximum-likelihood classification:
i.maxlik group=lsat7_2002 subgroup=lsat7_2002 signaturefile=sig_cluster_lsat2002 output=lsat7_2002_cluster_classes
Look at the result using GUI or the following command:
d.rast lsat7_2002_cluster_classes

Image segmentation

i.segment group=lsat7_2002 output=lsat7_2002_segments threshold=0.5 method=region_growing similarity=euclidean

Texture extraction

r.texture input=lsat7_2002_80 prefix=lsat7_2002_80_texture size=7 distance=1 method=corr,idm,entr
Use scatter plot in Map Display to compare IDM and Entr textures.

Explore raster values

Use query tool to get raster values. Use d.rast.num to show individual values of the raster.

Color enhancement

Add RGB layer to the Layer Manager or use the following command:
d.rgb blue=lsat7_2002_10 green=lsat7_2002_20 red=lsat7_2002_30
Apply color enhancement to the blue, green and red bands:
i.colors.enhance blue=lsat7_2002_10 green=lsat7_2002_20 red=lsat7_2002_30 strength=95
Now look again at the RGB layer (redraw in Map Display). The module i.colors.enhance does not create new rasters, it just creates new color tables.

Learn more