ANSI-C program: mask_class.c
NAME
mask_class - Set image data values belonging to a single
class or set of classes or the complement to a user-defined
value.
SYNOPSIS
mask_class <class_map> <file_in>
<file_out> <format_flag> <LR>
<selection_flag> <n_class> <class_1> ...
[class_n] [null_value]
<class_map> | class_mask file (class map 8-bit SUN (*.ras), BMP (*.bmp) raster file) |
<file_in> | input data file |
<file_out> | ouput data file |
<format_flag> | input/output data format flag (0: float, 1: fcomplex, 2: SUN (*.ras) or BMP (*.bmp) raster image, 3: unsigned char ) |
<LR> | left/right sense of class map image file 1:normal, -1:mirror image |
<selection_flag> | 1: mask is the region belonging to the selected
classes -1: mask is the complement of the region belonging to the selected classes |
<n_class> | number of classes to consider, up to 20 classes can be defined |
<class_1> |
class map value 1. |
... | n_class class map values must be
entered |
<class_n> | class map value n. |
[null value] | value written within the masked region float: default = 0.0 complex: default = (0.0, 0.0) SUN, BMP raster image: default = 0 0 0 unsigned char: default = 0 |
EXAMPLE
mask_class 1825_1868.landuse.ras 1825_1868.cc
1825_1868.cc_masked 1 -1 3 4 5 7
Sets the coherence values (input file 1825_1868.cc) for pixels corresponding to classes 4, 5, and 7 (indicated in the co-registered landuse map (1825_1868.landuse.ras) to 0.0.
mask_class 1825_1868.landuse.ras 1825_1868.cc 1825_1868.cc_masked -1 0.0 1 3 4 5 7
Sets the coherence values (input file 1825_1868.cc) for pixels not corresponding to classes 4, 5, or 7 (indicated in the co-registered landuse map (1825_1868.landuse.ras) to 0.0.
INSTALLATION
Source code mask_class.c in $LAT_HOME/src. For compilation adjust
and use Makefile: Executable of mask_class resides in
$LAT_HOME/bin
AVAILABILITY
Uses display programs definition file display.h, SUN raster file definition file
rasterfile.h, and BMP format
definition file, bmp_image.h.
DESCRIPTION
mask_class supports image classification and analysis.
All values of an input data file taht belong to a certain class
are set to a user-defined value. The class is defined a number of
values of a co-registered SUN raster or BMP format image, (or by
the compliment to those values).
Let us take as an example the following land-use classification. The class forest is recognized by a value 5 in the landuse map. For all areas belonging to the class forest we want know to retrieve further information. This may be a more detailed classsification into different forest types or it may be the retrieval of a geophysical or biophysical parameter. Lets assume, that we apply a retrieval algorithm which provides the forest biomass based on the cohrence and backscatter information. Such a classisfication algorithm applies only to forested areas, but not to other surface classes. Non-forested areas can be excluded using the program mask_class and set to 0.
The considered class can either be specified by the values of pixels belonging ot the class or by values of pixels not belonging to the class. The second option is particularly practical if the class includes all values exept for one or a small number of values.
OPTIONS
The class mask map in SUN raster or BMP format may be left/right
flipped relative to the image data. Up to 20 values may be used
to define the class.
SEE ALSO
display.h, rasterfile.h, bmp_image.h
DIAGNOSTICS
All messages are generally self-explanatory.
NOTES
none.
© Copyrights for Documentation, Users Guide and Reference Manual by Gamma Remote Sensing, 2000.
UW, CW, last change 29-May-2000.