Debian Codegraph @

doc/html-original/ALE/download/ale-0.7.x-tech/chain/index.html

raw
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>
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 5393119533<br>
43 </table>
44
45
46
47
48 <p><b>[ <a href="../">Up</a> ]</b></p>
49 <h1>ALE Rendering Chains</h1>
50
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>
60
61 <h2>Parameters</h2>
62
63 Parameters for rendering chain or rendering invariant <b>r</b> are as follows:</b>
64
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>
67
68 <br><br>
69
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>
82
83 </blockquote>
84
85 Parameters for scaled sampling filter with exclusion (SSFE) <b>e</b> are as follows:
86
87 <blockquote>
88 <b>e(n', i, j, i', j', E, G, P, B, d)</b>
89
90 <br><br>
91
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>
103
104 </blockquote>
105
106
107
108 Parameters for scaled sampling filter (SSF) <b>s</b> are as
109 follows:</b>
110
111 <blockquote>
112 <b>s(i, j, i', j', P, B, k)</b>
113
114 <br><br>
115
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>
124
125 </blockquote>
126
127 Parameters for sampling filter <b>f</b> are as follows:</b>
128
129 <blockquote>
130 <b>f(p)</b>
131
132 <br><br>
133
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>
138
139 </blockquote>
140
141 <h2>Chains</h2>
142
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>:
144
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>
148
149
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:
151
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>
155
156 Then <b>c</b> gives:
157
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>
161
162 Otherwise, <b>c</b> gives:
163
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>
167
168 If both of the expressions above are undefined, then <b>c</b> gives:
169
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>
173
174
175 <h2>Invariants</h2>
176
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.
180
181 <h3>Initial</h3>
182
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:
185
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>
189
190 If such an <b>m</b> can be chosen, then, using the C trinary if-else operator to express condition:
191
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>
195
196 Otherwise:
197
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>
200
201 <h3>Final</h3>
202
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:
205
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>
209
210 If such an <b>m</b> can be chosen, then, using the C trinary if-else operator to express condition:
211
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>
215
216 Otherwise:
217
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>
220
221 <h3>Minimal</h3>
222
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:
225
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>
229
230 If such an <b>m</b> can be chosen, then, using the C trinary if-else operator to express condition:
231
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>
235
236 Otherwise:
237
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>
241
242 <h3>Maximal</h3>
243
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:
246
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>
250
251 If such an <b>m</b> can be chosen, then, using the C trinary if-else operator to express condition:
252
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>
256
257 Otherwise:
258
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>
262
263 <h3>Average</h3>
264
265 <p>If an invariant <b>v</b> is of average type, then:
266
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>
270
271 <h2>Scaled Sampling Filter with Exclusion (SSFE)</h2>
272
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:
278
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>
282
283 <p>Where <b>&kappa;</b> is the operator for <a href="../certainty/">certainty</a>.
284
285 <h2>Scaled Sampling Filter (SSF)</h2>
286
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>.
290
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:
294
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>
298
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:
304
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>
308
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:
312
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>
316
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:
319
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>
323
324
325
326 <h2>Sampling Filter</h2>
327
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>
338
339
340 <br>
341 <hr>
342 <i>Copyright 2002, 2003, 2004 <a href="mailto:[email protected]">David Hilvert</a></i>
343 <p>Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
344
345
346 </body>
347 </html>