Summed-Area Tables
There are other approaches to computing this prefiltering integration on the fly.
One, which was introduced by Frank Crow is called a summed-area table. Basically,
a summed-area table is a tabularized two-dimensional cummulative distribution function.
Imagine having a 2-D table of numbers the cummulative distribution function could be
found as shown below.
To find the sum of region contained in a box bounded by
(x0, y0) and (x1, y1):
T(x1, y1) -
T(x0, y1) -
T(x1, y0) +
T(x0, y0)
This approach can be used to compute the integration of pixels that lie under a pixel
by divinging the resulting sum by the area of the rectangle,
(y1 - y0)(x1 - x0).
With a little more work you can compute the area under any four-sided polygon (How?).
|