ImageDimensionalityReduction - Image Dimensionality Reduction

Performs dimensionality reduction of the input image according to a dimensionality reduction model file.

Detailed description

This application reduces the dimension of an input image, based on a machine learning model file produced by the TrainDimensionalityReduction application. Pixels of the output image will contain the reduced values fromthe model. The input pixels can be optionally centered and reduced according to the statistics file produced by the ComputeImagesStatistics application.

Parameters

This section describes in details the parameters available for this application. Table [1] presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is ImageDimensionalityReduction .

[1]Table: Parameters table for Image Dimensionality Reduction.
Parameter Key Parameter Name Parameter Type
in Input Image Input image
mask Input Mask Input image
model Model file Input File name
imstat Statistics file Input File name
out Output Image Output image
ram Available RAM (Mb) Int
inxml Load otb application from xml file XML input parameters file
outxml Save otb application to xml file XML output parameters file
  • Input Image: The input image to predict.
  • Input Mask: The mask allow restricting classification of the input image to the area where mask pixel values are greater than 0.
  • Model file: A dimensionality reduction model file (produced by TrainRegression application).
  • Statistics file: A XML file containing mean and standard deviation to center and reduce samples before prediction (produced by ComputeImagesStatistics application). If this file containsone more bands than the sample size, the last stat of last band will beapplied to expand the output predicted value.
  • Output Image: Output image containing reduced values.
  • Available RAM (Mb): Available memory for processing (in MB).
  • Load otb application from xml file: Load otb application from xml file.
  • Save otb application to xml file: Save otb application to xml file.

Example

To run this example in command-line, use the following:

otbcli_ImageDimensionalityReduction -in QB_1_ortho.tif -imstat EstimateImageStatisticsQB1.xml -model clsvmModelQB1.model -out ReducedImageQB1.tif

To run this example from Python, use the following code snippet:

#!/usr/bin/python

# Import the otb applications package
import otbApplication

# The following line creates an instance of the ImageDimensionalityReduction application
ImageDimensionalityReduction = otbApplication.Registry.CreateApplication("ImageDimensionalityReduction")

# The following lines set all the application parameters:
ImageDimensionalityReduction.SetParameterString("in", "QB_1_ortho.tif")

ImageDimensionalityReduction.SetParameterString("imstat", "EstimateImageStatisticsQB1.xml")

ImageDimensionalityReduction.SetParameterString("model", "clsvmModelQB1.model")

ImageDimensionalityReduction.SetParameterString("out", "ReducedImageQB1.tif")

# The following line execute the application
ImageDimensionalityReduction.ExecuteAndWriteOutput()

Limitations

The input image must contain the feature bands used for the model training. If a statistics file was used during training by the Training application, it is mandatory to use the same statistics file for reduction.

Authors

This application has been written by OTB-Team.

See Also

These additional resources can be useful for further information:
TrainDimensionalityReduction, ComputeImagesStatistics