Preprocessing Images

Import and export of imagery data

Imagery data is raster data, so you can import it with the infamous r.in.gdal module. Especially its capacity to create a new location on the fly is very helpful in this context. Other more specialized import modules exist, such as i.in.erdas, r.in.bin, etc. In general, try r.in.gdal first and if that doesn't work, try the rest. Since image data is recorded at different wave lengths, it is often split into different images representing different ranges of wave lengths (such as red, green, blue, infrared, thermal, etc).

There is just one specialized image export model, i.out.erdas which, as you might have guessed, allows you to create ERDAS files and can export several channels. You obviously can also use any of the (raster export modules) for exporting single channel images.

Image groups

Since most image data comes in multiple channels representing different rqnges of zave lengths, GRASS needs to know which raster data files correspond to one image. This is what groups are for, and groups are created with i.group. As the man page for this module says: "i.group allows the user to collect raster map layers in an imagery group by assigning them to user-named subgroups or other groups. This enables the user to run analyses on any combination of the raster map layers in a group." Please see the man page for further information about its use.

Geocoding of images

Depending on how much money you can spend, the data you dispose of will be geocoded or no. For any sensible use geocoding is indispensable, so if you can't pay it, you'll have to do it yourself.

If you're part of the upper classes of image processors and in proud possession of geocoded data, just relax at the pool while the rest of us goes to work, unless you wish to work in a different projection than the one your data comes in. If you need help for that, please follow the links listed in the chapter called Project data. For the rest of us, let's go on.

In order to geocode an image, we need reference points for which we know the precise coordinates in the projection system we want to use. Those points are called ground control points or GCP. If you're of those that win in lotteries your data actually might contain GCP. In that case, r.in.gdal will store those points in a POINTS file and can even reproject them during import if you use the "target=" parameter. However, the lower masses and those whose GCP are not sufficient to reach an acceptable accuracy will have to identify the points themselves. Luckily GRASS offers you some help with this task.

Before doing anything else, you will have to group your data with i.group. Once this is done, please identify the target location (which you have created before using the instruction in the chapter called Set-up your location) with i.target. This defines the projection system into which you will recitfy your data.

The main tools for rectifying your images are i.points and i.rectify[1]. The first allows you to juxtapose one of the images of your group[2] with a raster reference map (use the option "PLOT RASTER" to use such a reference map). A zoom function helps you identify the points at sufficient precision level. At any moment you can calculate the root mean square error for the points entered and thus control the precision. Please see the man page for a complete description of how to use the module. Note that you need an open graphics monitor to use it. If you would rather use a vector map as reference map, you can use the module i.vpoints.

i.rectify will use the points you defined with i.points to ... rectify your image. In other words it geocodes your map by linking the data elements contained in your image to geographical coordinates. The module is pretty straightforward, but if questions remain, consult the man page.

Colors

Use r.colors to redefine the color table of your images. For example, you can use the "color=grey.eq" parameter setting to apply a contrast stretch to an image (useful for those that appear too dark).

Displaying images

In order to display your image in a recognizable way you have to create a color composite from its different frequency channels. Thus, to get a natural color composite you would combine the red, green and blue channels. Two options are open to you:

Radiometric preprocessing

In order to avoid certain phenomena such as atmospheric and terrain effects, but also image transformation by the vendor, several corrections need to be applied to your image data before you can procede to serious analysis. For most of these corrections you should use r.mapcalc (see the chapter called Raster map algrebra with r.mapcalc for links to general tutorials on this module and see the relevant litterature for more information on radiometric techniques).

Notes

[1]

You can also try i.points3 and i.rectify3 which are more recent, but still unfinished modules.

[2]

You might want to create a color composite image and include it into your group in order to display it.