.help imlintran Dec98 images.imgeom .ih NAME imlintran -- shift, scale, rotate a list of images .ih USAGE imlintran input output xrotation yrotation xmag ymag .ih PARAMETERS .ls input List of images to be transformed. .le .ls output List of output images. .le .ls 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 introduced by making the angle between xrotation and yrotation other than a multiple of 90 degrees. .le .ls 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. .le .ls xin = INDEF, yin = INDEF The origin of the input picture in pixels. Xin and yin default to the center of the input image. .le .ls xout = INDEF, yout = INDEF The origin of the output image. Xout and yout default to the center of the output image. .le .ls 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. .le .ls interpolant = "linear" The choices are the following. .ls nearest Nearest neighbor. .le .ls linear Bilinear interpolation in x and y. .le .ls poly3 Third order interior polynomial in x and y. .le .ls poly5 Fifth order interior polynomial in x and y. .le .ls spline3 Bicubic spline. .le .ls 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. .le .ls 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. .le .ls 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. .le .le .ls boundary = "nearest" The choices are: .ls nearest Use the value of the nearest boundary pixel. .le .ls constant Use a constant value. .le .ls reflect Generate value by reflecting about the boundary. .le .ls wrap Generate a value by wrapping around to the opposite side of the image. .le .le .ls constant = 0. The value of the constant for boundary extension. .le .ls fluxconserve = yes Preserve the total image flux? .le .ls 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. .le .ih DESCRIPTION IMLINTRAN linearly transforms a the list of images in input using rotation 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. .nf 1. subtract the origin xt = x(input) - xin yt = y(input) - yin 2. scale the image xt = xt / xmag yt = xt / xmag 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 .fi 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. .ih 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). .ih EXAMPLES .nf 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 scale in x and y by a factor of 1.5 cl> imlintran n7026 n7026rm 45.0 45.0 1.5 1.5 .fi .ih BUGS .ih SEE ALSO imshift, magnify, rotate, lintran, register, geotran, geomap .endhelp