Back to Index 

Geometry Menu


The Geometry menu provides a wide variety of commands for geometric image manipulation, such as scaling or resampling of images, combining images via mosaicing or insertion, computing and applying coordinate transformations, and rotating or mirroring images. These commands are useful for enlarging/reducing images (scaling), simulating image acquisition systems (resampling), adding text or grayscales to existing images (mosaicing or inserting), and registering images to maps or to other images (coordinate transforms).

The Horizontal Mosaic, Vertical Mosaic, General Mosaic, and Insert commands combine two images into a single image, and are therefore enabled only when there are two or more images on the desktop. All other commands are enabled for all types of images.


Average and Subsample

The Average and Subsample command resamples the input image by incrementally moving a window over the input image, and averaging the graylevel values of all pixels within the window. Parameters are the vertical and horizontal window size, and the increments for vertical and horizontal movement.

The graylevel of a pixel in the output image O is computed from the input image I as

where p and q are the vertical and horizontal window sizes, and delta-j and delta-k are the line and pixel increments, as specified in the dialog. An input image of size m-by-n-by-o results in an output image of size m-by--by-.

The Average and Subsample command smooths and reduces the size of the input image simultaneously. The amount of smoothing is dependent on the window size (the larger the window, the more the image is smoothed), while the reduction is directly proportional to the step increment (the larger the increment, the larger the reduction).


Window and Subsample

The Window and Subsample command extracts a window of pixels from the input image, and subsamples it to create the output image. Parameters are the coordinates of the pixels in the window’s upper left and lower right corner, and the subsample increments for the band, line, and pixel dimensions.

The graylevel of a pixel in the output image O is computed from the input image I as

where , , and are the coordinates of the first pixel to be subsampled, and delta-i, delta-j, and delta-k are the band, line and pixel increments, respectively, as specified in the dialog. The size of the output image is -by--by-, for an input image of size m-by-n-by-o.

The Window and Subsample command is useful for precisely extracting (and possibly subsampling) a subimage for further processing. If the size and location of the window to be extracted are not critical, and subsampling is not required, the Extraction tool may be used to quickly extract a subimage.


Scale

The Scale command performs linear scaling (reduction/enlargement) for the input image, independently in the horizontal and vertical direction. Parameters are the vertical and horizontal scale factors, the desired interpolation method, and, in the case of parametric cubic interpolation, an interpolation parameter a (which defaults to a value of -0.5).

The graylevel of a pixel in the output image O is computed from the input image I as

where and are the vertical and horizontal scale factors, respectively, as specified in the dialog. For a definition of the interpolation functions nni( ), bli( ), and pci( ), together with a discussion of the advantages and disadvantages of the individual methods, see the description of the Polynomial Warp command.


Rotate

The Rotate command rotates the current image by a user-specified angle. The resulting output image will generally be larger than the original image. Pixels that did not previously exist in the original image will be assigned a value as specified in Fill Graylevel: (default = 0.0 Black). A rotation matrix transformation is applied to the original image to produce the output image.


Mirror

The Mirror command mirrors the current image along one of four axes.

The graylevel of a pixel in the output image O is computed from an m-by-n-by-o input image I as

where the output image is of size m-by-n-by-o if the input image is mirrored along the vertical or along the horizontal axis, and of size m-by-o-by-n otherwise.


Control Points

Control Points command usage:

  1. Step 1 -- The user selects control points in each image.
    HIGHLY RECOMMENDED: Define the control points in the reference image in a particular sequence (Clockwise, right-to-left, etc.), then define the control points in the transformation image in the same sequence.
  2. Step 2 -- The user specifies the reference and transformation image for the Polynomial Warp command.
  3. Step 3 -- The user specifies the transformation model and selects the 1:1 correspondence of control points between the images.
    Control Point coordinate values
    may also be entered manually into the entry boxes -- bypassing the popup menu selection.
  4. Step 4 -- The command then computes the polynomial coefficients required to perform the Polynomial Warp command on an image.

Control points are defined for the reference and transformation image using the Control Points Tool. It is recommended to define the points on the reference image first, then define the points on the transformation image in the same order for matching convenience.

The coefficients (polynomial terms) are computed from the coordinates of a set of control points in both the image to be transformed and the reference image. Parameters are the number of control point pairs, the control point coordinates in both images, and the number of polynomial terms to be computed. The control point coordinates are retained between invocations of the Control Points command. The polynomial coefficients computed by the Control Points command are automatically transferred as defaults to the Polynomial Warp command (see below), which performs the actual coordinate transformation.

Given the coordinates of m control point pairs in the image, (Xi,Yi,) and in a reference coordinate system, (Xrefi,Yrefi), (1 <= i <= m), the Control Points command calculates a least-squares-fit polynomial to the set of control points by solving the following system of linear equations for the transformation coefficients (aj,bj), (1 <= j <= n):

Xi = a1 + a2*Xrefi + a3*Yrefi + a4*Xrefi*Yrefi + a5*Xrefi2 + a6*Yrefi2 , i = 1 to m.

Yi = b1 + b2*Xrefi + b3*Yrefi + b4*Xrefi*Yrefi + b5*Xrefi2 + b6*Yrefi2 , i = 1 to m.

Coordinates X and Y are in the coordinate system of the transformation image (the image that will be warped by the transformation), and coordinates (Xref,Yref) are in the coordinate system of the reference image. The number of control point pairs, m, and the number of polynomial terms, n, are as specified in the dialog.

Solving this system of linear equations requires that there be at least as many control point pairs as there are polynomial terms to be computed (i.e., m >= n). To solve the linear system, tclSADIE uses a matrix inversion technique. The matrix may become non-invertible (singular), if there are more than two control points lying on a common line (co-linearity condition). It is therefore recommended that the number of control point pairs always be larger than the number of polynomial terms, which also allows distribution of any errors in individual control point coordinates across the whole set of control points, as well as the computation of a meaningful transformation error.

For a more detailed discussion of geometric correction, please see R.A. Schowengerdt, Remote Sensing: Models and Methods for Image Processing, Academic Press, San Diego, CA, 1997.


Polynomial Warp

The Polynomial Warp command performs a coordinate transformation on the input (transformation) image. Parameters are the size of the image to be created, and a graylevel value to be used for pixels that do not exist in the original image (Fill Graylevel:). The transformation is determined by the number of polynomial terms, the values of the polynomial coefficients, the interpolation method, and, in the case of parametric cubic interpolation, an interpolation parameter a (which defaults to a value of -0.5). The default size of the output image is taken as the size of the input image. The number of polynomial terms and the polynomial coefficients are the most recent values specified and computed with the Control Points command.

The graylevel of a pixel in the output image O is computed from the input image I as

and nni( ), bli( ), and pci( ) represent the different interpolation functions, which, for an input image I of size m-by-n-by-o, are defined as follows.

where is the background (fill) graylevel, as specified in the dialog, and the function rnd( ) rounds its real-valued argument to the nearest integer.

The different interpolation methods offer a tradeoff between speed and accuracy. The nearest neighbor interpolation is fastest, whereas the parametric cubic interpolation is generally the most accurate; bi-linear interpolation is a compromise in speed and accuracy. The common cubic interpolation method has alpha = -1.0; however, alpha = -0.5 tends to give superior interpolation results. For a detailed discussion see S. K. Park and R. A. Schowengerdt, "Image Reconstruction by Parametric Cubic Convolution," Computer Vision, Graphics, and Image Processing, Vol. 23, No. 3 (September 1983), pp. 258-272.

The Polynomial Warp command is useful for registering an image (transformation image) to another image (reference image). The reference image is oftentimes a map of the surface of the earth produced in accordance with a standard map projection (UTM, State Plane, etc.). Note that the size of the output image should be equal to or greater than that of the reference image, to ensure that all of the common area is included in the warped (transformed) image.

For a more detailed discussion of geometric correction, please see R.A. Schowengerdt, Remote Sensing: Models and Methods for Image Processing, Academic Press, San Diego, CA, 1997.


Horizontal Mosaic

The Horizontal Mosaic command concatenates two images horizontally, with the right image vertically offset with respect to the left image. Parameters are the left image, the right image, a vertical offset between the images (which may be positive or negative), and a graylevel value to be used for background fill. The two images are chosen from pop-up menus of all images currently on the desktop. The images selected for mosaicing must have the same number of bands.

The graylevel of a pixel in the output image O is computed from the left input image I and the right input image J as

where delta-j is the vertical offset, and is the background (fill) graylevel, as specified in the dialog. The output image O is either of size m-by--by- (if delta-j < 0), or of size m-by--by- (if delta-j >= 0), for a left image of size m-by--by-, and a right image of size m-by--by-.

The Horizontal Mosaic command is useful for appending additional information (such as grayscales or textual annotations) to an image. Another use of the Horizontal Mosaic command is for visually comparing the contrast in multiple images. Due to tclSADIE’s automatic display stretch (Scaling On), mosaicing is one way of obtaining a relative comparison of the contrast in multiple images, since the composite image will be displayed with the same graylevel minimum and maximum. The background graylevel will only alter the contrast if it is outside the graylevel range of each one of the mosaiced images – but even then the contrast is altered equally in all images.


Vertical Mosaic

The Vertical Mosaic command concatenates two images vertically, with the top image horizontally offset with respect to the bottom image. Parameters are the top image, the bottom image, a horizontal offset between the images (which may be positive or negative), and a graylevel value to be used for background fill. The two images are chosen from pop-up menus of all images currently on the desktop. The images selected for mosaicing must have the same number of bands.

The graylevel of a pixel in the output image O is computed from the top input image I and the bottom input image J as

where delta-k is the horizontal offset, and is the background (fill) graylevel, as specified in the dialog. The output image O is either of size m-by--by- (if delta-k < 0), or of size m-by--by- (if delta-k >= 0), for a top image of size m-by--by-, and a bottom image of size m-by--by-.

The Vertical Mosaic command is useful for appending additional information (such as grayscales or textual annotations) to an image. Another use of the Vertical Mosaic command is for visually comparing the contrast in multiple images. Due to tclSADIE’s automatic display stretch (Scaling On), mosaicing is one way of obtaining a relative comparison of the contrast in multiple images, since the composite image will be displayed with the same graylevel minimum and maximum. The background graylevel will only alter the contrast if it is outside the graylevel range of each one of the mosaiced images – but even then the contrast is altered equally in all images.


General Mosaic

The General Mosaic command allows for composition of two images in an arbitrary fashion. The command creates an output image of the specified size, fills it with a background graylevel, and then places the images sequentially. Parameters are the size of the output image, the images (in order) to be combined, and the vertical and horizontal offsets for each image with respect to the origin of the output image. The two images are chosen from pop-up menus of all images currently on the desktop. The images selected for mosaicing must have the same number of bands. The input images must be positioned to be located completely inside the output image. If the two input images overlap, the first input image is overwritten.

The graylevel of a pixel in the output image O is computed from the input images I and J as

where and are the vertical and horizontal offsets, respectively, of the first image, and are the corresponding offsets for the second image, and is the background (fill) graylevel, as specified in the dialog.

The General Mosaic command is useful for appending additional information (such as grayscales or textual annotations) to an image. Another use of the General Mosaic command is for visually comparing the contrast in multiple images. Due to tclSADIE’s automatic display stretch (Scaling On), mosaicing is one way of obtaining a relative comparison of the contrast in multiple images, since the composite image will be displayed with the same graylevel minimum and maximum. The background graylevel will only alter the contrast if it is outside the graylevel range of each one of the mosaiced images – but even then the contrast is altered equally in all images.


Insert

The Insert command allows one image to be overlaid within another one. Parameters are the background image , the foreground image, and the offset of the foreground image with respect to the background image. The two images are chosen from pop-up menus of all images currently on the desktop. The images selected for insertion must have the same number of bands. The foreground image must be positioned to be located completely inside the background image.

The graylevel of a pixel in the output image O is computed from the background image I and the foreground image J as

where delta-j and delta-k are the vertical and horizontal offsets, respectively, as specified in the dialog. For a background image of size m-by--by-, and a foreground image of size m-by--by-, the output image is of size m-by--by-.

The Insert command is useful for inserting additional information (such as grayscales or textual annotations) into an image. It can also be used to create complex test targets, convolution kernels, or frequency filters by combining several simple images created with the File > New commands.


Last Updated: August 2000
University of Arizona
Electrical and Computer Engineering Department
Digital Image Analysis Laboratory © 1999,2000