# Stochastic Sampling

## Introduction

Sampling theory predicts that with a regular sampling grid, frequencies contained in the image that are greater than the Nyquist limit would alias. As a result, the aliases appear in the image too. The coherence of the samples interferes with the coherence of the image to produce errors called aliasing. If we make the samples irregular, in a controlled fashion, then these higher frequencies would appear in the image as noise rather than aliases. This perturbation of sampling and the tradeoff between sampling and noise is called Stochastic Sampling.

### Theory of Stochastic Sampling

In stochastic sampling, every point has a finite probability of being hit. Stochastic sampling is extremely powerful as the visual system is much more sensitive to aliases than noise. The human eye contains ans array of non-uniformly distributed photoreceptors and this is the reason that the eye does not produce its own aliasing effects. Photoreceptor cells in the fovea are tightly packed and the lens acts as an antialiasing filter. However in the region outside the fovea, the density is much less and the cells are non-uniformly distributed.
Different aliasing techniques are suitable for different types of rendering. Stochastic sampling is almost associated with ray tracers.

The type of randomness used in this case dictates the spectral character of the noise into which the higher frequencies are dispersed.

There are three classes of non-uniform patterns

• Poisson
• This pattern is generated by adding points at random locations until the area is full. This distribution is uniform. The Fourier transform is random too with values distributed over all the frequencies. So, it is not very useful as a filter as it does not discriminate between high and low frequencies. Convolution with this filter would scatter both high and low frequencies alike and as a result, the image is masked in white noise.

• Poisson Disc
• This is a generalization of the Poisson sampling whereby each sample point satisfies a minimum distance constraint. This pattern is achieved by generating uniformly distributed points as in Poisson sampling and retaining those that satisfy the minimum distance constraint. This method is extremely expensive.

• Jittered
• Jiterring is done by perturbing sample locations that are spaced out regularly. The jittered pattern is more clumsy in appearance. Jittering approximates the Poisson disc but the radius of the disc is smaller.
This increase in low frequency noise would cause an image convoluted with this filter to scatter the high frequencies into low frequencies. This is important as the human visual system is more sensitive to low frequencies and thus jittering is inferior to Poisson disc sampling. The same image appears noisier in the jittered case than when using Poisson disc distribution.
Sampling using jittering involves randomly shifting the uniform sample points in the two spatial variables, the sample point usually at the center of a pixel is perturbed to some location within it. Furthernmore, sampling using a Poisson disc distribution is more problematic as it would require storing the valuesin a look up table.

### Algorithm

• Subdivide pixel into a number of subpixels.

• Gives a regular grid of subpixels with centers Xic,Yic.

• Independently perturb Xic,Yic (add noise)

• Compute visbility and intensity at sample points.

• Filter resultant values with some reconstruction filter , the easiest of which is the box filter.

• Weighted average is probably a better idea.

Back to previous screen

Copyright - Sudhir R Kaushik (sudhir@cs.wpi.edu)