Overview of Warping Images

In image processing, image warping is used primarily to correct optical distortions introduced by camera lenses, or to register images acquired from either different perspectives or different sensors. When correcting optical distortions, the original image may be registered to a regular grid rather than to another image. In image warping, corresponding control points (selected in the input and reference images) control the geometry of the warping transformation. The arrays of control points from the original input image, Xi and Yi, are stretched to conform to the control point arrays Xo and Yo, designated in the reference image. Because these transformations are frequently nonlinear, image warping is often known as rubber sheeting. For general tips regarding control point selection see Tips for Selecting Control Points.

Image warping in IDL is a three-step process. First, control points are selected between two displayed images or between an image and a grid. Second, the resulting arrays of control points, Xi, Yi, Xo, and Yo, are then input into one of IDL's warping routines. Third, the warped image resulting from the translation of the Xi, Yi points to the Xo, Yo points, is displayed. It is often useful to display the warped image as a transparency, overlaying the reference image. For more information on creating transparencies with Direct and Object Graphics, see Creating Transparent Image Overlays.

The following table introduces the tasks and routines covered in this chapter.

Table 5-1: Image Warping Tasks and Routines  

Task
Routine
Description

Creating a Direct Graphics Display of Image Warping

See Warping Images Using Direct Graphics.

WSET

CURSOR

Set the window focus and select control point coordinates.

WARP_TRI

Warp the images using WARP_TRI's triangulation and interpolation.

POLYWARP

Create arrays of polynomial coefficients from the control point arrays before using POLY_2D.

POLY_2D

Warp the images using the polynomial warping functions of POLY_2D.

XPALETTE

Use XPALETTE to view a color table.

Creating an Object Graphics Display of Image Warping

See Warping Image Objects (Object Programming).

IDLgrPalette::Init

Create a palette object.

XROI

Select control points using the XROI utility.

WARP_TRI

Warp the input image to the reference image using the triangulation and interpolation functions of WARP_TRI.

SIZE

BYTARR

Change the warped image into a RGB image containing an alpha channel to enable transparency.

IDLgrImage::Init

Initialize transparent image and base image objects.

IDLgrWindow::Init

IDLgrView::Init

IDLgrModel::Init

Initialize the objects necessary for an Object Graphics display.

Tips for Selecting Control Points

Both examples in this chapter use control points to define the image warping transformation. To produce accurate results, use the following guidelines when selecting corresponding control points: