Make --follow default.
[Ale.git] / doc / user / alignment / index.xml
blob7011bd318c9a3757a7f9cda5fffb9a46cc224d75
1 <?xml version="1.0"?>
3 <!DOCTYPE book PUBLIC "-//Norman Walsh//DTD DocBk XML V3.1.4//EN"
4         "file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd">
6 <chapter id="user-alignment"><title>Alignment</title>
8 <p>Alignment compares each supplemental frame in the sequence with an intermediate
9 incremental rendering known as the alignment reference image.  Based on this
10 comparison, a transformation is assigned to the supplemental frame.  Many
11 different transformations can be assigned before alignment of the frame is
12 complete.</p>
14 <p>This manual page offers an overview of alignment options; see also <xref
15 linkend="user-tdf"/>.</p>
17 <s><t>Transformations</t>
19 <p>The variables used to adjust alignment are called transformations; they map
20 points from the source image coordinate system to a target coordinate system
21 (the rendering coordinate system).</p>
23 <p>ALE supports three transformation classes -- translational, euclidean, and
24 projective -- as well as barrel/pincushion distortion correction.  The
25 translational class applies only translations to the inputs, changing only the
26 positions of images; the Euclidean class applies translations and rotations;
27 and the projective class applies general projective transformations.
28 Additionally, barrel/pincushion distortion correction can be applied to each
29 frame.  The Euclidean class is most appropriate for use with scanners, or as a
30 first pass for projective transformations.  The projective class and
31 barrel/pincushion distortion correction are most appropriate for use with
32 cameras.  Except when capturing flat scenes, ALE does not correct perspective
33 changes, so movement of cameras should ideally be constrained so that no large
34 translations occur.</p>
36 <s><t>Transformation Class Options</t>
38 <ll>--translation     Only adjust the position of images
39 --euclidean       Adjust the position and orientation of images [default]
40 --projective      Use projective transformations.  Best quality, but slow.
41 </ll>
43 <p>For more information on barrel distortion correction, see the sub-page on 
44 <a href="file/">transformation data files</a>.</p>
46 </s><s><t>Transformation data file options</t>
48 <p>Transformations used in alignment can be loaded from, or saved to, a <a
49 href="file/">transformation data file</a>.  This can be useful when performing
50 alignment in several passes, or when refining rendering options.  A
51 transformation data file is required for barrel/pincushion distortion
52 correction.</p>
54 <ll>--trans-load=x    Load initial transformation settings from file x
55 --trans-save=x    Save final transformation data in file x
56 </ll>
58 </s><s><t>Alignment following</t>
60 <p>The --follow option hints that frames tend to be more closely aligned with
61 adjacent frames in the sequence than with the original frame.  --identity 
62 indicates that frames tend to closely align with the original frame.  These hints can be
63 useful even when initial alignment information is loaded from a file.</p>
65 <ll>--follow          Frames align closely with their predecessor.  [default]
66 --identity        Frames align closely with the original frame.
67 </ll>
69 </s></s><s><t>Match statistics</t>
71 <p>The match statistic indicates how well a transformed frame aligns with the
72 alignment reference image; it is used to select or reject transformations
73 during alignment.  After alignment of a particular frame is complete, ALE
74 displays the corresponding final match statistic.  If the value is close to
75 100%, then the frames are well aligned; very low values can indicate
76 misalignment; but even frames that are very well aligned typically do not
77 achieve 100% alignment.  For improving image quality, ALE works most
78 effectively when match values are lower than 100%.</p>
80 <s><t>Match threshold</t>
82 <p>A match threshold can be specified; no images with final match statistics
83 falling below this threshold will contribute to the final output.</p>
85 <ll>--threshold=x     Min. match threshold; a perfect match is 100.  (0 is default)
86 </ll>
88 </s><s><t>Alignment failure</t>
90 <p>When an image fails to meet the match threshold, a transformation is still
91 assigned to the frame (e.g., for writing to a <a href="file/">transformation
92 data file</a>).  The assigned transformation can be either the optimal
93 alignment found (this is default) or the default transformation.</p>
95 <ll>--fail-optimal    Frames beneath threshold are aligned optimally.  [default]
96 --fail-default    Frames beneath threshold keep their default alignment.
97 </ll>
99 </s><s><t>Alignment error metric exponent</t>
101 <p>The function calculated at each pixel to determine the match statistic is called
102 the alignment error metric, and is of the form <i>(a-b)<sup>x</sup></i>.
103 The value <i>x</i> is called the error metric exponent, and is 2 by default.
104 Larger numbers indicate that alignment will be more influenced by smaller
105 image features.</p>
107 <ll>--metric=x        Set the alignment error metric exponent.       (2 is default)
108 </ll>
110 </s><s><t>Alignment Channel Options</t>
112 <p>In calculating the per-pixel error metric, there are three ways in which ALE
113 can handle color channels.  By default, ALE adds the channels before
114 calculating the match, but it can also be configured to rely solely on the
115 green color channel, or to use all three channels separately.</p>
117 <ll>--align-all       Align images using all color channels
118 --align-green     Align images using the green channel
119 --align-sum       Align images using a sum of channels [default]
120 </ll>
122 </s><s><t>Monte Carlo Alignment</t>
124 <p>Aligning large images can take a very long time if all pixels are examined in
125 determining the match statistic, so it is often desirable to examine a smaller
126 subset of pixels.  The Monte Carlo alignment option allows this.  The number of
127 pixels used is specified as a percentage, and smaller numbers usually mean
128 faster, but less precise, alignment.  For defaults, see the <a href="../defaults/">
129 default settings</a> page.</p>
131 <ll>--mc &lt;x&gt;          Align using, on average, x% of available pixels (0 &lt; x &lt; 100)
132 --no-mc           Align using all pixels.
133 </ll>
135 </s><s><t>Alignment weight map</t>
137 <p>Typically, measured differences at each pixel in the alignment reference
138 image contribute equally to the match statistic.  To weight pixels differently,
139 a weight map can be used.  The scale of the map should correspond with that of
140 the alignment reference image, and if the upper-left corner of the map does not
141 coincide with the upper-left corner of the first frame in the sequence, then a
142 non-zero offset should be specified to indicate the difference.  See also <a
143 href="../exclusion/">exclusion regions</a>.</p>
145 <ll>--wm &lt;f&gt; &lt;x&gt; &lt;y&gt;  Use weight map image &lt;f&gt; at offset (&lt;x&gt;, &lt;y&gt;)
146 </ll>
148 </s><s><t>Frequency weighting</t>
150 <p>If ALE is compiled with FFTW support, then a high-pass-filtered version of
151 the alignment reference image can be used to weight reference image pixels'
152 contributions to the match statistic.  Frequency limiting can occur as a
153 fraction of the highest horizontal frequency, the highest vertical frequency,
154 or the highest average frequency.  Limit values should range between 0 (pass
155 all) and 1 (pass none).  If any limit is assigned a value of 1, no alignment
156 will occur, since all frequencies will have been excluded.  An output file can
157 optionally be specified for high-pass filtered data.</p>
159 <ll>--fl &lt;h&gt; &lt;v&gt; &lt;a&gt;  High-pass filters: horizontal &lt;h&gt;, vertical &lt;v&gt;, average &lt;a&gt;.
160 --flshow &lt;o&gt;      Write high-pass filtered data to file &lt;o&gt;.
161 </ll>
163 </s><s><t>Certainty weighting</t>
165 <p>Certainty weighting causes contributions to alignment error to be weighted
166 by certainty values.</p>
168 <ll>--cw              Weight alignment error by certainty.
169 --no-cw           Don't weight alignment error by certainty. [default]
170 </ll>
172 </s><s><t>Algorithmic weighting</t>
174 <p>This option writes the current alignment reference image and definition map
175 to specified files, executes a specified program with these arguments, and then
176 reads back alignment weights.  This option requires POSIX libraries, and
177 requires that ALE have been built with POSIX support enabled.</p>
179 <ll>--wmx &lt;e&gt; &lt;r&gt; &lt;d&gt; Write reference &lt;r&gt;, definition &lt;d&gt;, execute `&lt;e&gt; &lt;f&gt; &lt;d&gt;`,
180                   read weights &lt;r&gt; back.
181 </ll>
183 </s></s><s><t>Perturbation</t>
185 <p>The perturbation size determines the magnitude by which alignment parameters
186 are changed.  The size is initially set to be large, allowing large changes in
187 alignment to be evaluated, and is reduced as the locally optimal alignment is
188 found for each size.  When this size drops below a specified lower bound, the
189 frame is considered to be aligned.</p>
191 <s><t>Perturbation bounds</t>
193 <p>These options determine the upper and lower bounds for perturbation size.  The
194 perturb-upper and perturb-lower bounds apply to rotation (in arclength),
195 translation (in pixels), and the movement of the boundaries of a projected
196 frame (in pixels).  By appending the '%' character, values may optionally be
197 specified as a percentage of the number of pixels in the smallest image
198 dimension.  The rot-upper bound disables rotational perturbation above a
199 certain perturbation size (in degrees).  To disable alignment, set
200 perturb-upper to zero.</p>
202 <ll>--perturb-upper=x Perturbation upper bound pixels/arclength    (14% is default)
203                      ('x%' uses a fraction of the smallest image dimension.)
204 --perturb-lower=x Perturbation lower bound pixels/arclength   (.125 is default)
205                      ('x%' uses a fraction of the smallest image dimension.)
206 --rot-upper=x     Rotation-specific upper bound in degrees    (32.0 is default)
207 </ll>
209 </s><s><t>Barrel/pincushion distortion adjustment multiplier and rate</t>
211 <p>When using barrel/pincushion distortion parameters, any frame-to-frame
212 adjustments to these parameters are made in a manner dependent on the
213 perturbation size.  A multiplier, the barrel distortion adjustment multiplier,
214 is used to determine the perturbation of these parameters, based on the generic
215 perturbation size.  Additionally, the frame-to-frame rate of change of each
216 barrel distortion parameter can be limited to a specified maximum.  To disable
217 frame-to-frame adjustment of barrel/pincushion distortion parameters, set
218 bda-mult to zero.  Setting bda-rate to zero disables rate limitation.</p>
220 <ll>--bda-mult=x      Barrel distortion adjustment multiplier   (0.0001 is default)
221 --bda-rate=x      Barrel distortion rate of change maximum  (0.0004 is default)
222 </ll>
224 </s><s><t>Level of detail</t>
226 <p>Alignment at large perturbation sizes is usually carried out on
227 reduced-detail images.  To disable this, set lod-max to
228 log<sub>2</sub>(perturb-upper).</p>
230 <ll>--lod-max=x       LOD scale factor is max(1, (2^floor(x))/perturb)  (1 is def.)
231 </ll>
233 </s><s><t>Perturbation Types (experimental)</t>
235 <p>Perturbations are normally performed in output image coordinates.  To perform
236 perturbations in source image coordinates, specify <l>--perturb-source</l>.</p>
238 <ll>--perturb-output  Apply perturbations in output image coordinates. [default]
239 --perturb-source  Apply perturbations in source image coordinates.
240 </ll>
242 </s><s><t>Global Searching</t>
244 <p>In cases where important image features do not have sufficient overlap using
245 default alignment parameters (determined by <l>--identity</l> and
246 <l>--follow</l>), a number of translations can be applied to the default
247 parameters in order to find a new alignment starting point.  Since this process
248 searches the entire region of the alignment reference image, it is called a
249 global (as opposed to local) search.  To avoid misalignment, a minimum overlap
250 area can be specified.  In versions 0.8.1 and later, the search type 'points'
251 searches for a control point metric minimum.</p>
253 <ll>--gs &lt;type>       Set global search to &lt;type>, one of:
254                      local     Local alignment only [default]
255                      inner     Alignment reference image inner region
256                      outer     Alignment reference image outer region
257                      all       Union of inner and outer
258                      central   inner if below threshold or better; else, outer.
259                      points    Align by control points.  Ignores gs-mo.   [0.8.1 and later]
261 --gs-mo &lt;x>       Set &lt;x> pixel min. overlap for global search. (16 is default)
262 </ll>
264 </s>
265 </s>
267 </chapter>