Module 5.5: Spatial Operations

Spatial Operations

Many image enhancement techniques are based on spatial operations performed on local neighbourhoods of input pixels. Often, the image is convolved with a FIR filter called "spatial mask".

Spatial averaging and spatial lowpass filtering:

Here each pixel is replaced by a weighted average of its neighbourhood pixels i.e.

where and are i/pr opposite images. w is a suitably chosen window and are the filter weights.

Figure( 5.11): Spatial averaging masks

A common class of spatial averaging filters has all equal weights giving

where

is the number of pixels in the window.Another spatial averaging filter used often is given by

ie. each pixel is replaced by its average with the average of its nearest four pixels.

Uses

Spatial averaging is used for noise smoothing, LP filtering and subsampling of images. Suppose observed image is

white noise with zero mean variance

=

Then spatial average yields

where the spatial average of has zero mean and variance . ie. noise power is reduced by a factor equal to number of pixels in window w .

If the noiseless image is constant over the window, then spatial averaging results in an improvement in output.

SNR by a factor of

In practice the size of window w is limited due to the fact that is not really constant, so that spatial averaging introduces a distortion in the form of blurring.

Directional smoothing

Figure( 5.12):Directional smoothing filter

To protect edges from blurring while smoothing, a directional averaging filter is used. Spatial average are calculated in several directions as

And a direction is found such that

is minimum

Then gives the desired result.