ComputeImagesStatistics

Computes global mean and standard deviation for each band from a set of images and optionally saves the results in an XML file.

Description

This application computes a global mean and standard deviation for each band of a set of images and optionally saves the results in an XML file. The output XML is intended to be used as an input for the TrainImagesClassifier application to normalize samples before learning. You can also normalize the image with the XML file in the ImageClassifier application.

Parameters

Input images -il image1 image2... Mandatory
List of input image filenames.

Background Value -bv float
Background value to ignore in computation of statistics.

Optional outputs

Output XML file -out.xml filename [dtype]
XML filename where the statistics are saved for future reuse.

Mean pixel Value -out.mean string
Mean pixel value.

Min pixel Value -out.min string
Minimum pixel value.

Max pixel Value -out.max string
Maximum pixel value.

Standard deviation of pixel Value -out.std string
Standard deviation of pixel value.


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

Examples

From the command-line:

otbcli_ComputeImagesStatistics -il QB_1_ortho.tif -out.xml EstimateImageStatisticsQB1.xml

From Python:

import otbApplication

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

app.SetParameterStringList("il", ['QB_1_ortho.tif'])
app.SetParameterString("out.xml", "EstimateImageStatisticsQB1.xml")

app.ExecuteAndWriteOutput()

Limitations

Each image of the set must contain the same bands as the others (i.e. same types, in the same order).

See also

Documentation of the TrainImagesClassifier and ImageClassifier application.