next up previous
Next: Median Filter Up: Smoothing Previous: Smoothing

Spatial averaging (low-pass filtering)

The isolated pixels with gray values much different from its neighbors can be considered as impulses corresponding to high spatial frequencies. One way to get rid of this kind of noise is to use the average of a small local region in the image so that the out-of-range gray levels can be suppressed. Equivalently, this averaging operation in spatial domain corresponds to low-pass filtering in the spatial frequency domain.

The averaging operation is a weighted sum of the pixels in a small neighborhood and can be implemented by a common convolution with a kernel $w$ of certain shapes and values:


\begin{displaymath}y[m,n]=\sum \sum_{i,j \in w} w[i,j]\;x[m-i,n-j]
=\sum \sum_{i,j \in w} w[i,j]\;x[m+i,n+j] \end{displaymath}

where $w[i,j]=w[-i,-i]$ is a symmetric kernel of a limited size (typically 3x3, 5x5, 7x7, etc.). Some common kernels:

These convolution kernels can be considered as the approximations of some continuous 2D functions such as a rectangular function

\begin{displaymath}rect(x,y)=\left\{ \begin{array}{ll} 1 &
\mbox{if $\vert x\v...
...and $\vert y\vert<b$} \\
0 & \mbox{else} \end{array} \right. \end{displaymath}

and a Gaussian function

\begin{displaymath}gauss(x,y)=e^{-\frac{x^2+y^2}{2\sigma^2}} \end{displaymath}

Convolution with such functions in spatial domain $(x,y)$ is equivalent to the filtering in spatial frequency domain $(f_x,f_y)$ with the Fourier transforms of the kernel functions:

\begin{displaymath}
Rect(f_x,f_y)=\frac{sin(2\pi a f_x)}{\pi f_x}\frac{sin(2\pi a f_y)}{\pi f_y}
\end{displaymath}

sinc_2d.gif and

\begin{displaymath}
Gauss(f_x,f_y)=\sqrt{2\pi\sigma^2}e^{-\frac{\sigma^2(\omega_x^2+\omega_y^2)}{2}}
\end{displaymath}

gaussian_2d.gif

In general the Gaussian function is a preferred method for the following reasons:

Weymouth-Overton's algorithm


next up previous
Next: Median Filter Up: Smoothing Previous: Smoothing
Ruye Wang 2013-09-10