4.4.11 Image resampling with a rigid transform

Resample an image with a rigid transform

Detailed description

This application performs a parametric transform on the input image. Scaling, translation and rotation with scaling factor are handled. Parameters of the transform is expressed in physical units, thus particular attention must be paid on pixel size (value, and sign). Moreover transform is expressed from input space to output space (on the contrary ITK Transforms are expressed form output space to input space).

Parameters

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





Parameter key

Parameter type

Parameter description




in

Input image

Input image

out

Output image

Output image

transform

Group

Transform parameters

transform.type

Choices

Type of transformation

transform.type id

Choice

id

transform.type translation

Choice

translation

transform.type rotation

Choice

rotation

transform.type.id.scalex

Float

X scaling

transform.type.id.scaley

Float

Y scaling

transform.type.translation.tx

Float

The X translation (in physical units)

transform.type.translation.ty

Float

The Y translation (in physical units)

transform.type.translation.scalex

Float

X scaling

transform.type.translation.scaley

Float

Y scaling

transform.type.rotation.angle

Float

Rotation angle

transform.type.rotation.scalex

Float

X scaling

transform.type.rotation.scaley

Float

Y scaling

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.64: Parameters table for Image resampling with a rigid transform.

Input image The input image to translate.

Output image The transformed output image.

Transform parameters This group of parameters allows setting the transformation to apply.

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

Available RAM (Mb) This allows setting the maximum amount of RAM available for processing. As the writing task is time consuming, it is better to write large pieces of data, which can be achieved by increasing this parameter (pay attention to your system capabilities)

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_RigidTransformResample -in qb_toulouse_sub.tif -out rigitTransformImage.tif -transform.type rotation -transform.type.rotation.angle 20 -transform.type.rotation.scalex 2. -transform.type.rotation.scaley 2.

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 RigidTransformResample application 
RigidTransformResample = otbApplication.Registry.CreateApplication("RigidTransformResample") 
 
# The following lines set all the application parameters: 
RigidTransformResample.SetParameterString("in", "qb_toulouse_sub.tif") 
 
RigidTransformResample.SetParameterString("out", "rigitTransformImage.tif") 
 
RigidTransformResample.SetParameterString("transform.type","rotation") 
 
RigidTransformResample.SetParameterFloat("transform.type.rotation.angle", 20) 
 
RigidTransformResample.SetParameterFloat("transform.type.rotation.scalex", 2.) 
 
RigidTransformResample.SetParameterFloat("transform.type.rotation.scaley", 2.) 
 
# The following line execute the application 
RigidTransformResample.ExecuteAndWriteOutput()

Limitations

None

Authors

This application has been written by OTB-Team.

See also

These additional ressources can be useful for further information: