Changeset 125 for trunk/SRC/Interpolation/square2quadrilateral.pro
- Timestamp:
- 07/06/06 16:10:25 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Interpolation/square2quadrilateral.pro
r121 r125 1 1 ;+ 2 2 ; 3 ; @file_comments warm (or map) a unit square onto an arbitrary quadrilateral 3 ; @file_comments 4 ; warm (or map) a unit square onto an arbitrary quadrilateral 4 5 ; according to the 4-point correspondences: 5 6 ; (0,0) -> (x0,y0) … … 13 14 ; @categories image, grid manipulation 14 15 ; 15 ; 16 ; @param x0in {in}{required} the coordinates of the quadrilateral 17 ; (see above for correspondance with the unit square). Can be 18 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 19 ; given in the anticlockwise order. 20 ; @param y0in {in}{required} the coordinates of the quadrilateral 21 ; (see above for correspondance with the unit square). Can be 22 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 23 ; given in the anticlockwise order. 24 ; @param x1in {in}{required} the coordinates of the quadrilateral 25 ; (see above for correspondance with the unit square). Can be 26 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 27 ; given in the anticlockwise order. 28 ; @param y1in {in}{required} the coordinates of the quadrilateral 29 ; (see above for correspondance with the unit square). Can be 30 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 31 ; given in the anticlockwise order. 32 ; @param x2in {in}{required} the coordinates of the quadrilateral 33 ; (see above for correspondance with the unit square). Can be 34 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 35 ; given in the anticlockwise order. 36 ; @param y2in {in}{required} the coordinates of the quadrilateral 37 ; (see above for correspondance with the unit square). Can be 38 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 39 ; given in the anticlockwise order. 40 ; @param x3in {in}{required} the coordinates of the quadrilateral 41 ; (see above for correspondance with the unit square). Can be 42 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 43 ; given in the anticlockwise order. 44 ; @param y3in {in}{required} the coordinates of the quadrilateral 45 ; (see above for correspondance with the unit square). Can be 46 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 47 ; given in the anticlockwise order. 48 ; 49 ; @param xxin {in}{optional} the coordinates of the point(s) for which we want to do the 16 ; @param x0in {in}{required} the coordinates of the quadrilateral 17 ; (see above for correspondance with the unit square). Can be 18 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 19 ; given in the anticlockwise order. 20 ; @param y0in {in}{required} the coordinates of the quadrilateral 21 ; (see above for correspondance with the unit square). Can be 22 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 23 ; given in the anticlockwise order. 24 ; @param x1in {in}{required} the coordinates of the quadrilateral 25 ; (see above for correspondance with the unit square). Can be 26 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 27 ; given in the anticlockwise order. 28 ; @param y1in {in}{required} the coordinates of the quadrilateral 29 ; (see above for correspondance with the unit square). Can be 30 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 31 ; given in the anticlockwise order. 32 ; @param x2in {in}{required} the coordinates of the quadrilateral 33 ; (see above for correspondance with the unit square). Can be 34 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 35 ; given in the anticlockwise order. 36 ; @param y2in {in}{required} the coordinates of the quadrilateral 37 ; (see above for correspondance with the unit square). Can be 38 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 39 ; given in the anticlockwise order. 40 ; @param x3in {in}{required} the coordinates of the quadrilateral 41 ; (see above for correspondance with the unit square). Can be 42 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 43 ; given in the anticlockwise order. 44 ; @param y3in {in}{required} the coordinates of the quadrilateral 45 ; (see above for correspondance with the unit square). Can be 46 ; scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are 47 ; given in the anticlockwise order. 48 ; 49 ; @param xxin {in}{optional} the coordinates of the point(s) for which we want to do the 50 50 ; mapping. Can be scalar or array. 51 ; 51 ; @param yyin {in}{optional} the coordinates of the point(s) for which we want to do the 52 52 ; mapping. Can be scalar or array. 53 53 ; … … 55 55 ; 56 56 ; (2,n) array: the new coodinates (xout, yout) of the (xin,yin) 57 ; point(s) after mapping. 57 ; point(s) after mapping. 58 58 ; If xin is a scalar, then n is equal to the number of elements of 59 59 ; x0. If xin is an array , then n is equal to the number of 60 60 ; elements of xin. 61 61 ; If xin and yin are omited, square2quadrilateral returns the 62 ; matrix A which is used for the inverse transformation. 62 ; matrix A which is used for the inverse transformation. 63 63 ; 64 64 ; … … 66 66 ; twisted) is not work. This has to be tested. 67 67 ; 68 ; @examples 68 ; @examples 69 69 ; 70 70 ; IDL> splot,[0,5],[0,3],/nodata,xstyle=1,ystyle=1 … … 81 81 ; IEEE Computer Society Press, Los Alamitos, California 82 82 ; Chapter 3, see p 52-56 83 ; 83 ; 84 84 ; 85 85 ; @version $Id$ … … 127 127 ; 128 128 IF keyword_set(double) THEN a = dblarr(8, n_elements(x0)) $ 129 ELSE a = fltarr(8, n_elements(x0)) 129 ELSE a = fltarr(8, n_elements(x0)) 130 130 ; 131 131 delx3 = x0-x1+x2-x3 … … 161 161 yy2 = y2[projectivemap] 162 162 yy3 = y3[projectivemap] 163 ; 163 ; 164 164 delx1 = xx1-xx2 165 165 dely1 = yy1-yy2 … … 186 186 a[7, projectivemap] = a23 187 187 ENDIF 188 ; 188 ; 189 189 IF NOT arg_present(xxin) THEN return, a 190 190 ; 191 191 IF n_elements(xin) EQ 1 THEN BEGIN 192 xin = replicate(xin, n_elements(x0)) 193 yin = replicate(yin, n_elements(x0)) 192 xin = replicate(xin, n_elements(x0)) 193 yin = replicate(yin, n_elements(x0)) 194 194 ENDIF 195 195 ;
Note: See TracChangeset
for help on using the changeset viewer.