| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>ALE User Manual: Alignment</title> |
| 5 | <style type="text/css"> |
| 6 | TABLE.ba { max-width: 678; text-align: center; padding-bottom: 15; padding-top: 5} |
| 7 | TABLE.inline { padding-right: 300; clear: left} |
| 8 | TD.text_table {padding-left: 2; padding-right: 2; border-width: 1} |
| 9 | H2 {clear: left} |
| 10 | P {max-width: none; padding-right: 300; clear: left} |
| 11 | BLOCKQUOTE {padding-right: 400 } |
| 12 | LI {max-width: 640; clear: left} |
| 13 | P.footer {max-width: none; width: auto; padding-left: 0} |
| 14 | P.header {max-width: none; width: auto; padding-left: 0} |
| 15 | HR.main {max-width: 640; clear: left; padding-left: 0; margin-left: 0} |
| 16 | HR.footer {clear: both} |
| 17 | </style> |
| 18 | |
| 19 | </head> |
| 20 | <body> |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | <table align=right valign=top width=160> |
| 28 | <td valign=top height=600 width=160> |
| 29 | <a href="http://auricle.dyndns.org/ALE/"> |
| 30 | <big>ALE</big> |
| 31 | <br> |
| 32 | Image Processing Software |
| 33 | <br> |
| 34 | <br> |
| 35 | <small>Deblurring, Anti-aliasing, and Superresolution.</small></a> |
| 36 | <br><br> |
| 37 | <big> |
| 38 | Local Operation |
| 39 | </big> |
| 40 | <hr> |
| 41 | localhost<br> |
| 42 | 2684415918<br> |
| 43 | </table> |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | <p><b>[ <a href="../">Up</a> ]</b></p> |
| 49 | <h1>Alignment</h1> |
| 50 | |
| 51 | <p>Alignment compares each supplemental frame in the sequence with an intermediate |
| 52 | incremental rendering known as the alignment reference image. Based on this |
| 53 | comparison, a transformation is assigned to the supplemental frame. Many |
| 54 | different transformations can be assigned before alignment of the frame is |
| 55 | complete. |
| 56 | |
| 57 | <p>This manual page offers an overview of alignment options; linked from this |
| 58 | page is a sub-page offering more detail on <a href="file/">transformation |
| 59 | data files</a>. |
| 60 | |
| 61 | <h2>Transformations</h2> |
| 62 | |
| 63 | <p>The variables used to adjust alignment are called transformations; they map |
| 64 | points from the source image coordinate system to a target coordinate system |
| 65 | (the rendering coordinate system). |
| 66 | |
| 67 | <p>ALE supports three transformation classes -- translational, euclidean, and |
| 68 | projective -- as well as barrel/pincushion distortion correction. The |
| 69 | translational class applies only translations to the inputs, changing only the |
| 70 | positions of images; the Euclidean class applies translations and rotations; |
| 71 | and the projective class applies general projective transformations. |
| 72 | Additionally, barrel/pincushion distortion correction can be applied to each |
| 73 | frame. The Euclidean class is most appropriate for use with scanners, or as a |
| 74 | first pass for projective transformations. The projective class and |
| 75 | barrel/pincushion distortion correction are most appropriate for use with |
| 76 | cameras. Except when capturing flat scenes, ALE does not correct perspective |
| 77 | changes, so movement of cameras should ideally be constrained so that no large |
| 78 | translations occur. |
| 79 | |
| 80 | <h3>Transformation Class Options</h3> |
| 81 | |
| 82 | <pre> |
| 83 | --translation Only adjust the position of images |
| 84 | --euclidean Adjust the position and orientation of images [default] |
| 85 | --projective Use projective transformations. Best quality, but slow. |
| 86 | </pre> |
| 87 | |
| 88 | For more information on barrel distortion correction, see the sub-page on |
| 89 | <a href="file/">transformation data files</a>. |
| 90 | |
| 91 | <h3>Transformation data file options</h3> |
| 92 | |
| 93 | <p>Transformations used in alignment can be loaded from, or saved to, a <a |
| 94 | href="file/">transformation data file</a>. This can be useful when performing |
| 95 | alignment in several passes, or when refining rendering options. A |
| 96 | transformation data file is required for barrel/pincushion distortion |
| 97 | correction. |
| 98 | |
| 99 | <pre> |
| 100 | --trans-load=x Load initial transformation settings from file x |
| 101 | --trans-save=x Save final transformation data in file x |
| 102 | </pre> |
| 103 | |
| 104 | <h3>Alignment following</h3> |
| 105 | |
| 106 | <p>The --follow option hints that frames tend to be more closely aligned with |
| 107 | adjacent frames in the sequence than with the original frame. This hint can be |
| 108 | useful even when initial alignment information is loaded from a file. |
| 109 | |
| 110 | <pre> |
| 111 | --identity Frames align closely with the original frame. [default] |
| 112 | --follow Frames align closely with their immediate predecessor. |
| 113 | </pre> |
| 114 | |
| 115 | <h2>Match statistics</h2> |
| 116 | |
| 117 | <p>The match statistic indicates how well a transformed frame aligns with the |
| 118 | alignment reference image; it is used to select or reject transformations |
| 119 | during alignment. After alignment of a particular frame is complete, ALE |
| 120 | displays the corresponding final match statistic. If the value is close to |
| 121 | 100%, then the frames are well aligned; very low values can indicate |
| 122 | misalignment; but even frames that are very well aligned typically do not |
| 123 | achieve 100% alignment. For improving image quality, ALE works most |
| 124 | effectively when match values are lower than 100%. |
| 125 | |
| 126 | <h3>Match threshold</h3> |
| 127 | |
| 128 | <p>A match threshold can be specified; no images with final match statistics |
| 129 | falling below this threshold will contribute to the final output. |
| 130 | |
| 131 | <pre> |
| 132 | --threshold=x Min. match threshold; a perfect match is 100. (0 is default) |
| 133 | </pre> |
| 134 | |
| 135 | <h3>Alignment failure</h3> |
| 136 | |
| 137 | <p>When an image fails to meet the match threshold, a transformation is still |
| 138 | assigned to the frame (e.g., for writing to a <a href="file/">transformation |
| 139 | data file</a>). The assigned transformation can be either the optimal |
| 140 | alignment found (this is default) or the default transformation. |
| 141 | |
| 142 | <pre> |
| 143 | --fail-optimal Frames beneath threshold are aligned optimally. [default] |
| 144 | --fail-default Frames beneath threshold keep their default alignment. |
| 145 | </pre> |
| 146 | |
| 147 | <h3>Alignment error metric exponent</h3> |
| 148 | |
| 149 | <p>The function calculated at each pixel to determine the match statistic is called |
| 150 | the alignment error metric, and is of the form <i>(a-b)<sup>x</sup></i>. |
| 151 | The value <i>x</i> is called the error metric exponent, and is 2 by default. |
| 152 | Larger numbers indicate that alignment will be more influenced by smaller |
| 153 | image features. |
| 154 | |
| 155 | <pre> |
| 156 | --metric=x Set the alignment error metric exponent. (2 is default) |
| 157 | </pre> |
| 158 | |
| 159 | <h3>Alignment Channel Options</h3> |
| 160 | |
| 161 | <p>In calculating the per-pixel error metric, there are three ways in which ALE |
| 162 | can handle color channels. By default, ALE adds the channels before |
| 163 | calculating the match, but it can also be configured to rely solely on the |
| 164 | green color channel, or to use all three channels separately. |
| 165 | |
| 166 | <pre> |
| 167 | --align-all Align images using all color channels |
| 168 | --align-green Align images using the green channel |
| 169 | --align-sum Align images using a sum of channels [default] |
| 170 | </pre> |
| 171 | |
| 172 | <h3>Monte Carlo Alignment</h3> |
| 173 | |
| 174 | <p>Aligning large images can take a very long time if all pixels are examined in |
| 175 | determining the match statistic, so it is often desirable to examine a smaller |
| 176 | subset of pixels. The Monte Carlo alignment option allows this. The number of |
| 177 | pixels used is specified as a percentage, and smaller numbers usually mean |
| 178 | faster, but less precise, alignment. For defaults, see the <a href="../defaults/"> |
| 179 | default settings</a> page. |
| 180 | |
| 181 | <pre> |
| 182 | --mc <x> Align using, on average, x% of available pixels (0 < x < 100) |
| 183 | --no-mc Align using all pixels. |
| 184 | </pre> |
| 185 | |
| 186 | <h3>Alignment weight map</h3> |
| 187 | |
| 188 | <p>Typically, measured differences at each pixel in the alignment reference |
| 189 | image contribute equally to the match statistic. To weight pixels differently, |
| 190 | a weight map can be used. The scale of the map should correspond with that of |
| 191 | the alignment reference image, and if the upper-left corner of the map does not |
| 192 | coincide with the upper-left corner of the first frame in the sequence, then a |
| 193 | non-zero offset should be specified to indicate the difference. See also <a |
| 194 | href="../exclusion/">exclusion regions</a>. |
| 195 | |
| 196 | <pre> |
| 197 | --wm <f> <x> <y> Use weight map image <f> at offset (<x>, <y>) |
| 198 | </pre> |
| 199 | |
| 200 | <h3>Frequency weighting</h3> |
| 201 | |
| 202 | <p>If ALE is compiled with FFTW support, then a high-pass-filtered version of |
| 203 | the alignment reference image can be used to weight reference image pixels' |
| 204 | contributions to the match statistic. Frequency limiting can occur as a |
| 205 | fraction of the highest horizontal frequency, the highest vertical frequency, |
| 206 | or the highest average frequency. Limit values should range between 0 (pass |
| 207 | all) and 1 (pass none). If any limit is assigned a value of 1, no alignment |
| 208 | will occur, since all frequencies will have been excluded. An output file can |
| 209 | optionally be specified for high-pass filtered data.</p> |
| 210 | |
| 211 | <pre> |
| 212 | --fl <h> <v> <a> High-pass filters: horizontal <h>, vertical <v>, average <a>. |
| 213 | --flshow <o> Write high-pass filtered data to file <o>. |
| 214 | </pre> |
| 215 | |
| 216 | <h3>Certainty weighting</h3> |
| 217 | |
| 218 | <p>Certainty weighting causes contributions to alignment error to be weighted |
| 219 | by certainty values.</p> |
| 220 | |
| 221 | <pre> |
| 222 | --cw Weight alignment error by certainty. |
| 223 | --no-cw Don't weight alignment error by certainty. [default] |
| 224 | </pre> |
| 225 | |
| 226 | <h3>Algorithmic weighting</h3> |
| 227 | |
| 228 | <p>This option writes the current alignment reference image and definition map |
| 229 | to specified files, executes a specified program with these arguments, and then |
| 230 | reads back alignment weights. This option requires POSIX libraries, and |
| 231 | requires that ALE have been built with POSIX support enabled.</p> |
| 232 | |
| 233 | <pre> |
| 234 | --wmx <e> <r> <d> Write reference <r>, definition <d>, execute `<e> <f> <d>`, |
| 235 | read weights <r> back. |
| 236 | </pre> |
| 237 | |
| 238 | <h2>Perturbation</h2> |
| 239 | |
| 240 | <p>The perturbation size determines the magnitude by which alignment parameters |
| 241 | are changed. The size is initially set to be large, allowing large changes in |
| 242 | alignment to be evaluated, and is reduced as the locally optimal alignment is |
| 243 | found for each size. When this size drops below a specified lower bound, the |
| 244 | frame is considered to be aligned. |
| 245 | |
| 246 | <h3>Perturbation bounds</h3> |
| 247 | |
| 248 | <p>These options determine the upper and lower bounds for perturbation size. The |
| 249 | perturb-upper and perturb-lower bounds apply to rotation (in arclength), |
| 250 | translation (in pixels), and the movement of the boundaries of a projected |
| 251 | frame (in pixels). By appending the '%' character, values may optionally be |
| 252 | specified as a percentage of the number of pixels in the smallest image |
| 253 | dimension. The rot-upper bound disables rotational perturbation above a |
| 254 | certain perturbation size (in degrees). To disable alignment, set |
| 255 | perturb-upper to zero. |
| 256 | |
| 257 | <pre> |
| 258 | --perturb-upper=x Perturbation upper bound pixels/arclength (14% is default) |
| 259 | ('x%' uses a fraction of the smallest image dimension.) |
| 260 | --perturb-lower=x Perturbation lower bound pixels/arclength (.125 is default) |
| 261 | ('x%' uses a fraction of the smallest image dimension.) |
| 262 | --rot-upper=x Rotation-specific upper bound in degrees (32.0 is default) |
| 263 | </pre> |
| 264 | |
| 265 | <h3>Barrel/pincushion distortion adjustment multiplier and rate</h3> |
| 266 | |
| 267 | <p>When using barrel/pincushion distortion parameters, any frame-to-frame |
| 268 | adjustments to these parameters are made in a manner dependent on the |
| 269 | perturbation size. A multiplier, the barrel distortion adjustment multiplier, |
| 270 | is used to determine the perturbation of these parameters, based on the generic |
| 271 | perturbation size. Additionally, the frame-to-frame rate of change of each |
| 272 | barrel distortion parameter can be limited to a specified maximum. To disable |
| 273 | frame-to-frame adjustment of barrel/pincushion distortion parameters, set |
| 274 | bda-mult to zero. Setting bda-rate to zero disables rate limitation. |
| 275 | |
| 276 | <pre> |
| 277 | --bda-mult=x Barrel distortion adjustment multiplier (0.0001 is default) |
| 278 | --bda-rate=x Barrel distortion rate of change maximum (0.0004 is default) |
| 279 | </pre> |
| 280 | |
| 281 | <h3>Level of detail</h3> |
| 282 | |
| 283 | <p>Alignment at large perturbation sizes is usually carried out on |
| 284 | reduced-detail images. To disable this, set lod-max to |
| 285 | log<sub>2</sub>(perturb-upper). |
| 286 | |
| 287 | <pre> |
| 288 | --lod-max=x LOD scale factor is max(1, (2^floor(x))/perturb) (1 is def.) |
| 289 | </pre> |
| 290 | |
| 291 | <h3>Perturbation Types (experimental)</h3> |
| 292 | |
| 293 | <p>Perturbations are normally performed in output image coordinates. To perform |
| 294 | perturbations in source image coordinates, specify <code>--perturb-source</code>. |
| 295 | |
| 296 | <pre> |
| 297 | --perturb-output Apply perturbations in output image coordinates. [default] |
| 298 | --perturb-source Apply perturbations in source image coordinates. |
| 299 | </pre> |
| 300 | |
| 301 | <h3>Global Searching</h3> |
| 302 | |
| 303 | <p>In cases where important image features do not have sufficient overlap using |
| 304 | default alignment parameters (determined by <code>--identity</code> and |
| 305 | <code>--follow</code>), a number of translations can be applied to the default |
| 306 | parameters in order to find a new alignment starting point. Since this process |
| 307 | searches the entire region of the alignment reference image, it is called a |
| 308 | global (as opposed to local) search. To avoid misalignment, a minimum overlap |
| 309 | area can be specified. In versions 0.8.1 and later, the search type 'points' |
| 310 | searches for a control point metric minimum. |
| 311 | |
| 312 | <pre> |
| 313 | --gs <type> Set global search to <type>, one of: |
| 314 | local Local alignment only [default] |
| 315 | inner Alignment reference image inner region |
| 316 | outer Alignment reference image outer region |
| 317 | all Union of inner and outer |
| 318 | central inner if below threshold or better; else, outer. |
| 319 | points Align by control points. Ignores gs-mo. [0.8.1 and later] |
| 320 | |
| 321 | --gs-mo <x> Set <x> pixel min. overlap for global search. (16 is default) |
| 322 | </pre> |
| 323 | |
| 324 | <br> |
| 325 | <hr> |
| 326 | <i>Copyright 2003, 2004 <a href="mailto:[email protected]">David Hilvert</a></i> |
| 327 | <p>Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. |
| 328 | |
| 329 | |
| 330 | </body> |
| 331 | </html> |