Rescale

This application is deprecated and will be removed in a future release.

Rescale the image between two given values.

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). Input minimum and maximum values is automatically computed for all image bands.

This application has several output images and supports “multi-writing”. Instead of computing and writing each image independently, the streamed image blocks are written in a synchronous way for each output. The output images will be computed strip by strip, using the available RAM to compute the strip size, and a user defined streaming mode can be specified using the streaming extended filenames (type, mode and value). Note that multi-writing can be disabled using the multi-write extended filename option: &multiwrite=false, in this case the output images will be written one by one. Note that multi-writing is not supported for MPI writers.

Parameters

Input Image -in image Mandatory
The image to scale.

Output Image -out image [dtype] Mandatory
The rescaled image filename.

Output min value -outmin float Default value: 0
Minimum value of the output image.

Output max value -outmax float Default value: 255
Maximum value of the output image.

Available RAM (MB) -ram int Default value: 256
Available memory for processing (in MB).

Examples

From the command-line:

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

From Python:

import otbApplication

app = otbApplication.Registry.CreateApplication("Rescale")

app.SetParameterString("in", "QB_Toulouse_Ortho_PAN.tif")
app.SetParameterString("out", "rescaledImage.png")
app.SetParameterOutputImagePixelType("out", 1)
app.SetParameterFloat("outmin", 0)
app.SetParameterFloat("outmax", 255)

app.ExecuteAndWriteOutput()

See also