37
$\begingroup$

In 1d signal processing, many types of low pass filters are used. Gaussian filters are almost never used, though.

Why are they so popular in image processing applications? Are these filters a result of optimizing any criterion or are just ad hoc solution since image 'bandwidth' is usually not well defined.

$\endgroup$

5 Answers 5

31
$\begingroup$

Image processing applications are different from say audio processing applications, because many of them are tuned for the eye. Gaussian masks nearly perfectly simulate optical blur (see also point spread functions). In any image processing application oriented at artistic production, Gaussian filters are used for blurring by default.

Another important quantitative property of Gaussian filters is that they're everywhere non-negative. This is important because most 1D signals vary about 0 ($x \in \mathbb{R}$) and can have either positive or negative values. Images are different in the sense that all values of an image are non-negative ($x \in \mathbb{R}^+$). Convolution with a Gaussian kernel (filter) guarantees a non-negative result, so such function maps non-negative values to other non-negative values ($f: \mathbb{R}^+ \rightarrow \mathbb{R}^+$). The result is therefore always another valid image.

In general, frequency rejection in Image processing in not as crucial as in 1D signals. For example, in modulation schemes your filters need to be very precise to reject other channels transmitted on different carrier frequencies, and so on. I can't think of anything just as constraining for image processing problems.

$\endgroup$
23
$\begingroup$

Gaussian filters are used in image processing because they have a property that their support in the time domain, is equal to their support in the frequency domain. This comes about from the Gaussian being its own Fourier Transform.

What are the implications of this? Well, if the support of the filter is the same in either domain, that means that the ratio of both supports is 1. As it turns out, this means that Gaussian filters have the 'minimum time-bandwidth product'.

So what you might say? Well, in image processing, one very important task is to remove white noise, all the while maintaining salient edges. This can be a contradictory task - white noise exists at all frequencies equally, while edges exist in the high frequency range. (Sudden changes in spatial signals). In traditional noise removal via filtering, a signal is low pass filtered, which means that high frequency components in your signal are completely removed.

But if images have edges as high frequency components, traditional LPF'ing will also remove them, and visually, this manifests itself as the edges becoming more 'smudged'.

How then, to remove noise, but also preserve high frequency edges? Enter the Gaussian kernel. Since the Fourier Transform of a Gaussian is also a Gaussian, the Gaussian filter does not have a sharp cutoff at some pass band frequency beyond which all higher frequencies are removed. Instead, it has a graceful and natural tail that becomes ever lower as the frequency increases. This means that it will act as a low pass filter, but also allow in higher frequency components commensurate with how quickly its tail decays. (On the other hand, a LPF will have a higher time bandwidth product, because its support in the F-domain is not nearly as big as that of a Gaussians').

This then allows one to attain the best of both worlds - noise removal, plus edge preservation.

$\endgroup$
7
  • 4
    $\begingroup$ I'm not sure that you can compare the two supports directly since one is measured in time/length and the other one in Hz/radians. Their morphology is identical, but the universal scaling property still holds. $\endgroup$
    – Phonon
    Jul 31, 2012 at 22:02
  • $\begingroup$ Thanks for the reminding me of the minimum time-bandwidth product. However, as Phonon mentioned, reducing spatial (~time) domain support necessarily increases bandwidth. There's no way you can have both noise suppression and preserve edges with a simple Gaussian filter. That's why Perona & Malik developed anisotropic filtering. $\endgroup$
    – nimrodm
    Aug 1, 2012 at 13:28
  • $\begingroup$ @Phonon As I have seen, the supports are simply how many non-zero entries describe the function in either domain - I do believe they are the same. (Hence, ratio of 1). The being said, the time-bandwidth product is measured as a product of variance of the function in time and frequency. How its normalized differs from authors, I have seen it equated to either 1/2 or 1/4. $\endgroup$
    – Spacey
    Aug 1, 2012 at 13:36
  • 1
    $\begingroup$ @nimrodm "reducing spatial (~time) domain support necessarily increases bandwidth.", Yes, that is the trend, stemming from the time-frequency inverse relationship. (This is where the time-frequency uncertainty comes from). However, the Gaussian function is of a class that totally minimizes this product. Given the inverse relationship between time and frequency, there is no way to do so unless it has equal support in both domains. $\endgroup$
    – Spacey
    Aug 1, 2012 at 13:39
  • $\begingroup$ @nimrodm In anisotropic diffusion, the kernels I have seen are still gaussian, albeit with covariance matricies that are dependent on the gradient of the image. (Its also a non-linear method, VS gaussian smoothing which is linear). But, the gaussian remains used due to its properties. $\endgroup$
    – Spacey
    Aug 1, 2012 at 13:51
15
$\begingroup$

You have good answers already, but I'll just add one further useful property of 2D Gaussian filters, which is that they are separable, i.e. the 2D filter can be decomposed into two 1D filters. This can be an important performance consideration for larger kernel sizes, since an MxN separable filter can be implemented with M+N multiply-adds whereas a non-separable MxN filter requires M*N multiply-adds.

$\endgroup$
2
  • 3
    $\begingroup$ That's a good argument. A 2D Gaussian filter is both radially symmetric and still separable so implementation complexity is greatly reduced. $\endgroup$
    – nimrodm
    Aug 1, 2012 at 13:30
  • 1
    $\begingroup$ As a reference, The Scientist and Engineer's Guide to DSP provides an excellent description of this property in Chapter 24. $\endgroup$ Aug 16, 2018 at 16:23
9
$\begingroup$

The imagemagick manual has a great explanation of why filtering with sinc functions leads to "ringing" effects while gaussians do not. (http://www.imagemagick.org/Usage/fourier/#blurring and http://www.imagemagick.org/Usage/fourier/#circle_spectrum). When you have edges (discontinuities) in your image (which most images do) then completely chopping out all the high frequencies leaves you with ripples in the spatial domain. You also get ringing when you filter square waves with a sinc function in one dimension.

$\endgroup$
4
$\begingroup$

There has been beautiful answers already, but I will add my grain of salt, ot rather a different perspective:

Filtering at the most abstract level can be considered as applying some prior knowledge to some raw data. It means that applying some filtering algorithm is to apply this prior to find an optimum in signal to noise ratio, for instance.

For image, a classical prior is the smoothness of values (eg intensity) with respect to position (this can be seen as the point spread function mentioned by @Phonon). It is often modeled as a gaussian as it is the shape that you would obtain when mixing different objects with a known smoothness radius (this is called the central limit theorem). This is mostly useful when you wish to make derivatives of an image: rather than differentiating on the raw signal (which would produce a noisy output), you should do that on the smoothed image. This is equivalent to apply a wavelet-like operator such as Gabor filters.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.