OACALCATTSAR

Calculate object attributes from SAR imagery


EnvironmentsPYTHON :: EASI
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Related

Back to top

Description


From one or more input channels, OACALCATTSAR calculates attributes of objects (polygons) in a vector layer, and then writes the output values to the same or a new segmentation vector layer. Attributes can be statistical, geometrical, textural, or polarimetric.
Back to top

Parameters


oacalcattsar(fili, dbic, chnalias, filv, dbvs, filo, dbov, ftype, statatt, geoatt, ppixatt, qpatt, texatt, texwinsz)

Name Type Caption Length Value range
FILI* str Input file name 1 -    
DBIC List[int] Input raster channels 0 -    
CHNALIAS str Aliases of input channels 0 -    
FILV str Name of input vector file 0 -    
DBVS* List[int] Segment number of vector layer 1 - 1  
FILO str Output vector file name 0 -    
DBOV List[int] Output vector segment 0 - 1  
FTYPE str Output file type 0 - 3 PIX | SHP
Default: PIX
STATATT str Statistical attributes to calculate 0 -    
GEOATT str Geometrical attributes to calculate 0 -    
PPIXATT str Calculate pure pixels 0 - 3 NO | YES
Default: NO
QPATT str Polarimetric attributes to calculate 0 -    
TEXATT str Texture attributes to calculate 0 -    
TEXWINSZ List[int] Size of texture window 0 - 1 Default: 11

* Required parameter
Back to top

Parameter descriptions

FILI

The name of the PCIDSK file that contains the SAR-image channels to process.

DBIC

The channel or channels from which to extract attributes.

By default, all channels are processed.

CHNALIAS

Comma-separated aliases, or brief descriptions, of each channel specified as input.

The field names will appear in the attribute table with the aliases you specify.

If you do not specify a value, an alias is generated based on GDB-provided channel metadata, if it exists. If the channel metadata is unavailable, a generic sequence of bands is used; for example, B01, B02, B01, and so on.

Note: Aliases must be in the same order as the input channels, and the channel numbers must correspond.

FILV

The name of the file that contains a vector layer of closed polygons; typically, a segmentation layer generated by OASEGSAR.

If you do not specify a value, the PCIDSK file you specified as input is used.

DBVS

The vector layer to which to write the calculated attributes.

FILO

The file containing the segmentation layer to which to write the calculated attributes.

The file name you specify can be that of the input file or a new output file. When you create a new output file, the objects and attributes you specified are also written to the file.

If you do not specify a value, the segmentation layer is written to the corresponding layer of the input file.

DBOV

The segment number of the vector layer of the output file to which to write the results of the attribute calculation.

When FILO does not exist, DBOV will be ignored. The results will be written to the new file.

FTYPE

The format of the output file.

The following formats are supported:

The default is PIX.

STATATT

The statistical attributes to calculate for each object of the input segmentation vector layer from the input channels.

Specify the attributes you want to calculate as follows:

You can also specify a subset of any statistical attributes. For example, to specify minimum and mean, enter "MIN, MEAN".

GEOATT

The geometrical attributes to calculate for each object of the input segmentation vector layer.

Specify the attributes you want to calculate as follows:

By using a comma-separated string, you can define a subset of any geometrical attributes. For example, to specify form factor, solidity, and minor-axis length, enter "FOR, SOL, MIA".

PPIXATT

Calculate pure pixels.

You can specify the value as one of the following: When you specify Yes, the field name will be appended with _PP_ to indicate it is pure-pixel statistics.

This parameter is optional.

QPATT

The polarimetric attributes to calculate for each object of the input segmentation vector layer.

Specify the attributes you want to calculate as follows:

By using a comma-separated string, you can define a subset of any polarimetric attributes. For example, to specify form Cloude and volume, enter "CLOUDE, VOL".

TEXATT

The texture attributes to calculate for each object of the input segmentation vector layer from the input raster layers.

The attributes are based on second-order statistics calculated from the gray-level cooccurrence matrices.

Specify the attributes you want to calculate as follows:

You can also specify a subset of any textural attributes. For example, to specify cooccurrence standard deviation and cooccurrence contrast, enter "TSTD, TCON".

TEXWINSZ

The size of the window to use to extract texture attributes.

The value you specify must be an odd integer and a minimum of 5.

The default size is 11.

Back to top

Details

Supported channels

OACALCATTSAR can calculate attributes of the following channel types:

Statistical attributes

Statistical attributes are calculated based on the image pixels inside an object. Attributes are calculated for each of the selected image bands and added to the attribute table of the vector segment layer as new fields (attributes). The following table provides a description of statistical attributes you can calculate.

Table 1. Statistical attributes
Attribute Short name Description
Min. Min Minimum value of the pixels beneath an object in a selected band
Max. Max Maximum value of the pixels beneath an object in a selected band
Mean Mean Mean value of the pixels beneath an object in a selected band
Standard deviation StdV Standard-deviation value of the pixels beneath an object in a selected band

Pure-pixel statistics

Imagery and data sets of various resolutions are often used in an object-based image analysis (OBIA) to combine information from (a) high-spatial-resolution panchromatic or wide-band multispectral imagery acquired at a low-temporal resolution with (b) imagery from narrow-band multispectral high-temporal resolution with a low-spatial resolution. This fusion of information of various resolutions is used commonly with multitemporal image analysis.

Pixels along the borders of segments contain information from the adjoining segments and act as mixed pixels. This can have substantial impact on the local mean of a segment. To overcome the mixed-pixels issue, you can opt to calculate statistics by excluding the pixels on the segment boundary. This is referred to as pure-pixel statistics.

Geometrical attributes

The attributes representing geometrical characteristics of an object (polygon segment) make object-based image analysis (OBIA) advantageous over pixel-based measures. The geometrical attributes are calculated by analyzing the polygon boundary created during segmentation, so raster information is not required. Many of the shape descriptors used commonly are calculated. Each is described in the following table.

Note: Geometrical attributes are independent from the channel aliases, because they are calculated from the shape of objects.
Table 2. Geometrical attributes
Attribute Short name Description
Compactness Compact A measure of closely packed a shape is. A circle is the most compact.

Compactness = √(4 × As ÷ pi) ÷ O

Where As is the area of the object, and O is the perimeter of the object (outer contour).

Elongation Elongation The ratio of the height and width of a rotated, minimal-bounding box; that is, rotate a rectangle so it is the smallest rectangle in which the object fits, and then compare its height with its width.

Elongation = major axis length ÷ minor axis length

Circularity Circular A ratio representing how like is the shape of the object to a circle. Circularity is the ratio of the area of a shape to the perimeter of the square of the shape.

Circularity = As ÷ O2

Where As is the area of the shape, and O2 is square of the perimeter of the shape.

Rectangularity Rectangular How rectangular a shape is; that is, how much it fills its minimum bounding rectangle:

Rectangularity = As ÷ AR

Where As is the area of a shape, and AR is the area of the minimum bounding rectangle.

Convexity Convexity The relative amount that an object differs from a convex object. Convexity is calculated by forming the ratio of the perimeter of the convex hull of an object to the perimeter of the object itself.

Convexity = convex-hull perimeter ÷ object perimeter

Solidity Solidity The density of an object. Solidity is calculated as the ratio of the area of an object to the area of a convex hull of the object. A value of 1 indicates a solid object, and a value less than 1 indicates an object having an irregular boundary or containing holes.

Solidity = area ÷ convex-hull area

Form factor FormFactor The measure that compares the area of a polygon to the square of the perimeter. The form-factor value of a circle is 1, and the value of a square is pi ÷ 4.

Form factor = 4 × pi × area ÷ sqrt (perimeter)

Major-axis length MajorAxis The length of the major axis of an oriented bounding box enclosing the polygon.

Values are map units of the pixel size. If the image is not georeferenced, the values are pixels.

Minor-axis length MinorAxis The length of the minor axis of an oriented bounding box enclosing the polygon.

Values are map units of the pixel size. If the image is not georeferenced, the values are pixels.

Texture attributes

You can calculate texture measures for a specific direction or directional invariant for all pixels in an input image. The measures are based on second-order statistics calculated from the gray-level cooccurrence matrices.

Table 3. Texture attributes
Attribute Short name Description Algorithm Python EASI Focus/Modeler
Mean Tex_Mean_<ch_alias_name> Cooccurrence mean TEX
Click to view help topic
Click to view help topic
Click to view help topic
Standard deviation Tex_Std_<ch_alias_name> Cooccurrence standard deviation TEX
Click to view help topic
Click to view help topic
Click to view help topic
Entropy Tex_Ent_<ch_alias_name> Cooccurrence entropy TEX
Click to view help topic
Click to view help topic
Click to view help topic
Angular second moment Tex_Ang2m_<ch_alias_name> Cooccurrence angular second moment TEX
Click to view help topic
Click to view help topic
Click to view help topic
Contrast Tex_Cont_<ch_alias_name> Cooccurrence contrast TEX
Click to view help topic
Click to view help topic
Click to view help topic

Polarimetric attributes

The predefined polarimetric attributes described in the following table are available for fully polarimetric images only (matrix type = [s4c]). The attributes correspond to a selection of parameters from various polarimetric decompositions that have the potential to discriminate among a diverse set of land-cover classes.

Note: For more information about polarimetric attributes, in the following table, click Help book to view the help of the algorithm according to the relevant programming environment.
Table 4. Polarimetric attributes
Attribute Short name in Attribute Manager Unit (bounds: min., max.) Algorithm Python EASI Focus/Modeler
Scattering type AlphaAngle Degrees [0,90] PSEABA
Click to view help topic
Click to view help topic
Click to view help topic
Entropy Entropy Unitless [0,1] PSEABA
Click to view help topic
Click to view help topic
Click to view help topic
Anisotropy Anisotropy Unitless [0,1] PSEABA
Click to view help topic
Click to view help topic
Click to view help topic
Orientation angle BetaAngle Degrees [0, ] PSEABA
Click to view help topic
Click to view help topic
Click to view help topic
First eigenvalue Lambda1 Intensity [0, ] PSEABA
Click to view help topic
Click to view help topic
Click to view help topic
Second eigenvalue Lambda2 Intensity [0, ] PSEABA
Click to view help topic
Click to view help topic
Click to view help topic
Third eigenvalue Lambda3 Intensity [0, ] PSEABA
Click to view help topic
Click to view help topic
Click to view help topic
Double-bounce scattering DoubleBounce Intensity [0, ] PSFREDUR
Click to view help topic
Click to view help topic
Click to view help topic
Volume scattering Volume Intensity [0, ] PSFREDUR
Click to view help topic
Click to view help topic
Click to view help topic
Surface scattering Surface Intensity [0, ] PSFREDUR
Click to view help topic
Click to view help topic
Click to view help topic
HH-VV phase difference HHVVPhase Degrees [-180,180] PSPHDIFF
Click to view help topic
Click to view help topic
Click to view help topic
Maximum degree of polarization MaxDegPol Unitless [0,1] PSPOLDIS
Click to view help topic
Click to view help topic
Click to view help topic
Minimum degree of polarization MinDegPol Unitless [0,1] PSPOLDIS
Click to view help topic
Click to view help topic
Click to view help topic
Maximum of received power MaxRecPwr Intensity [0, ] PSPOLDIS
Click to view help topic
Click to view help topic
Click to view help topic
Minimum of received power MinRecPwr Intensity [0, ] PSPOLDIS
Click to view help topic
Click to view help topic
Click to view help topic
Maximum of scattered intensity MaxScatInt Intensity [0, ] PSPOLDIS
Click to view help topic
Click to view help topic
Click to view help topic
Note: With the polarimetric parameters for PSPOLDIS, the step size for the orientation and ellipticity angles are set to five degrees (5), respectively.

Band aliases

Aliases supplement the organization of the attributes you calculate. With attributes calculated from image layers, corresponding fields are created in the attribute table of segments. To distinguish among the various attributes, the field name is appended with the relevant layer identifier. By using aliases, you can better manage and interpret the information in the attribute table, which you can view in Attribute Manager.

During attribute calculation, the metadata is analyzed for identification of various band names and short names based on the sensor and wavelength range.

Aliases are generated based on the GDB-provided channel-metadata tag, if it is present. With optical data, aliases are generated from the BandDescription tag and, with SAR data, from the Polorization tag. If the metadata is found, a generic short name, such as B01, B02, B03, and so on is applied as an alias. You can, however, modify the aliases to suit.

The following table shows an example of the channel-level metadata tags and aliases for a sample SAR image, RS2_ FQ18_20090818_HH_VV_HV_VH_SLC.pix.

Table 5. Aliases for sample SAR image
Input channel RS2_ FQ18_20090818_HH_VV_HV_VH_SLC Channel-metadata tag Polarization Alias
1 RADARSAT-2 HH Sigma Nought Complex HH HH0818
2 RADARSAT-2 HV Sigma Nought Complex HV VV0818
3 RADARSAT-2 VH Sigma Nought Complex VH VH0818
4 RADARSAT-2 VV Sigma Nought Complex VV VV0818

For example, to generate the statistical attributes HH0818_mean, HH0818_min, VV0818_mean, VV0818_min for each object of a segmentation vector layer, specify the input channels and statistical attributes as follows:
DBIC=1,4
CHNALIAS="HH0818, VV0818"
STATTATT="Mean, Min"
			
Note: If necessary, you can use the same segmentation vector layer to run attribute calculation on several images. If any of the images already have aliases and attributes matching the ones defined herein, they will be overwritten.
Back to top

Example

from pci.oacalcattsar import oacalcattsar
fili= "RS2_SLC_FQ09subset.pix"
dbic=[1,2,3,4]           
chnalias=""        
filv="RS2_SLC_FQ09subset_seg_35_0.1_0.5.pix"
dbvs=[2]
filo=""                               # Blank, calculated attributes will be to added filv/dbvs
dbov=[2]
ftype="PIX"
statatt="all"                    # Calculate all statistical attributes 
geoatt=""                        # None - do not calculate geometrical attributes
ppixatt="No"
qpatt="all"                      # Calculate all polarimetric attributes
texatt="tmean, tstd"     # Calculate only the mean and standard deviation texture measures
texwinsz=[11]

oacalcattsar ( fili, dbic, chnalias, filv, dbvs, filo, dbov, ftype, statatt, geoatt, ppixatt, qpatt, texatt, texwinsz)

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