5.4.6 Grid Based Image Resampling
Resamples an image according to a resampling grid
Detailed description
This application allows to perform image resampling from an input resampling grid.
Parameters
This section describes in details the parameters available for this application. Table 5.26, page 477
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) = (xin −
xout,yin−yout) |
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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Figure 5.26: Parameters table for Grid Based Image Resampling.
Input and output data
This group of parameters allows to set the input and output images.
- Input image: The input image to resample
- Output Image: The resampled output image
Resampling grid parameters
- Input resampling grid: The resampling grid
- Grid Type: Allows to choose between two grid types
Available choices are:
- Displacement grid: G(x_out,y_out) = (x_in−x_out,y_in−y_out): A deformation grid
contains at each grid position the offset to apply to this position in order to get to the
corresponding point in the input image to resample
- Localisation grid: G(x_out,y_out) = (x_in,y_in): A localisation grid contains at each
grid position the corresponding position in the input image to resample
Output Image parameters
Parameters of the output image
- Upper Left X: X Coordinate of the upper-left pixel of the output resampled image
- Upper Left Y: Y Coordinate of the upper-left pixel of the output resampled image
- Size X: Size of the output resampled image along X (in pixels)
- Size Y: Size of the output resampled image along Y (in pixels)
- Pixel Size X: Size of each pixel along X axis
- Pixel Size Y: Size of each pixel along Y axis
- Default value: The default value to give to pixel that falls outside of the input image.
Interpolation
This group of parameters allows to define how the input image will be interpolated during resampling.
Available choices are:
- Nearest Neighbor interpolation: Nearest neighbor interpolation leads to poor image quality,
but it is very fast.
- Linear interpolation: Linear interpolation leads to average image quality but is quite fast
- Bicubic interpolation
- Radius for bicubic interpolation: This parameter allows to control the size of the
bicubic interpolation filter. If the target pixel size is higher than the input pixel size,
increasing this parameter will reduce aliasing artefacts.
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:
- otbStereorecificationGridGeneration