NAME

imagery - Description of GRASS image processing functions.

IMAGE PROCESSING IN GRASS

The following discussion is intended to provide a quick overview of image processing in GRASS. Some concepts and some hints are provided. For a more complete discussion and description of image processing in GRASS see GRASS Tutorial: Image Processing.

EXTRACTING IMAGERY DATA INTO A GRASS DATABASE

Remotely sensed images are captured for computer processing by filtering radiation emanating from the image into various electromagnetic wavelength bands, converting the overall intensity for each band to digital format, and storing the values on computer compatible media such as magnetic tape.

The GRASS programs which extract image data from magnetic tape can read LANDSAT multi-spectral scanner (MSS) data (i.tape.mss), LANDSAT thematic mapper (TM) data, (i.tape.tm), and other formats, such as scanned aerial photography or SPOT satellite data (i.tape.other). They extract the band data into raster files in a GRASS database. Each band becomes a separate raster file, with standard GRASS map layer support, and can be displayed and analyzed just like any other raster file.

UNREGISTERED DATA

The band data extracted from tapes are assumed to be unregistered data. This means that the GRASS software does not know the earth coordinates for pixels in the image. The only coordinates known at the time of extraction are the columns and the rows relative to the way the data was stored on the tape.

Data can only be extracted into a database which has an x,y coordinate system, and not into a projected database (e.g., a UTM database). This is to prevent users from mixing the unregistered data with registered data in the same database. The GRASS system comes with the database imagery which is an x,y database. New databases can be created by users during GRASS startup. See the g.help section on "Setting Up a GRASS Database" for instructions on creating a new database.

CELL HEADERS

The cell headers for the band files in these x,y databases are set to reflect the rows and columns of the extracted data. The north-south values represent the rows, and the east-west values represent the columns. The resolution of the unregistered data is set to 1.

Note, however, that while the row numbers increase from 1 to n from north to south, GRASS requires that the values of the user's current geographic region decrease from north to south. The solution adopted was to represent the rows with negative values (i.e., -1 to -n). This allows them to decrease from north to south and, if the minus sign is ignored, to reflect the row numbers.

The cell headers for the layers in x,y databases are set so that the coordinates at the center of each pixel exactly reflect the row and column for that pixel. The northern edge is set to 0.5 less than the first row, the southern edge 0.5 larger than the last row, the west to 0.5 less than the first column, and the east to 0.5 larger than the last column. When the image is displayed on the graphics monitor, the d.where command can be used to report row and column values.

For example, suppose rows 100-500 and columns 200-800 are extracted. Then the cell headers for the extracted data will be given the following values:

north:	-99.5
south:	-500.5
west:	199.5
east:	800.5
ns res:	1.0
ew res:	1.0

REGION AND MASK

Since the data layers are given essentially contrived cell headers, users must exercise extra care when analyzing or displaying unregistered images. It is very easy for the user's GRASS region to have absolutely no relationship to the data he is trying to display. This could happen when the region is set for data extracted from one tape, but the analysis is attempted on data extracted from another tape. A good habit to develop is to set the region to exactly match one of the band files. This can be done using the GRASS g.region command.

Another pitfall is to have a mask set to a band file from one data set while trying to read another. Even if the region is set properly, the data will appear to be all no-data since the mask will effectively knock out any data. Be sure that the mask is either set to a related data layer or not set at all. See r.mask for information on setting and unsetting the mask.

Please note that the tape extraction routines set your database region to match the rows and columns of the data that is extracted.

GROUPS

Since the band files are individual raster files, it is necessary to have a mechanism to maintain a relationship between band files from the same image as well as raster files derived from the band files. The GRASS group data structure accomplishes this goal. The group is essentially a list of names of raster files that belong in the group. For user convenience, groups are also created (and updated) by the tape extraction routines. The tape extraction programs ask the user to supply a group name as well as to specify the bands to be extracted. Suppose that the user extracts bands 1, 2, and 3 into a group called nhap. Then the band files will become the raster files nhap.1, nhap.2, and nhap.3 and the group nhap will list these 3 raster files as members of the group.

Groups can also be created and modified by the user using the GRASS command i.group.

IMAGE REGISTRATION AND RECTIFICATION

Image registration and image rectification is the process of associating earth coordinates with pixels on the image and then converting the unregistered raster files to raster files in a projected database.

Image registration (i.points) is applied to a group, rather than to individual raster files. The control points are stored in the group, allowing all related band files to be registered in one step rather than individually.

Image rectification (i.rectify) is applied to individual raster files, with the control points for the group used to control the rectification and the group target (i.target) used to specify the database where the rectified layer will live.

IMAGE CLASSIFICATION

Image classification methods process all or a subset of the band files as a unit. Spectral signatures for the image are generated (i.cluster) and then used to produce a landcover map (i.maxlik).

The signatures must be associated only with the raster files actually used in the analysis. This means that with a group subgroups must be created (i.group) which list the band files to be grouped for classification purposes. The signatures are stored with the subgroup.

Note that multiple subroups can be created within a group. This allows different classifications to be run with different combinations of band files.

Also note that raster files produced by the classification process (i.maxlik) are automatically listed as part of the group.

RECTIFIED VS. UNRECTIFIED ANALYSIS

There are two possible routes for processing image data. The first is to register the group (i.points), perform the analyses on the unrectified band data (i.maxlik), and then rectify the results (i.rectify). The second is to register the group (i.points), rectify the band data (i.rectify), then run analyses on the rectified band data in the target location (i.rectify). Both routes are permissible in GRASS. Users will most likely prefer the first. The second route requires leaving GRASS and re-running GRASS under the target location. It also will require that a group be created to hold the rectified band files since i.rectify does not create or modify groups. Also, spatial filtering may not be as effective on rectified data since the rectification of the data requires resampling the original data.

SEE ALSO

GRASS Tutorial: Image Processing

d.where
g.region
i.cluster
i.group
i.maxlik
i.points
i.rectify
i.tape.other
i.tape.mss
i.tape.tm
i.target
r.mask

AUTHOR

Michael Shapiro, U.S.Army Construction Engineering Research Laboratory