ImageDimensionalityReduction¶
基于降维模型文件执行输入图像的降维。
描述¶
此应用程序基于由 TrainDimensionalityReduction 申请。输出图像的像素将包含模型的减小值。输入像素可以根据 ComputeImagesStatistics 申请。
参数¶
Input Image -in image
Mandatory
The input image to predict.
Input Mask -mask image
The mask allow restricting classification of the input image to the area where mask pixel values are greater than 0.
Model file -model filename [dtype]
Mandatory
A dimensionality reduction model file (produced by TrainRegression application).
Statistics file -imstat filename [dtype]
An 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 -out image [dtype]
Mandatory
Output image containing reduced values
Available RAM (MB) -ram int
Default value: 256
Available memory for processing (in MB).
实例¶
从命令行执行以下操作:
otbcli_ImageDimensionalityReduction -in QB_1_ortho.tif -imstat EstimateImageStatisticsQB1.xml -model clsvmModelQB1.model -out ReducedImageQB1.tif
来自Python的评论:
import otbApplication
app = otbApplication.Registry.CreateApplication("ImageDimensionalityReduction")
app.SetParameterString("in", "QB_1_ortho.tif")
app.SetParameterString("imstat", "EstimateImageStatisticsQB1.xml")
app.SetParameterString("model", "clsvmModelQB1.model")
app.SetParameterString("out", "ReducedImageQB1.tif")
app.ExecuteAndWriteOutput()
局限性¶
输入图像必须包含用于模型训练的特征波段。如果培训应用程序在培训期间使用了统计文件,则必须使用相同的统计文件进行减少。