1i.rectify(1) Grass User's Manual i.rectify(1)
2
3
4
6 i.rectify - Rectifies an image by computing a coordinate transforma‐
7 tion for each pixel in the image based on the control points.
8
10 imagery, rectify
11
13 i.rectify
14 i.rectify --help
15 i.rectify [-cat] group=name [input=name[,name,...]] extension=string
16 order=integer [resolution=float] [memory=memory in MB]
17 [method=string] [--help] [--verbose] [--quiet] [--ui]
18
19 Flags:
20 -c
21 Use current region settings in target location (def.=calculate
22 smallest area)
23
24 -a
25 Rectify all raster maps in group
26
27 -t
28 Use thin plate spline
29
30 --help
31 Print usage summary
32
33 --verbose
34 Verbose module output
35
36 --quiet
37 Quiet module output
38
39 --ui
40 Force launching GUI dialog
41
42 Parameters:
43 group=name [required]
44 Name of input imagery group
45
46 input=name[,name,...]
47 Name of input raster map(s)
48
49 extension=string [required]
50 Output raster map(s) suffix
51
52 order=integer [required]
53 Rectification polynomial order (1-3)
54 Options: 1-3
55 Default: 1
56
57 resolution=float
58 Target resolution (ignored if -c flag used)
59
60 memory=memory in MB
61 Amount of memory to use in MB
62 Default: 300
63
64 method=string
65 Interpolation method to use
66 Options: nearest, linear, cubic, lanczos, linear_f, cubic_f, lanc‐
67 zos_f
68 Default: nearest
69
71 i.rectify uses the control points included in the source data or iden‐
72 tified with the Ground Control Points Manager to calculate a transfor‐
73 mation matrix and then converts x,y cell coordinates to standard map
74 coordinates for each pixel in the image. The result is a planimetric
75 image with a transformed coordinate system (i.e., a different coordi‐
76 nate system than before it was rectified). Supported transformation
77 methods are first, second, and third order polynomial and thin plate
78 spline. Thin plate spline is recommended for ungeoreferenced satellite
79 imagery where ground control points (GCPs) are included. Examples are
80 NOAA/AVHRR and ENVISAT imagery which include throusands of GCPs.
81
82 If no ground control points are available, the Ground Control Points
83 Manager must be run before i.rectify. An image must be georeferences
84 before it can reside in a standard coordinate LOCATION, and therefore
85 be analyzed with the other map layers in the standard coordinate LOCA‐
86 TION. Upon completion of i.rectify, the rectified image is deposited in
87 the target standard coordinate LOCATION. This LOCATION is selected
88 using i.target.
89
90 More than one raster map may be rectified at a time. Each cell file
91 should be given a unique output file name. The rectified image or rec‐
92 tified raster maps will be located in the target LOCATION when the pro‐
93 gram is completed. The original unrectified files are not modified or
94 removed.
95
96 If the -c flag is used, i.rectify will only rectify that portion of the
97 image or raster map that occurs within the chosen window region in the
98 target location, and only that portion of the cell file will be relo‐
99 cated in the target database. It is important therefore, to check the
100 current mapset window in the target LOCATION if the -c flag is used.
101
102 If you are rectifying a file with plans to patch it to another file
103 using the GRASS program r.patch, choose option number one, the current
104 window in the target location. This window, however, must be the
105 default window for the target LOCATION. When a file being rectified is
106 smaller than the default window in which it is being rectified, NULLs
107 are added to the rectified file. Patching files of the same size that
108 contain NULL data, eliminates the possibility of a no-data line in the
109 patched result. This is because, when the images are patched, the NULLs
110 in the image are "covered" with non-NULL pixel values. When rectifying
111 files that are going to be patched, rectify all of the files using the
112 same default window.
113
114 Coordinate transformation
115 The desired order of transformation (1, 2, or 3) is selected with the
116 order option. The program will calculate the RMSE and check the
117 required number of points.
118
119 Linear affine transformation (1st order transformation)
120 x’ = ax + by + c
121 y’ = Ax + By + C The a,b,c,A,B,C are determined by least squares
122 regression based on the control points entered. This transformation
123 applies scaling, translation and rotation. It is NOT a general purpose
124 rubber-sheeting like TPS, nor is it ortho-photo rectification using a
125 DEM, not second order polynomial, etc. It can be used if (1) you have
126 geometrically correct images, and (2) the terrain or camera distortion
127 effect can be ignored.
128
129 Polynomial Transformation Matrix (2nd, 3d order transformation)
130 i.rectify uses a first, second, or third order transformation matrix to
131 calculate the registration coefficients. The number of control points
132 required for a selected order of transformation (represented by n) is
133 ((n + 1) * (n + 2) / 2) or 3, 6, and 10 respectively. It is strongly
134 recommended that one or more additional points be identified to allow
135 for an overly-determined transformation calculation which will generate
136 the Root Mean Square (RMS) error values for each included point. The
137 RMS error values for all the included control points are immediately
138 recalculated when the user selects a different transformation order
139 from the menu bar. The polynomial equations are performed using a modi‐
140 fied Gaussian elimination method.
141
142 Thin plate spline (TPS) transformation
143 TPS transformation is selected with the -t flag. This method of coordi‐
144 nate transformation is recommended for satellite imagery where hundreds
145 or thousands of GCPs are included, and for historical printed or
146 scanned maps with unknown georeferencing and/or known localized distor‐
147 tions.
148
149 TPS combines a linear affine transformation with individual transforma‐
150 tion coefficients for each GCP, using the radial basis kernel function
151 with the distance dist between any two points:
152 dist2 * log(dist) As a consequence, localized distortions can be
153 removed with TPS transformation. For example, scan line sensors will
154 have due to the changing viewing angle larger distortions towards the
155 end points of the scan line than at the center of the scan line. Even
156 higher order polynomial transformations are not able to remove these
157 locally different distortions, but TPS transformation can. For best
158 results, TPS requires an even and, for localized distortions, dense
159 spacing of GCPs.
160
161 Resampling method
162 The rectified data is resampled with one of seven different methods:
163 nearest, bilinear, cubic, lanczos, bilinear_f, cubic_f, or lanczos_f.
164
165 The method=nearest method, which performs a nearest neighbor assign‐
166 ment, is the fastest of the resampling methods. It is primarily used
167 for categorical data such as a land use classification, since it will
168 not change the values of the data cells. The method=bilinear method
169 determines the new value of the cell based on a weighted distance aver‐
170 age of the 4 surrounding cells in the input map. The method=cubic
171 method determines the new value of the cell based on a weighted dis‐
172 tance average of the 16 surrounding cells in the input map. The
173 method=lanczos method determines the new value of the cell based on a
174 weighted distance average of the 25 surrounding cells in the input map.
175
176 The bilinear, cubic and lanczos interpolation methods are most appro‐
177 priate for continuous data and cause some smoothing. These options
178 should not be used with categorical data, since the cell values will be
179 altered.
180
181 In the bilinear, cubic and lanczos methods, if any of the surrounding
182 cells used to interpolate the new cell value are NULL, the resulting
183 cell will be NULL, even if the nearest cell is not NULL. This will
184 cause some thinning along NULL borders, such as the coasts of land
185 areas in a DEM. The bilinear_f, cubic_f and lanczos_f interpolation
186 methods can be used if thinning along NULL edges is not desired. These
187 methods "fall back" to simpler interpolation methods along NULL bor‐
188 ders. That is, from lanczos to cubic to bilinear to nearest.
189
190 If nearest neighbor assignment is used, the output map has the same
191 raster format as the input map. If any of the other interpolations is
192 used, the output map is written as floating point.
193
195 If i.rectify starts normally but after some time the following text is
196 seen:
197 ERROR: Error writing segment file
198 the user may try the -c flag or the module needs more free space on the
199 hard drive.
200
202 The GRASS 4 Image Processing manual
203
204 m.transform, r.proj, v.proj, i.group, i.target
205 Ground Control Points Manager
206
208 William R. Enslin, Michigan State University, Center for Remote Sensing
209
210 Modified for GRASS 5.0 by:
211 Luca Palmeri (palmeri@ux1.unipd.it)
212 Bill Hughes
213 Pierre de Mouveaux (pmx@audiovu.com)
214 CMD mode by Bob Covill
215
217 Available at: i.rectify source code (history)
218
219 Main index | Imagery index | Topics index | Keywords index | Graphical
220 index | Full index
221
222 © 2003-2019 GRASS Development Team, GRASS GIS 7.8.2 Reference Manual
223
224
225
226GRASS 7.8.2 i.rectify(1)