doc: Rename 'localhost' subdirectory to more relevant 'html-original'.
[Ale.git] / doc / html-original / ALE / download / ale-0.7.x-tech / chain / index.html
blob7d6faece7273b20c79c4ce4b88302cd6a68d6cbe
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <title>ALE Rendering Chains</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>
19 </head>
20 <body>
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 5393119533<br>
43 </table>
48 <p><b>[ <a href="../">Up</a> ]</b></p>
49 <h1>ALE Rendering Chains</h1>
51 <p>In cases of spatially non-uniform resolution, rendering chains can maintain low
52 aliasing in poorly-resolved regions while preserving detail in well-resolved
53 regions. Each chain is based on a sequence of rendering invariants, each
54 allowing first, last, average, minimum, or maximum pixel values to be rendered.
55 For a given invariant, exclusion regions are honored by default, but can
56 optionally be ignored. Finally, for a given invariant, resolution can be
57 limited to the minimum of the input and output images, to prevent aliasing, or
58 can use the full resolution of the output image, to prevent loss of fine
59 details.</p>
61 <h2>Parameters</h2>
63 Parameters for rendering chain or rendering invariant <b>r</b> are as follows:</b>
65 <blockquote>
66 <b>r(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>)</b>
68 <br><br>
70 <table>
71 <tr><th align=left>Parameter<th><pre> </pre><th align=left>Description</tr>
72 <tr><td>n</td><td></td><td> the number of images contributing to output</tr>
73 <tr><td>n'</td><td></td><td> the current image index</tr>
74 <tr><td>(i, j)</td><td></td><td> the output pixel position</tr>
75 <tr><td>(i', j')</td><td></td><td> the pixel position in the current image</tr>
76 <tr><td>E<sub>x</sub></td><td></td><td> linear exposure adjustment for image x</tr>
77 <tr><td>G</td><td></td><td> gamma correction</tr>
78 <tr><td>P<sub>x</sub></td><td></td><td> projective transformation for image x</tr>
79 <tr><td>B<sub>x</sub></td><td></td><td> barrel distortion for image x</tr>
80 <tr><td>d<sub>x</sub></td><td></td><td> image x</tr>
81 </table>
83 </blockquote>
85 Parameters for scaled sampling filter with exclusion (SSFE) <b>e</b> are as follows:
87 <blockquote>
88 <b>e(n', i, j, i', j', E, G, P, B, d)</b>
90 <br><br>
92 <table>
93 <tr><th align=left>Parameter<th><pre> </pre><th align=left>Description</tr>
94 <tr><td>n'</td><td></td><td> the current image index</tr>
95 <tr><td>(i, j)</td><td></td><td> the output pixel position</tr>
96 <tr><td>(i', j')</td><td></td><td> the input pixel position</tr>
97 <tr><td>E</td><td></td><td> linear exposure adjustment</tr>
98 <tr><td>G</td><td></td><td> gamma correction</tr>
99 <tr><td>P</td><td></td><td> projective transformation</tr>
100 <tr><td>B</td><td></td><td> barrel distortion</tr>
101 <tr><td>d</td><td></td><td> image</tr>
102 </table>
104 </blockquote>
108 Parameters for scaled sampling filter (SSF) <b>s</b> are as
109 follows:</b>
111 <blockquote>
112 <b>s(i, j, i', j', P, B, k)</b>
114 <br><br>
116 <table>
117 <tr><th align=left>Parameter<th><pre> </pre><th align=left>Description</tr>
118 <tr><td>(i, j)</td><td></td><td> the output pixel position</tr>
119 <tr><td>(i', j')</td><td></td><td> the input pixel position</tr>
120 <tr><td>P</td><td></td><td> projective transformation</tr>
121 <tr><td>B</td><td></td><td> barrel distortion</tr>
122 <tr><td>k</td><td></td><td> certainty values</tr>
123 </table>
125 </blockquote>
127 Parameters for sampling filter <b>f</b> are as follows:</b>
129 <blockquote>
130 <b>f(p)</b>
132 <br><br>
134 <table>
135 <tr><th align=left>Parameter<th><pre> </pre><th align=left>Description</tr>
136 <tr><td>p</td><td></td><td>position offset p = (i, j)</tr>
137 </table>
139 </blockquote>
141 <h2>Chains</h2>
143 <p>A chain <b>c</b> is based on a sequence of rendering invariants <b>v<sub>1</sub>, v<sub>2</sub>, ..., v<sub>max</sub></b>. For each <b>v<sub>x</sub></b>, define <b>w<sub>x</sub></b>:
145 <blockquote>
146 <b>w<sub>x</sub>(n, i, j, E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = &sum;<sub>n'&isin;0..n</sub> &sum;<sub>(i', j')&isin;Dom[d<sub>n'</sub>]</sub> v<sub>x</sub>(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>)</b>
147 </blockquote>
150 If <b>w<sub>t</sub></b> is the weight threshold (ALE option 'wt'), and there exists a smallest <b>x</b> such that:
152 <blockquote>
153 <b>w<sub>x</sub>(n, i, j, E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) &ge; w<sub>t</sub></b>
154 </blockquote>
156 Then <b>c</b> gives:
158 <blockquote>
159 <b>c(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = v<sub>x</sub>(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) / w<sub>x</sub>(n, i, j, E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>)</b>
160 </blockquote>
162 Otherwise, <b>c</b> gives:
164 <blockquote>
165 <b>c(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = v<sub>max</sub>(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) / w<sub>max</sub>(n, i, j, E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>)</b>
166 </blockquote>
168 If both of the expressions above are undefined, then <b>c</b> gives:
170 <blockquote>
171 <b>c(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = 0</b>
172 </blockquote>
175 <h2>Invariants</h2>
177 <p>There are five types of rendering invariants, all of which are parameterized
178 with a scaled sampling filter with exclusion, denoted here by the symbol <b>e</b>. In particular, an
179 invariant can be of initial, final, maximal, minimal, or average type.
181 <h3>Initial</h3>
183 <p>If an invariant <b>v</b> is of initial type, then choose the smallest <b>m</b> such that
184 the following expression is non-zero:
186 <blockquote>
187 <b>&sum;<sub>(i',j')&isin;Dom[d<sub>m</sub>]</sub> e(m, i, j, i', j', E<sub>m</sub>, G, P<sub>m</sub>, B<sub>m</sub>, d<sub>m</sub>)</b>
188 </blockquote>
190 If such an <b>m</b> can be chosen, then, using the C trinary if-else operator to express condition:
192 <blockquote>
193 <b>v(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = (n' == m) ? e(m, i, j, i', j', E<sub>m</sub>, G, P<sub>m</sub>, B<sub>m</sub>, d<sub>m</sub>) : 0</b>
194 </blockquote>
196 Otherwise:
198 <blockquote> <b>v(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = 0</b>
199 </blockquote>
201 <h3>Final</h3>
203 <p>If an invariant <b>v</b> is of final type, then choose the largest <b>m</b> such that
204 the following expression is non-zero:
206 <blockquote>
207 <b>&sum;<sub>(i',j')&isin;Dom[d<sub>m</sub>]</sub> e(m, i, j, i', j', E<sub>m</sub>, G, P<sub>m</sub>, B<sub>m</sub>, d<sub>m</sub>)</b>
208 </blockquote>
210 If such an <b>m</b> can be chosen, then, using the C trinary if-else operator to express condition:
212 <blockquote>
213 <b>v(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = (n' == m) ? e(m, i, j, i', j', E<sub>m</sub>, G, P<sub>m</sub>, B<sub>m</sub>, d<sub>m</sub>) : 0</b>
214 </blockquote>
216 Otherwise:
218 <blockquote> <b>v(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = 0</b>
219 </blockquote>
221 <h3>Minimal</h3>
223 <p>If an invariant <b>v</b> is of minimal type, then choose <b>m</b> such that the following
224 expression is defined and minimal:
226 <blockquote>
227 <b>&sum;<sub>(i',j')&isin;Dom[d<sub>m</sub>]</sub> E<sub>m</sub><sup>-1</sup>G<sup>-1</sup>d<sub>m</sub>(i',j') * e(m, i, j, i', j', E<sub>m</sub>, G, P<sub>m</sub>, B<sub>m</sub>, d<sub>m</sub>) / &sum;<sub>(i',j')&isin;Dom[d<sub>m</sub>]</sub> e(m, i, j, i', j', E<sub>m</sub>, G, P<sub>m</sub>, B<sub>m</sub>, d<sub>m</sub>)</b>
228 </blockquote>
230 If such an <b>m</b> can be chosen, then, using the C trinary if-else operator to express condition:
232 <blockquote>
233 <b>v(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = (n' == m) ? e(m, i, j, i', j', E<sub>m</sub>, G, P<sub>m</sub>, B<sub>m</sub>, d<sub>m</sub>) : 0</b>
234 </blockquote>
236 Otherwise:
238 <blockquote>
239 <b>v(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = 0</b>
240 </blockquote>
242 <h3>Maximal</h3>
244 <p>If an invariant <b>v</b> is of maximal type, then choose <b>m</b> such that the following
245 expression is defined and maximal:
247 <blockquote>
248 <b>&sum;<sub>(i',j')&isin;Dom[d<sub>m</sub>]</sub> E<sub>m</sub><sup>-1</sup>G<sup>-1</sup>d<sub>m</sub>(i',j') * e(m, i, j, i', j', E<sub>m</sub>, G, P<sub>m</sub>, B<sub>m</sub>, d<sub>m</sub>) / &sum;<sub>(i',j')&isin;Dom[d<sub>m</sub>]</sub> e(m, i, j, i', j', E<sub>m</sub>, G, P<sub>m</sub>, B<sub>m</sub>, d<sub>m</sub>)</b>
249 </blockquote>
251 If such an <b>m</b> can be chosen, then, using the C trinary if-else operator to express condition:
253 <blockquote>
254 <b>v(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = (n' == m) ? e(m, i, j, i', j', E<sub>m</sub>, G, P<sub>m</sub>, B<sub>m</sub>, d<sub>m</sub>) : 0</b>
255 </blockquote>
257 Otherwise:
259 <blockquote>
260 <b>v(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = 0</b>
261 </blockquote>
263 <h3>Average</h3>
265 <p>If an invariant <b>v</b> is of average type, then:
267 <blockquote>
268 <b>v(n, n', i, j, i', j', E<sub>0</sub>, ..., E<sub>n</sub>, G, P<sub>0</sub>, ..., P<sub>n</sub>, B<sub>0</sub>, ..., B<sub>n</sub>, d<sub>0</sub>, ..., d<sub>n</sub>) = e(n', i, j, i', j', E<sub>n'</sub>, G, P<sub>n'</sub>, B<sub>n'</sub>, d<sub>n'</sub>)</b>
269 </blockquote>
271 <h2>Scaled Sampling Filter with Exclusion (SSFE)</h2>
273 <p>A scaled sampling filter with exclusion <b>e</b> is parameterized with a scaled sampling filter <b>s</b>, and
274 can be of two types: it can either honor exclusion regions or not. Define
275 <b>is_exclude(n', i, j)</b> to be false if point <b>(i, j)</b> is not excluded
276 for frame <b>n'</b>, or if exclusion regions are not being honored. Then,
277 using the C trinary if-else operator to express condition:
279 <blockquote>
280 <b>e(n', i, j, i', j', E, G, P, B, d) = is_exclude(n', i, j) ? 0 : s(i, j, i', j', P, B, &kappa;G<sup>-1</sup>E<sup>-1</sup>d)</b>
281 </blockquote>
283 <p>Where <b>&kappa;</b> is the operator for <a href="../certainty/">certainty</a>.
285 <h2>Scaled Sampling Filter (SSF)</h2>
287 <p>Define <b>bayer(i, j)</b> to be a function that returns an RGB value whose
288 channels are either zero or one, depending on whether that color is sampled at
289 <b>(i, j)</b>.
291 <p>A scaled sampling filter <b>s</b> is parameterized with a sampling filter
292 <b>f</b>, and can be one of two types: fine or coarse. If it is fine, then,
293 using <b>P</b> and <b>B</b> as functions:
295 <blockquote>
296 <b>s(i, j, i', j', P, B, k) = bayer(i', j') * k(i', j') * f(B(P(i', j')) - (i, j))</b>
297 </blockquote>
299 <p>If SSF <b>s</b> is coarse, then color channels are handled separately,
300 depending on their density relative to the output image, at point <b>(i, j)</b>
301 in the output image. In particular, bayer patterns can cause some colors to be
302 more dense than others. If the local density of channel <b>h</b> is lower in
303 each dimension than the density of channel <b>h</b> in the output image, then:
305 <blockquote>
306 <b>[s(i, j, i', j', P, B, k)]<sub>h</sub> = [bayer(i', j') * k(i', j') * f((i', j') - P<sup>-1</sup>(B<sup>-1</sup>(i, j)))]<sub>h</sub></b>
307 </blockquote>
309 <p>Otherwise, if channel <b>h</b> is locally less dense by a factor <b>d</b> in
310 exactly one dimension of the input image, then set <b>d_pair</b> equal to
311 <b>(1, d)</b> or <b>(d, 1)</b>, according to the dimension, and:
313 <blockquote>
314 <b>[s(i, j, i', j', P, B, k)]<sub>h</sub> = [bayer(i', j') * k(i', j') * f(d_pair * (B(P(i', j')) - (i, j)))]<sub>h</sub></b>
315 </blockquote>
317 <p>Otherwise, channel <b>h</b> is locally at least as dense in both dimensions of
318 the input image as it is dense in the output image. In this case:
320 <blockquote>
321 <b>[s(i, j, i', j', P, B, k)]<sub>h</sub> = [bayer(i', j') * k(i', j') * f(B(P(i', j')) - (i, j))]<sub>h</sub></b>
322 </blockquote>
326 <h2>Sampling Filter</h2>
328 <p>Sampling filters can be one of the following:</p>
329 <table>
330 <tr><th align=left>Type</th><th><pre> </pre></th><th align=left>Description</th></tr>
331 <tr><td>sinc<td><td>Sinc filter: (sin &pi;x) / (&pi;x)</td>
332 <tr><td>lanc:&lt;x&gt;<td><td>Lanczos, diameter x.
333 <tr><td>triangle:&lt;x&gt;<td><td>Triangle, diameter x.
334 <tr><td>box:&lt;x&gt;<td><td>Box, diameter x.
335 <tr><td>zero<td><td>Zero function
336 <tr><td>&lt;f&gt;*&lt;f&gt;<td><td>Pointwise multiplication (windowing)
337 </table>
340 <br>
341 <hr>
342 <i>Copyright 2002, 2003, 2004 <a href="mailto:dhilvert@auricle.dyndns.org">David Hilvert</a></i>
343 <p>Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
346 </body>
347 </html>