| 1 | <h2>DESCRIPTION</h2> |
| 2 | |
| 3 | <em>v.rectify</em> uses control points to calculate a 2D or 3D |
| 4 | transformation matrix based on a first, second, or third order |
| 5 | polynomial and then converts x,y(, z) coordinates to standard map |
| 6 | coordinates for each object in the vector map. The result is a vector |
| 7 | map with a transformed coordinate system (i.e., a different coordinate |
| 8 | system than before it was rectified). |
| 9 | <p> |
| 10 | The <em>-o</em> flag enforces orthogonal rotation (currently for 3D only) |
| 11 | where the axes remain orthogonal to each other, e.g. a cube with right |
| 12 | angles remains a cube with right angles after transformation. This is not |
| 13 | guaranteed even with affine (1<sup>st</sup> order) 3D transformation. |
| 14 | |
| 15 | <p> |
| 16 | Great care should be taken with the placement of Ground Control Points. |
| 17 | For 2D transformation, the control points must not lie on a line, instead |
| 18 | 3 of the control points must form a triangle. For 3D transformation, the |
| 19 | control points must not lie on a plane, instead 4 of the control points |
| 20 | must form a triangular pyramid. It is recommended to investigate RMS |
| 21 | errors and deviations of the Ground Control Points prior to transformation. |
| 22 | |
| 23 | <p> |
| 24 | 2D Ground Control Points can be identified in |
| 25 | <em><a href="g.gui.gcp.html">g.gui.gcp</a></em>. |
| 26 | <p> |
| 27 | 3D Ground Control Points must be provided in a text file with the |
| 28 | <b>points</b> option. The 3D format is equivalent to the format for 2D |
| 29 | ground control points with an additional third coordinate: |
| 30 | |
| 31 | <div class="code"><pre> |
| 32 | x y z east north height status |
| 33 | </pre></div> |
| 34 | where <em>x, y, z</em> are source coordinates, <em>east, north, height</em> |
| 35 | are target coordinates and status (0 or 1) indicates whether a given |
| 36 | point should be used. Numbers must be separated by space and must use a |
| 37 | point (.) as decimal separator. |
| 38 | |
| 39 | <p> |
| 40 | If no <b>group</b> is given, the rectified vector will be written to |
| 41 | the current mapset. If a <b>group</b> is given and a target has been |
| 42 | set for this group with <em><a href="i.target.html">i.target</a></em>, |
| 43 | the rectified vector will be written to the target project and mapset. |
| 44 | |
| 45 | <h3>Coordinate transformation and RMSE</h3> |
| 46 | <p>The desired order of transformation (1, 2, or 3) is selected with the |
| 47 | <b>order</b> option. |
| 48 | |
| 49 | If the <b>-r</b> flag is given, <em>v.rectify</em> will calculate the |
| 50 | Root Mean Square Error (RMSE) and print out statistics in tabular format. |
| 51 | The last row gives a summary with the first column holding the number of |
| 52 | active points, followed by average deviations for each dimension and both |
| 53 | forward and backward transformation and finally forward and backward |
| 54 | overall RMSE. |
| 55 | |
| 56 | <h4>2D linear affine transformation (1st order transformation)</h4> |
| 57 | |
| 58 | <dl> |
| 59 | <dd> x' = a1 + b1 * x + c1 * y |
| 60 | <dd> y' = a2 + b2 * x + c2 * y |
| 61 | </dl> |
| 62 | |
| 63 | <h4>3D linear affine transformation (1st order transformation)</h4> |
| 64 | |
| 65 | <dl> |
| 66 | <dd> x' = a1 + b1 * x + c1 * y + d1 * z |
| 67 | <dd> y' = a2 + b2 * x + c2 * y + d2 * z |
| 68 | <dd> z' = a3 + b3 * x + c3 * y + d3 * z |
| 69 | </dl> |
| 70 | |
| 71 | The a,b,c,d coefficients are determined by least squares regression |
| 72 | based on the control points entered. This transformation |
| 73 | applies scaling, translation and rotation. It is NOT a |
| 74 | general purpose rubber-sheeting, nor is it ortho-photo |
| 75 | rectification using a DEM, not second order polynomial, |
| 76 | etc. It can be used if (1) you have geometrically correct |
| 77 | data, and (2) the terrain or camera distortion effect can |
| 78 | be ignored. |
| 79 | |
| 80 | <h4>Polynomial Transformation Matrix (2nd, 3d order transformation)</h4> |
| 81 | |
| 82 | <em>v.rectify</em> uses a first, second, or third order transformation |
| 83 | matrix to calculate the registration coefficients. The minimum number |
| 84 | of control points required for a 2D transformation of the selected order |
| 85 | (represented by n) is |
| 86 | |
| 87 | <dl> |
| 88 | <dd>((n + 1) * (n + 2) / 2) |
| 89 | </dl> |
| 90 | |
| 91 | or 3, 6, and 10 respectively. For a 3D transformation of first, second, |
| 92 | or third order, the minimum number of required control points is 4, 10, |
| 93 | and 20, respectively. It is strongly recommended that more than the |
| 94 | minimum number of points be identified to allow for an overly-determined |
| 95 | transformation calculation which will generate the Root Mean Square (RMS) |
| 96 | error values for each included point. The polynomial equations are |
| 97 | determined using a modified Gaussian elimination method. |
| 98 | |
| 99 | <h2>SEE ALSO</h2> |
| 100 | |
| 101 | The GRASS 4 <em> |
| 102 | <a href="https://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image |
| 103 | Processing manual</a></em> |
| 104 | |
| 105 | <p> |
| 106 | <em> |
| 107 | <a href="g.gui.gcp.html">g.gui.gcp</a>, |
| 108 | <a href="i.group.html">i.group</a>, |
| 109 | <a href="i.rectify.html">i.rectify</a>, |
| 110 | <a href="i.target.html">i.target</a>, |
| 111 | <a href="m.transform.html">m.transform</a>, |
| 112 | <a href="r.proj.html">r.proj</a>, |
| 113 | <a href="v.proj.html">v.proj</a>, |
| 114 | <a href="v.transform.html">v.transform</a> |
| 115 | </em> |
| 116 | |
| 117 | <br> |
| 118 | <em> |
| 119 | <a href="wxGUI.gcp.html">Manage Ground Control Points</a> |
| 120 | </em> |
| 121 | |
| 122 | <h2>AUTHOR</h2> |
| 123 | |
| 124 | Markus Metz |
| 125 | <p> |
| 126 | based on <a href="i.rectify.html">i.rectify</a> |