AFFINE Function
Standard Library function that applies an affine transformation to an array.
enabled.
Usage
result = AFFINE(a, b[, c])
Input Parameters
a—An n-dimensional array.
b—An invertible (n,n) array.
c—An n-element vector (optional).
Returned Value
result—An array representing a (and of the same dimensions as a) under the coordinate transformation y = b#x + c, where y and x are coordinates for the result and for a, respectively, which differ from array index coordinates by a simple translation to the array centroid.
Keywords
Ev—A scalar used to replace extrapolated values. By default, the values in the transformed array are obtained by nearest neighbor interpolation of the input array. Extrapolated values can be replaced with the scalar Ev.
Blin—If a is 2-dimensional and Blin is set then bilinear interpolation is used instead of the default nearest-neighbor interpolation. If Blin is set then Ev must also be set.
Discussion
AFFINE generalizes the common image processing tasks of rotation and translation to ND arrays and to general invertible affine transformations.
Example
; Make a 3d array representing a 24-bit image, and display the 
; image
a = ALLAN(640,512)
WINDOW, 0
TV, a, True=3
 
; Make system variable containing a 20-degree z-axis rotation 
; matrix
T3D, /Reset, Rotate=[0,0,20]
 
; Apply the rotation to the image; display result in another 
; window
d = AFFINE( a, !p.t(0:2,0:2), Ev=0 )
WINDOW, 1
TV, d, True=3