STScI Logo

imlintran images.imgeom


NAME · USAGE · PARAMETERS · DESCRIPTION · TIMINGS · EXAMPLES
BUGS · SEE_ALSO

NAME

imlintran -- shift, scale, rotate a list of images

USAGE

imlintran input output xrotation yrotation xmag ymag

PARAMETERS

input
List of images to be transformed.
output
List of output images.
xrotation, yrotation
Angle of rotation of points on the image axes in degrees. Positive angles rotate in a counter-clockwise sense around the x axis. For a normal coordinate axes rotation xrotation and yrotation should be the same. A simple y axis flip can be introduced by make yrotation equal to xrotation plus 180 degrees. An axis skew can be intoduced by making the angle between xrotation and yrotation other than a multiple of 90 degrees.
xmag, ymag
The number of input pixels per output pixel in x and y. The magnifications must always be positive numbers. Numbers less than 1 magnify the image; numbers greater than one reduce the image.
xin = INDEF, yin = INDEF
The origin of the input picture in pixels. Xin and yin default to the center of the input image.
xout = INDEF, yout = INDEF
The origin of the output image. Xout and yout default to the center of the output image.
ncols = INDEF, nlines = INDEF
The number of columns and rows in the output image. The default is to keep the dimensions the same as the input image. If ncols and nrows are less than or equal to zero then the task computes the number of rows and columns required to include the whole input image, excluding the effects of any origin shift.
interpolant = "linear"
The choices are the following.
nearest
Nearest neighbour.
linear
Bilinear interpolation in x and y.
poly3
Third order interior polynomial in x and y.
poly5
Fifth order interior polynomial in x and y.
spline3
Bicubic spline.
sinc
2D sinc interpolation. Users can specify the sinc interpolant width by appending a width value to the interpolant string, e.g. sinc51 specifies a 51 by 51 pixel wide sinc interpolant. The sinc width will be rounded up to the nearest odd number. The default sinc width is 31 by 31.
lsinc
Look-up table sinc interpolation. Users can specify the look-up table sinc interpolant width by appending a width value to the interpolant string, e.g. lsinc51 specifies a 51 by 51 pixel wide look-up table sinc interpolant. The user supplied sinc width will be rounded up to the nearest odd number. The default sinc width is 31 by 31 pixels. Users can specify the resolution of the lookup table sinc by appending the look-up table size in square brackets to the interpolant string, e.g. lsinc51[20] specifies a 20 by 20 element sinc look-up table interpolant with a pixel resolution of 0.05 pixels in x and y. The default look-up table size and resolution are 20 by 20 and 0.05 pixels in x and y respectively.
drizzle
2D drizzle resampling. Users can specify the drizzle pixel fraction in x and y by appending a value between 0.0 and 1.0 in square brackets to the interpolant string, e.g. drizzle[0.5]. The default value is 1.0. The value 0.0 is increased internally to 0.001. Drizzle resampling with a pixel fraction of 1.0 in x and y is equivalent to fractional pixel rotated block summing (fluxconserve = yes) or averaging (flux_conserve = no) if xmag and ymag are > 1.0.
boundary = "nearest"
The choices are:
nearest
Use the value of the nearest boundary pixel.
constant
Use a constant value.
reflect
Generate value by reflecting about the boundary.
wrap
Generate a value by wrapping around to the opposite side of the image.
constant = 0.
The value of the constant for boundary extension.
fluxconserve = yes
Preserve the total image flux?
nxblock = 512, nyblock = 512
If the size of the output image is less than nxblock by nyblock then the entire image is transformed at once. Otherwise the output image is computed in blocks of nxblock by nxblock pixels.

DESCRIPTION

IMLINTRAN linearly transforms a the list of images in input using rotatiion angles and magnification factors supplied by the user and writes the output images into output. The coordinate transformation from input to output image is described below.

    1. subtract the origin

    xt = x(input) - xin
    yt = y(input) - yin

    2. scale the image

    xt = xt / xmag + yt / ymag
    yt = xt / xmag + yt / ymag

    3. rotate the image

    xt = xt * cos (xrotation) - yt * sin (yrotation)
    yt = xt * sin (yrotation) + yt * cos (yrotation)

    4. new orgin

    x(output) = xt + xout
    y(output) = yt + yout

The output image gray levels are determined by interpolating in the input image at the positions of the transformed output pixels using the inverse of the above transformation. IMLINTRAN uses the routines in the 2-D interpolation package.

TIMINGS

It requires approximately 70 and 290 cpu seconds respectively to linearly transform a 512 by 512 real image using bilinear and biquintic interpolation respectively (Vax 11/750 fpa).

EXAMPLES

1. Rotate an image 45 degrees around its center and magnify
   the image by a factor of 2. in each direction.

   cl> imlintran n4151 n4151rm 45.0 45.0 0.50 0.50

2. Rotate the axes of an image by 45 degrees around 100. and 100.,
   shift the orgin to 150. and 150. and flip the y axis.

   cl> imlintran n1068 n1068r 45.0 225.0 1.0 1.0 xin=100. yin=100. \
   >>> xout=150. yout=150.

3. Rotate an image by 45 degrees and reduce the the scale in x and y
   by a factor of 1.5

   cl> imlintran n7026 n7026rm 45.0 45.0 1.5 1.5

BUGS

SEE ALSO

imshift, magnify, rotate, lintran, register, geotran, geomap


Search Form · STSDAS