SARCLASS

SAR classification using regions


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Acknowledgements :: References :: Related

Back to top

Description


SARCLASS classifies homogeneous regions defined for a SAR image. It uses the regions defined by SARSEG and training sites (provided as a set of points in a vector layer).
Back to top

Parameters


sarclass(file, dbic, dbrc, dbcb, dbvs, fldnme, classmsr, classthr, rpttype, class1, class2, class3, class4, class5, class6, class7, class8, class9, class10)

Name Type Caption Length Value range
FILE * str Input detected SAR image 1 -    
DBIC * List[int] Input SAR image channel 1 - 1  
DBRC * List[int] Input region raster 1 - 1  
DBCB List[int] List of class bitmaps 0 - 10  
DBVS * List[int] Input training points 1 - 1  
FLDNME * str Field name 1 -    
CLASSMSR str Classification measure 0 - 4 SAR | MEAN
Default: SAR
CLASSTHR List[float] Classification threshold 0 - 1  
RPTTYPE str Classification report type 0 - 5 SHORT | LONG
Default: SHORT
CLASS1 str Name of class 1 0 - 64  
CLASS2 str Name of class 2 0 - 64  
CLASS3 str Name of class 3 0 - 64  
CLASS4 str Name of class 4 0 - 64  
CLASS5 str Name of class 5 0 - 64  
CLASS6 str Name of class 6 0 - 64  
CLASS7 str Name of class 7 0 - 64  
CLASS8 str Name of class 8 0 - 64  
CLASS9 str Name of class 9 0 - 64  
CLASS10 str Name of class 10 0 - 64  

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the segmented SAR file produced by SARSEG. The image file must contain the SAR image channel and the region (segment) number channel.

DBIC

Specifies the image channel to be classified. This parameter must specify the SAR image channel that was previously used as input to SARSEG. Any required pixel value conversions and resolution modifications must be performed before running SARSEG

DBRC

Specifies the input channel containing region (segment) numbers created by SARSEG. All pixels belonging to the same region have the same pixel value in DBRC. The regions in DBRC can be spatially disjointed to allow manual region merging before running SARCLASS.

DBCB

Optionally specifies the list of bitmap segments to identify the area occupied by each class. If this parameter is not specified, new bitmap segments are created. If this parameter is specified, the existing bitmaps with provided numbers are overwritten. The number of specified bitmaps must be the same as the number of requested classes (see the CLASS parameters). The bitmaps are assigned consecutively to the specified classes; for example, if DBCB=3,5 and CLASS1 and CLASS3 are defined, bitmap 3 will identify regions assigned to CLASS1, and bitmap 5 will identify regions assigned to CLASS3. No other bitmaps will be modified.

DBVS

Specifies the segment number of the input vector layer containing the training points for all classes. This vector segment should contain a number of points, with the class name for each point provided in the attribute (field) specified by the FLDNME parameter. For each point, the region ID under each sample is extracted from the DBRC channel, and the region added to the list of training regions for a given class. Points with an empty or "NoData" class name are ignored.

Multiple points marking the same region for the same class are ignored, but a warning is issued. If the same region is marked for different classes, an error is issued and processing stops.

FLDNME

Specifies the name of the attribute field containing the class name of every training point in the input point layer.

For each point in the vector segment, the content of the "Field Name" attribute is compared with class names provided in parameters CLASS1 to CLASS10. All points with matching names are used; other points are ignored. If all CLASS1 to CLASS10 parameters are unspecified (blank), all points in the input vector segment are used except ones with an empty (blank) or "NoData" Field Name attribute.

CLASSMSR

Optionally specifies the classification measure.

Acceptable values are:

See the Details section for more information about the two classification measures

CLASSTHR

Optionally specifies the classification measure threshold that each region must meet to be assigned to a class. It also implicitly controls the creation of the "zero class" of unclassified pixels. If this parameter is not specified, every region is assigned to a class. If specified, the regions that differ too much from the best-matching class are not assigned to this class, and are left unclassified. The practically effective values of T are usually in the range between 0.5 and 1.5, depending on the image and the classification measure (SAR or MEAN).

See the Details section for a more information about the thresholding algorithm.

RPTTYPE

Optionally specifies the classification report type.

Supported values are:

CLASS1

Optionally specifies the name of class 1. If specified, the name will be used for the bitmap assigned to this class. If none of the "Class" parameters (Class1 through Class10) are specified, all points in the input training points segment are used, and the class names are derived from the attribute specified in the FLDNME (Field Name) parameter.

CLASS2

Optionally specifies the name of class 2. If specified, the name will be used for the bitmap assigned to this class. If none of the "Class" parameters (Class1 through Class10) are specified, all points in the input training points segment are used, and the class names are derived from the attribute specified in the FLDNME (Field Name) parameter.

CLASS3

Optionally specifies the name of class 3. If specified, the name will be used for the bitmap assigned to this class. If none of the "Class" parameters (Class1 through Class10) are specified, all points in the input training points segment are used, and the class names are derived from the attribute specified in the FLDNME (Field Name) parameter.

CLASS4

Optionally specifies the name of class 4. If specified, the name will be used for the bitmap assigned to this class. If none of the "Class" parameters (Class1 through Class10) are specified, all points in the input training points segment are used, and the class names are derived from the attribute specified in the FLDNME (Field Name) parameter.

CLASS5

Optionally specifies the name of class 5. If specified, the name will be used for the bitmap assigned to this class. If none of the "Class" parameters (Class1 through Class10) are specified, all points in the input training points segment are used, and the class names are derived from the attribute specified in the FLDNME (Field Name) parameter.

CLASS6

Optionally specifies the name of class 6. If specified, the name will be used for the bitmap assigned to this class. If none of the "Class" parameters (Class1 through Class10) are specified, all points in the input training points segment are used, and the class names are derived from the attribute specified in the FLDNME (Field Name) parameter.

CLASS7

Optionally specifies the name of class 7. If specified, the name will be used for the bitmap assigned to this class. If none of the "Class" parameters (Class1 through Class10) are specified, all points in the input training points segment are used, and the class names are derived from the attribute specified in the FLDNME (Field Name) parameter.

CLASS8

Optionally specifies the name of class 8. If specified, the name will be used for the bitmap assigned to this class. If none of the "Class" parameters (Class1 through Class10) are specified, all points in the input training points segment are used, and the class names are derived from the attribute specified in the FLDNME (Field Name) parameter.

CLASS9

Optionally specifies the name of class 9. If specified, the name will be used for the bitmap assigned to this class. If none of the "Class" parameters (Class1 through Class10) are specified, all points in the input training points segment are used, and the class names are derived from the attribute specified in the FLDNME (Field Name) parameter.

CLASS10

Optionally specifies the name of class 10. If specified, the name will be used for the bitmap assigned to this class. If none of the "Class" parameters (Class1 through Class10) are specified, all points in the input training points segment are used, and the class names are derived from the attribute specified in the FLDNME (Field Name) parameter.

Back to top

Details

SARCLASS classifies a segmented image created by SARSEG. A supervised classification is performed, with the required classes provided as parameters. Each region is assigned to a class or left unclassified, depending on the parameters discussed below.

All pixels of all regions assigned to a given class are marked as 'on' bits in the output bitmap corresponding to this class.

The statistics of all classes and (optionally) of individual regions are provided in the run report.

Training information for SARCLASS is provided in the form of training points in the specified input vector segment. Each point should be placed in an image area representative of a given class, and the corresponding class name entered in the field (attribute) column with the name specified by the FLDNME (Field Name) parameter.

If none of the "Class" parameters are specified, the algorithm uses all points in the input vector segment, with the exception of points with a blank or "NoData" value in the column specified by the FLDNME parameter. In this case, SARCLASS can process up to 20 distinct classes.

The input file for SARCLASS is an output file from the SARSEG algorithm. It contains an image channel and a channel with unique region IDs.

If SAR classification is requested, the image channel is assumed to contain SAR positive intensity or radar backscatter values, and no pixel value conversion is performed.

For the purpose of SARSEG and SARCLASS, the suitable estimates of radar cross section are: pixel intensity (power); calibrated radar brightness beta-0; radar backscatter sigma-0; and radar backscatter gamma-0. The algorithm assumes that input image pixel values are already converted to the desired format, and does not transform them internally.

Each region is assumed to be a homogeneous area, with constant radar backscatter, and only limited noise. The processing in SARCLASS does not require the regions to be contiguous. It is possible to manually merge regions produced by SARSEG before running SARCLASS.

Up to ten required classes can be specified explicitly through the "Class" parameters, or implicitly through the FLDNME attribute in the input vector segment. At least one class must be specified, and for each class, at least one training region must be provided. It is recommended that you provide several training points (and the underlying regions) for each class. Training points specified for undefined classes are ignored. Repeated regions for a single class are detected and a warning is issued, but processing continues. Repeated regions between classes cause an error, and execution stops.

The classification in SARCLASS is performed on a per-region basis, as opposed to the standard per-pixel classification. This means that classification measures dependent on pixel value histograms within regions (median, mode) cannot be used. Moreover, such parameters are not applicable to SAR images. The two classification measures supported in SARCLASS are a SAR-specific measure and a region mean; these are specified using the CLASSMSR (Classification Measure) parameter.

The SAR-specific measure is a Maximum Likelihood classifier, which maximizes the likelihood of a region belonging to a given class, except that it accounts for the speckle model in SAR. Specifically, a region 'i' is assigned to the class 'k' for which the SAR measure is maximum:

-ln(sigma(k)) - I(i)/sigma(k) = MAX(k) 
where:

This measure stems from maximizing the likelihood of a segment belonging to a given class. There is no dependency on the effective number of SAR looks, because it is constant for the entire image.

When the SAR measure is specified, all training regions must have their mean value greater than zero. If a training region is detected with a zero or negative mean, an error message is issued and execution ends. Such regions cannot be used as training regions when the SAR measure is specified.

For the MEAN classification measure, a region 'i' is assigned to the class 'k' that has its mean closest to the region's mean:

ABS(mean(i) - mean(k)) = MIN(k) 
where:

By default, all regions in the input file are classified by SARCLASS, and there is no "zero class" of unclassified pixels. By specifying the CLASSTHR (Classification Threshold) parameter, it is possible to reject regions that are too different from any of the specified classes. The regions outside the classification threshold are left unassigned, and there are no set pixels for them in any of the output classes.

Assume a region i has been found to be closest to the class k according to the selected classification measure. If the threshold T is specified, the region is rejected (left unclassified) if the following condition is satisfied:

ABS(mean(i) - mean(k)) > T * std(k) 
where:

The practically effective values of T are usually in the range between 0.5 and 1.5, depending on the image and the classification measure (SAR or MEAN). If a particular value works well except for one or two classes, it may be possible to correct this by adjusting training data for the problematic classes. After adding training data with larger range of values, the standard deviation of all training regions for the class will increase, and the threshold will become more permissive. If training data with smaller range of values is selected, the threshold will become more restrictive, and more regions will be rejected.

For constant images, all regions are assigned to the first specified class when the MEAN measure is used. For the SAR measure, this is also the case if the Classification Threshold parameter is not specified. If the threshold is specified, either all pixels are assigned to a single class, or all pixels are unclassified. The SAR measure cannot be used for an empty image (with all pixels zero) or an image with negative pixel values, and an error is returned.

The results of classification are stored in output bitmaps, one per class. Within each bitmap, pixels of all regions assigned to a given class are set (1), and all other pixels are off (0). New bitmaps can be created by SARCLASS if the bitmap segments are not specified, or existing bitmaps can be used. The existing bitmaps are overwritten with the current run results.

Classification statistics are written to a classification report. The report can be either SHORT or LONG. Both versions list run parameters, and provide summary (per-class) statistics for the training and classified regions. The SHORT report also provides a 50-bin histogram, indicating the number of regions with their classification measure value within each bin range.

The LONG report provides detailed statistics of all training and classified regions in the input regions channel, grouped by class. It also provides the image location of the first pixel of each region, as encountered during image scan (lines from the top of the image, then left to right within each line).

The use of the classification threshold and its optimum value depend on the measure type, the number and homogeneity of training regions, and the segmented image content. It is useful to run SARCLASS once without the threshold and with default Input Regions (DBRC) and Report Type (RPTTYPE) parameters, examine the measure value histogram, then select the threshold to screen out the undesirable regions. For the SAR measure, the regions from the top of the histogram will be left unclassified, with their values smaller than the threshold. For the MEAN measure, regions from the bottom of the histogram will be left unclassified, with their values larger than the threshold.

If a more detailed analysis is required, SARCLASS can be run again with the LONG report, and the assignment of individual regions verified.

If DBCB is not modified between the runs, bitmaps created in the first run will be overwritten. If DBCB is defaulted before each run, a new set of bitmaps will be created every time, and the effects of different settings can be compared.

Back to top

Example

A segmented file sarseg1.pix has been produced. The image has been visually inspected, and training points have been collected for several desired classes in point layer 2. A class name for each training point was entered in the field "ClassName". The following example shows how to set up parameters and run SARCLASS.

from pci.sarclass import sarclass

file	=	"sarseg1.pix"	# input segmented SAR image file
dbic	=	[3]	# input SAR image channel
dbrc	=	[2]	# input region channel
dbcb	=	[]	# store classes as a new set of bitmaps
dbcv	=	[2]	# vector segment containing class samples
fldnme	=	"ClassName"	# attribute field containing class names
classmsr	=	"SAR"	# classification measure
classthr	= []	
rpttype	=	""	# produce a SHORT classification report
class1	=	"Water"
class2	=	"Grass"
class3	=	""
class4	=	"Forest"
class5	=	""
class6	=	""
class7	=	""
class8	=	""
class9	=	""
class10	=	""
report	=	"sarclass_rep.txt"	# save classification report as text file

sarclass (file, dbic, dbrc, dbcb, dbcv, fldnme, classmsr, classthr, rpttype, class1, class2, class3, class4,
class5, class6, class7, class8, class9, class10)
			
Back to top

Acknowledgements

Support for the development of this software was received through the Earth Observation applications Development Program (EODAP) of the Canadian Space Agency/L'Agence Spatiale Canadienne, under contract No. 9F028-2-4917/14.

Back to top

References

Oliver C. and I. Quegan, 1998. Understanding Synthetic Aperture Images, Artech House, Boston.

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.