Performs a prediction of the input image according to a regression model file.
This application predict output values from an input image, based on a regression model file produced by the TrainRegression application. Pixels of the output image will contain the predicted values fromthe regression model (single band). The input pixels can be optionally centered and reduced according to the statistics file produced by the ComputeImagesStatistics application. An optional input mask can be provided, in which case only input image pixels whose corresponding mask value is greater than 0 will be processed. The remaining of pixels will be given the value 0 in the output image.
This section describes in details the parameters available for this application. Table 4.128, page 727 presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is PredictRegression.
Parameter key | Parameter type |
Parameter description |
in | Input image |
Input Image |
mask | Input image |
Input Mask |
model | Input File name |
Model file |
imstat | Input File name |
Statistics file |
out | Output image |
Output Image |
ram | Int |
Available RAM (Mb) |
inxml | XML input parameters file |
Load otb application from xml file |
outxml | XML output parameters file |
Save otb application to xml file |
|
||
|
||
|
||
|
||
|
To run this example in command-line, use the following:
To run this example from Python, use the following code snippet:
The input image must contain the feature bands used for the model training (without the predicted value). If a statistics file was used during training by the TrainRegression, it is mandatory to use the same statistics file for prediction. If an input mask is used, its size must match the input image size.
This application has been written by OTB-Team.
These additional ressources can be useful for further information: