[89] | 1 | |
---|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
| 3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
| 4 | |
---|
| 5 | <!-- Generated by IDLdoc 2.0 --> |
---|
| 6 | |
---|
| 7 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
---|
| 8 | <head> |
---|
[104] | 9 | <title>quadrilateral2square.pro (SAXO Documentation)</title> |
---|
[89] | 10 | |
---|
| 11 | |
---|
| 12 | <link rel="stylesheet" type="text/css" media="all" href="./../main_files.css" /> |
---|
| 13 | <link rel="stylesheet" type="text/css" media="print" href="./../main_files_print.css" /> |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | <script type="text/javascript"> |
---|
| 17 | function setTitle() { |
---|
[104] | 18 | parent.document.title="quadrilateral2square.pro (SAXO Documentation)"; |
---|
[89] | 19 | } |
---|
| 20 | </script> |
---|
| 21 | </head> |
---|
| 22 | |
---|
| 23 | <body onload="setTitle();"> |
---|
| 24 | |
---|
| 25 | <div id="navbar_title"> |
---|
[104] | 26 | <h1>SAXO Documentation</h1> |
---|
[89] | 27 | </div> |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | <div id="main_navbar"> |
---|
| 31 | |
---|
| 32 | <table cellspacing="0"> |
---|
| 33 | <tr> |
---|
| 34 | |
---|
| 35 | <td><a href="./../overview.html?format=raw" title="Overview of library">Overview</a></td> |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | <td >Directory</td> |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | <td><a href="./../idldoc-categories.html?format=raw" title="Browse library by category">Categories</a></td> |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | <td><a href="./../idldoc-index.html?format=raw" title="Index of files, routines, and parameters">Index</a></td> |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | <td><a href="./../search-page.html?format=raw" title="Search library">Search</a></td> |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | <td id="selected">File</td> |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | <td >Source</td> |
---|
| 58 | |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | <td><a href="./../idldoc-help.html?format=raw" title="Help on IDLdoc">Help</a></td> |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | <td >Etc</td> |
---|
| 65 | |
---|
| 66 | <td id="flexible">Developer documentation</td> |
---|
| 67 | </tr> |
---|
| 68 | </table> |
---|
| 69 | |
---|
| 70 | </div> |
---|
| 71 | |
---|
| 72 | <div id="secondary_navbar"> |
---|
| 73 | |
---|
| 74 | <a href="neighbor.html"><<prev file</a> | <a href="spl_fstdrv.html">next file >></a> <a href="quadrilateral2square.html" target="_TOP">view single page</a> | <a href="./../index.html?format=raw" target="_TOP">view frames</a> summary: fields | routine details: <a href="#routine_details">routine</a> |
---|
| 75 | |
---|
| 76 | </div> |
---|
| 77 | |
---|
| 78 | |
---|
| 79 | <div id="container"> |
---|
| 80 | |
---|
| 81 | <h1 class="directory"><a href="directory-overview.html?format=raw">Interpolation/</a></h1> |
---|
| 82 | <h2 class="pro_file">quadrilateral2square.pro</h2> |
---|
| 83 | |
---|
| 84 | <div id="file_attr"> |
---|
| 85 | <dl> |
---|
| 86 | </dl> |
---|
| 87 | </div> |
---|
| 88 | |
---|
[101] | 89 | <div id="file_comments"> warm (or map) an arbitrary quadrilateral onto a unit square |
---|
| 90 | according to the 4-point correspondences: |
---|
| 91 | (x0,y0) -> (0,0) |
---|
| 92 | (x1,y1) -> (1,0) |
---|
| 93 | (x2,y2) -> (1,1) |
---|
| 94 | (x3,y3) -> (0,1) |
---|
| 95 | This is the inverse function of square2quadrilateral.pro |
---|
| 96 | The mapping is done using perspective transformation which preserve |
---|
| 97 | lines in all orientations and permit quadrilateral to quadrilateral |
---|
| 98 | mappings. see ref. bellow. |
---|
| 99 | </div> |
---|
[89] | 100 | |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | |
---|
| 108 | |
---|
| 109 | <div id="routine_details"> |
---|
| 110 | |
---|
| 111 | |
---|
| 112 | <div class="routine_details" id="_quadrilateral2square"> |
---|
| 113 | |
---|
[101] | 114 | <h2><a class="top" href="#container">top</a>quadrilateral2square <span class="categories"> image, grid manipulation |
---|
| 115 | </span></h2> |
---|
[89] | 116 | |
---|
| 117 | <p class="header"> |
---|
| 118 | <span class="result">result = </span>quadrilateral2square(<span class="result"><a href="#_quadrilateral2square_param_x0in">x0in</a>, <a href="#_quadrilateral2square_param_y0in">y0in</a>, <a href="#_quadrilateral2square_param_x1in">x1in</a>, <a href="#_quadrilateral2square_param_y1in">y1in</a>, <a href="#_quadrilateral2square_param_x2in">x2in</a>, <a href="#_quadrilateral2square_param_y2in">y2in</a>, <a href="#_quadrilateral2square_param_x3in">x3in</a>, <a href="#_quadrilateral2square_param_y3in">y3in</a>, <a href="#_quadrilateral2square_param_xxin">xxin</a>, <a href="#_quadrilateral2square_param_yyin">yyin</a></span>, <a href="#_quadrilateral2square_keyword_PERF">PERF</a>=<span class="result">PERF</span>)</p> |
---|
| 119 | |
---|
| 120 | <div class="comments"> |
---|
[101] | 121 | </div> |
---|
[89] | 122 | |
---|
[101] | 123 | <h3>Return value</h3><div class="value"> |
---|
[89] | 124 | |
---|
| 125 | (2,n) array: the new coodinates (xout, yout) of the (xin,yin) |
---|
| 126 | point(s) after mapping. |
---|
| 127 | If xin is a scalar, then n is equal to the number of elements of |
---|
| 128 | x0. If xin is an array , then n is equal to the number of |
---|
| 129 | elements of xin. |
---|
[101] | 130 | </div> |
---|
[89] | 131 | |
---|
| 132 | |
---|
| 133 | <h3>Parameters</h3> |
---|
| 134 | |
---|
| 135 | |
---|
| 136 | <h4 id="_quadrilateral2square_param_x0in">x0in |
---|
[101] | 137 | <span class="attr">in</span> |
---|
[89] | 138 | |
---|
| 139 | |
---|
[101] | 140 | <span class="attr">required</span> |
---|
[89] | 141 | |
---|
| 142 | |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | </h4> |
---|
| 146 | |
---|
[101] | 147 | <div class="comments"> the coordinates of the quadrilateral</div> |
---|
[89] | 148 | |
---|
| 149 | <h4 id="_quadrilateral2square_param_y0in">y0in |
---|
[101] | 150 | <span class="attr">in</span> |
---|
[89] | 151 | |
---|
| 152 | |
---|
[101] | 153 | <span class="attr">required</span> |
---|
[89] | 154 | |
---|
| 155 | |
---|
| 156 | |
---|
| 157 | |
---|
| 158 | </h4> |
---|
| 159 | |
---|
[101] | 160 | <div class="comments"> the coordinates of the quadrilateral</div> |
---|
[89] | 161 | |
---|
| 162 | <h4 id="_quadrilateral2square_param_x1in">x1in |
---|
[101] | 163 | <span class="attr">in</span> |
---|
[89] | 164 | |
---|
| 165 | |
---|
[101] | 166 | <span class="attr">required</span> |
---|
[89] | 167 | |
---|
| 168 | |
---|
| 169 | |
---|
| 170 | |
---|
| 171 | </h4> |
---|
| 172 | |
---|
[101] | 173 | <div class="comments"> the coordinates of the quadrilateral</div> |
---|
[89] | 174 | |
---|
| 175 | <h4 id="_quadrilateral2square_param_y1in">y1in |
---|
[101] | 176 | <span class="attr">in</span> |
---|
[89] | 177 | |
---|
| 178 | |
---|
[101] | 179 | <span class="attr">required</span> |
---|
[89] | 180 | |
---|
| 181 | |
---|
| 182 | |
---|
| 183 | |
---|
| 184 | </h4> |
---|
| 185 | |
---|
[101] | 186 | <div class="comments"> the coordinates of the quadrilateral</div> |
---|
[89] | 187 | |
---|
| 188 | <h4 id="_quadrilateral2square_param_x2in">x2in |
---|
[101] | 189 | <span class="attr">in</span> |
---|
[89] | 190 | |
---|
| 191 | |
---|
[101] | 192 | <span class="attr">required</span> |
---|
[89] | 193 | |
---|
| 194 | |
---|
| 195 | |
---|
| 196 | |
---|
| 197 | </h4> |
---|
| 198 | |
---|
[101] | 199 | <div class="comments"> the coordinates of the quadrilateral</div> |
---|
[89] | 200 | |
---|
| 201 | <h4 id="_quadrilateral2square_param_y2in">y2in |
---|
[101] | 202 | <span class="attr">in</span> |
---|
[89] | 203 | |
---|
| 204 | |
---|
[101] | 205 | <span class="attr">required</span> |
---|
[89] | 206 | |
---|
| 207 | |
---|
| 208 | |
---|
| 209 | |
---|
| 210 | </h4> |
---|
| 211 | |
---|
[101] | 212 | <div class="comments"> the coordinates of the quadrilateral</div> |
---|
[89] | 213 | |
---|
| 214 | <h4 id="_quadrilateral2square_param_x3in">x3in |
---|
[101] | 215 | <span class="attr">in</span> |
---|
[89] | 216 | |
---|
| 217 | |
---|
[101] | 218 | <span class="attr">required</span> |
---|
[89] | 219 | |
---|
| 220 | |
---|
| 221 | |
---|
| 222 | |
---|
| 223 | </h4> |
---|
| 224 | |
---|
[101] | 225 | <div class="comments"> the coordinates of the quadrilateral</div> |
---|
[89] | 226 | |
---|
| 227 | <h4 id="_quadrilateral2square_param_y3in">y3in |
---|
[101] | 228 | <span class="attr">in</span> |
---|
[89] | 229 | |
---|
| 230 | |
---|
[101] | 231 | <span class="attr">required</span> |
---|
[89] | 232 | |
---|
| 233 | |
---|
| 234 | |
---|
| 235 | |
---|
| 236 | </h4> |
---|
| 237 | |
---|
[101] | 238 | <div class="comments"> the coordinates of the quadrilateral |
---|
| 239 | (see above for correspondance with the unit square). Can be |
---|
| 240 | scalar or array. (x0,y0), (x1,y1), (x2,y2) and (x3,y3) are |
---|
| 241 | given in the anticlockwise order. |
---|
| 242 | </div> |
---|
[89] | 243 | |
---|
| 244 | <h4 id="_quadrilateral2square_param_xxin">xxin |
---|
[101] | 245 | <span class="attr">in</span> |
---|
[89] | 246 | |
---|
| 247 | |
---|
[101] | 248 | <span class="attr">required</span> |
---|
[89] | 249 | |
---|
| 250 | |
---|
| 251 | |
---|
| 252 | |
---|
| 253 | </h4> |
---|
| 254 | |
---|
[101] | 255 | <div class="comments"> the coordinates of the point(s) for which we want to do the |
---|
| 256 | mapping. Can be scalar or array.</div> |
---|
[89] | 257 | |
---|
| 258 | <h4 id="_quadrilateral2square_param_yyin">yyin |
---|
[101] | 259 | <span class="attr">in</span> |
---|
[89] | 260 | |
---|
| 261 | |
---|
[101] | 262 | <span class="attr">required</span> |
---|
[89] | 263 | |
---|
| 264 | |
---|
| 265 | |
---|
| 266 | |
---|
| 267 | </h4> |
---|
| 268 | |
---|
[101] | 269 | <div class="comments"> the coordinates of the point(s) for which we want to do the |
---|
| 270 | mapping. Can be scalar or array. |
---|
| 271 | </div> |
---|
[89] | 272 | |
---|
| 273 | |
---|
| 274 | |
---|
| 275 | |
---|
| 276 | |
---|
| 277 | |
---|
| 278 | <h3>Keywords</h3> |
---|
| 279 | |
---|
| 280 | <h4 id="_quadrilateral2square_keyword_PERF">PERF |
---|
| 281 | |
---|
| 282 | |
---|
| 283 | |
---|
| 284 | |
---|
| 285 | |
---|
| 286 | |
---|
| 287 | |
---|
| 288 | |
---|
| 289 | </h4> |
---|
| 290 | |
---|
| 291 | <div class="comments"></div> |
---|
| 292 | |
---|
| 293 | |
---|
| 294 | |
---|
[101] | 295 | <h3>Examples</h3><div class="value"> |
---|
| 296 | |
---|
| 297 | res = square2quadrilateral(x0,y0,x1,y1,x2,y2,x3,y3,xin,yin) |
---|
| 298 | |
---|
| 299 | |
---|
| 300 | |
---|
| 301 | IDL> splot,[0,5],[0,3],/nodata,xstyle=1,ystyle=1 |
---|
| 302 | IDL> tracegrille, findgen(11)*.1, findgen(11)*.1,color=indgen(12)*20 |
---|
| 303 | IDL> xin = (findgen(11)*.1)#replicate(1, 11) |
---|
| 304 | IDL> yin = replicate(1, 11)#(findgen(11)*.1) |
---|
| 305 | IDL> out = square2quadrilateral(2,1,3,0,5,1,2,3, xin, yin) |
---|
| 306 | IDL> tracegrille, reform(out[0,*],11,11), reform(out[1,*],11,11),color=indgen(12)*20 |
---|
| 307 | |
---|
| 308 | IDL> inorg=quadrilateral2square(2,1,3,0,5,1,2,3,out[0,*],out[1,*]) |
---|
| 309 | IDL> tracegrille, reform(inorg[0,*],11,11), reform(inorg[1,*],11,11),color=indgen(12)*20 |
---|
| 310 | </div> |
---|
| 311 | <h3>Version history</h3> |
---|
[89] | 312 | |
---|
| 313 | |
---|
[101] | 314 | <h4>History</h4><div class="value"> |
---|
| 315 | Sebastien Masson (smasson@lodyc.jussieu.fr) |
---|
| 316 | August 2003 |
---|
| 317 | Based on "Digital Image Warping" by G. Wolberg |
---|
| 318 | IEEE Computer Society Press, Los Alamitos, California |
---|
| 319 | Chapter 3, see p 52-56 |
---|
| 320 | </div> |
---|
[89] | 321 | |
---|
| 322 | |
---|
[101] | 323 | <h3>Known issues</h3> |
---|
[89] | 324 | |
---|
| 325 | |
---|
| 326 | |
---|
[101] | 327 | <h4>Restrictions</h4><div class="value"> I think degenerated quadrilateral (e.g. flat of |
---|
| 328 | twisted) is not work. This has to be tested. |
---|
| 329 | </div> |
---|
[89] | 330 | |
---|
| 331 | |
---|
| 332 | |
---|
| 333 | |
---|
| 334 | |
---|
| 335 | |
---|
| 336 | |
---|
| 337 | |
---|
| 338 | |
---|
| 339 | |
---|
| 340 | |
---|
| 341 | </div> |
---|
| 342 | |
---|
| 343 | </div> |
---|
| 344 | |
---|
| 345 | |
---|
| 346 | |
---|
| 347 | <div id="tagline">Produced by IDLdoc 2.0.</div> |
---|
| 348 | |
---|
| 349 | </div> |
---|
| 350 | |
---|
| 351 | </body> |
---|
| 352 | </html> |
---|