i.rectify.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <h2>DESCRIPTION</h2>
  2. <em>i.rectify</em> uses the control points included in the source data
  3. or identified with the
  4. <a href="wxGUI.gcp.html">Ground Control Points Manager</a>
  5. to calculate a transformation matrix and then converts x,y
  6. cell coordinates to standard map coordinates for each pixel
  7. in the image. The result is a planimetric image with a
  8. transformed coordinate system (i.e., a different coordinate
  9. system than before it was rectified). Supported transformation methods
  10. are first, second, and third order polynomial and thin plate spline.
  11. Thin plate spline is recommended for ungeoreferenced satellite imagery
  12. where ground control points (GCPs) are included. Examples are
  13. <a href="http://www.gdal.org/frmt_l1b.html">NOAA/AVHRR</a>
  14. and <a href="http://www.gdal.org/frmt_various.html#Envisat">ENVISAT</a>
  15. imagery which include throusands of GCPs.
  16. <p>
  17. If no ground control points are available, the
  18. <a href="wxGUI.gcp.html">Ground Control Points Manager</a>
  19. must be run before <em>i.rectify</em>. An image must be
  20. georeferences before it can reside in a standard coordinate
  21. LOCATION, and therefore be analyzed with the other map
  22. layers in the standard coordinate LOCATION. Upon
  23. completion of <em>i.rectify</em>, the rectified image is
  24. deposited in the target standard coordinate LOCATION. This
  25. LOCATION is selected using
  26. <em><a href="i.target.html">i.target</a></em>.
  27. <p>More than one raster map may be rectified at a time. Each cell file
  28. should be given a unique output file name. The rectified image or
  29. rectified raster maps will be located in the target LOCATION when the
  30. program is completed. The original unrectified files are not modified
  31. or removed.
  32. <p>If the <b>-c</b> flag is used, <em>i.rectify</em> will only rectify that
  33. portion of the image or raster map that occurs within the chosen window
  34. region in the target location, and only that portion of the cell
  35. file will be relocated in the target database. It is
  36. important therefore, to check the current mapset window in
  37. the target LOCATION if the <b>-c</b> flag is used.
  38. <p>
  39. If you are rectifying a file with plans to patch it to
  40. another file using the GRASS program <em>r.patch</em>,
  41. choose option number one, the current window in the target
  42. location. This window, however, must be the default window
  43. for the target LOCATION. When a file being rectified is
  44. smaller than the default window in which it is being
  45. rectified, NULLs are added to the rectified file. Patching
  46. files of the same size that contain NULL data,
  47. eliminates the possibility of a no-data line in the patched
  48. result. This is because, when the images are patched, the
  49. NULLs in the image are "covered" with non-NULL pixel
  50. values. When rectifying files that are going to be
  51. patched, rectify all of the files using the same default
  52. window.
  53. <h3>Coordinate transformation</h3>
  54. <p>The desired order of transformation (1, 2, or 3) is selected with the
  55. <b>order</b> option.
  56. The program will calculate the RMSE and check the required number of points.
  57. <h4>Linear affine transformation (1st order transformation)</h4>
  58. <dl>
  59. <dd> x' = ax + by +c
  60. <dd> y' = Ax + Bt +C
  61. </dl>
  62. The a,b,c,A,B,C are determined by least squares regression
  63. based on the control points entered. This transformation
  64. applies scaling, translation and rotation. It is NOT a
  65. general purpose rubber-sheeting, nor is it ortho-photo
  66. rectification using a DEM, not second order polynomial,
  67. etc. It can be used if (1) you have geometrically correct
  68. images, and (2) the terrain or camera distortion effect can
  69. be ignored.
  70. <h4>Polynomial Transformation Matrix (2nd, 3d order transformation)</h4>
  71. <em>i.rectify</em> uses a first, second, or third order transformation
  72. matrix to calculate the registration coefficients. The number
  73. of control points required for a selected order of transformation
  74. (represented by n) is
  75. <dl>
  76. <dd>((n + 1) * (n + 2) / 2)
  77. </dl>
  78. or 3, 6, and 10 respectively. It is strongly recommended
  79. that one or more additional points be identified to allow
  80. for an overly-determined transformation calculation which
  81. will generate the Root Mean Square (RMS) error values for
  82. each included point. The RMS error values for all the
  83. included control points are immediately recalculated when
  84. the user selects a different transformation order from the
  85. menu bar. The polynomial equations are performed using a
  86. modified Gaussian elimination method.
  87. <h4>Thin plate spline (TPS) transformation</h4>
  88. TPS transformation is selected with the <b>-t</b> flag. This method of
  89. coordinate transformation is recommended for satellite imagery where
  90. hundreds or thousands of GCPs are included, and for historical printed
  91. or scanned maps with unknown georeferencing and/or known localized
  92. distortions.
  93. <p>
  94. TPS combines a linear affine transformation with individual
  95. transformation coefficients for each GCP, using the radial basis kernel
  96. function with the distance <em>dist</em> between any two points:
  97. <dl>
  98. <dd>dist<sup>2</sup> * log(dist)
  99. </dl>
  100. As a consequence, localized distortions can be removed with TPS
  101. transformation. For example, scan line sensors will have due to the
  102. changing viewing angle larger distortions towards the end points of the
  103. scan line than at the center of the scan line. Even higher order
  104. polynomial transformations are not able to remove these locally
  105. different distortions, but TPS transformation can. For best results,
  106. TPS requires an even and, for localized distortions, dense spacing of
  107. GCPs.
  108. <h3>Resampling method</h3>
  109. <p>The rectified data is resampled with one of seven different methods:
  110. <em>nearest</em>, <em>bilinear</em>, <em>cubic</em>, <em>lanczos</em>,
  111. <em>bilinear_f</em>, <em>cubic_f</em>, or <em>lanczos_f</em>.
  112. <p>The <em>method=nearest</em> method, which performs a nearest neighbor assignment,
  113. is the fastest of the resampling methods. It is primarily used for
  114. categorical data such as a land use classification, since it will not change
  115. the values of the data cells. The <em>method=bilinear</em> method determines the new
  116. value of the cell based on a weighted distance average of the 4 surrounding
  117. cells in the input map. The <em>method=cubic</em> method determines the new value of
  118. the cell based on a weighted distance average of the 16 surrounding cells in
  119. the input map. The <em>method=lanczos</em> method determines the new value of
  120. the cell based on a weighted distance average of the 25 surrounding cells in
  121. the input map.
  122. <p>The bilinear, cubic and lanczos interpolation methods are most appropriate for
  123. continuous data and cause some smoothing. These options should not be used
  124. with categorical data, since the cell values will be altered.
  125. <p>In the bilinear, cubic and lanczos methods, if any of the surrounding cells used to
  126. interpolate the new cell value are NULL, the resulting cell will be NULL, even if
  127. the nearest cell is not NULL. This will cause some thinning along NULL borders,
  128. such as the coasts of land areas in a DEM. The bilinear_f, cubic_f and lanczos_f
  129. interpolation methods can be used if thinning along NULL edges is not desired.
  130. These methods "fall back" to simpler interpolation methods along NULL borders.
  131. That is, from lanczos to cubic to bilinear to nearest.
  132. <p>If nearest neighbor assignment is used, the output map has the same raster
  133. format as the input map. If any of the other interpolations is used, the
  134. output map is written as floating point.
  135. <p><!--
  136. Note: In interactive mode it is possible to define a new file name
  137. for the target images. This is (currently) not provided in command line
  138. mode.
  139. -->
  140. <h2>NOTES</h2>
  141. If <em>i.rectify</em> starts normally but after some time the following text is seen:
  142. <br><tt>
  143. ERROR: Error writing segment file
  144. </tt><br>
  145. the user may try the <b>-c</b> flag or the module needs more free space
  146. on the hard drive.
  147. <h2>SEE ALSO</h2>
  148. The GRASS 4 <em>
  149. <a href="http://grass.osgeo.org/gdp/imagery/grass4_image_processing.pdf">Image
  150. Processing manual</a></em>
  151. <p><em>
  152. <a href="m.transform.html">m.transform</a>,
  153. <a href="r.proj.html">r.proj</a>,
  154. <a href="v.proj.html">v.proj</a>,
  155. <a href="i.group.html">i.group</a>,
  156. <a href="i.target.html">i.target</a>
  157. <br>
  158. <a href="wxGUI.gcp.html">Ground Control Points Manager</a>
  159. </em>
  160. <h2>AUTHORS</h2>
  161. William R. Enslin,
  162. Michigan State University,
  163. Center for Remote Sensing
  164. <p>Modified for GRASS 5.0 by:<br>
  165. Luca Palmeri (palmeri@ux1.unipd.it)<br>
  166. Bill Hughes<br>
  167. Pierre de Mouveaux (pmx@audiovu.com)
  168. <br>
  169. CMD mode by Bob Covill
  170. <p><i>Last changed: $Date$</i>