4.1.11 Rescale Image

Rescale the image between two given values.

Detailed description

This application scales the given image pixel intensity between two given values. By default min (resp. max) value is set to 0 (resp. 255).

Parameters

This section describes in details the parameters available for this application. Table 4.22, page 442 presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is Rescale.





Parameter key

Parameter type

Parameter description




in

Input image

Input Image

out

Output image

Output Image

ram

Int

Available RAM (Mb)

outmin

Float

Output min value

outmax

Float

Output max value

inxml

XML input parameters file

Load otb application from xml file

outxml

XML output parameters file

Save otb application to xml file











Table 4.22: Parameters table for Rescale Image.

Example

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

otbcli_Rescale -in QB_Toulouse_Ortho_PAN.tif -out rescaledImage.png uchar -outmin 0 -outmax 255

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 Rescale application 
Rescale = otbApplication.Registry.CreateApplication("Rescale") 
 
# The following lines set all the application parameters: 
Rescale.SetParameterString("in", "QB_Toulouse_Ortho_PAN.tif") 
 
Rescale.SetParameterString("out", "rescaledImage.png") 
Rescale.SetParameterOutputImagePixelType("out", 1) 
 
Rescale.SetParameterFloat("outmin", 0) 
 
Rescale.SetParameterFloat("outmax", 255) 
 
# The following line execute the application 
Rescale.ExecuteAndWriteOutput()

Limitations

None

Authors

This application has been written by OTB-Team.