ImageRegression¶
根据回归模型文件执行对输入图像的预测。
描述¶
此应用程序根据以下两种方法之一生成的回归模型文件预测输入图像的输出值 TrainVectorRegression 或 TrainImagesRegression 。输出图像的像素将包含回归模型(单波段)的预测值。输入像素可以根据 ComputeImagesStatistics 申请。可以提供可选的输入掩码,在这种情况下,将仅处理相应掩码值大于零的输入图像像素。剩余的像素在输出图像中将被赋予零值。
参数¶
Input Image -in image
Mandatory
The input image to predict.
Input Mask -mask image
The mask restrict the classification of the input image to the area where mask pixel values are greater than zero.
Model file -model filename [dtype]
Mandatory
A regression model file (produced either by TrainVectorRegression application or the TrainImagesRegression application).
Statistics file -imstat filename [dtype]
An XML file containing mean and standard deviation to center and reduce samples before prediction (produced by the ComputeImagesStatistics application). If this file contains one more band than the sample size, the last stat of the last band will beapplied to expand the output predicted value.
Output Image -out image [dtype]
Mandatory
Output image containing predicted values
Available RAM (MB) -ram int
Default value: 256
Available memory for processing (in MB).
实例¶
从命令行执行以下操作:
otbcli_ImageRegression -in QB_1_ortho.tif -imstat EstimateImageStatisticsQB1.xml -model clsvmModelQB1.svm -out clLabeledImageQB1.tif
来自Python的评论:
import otbApplication
app = otbApplication.Registry.CreateApplication("ImageRegression")
app.SetParameterString("in", "QB_1_ortho.tif")
app.SetParameterString("imstat", "EstimateImageStatisticsQB1.xml")
app.SetParameterString("model", "clsvmModelQB1.svm")
app.SetParameterString("out", "clLabeledImageQB1.tif")
app.ExecuteAndWriteOutput()
局限性¶
输入图像必须包含用于模型训练的特征波段。如果列车倒退在训练期间使用了统计文件,则必须使用相同的统计文件进行预测。如果使用输入蒙版,则其大小必须与输入图像大小匹配。