Homework 3 - Sampling
Image functions
From the sampling viewpoint both image functions show irregular behaviors
by having very high frequency components at some part of the image.
To effectively deal with this is not an easy problem.
Click here to see images of the 2D function.
Click here to see images of the checkerboard.
Sampling
The following techniques help to make sampling more effective:
- Jittering: jittering reduces the "resonance effect". For example
for the checkerboard scene we don't get that distinct grey line in the
background for jittered images.
- Multijittering: Due to patent problems this is a reasonable approach. Also, it is better than simple jittering, since we regularize sampling in a subpixel by dividing it up to subsubpixels. That's why multijittered images look better for certain number of samples (e.g. image of 2D function with 16 samples per pixel).
- Adaptive sampling: The basic idea is that we reduce the
number of samples for pixels with low intensity variations.
Adaptive sampling
I used a recursive subdivision strategy according to the following rules:
- Divide the region into four subregions.
- Calculate the absolute differences (d_i) between the four corner
points and the center of the region.
- If d_i > epsilon, call the procedure
for the corresponding subregion recursively.
- Else the value assigned to the subregion
will be the value of the function in the center of the subregion.
- The value of a region is the average of the value of its subregions.
Note that this strategy avoids considering the same point twice.
From the results we can see that this approach works well for
the 2D image function, and breaks down for the checkerboard.
The reason is that it misses a lot of samples at the critical areas, since
its decision is based on only five specially selected points. A better adaptive
strategy would be iterative deepening, i.e. when we iteratively increase
the number of samples until the error between successive samples is small.
Filtering
Filtering is good because it hides reality by smoothing the image. The problem is
that implementing effective filtering is a pain because we need to store
the subpixel values of a couple of image lines in a buffer. A less efficient
method is not to bother with buffering but recalculate samples when needed.
This makes the algorithm slower (in this case four times slower), but easier
to implement. This method also has the sideeffect that when using a
random sampling strategy
with a small number of samples per pixel, we the image will be noisy, since
not the same points are taken into account in filtering neighboring pixels.
I compared box and tent filtering. The results are pleasing,
because tent filtering does not produce the "resonance effect" for high
frequency components. In case of the 2D image function this means that
we get a smoother transition on the right side of the image as going towards
higher frequencies. For the checkerboard scene it makes the critical part
of the image smoother and also helps to antialias edges more efficiently.
ikits@cs.utah.edu