Standard Library procedure that calculates the coefficients needed for apolynomial image warping transformation.
yd The vector containing the y-coordinates to be fit as a function of (xin, yin).
xin The vector containing the independent x-coordinates. Must have the same number of points as xd.
yin The vector containing the independent y-coordinates. Must have the same number of points as yd.
deg The degree of the polynomial to be fitted to the data. The number of coordinate pairs formed by xin and yin must be greater than or equal to (deg + 1)2.
ym A (deg + 1)-by-(deg + 1) array containing the coefficients of yd as a function of (xin, yin).
NOTE: The xm (x-coefficients) and ym (y-coefficients) can be used as input for the POLY_2D function. POLY_2D performs the actual warping of the image, using the x and y transformation coefficients that you provide.
image = BYTSCL(DIST(300)) WINDOW, XSize=300, YSize=300 TV, image
xin = [100, 200, 200, 100] yin = [200, 200, 100, 100] XYOUTS, 100, 200, '0', /Device XYOUTS, 200, 200, '1', /Device XYOUTS, 200, 100, '2', /Device XYOUTS, 100, 100, '3', /Device
xd = INTARR(4) yd = INTARR(4) FOR i=0,3 DO BEGIN
PRINT, 'Pick warped point ', i
CURSOR, xt, yt, /Device
WAIT, 0.5
xd(i) = xt
yd(i) = yt
ENDFOR
deg = 1 POLYWARP, xd, yd, xin, yin, deg, xm, ym
interp = 1 result = POLY_2D(image, xm, ym, interp)
TVSCL, result
For more information on image processing, see Chapter 5, Displaying 3D Data, in the PV-WAVE User's Guide.
For additional information, see Geometric Transformations in Chapter 6 of the PV-WAVE User's Guide.