ObjectsRadiometricStatistics

Compute features attributes of a vector dataset over an image.

Description

This application computes radiometric and shapes attributes on a vector dataset, using an image. The results are stored in the attribute table. Shape attributes are : number of pixels, flatness, roundness, elongation, perimeter. Radiometric attributes are for each band of the input image : mean, standard-deviation, median, variance, kurtosis, skewness.

This application has several output images and supports “multi-writing”. Instead of computing and writing each image independently, the streamed image blocks are written in a synchronous way for each output. The output images will be computed strip by strip, using the available RAM to compute the strip size, and a user defined streaming mode can be specified using the streaming extended filenames (type, mode and value). Note that multi-writing can be disabled using the multi-write extended filename option: &multiwrite=false, in this case the output images will be written one by one. Note that multi-writing is not supported for MPI writers.

Parameters

Input vector dataset -in filename [dtype] Mandatory
Input vector dataset providing segmentation.

Input reference image -im image Mandatory
Input image used to compute radiometric attributes.

ID field -field string Default value: label
Name of the field containing object IDs.

Background value -background int Default value: 0
Background value. Needs to be different of any object ID.

Examples

From the command-line:

otbcli_ObjectsRadiometricStatistics -in segmentation.shp -im image_XS.tif -field label -background 0

From Python:

import otbApplication

app = otbApplication.Registry.CreateApplication("ObjectsRadiometricStatistics")

app.SetParameterString("in", "segmentation.shp")
app.SetParameterString("im", "image_XS.tif")
app.SetParameterString("field", "label")
app.SetParameterInt("background", 0)

app.ExecuteAndWriteOutput()

See also

For now, support of input dataset with multiple layers having different projection reference system is limited.