Standard Library procedure that calculates the coefficients needed for apolynomial image warping transformation.
yd
xin
yin
deg
ym
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.