LocalStatisticExtraction

Computes local statistical moments on every pixel in the selected channel of the input image

Description

This application computes the 4 local statistical moments on every pixel in the selected channel of the input image, over a specified neighborhood. The output image is multi band with one statistical moment (feature) per band. Thus, the 4 output features are the Mean, the Variance, the Skewness and the Kurtosis. They are provided in this exact order in the output image.

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 Image -in image Mandatory
The input image to compute the features on.

Feature Output Image -out image [dtype] Mandatory
Output image containing the local statistical moments.

Selected Channel -channel int Default value: 1
The selected channel index (1 based)

Neighborhood radius -radius int Default value: 3
The computational window radius.

Available RAM (MB) -ram int Default value: 256
Available memory for processing (in MB).

Examples

From the command-line:

otbcli_LocalStatisticExtraction -in qb_RoadExtract.tif -channel 1 -radius 3 -out Statistics.tif

From Python:

import otbApplication

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

app.SetParameterString("in", "qb_RoadExtract.tif")
app.SetParameterInt("channel", 1)
app.SetParameterInt("radius", 3)
app.SetParameterString("out", "Statistics.tif")

app.ExecuteAndWriteOutput()

See also

otbRadiometricMomentsImageFunction class