4.4.6 Grid Based Image Resampling

Resamples an image according to a resampling grid

Detailed description

This application allows performing image resampling from an input resampling grid.

Parameters

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





Parameter key

Parameter type

Parameter description




io

Group

Input and output data

io.in

Input image

Input image

io.out

Output image

Output Image

grid

Group

Resampling grid parameters

grid.in

Input image

Input resampling grid

grid.type

Choices

Grid Type

grid.type def

Choice

Displacement grid: G(xout,yout) = (xinxout,yinyout)

grid.type loc

Choice

Localisation grid: G(xout,yout) = (xin,yin)

out

Group

Output Image parameters

out.ulx

Float

Upper Left X

out.uly

Float

Upper Left Y

out.sizex

Int

Size X

out.sizey

Int

Size Y

out.spacingx

Float

Pixel Size X

out.spacingy

Float

Pixel Size Y

out.default

Float

Default value

interpolator

Choices

Interpolation

interpolator nn

Choice

Nearest Neighbor interpolation

interpolator linear

Choice

Linear interpolation

interpolator bco

Choice

Bicubic interpolation

interpolator.bco.radius

Int

Radius for bicubic interpolation

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











Table 4.54: Parameters table for Grid Based Image Resampling.

Input and output data This group of parameters allows setting the input and output images.

Resampling grid parameters

Output Image parameters Parameters of the output image

Interpolation This group of parameters allows one to define how the input image will be interpolated during resampling. Available choices are:

Available RAM (Mb) Available memory for processing (in MB)

Load otb application from xml file Load otb application from xml file

Save otb application to xml file Save otb application to xml file

Example

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

otbcli_GridBasedImageResampling -io.in ROI_IKO_PAN_LesHalles_sub.tif -io.out ROI_IKO_PAN_LesHalles_sub_resampled.tif uint8 -grid.in ROI_IKO_PAN_LesHalles_sub_deformation_field.tif -out.sizex 256 -out.sizey 256 -grid.type def

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 GridBasedImageResampling application 
GridBasedImageResampling = otbApplication.Registry.CreateApplication("GridBasedImageResampling") 
 
# The following lines set all the application parameters: 
GridBasedImageResampling.SetParameterString("io.in", "ROI_IKO_PAN_LesHalles_sub.tif") 
 
GridBasedImageResampling.SetParameterString("io.out", "ROI_IKO_PAN_LesHalles_sub_resampled.tif") 
GridBasedImageResampling.SetParameterOutputImagePixelType("io.out", 1) 
 
GridBasedImageResampling.SetParameterString("grid.in", "ROI_IKO_PAN_LesHalles_sub_deformation_field.tif") 
 
GridBasedImageResampling.SetParameterInt("out.sizex", 256) 
 
GridBasedImageResampling.SetParameterInt("out.sizey", 256) 
 
GridBasedImageResampling.SetParameterString("grid.type","def") 
 
# The following line execute the application 
GridBasedImageResampling.ExecuteAndWriteOutput()

Limitations

None

Authors

This application has been written by OTB-Team.

See also

These additional ressources can be useful for further information: