Posts Tagged ‘filtering’

No, that’s not a Gaussian filter

Friday, February 6th, 2015

I recently got a question from a reader regarding Gaussian filtering, in which he says:

I have seen some codes use 3×3 Gaussian kernel like

    h1 = [1, 2, 1]/4

to do the separate filtering.

The paper by Burt and Adelson (The Laplacian Pyramid as a Compact Image Code, IEEE Transactions on Communication, 31:532-540, 1983) seems to use 5×5 Gaussian kernel like

    h1 = [1/4 - a/2, 1/4, a, 1/4, 1/4-a/2],

and a is between 0.3-0.6. A typical value of a may be 0.375, thus the Gaussian kernel is:

    h1 = [0.0625, 0.25, 0.375, 0.25, 0.0625]

or

    h1 = [1, 4, 6, 4, 1]/16.

I have written previously about Gaussian filtering, but neither of those posts make it clear what a Gaussian filter kernel looks like.

(more…)

On interpolation

Saturday, January 4th, 2014

Last month I asked the following question in an exam for the advanced image analysis course we teach here: “Given that interpolation is a convolution, describe how you would compute an interpolation using the Fourier Transform.” Unfortunately I can count on one finger the number of students that did not simply answer with something in the order of “convolution can be computed by multiplication in the Fourier domain.” And the one student that did not give this answer didn’t give an answer at all… Apparently this question is too difficult, though I thought it was interesting and only mildly challenging. In this post I’ll discuss interpolation and in passing give the correct answer to this question.

(more…)

Mathematical Morphology and colour images

Sunday, June 23rd, 2013

We recently organized the 11th International Symposium on Mathematical Morphology here in Uppsala. I’m very happy with how the event turned out, and we got lots of positive comments from participants, so all our hard work paid off. We had a nice turnout, very interesting presentations, and lots of discussions. And I’m now the editor of a book containing all the papers presented.

There seem to be several trending topics in the ISMM community at the moment. One of those is the application of Mathematical Morphology to colour images. People have been working on this topic for a while now, and still there is no optimal solution. This year, three very different methods were presented to try and solve this problem. But what is this problem about?

(more…)

Evaluating noise filters

Saturday, September 1st, 2012

Most of the new papers that I come across that propose a new or improved way of filtering out noise from images use the Peak Signal-to-Noise Ratio (PSNR) as a means to evaluate their results. It has been shown again and again that this is not a good way of evaluating the performance of a filter. When people compute the PSNR for a filtered image, what they actually do is compare this filtered image to an undistorted one (i.e. known ground truth). This is very different from what the name PSNR implies: the ratio of peak signal power to noise power. Of course, that is something that cannot be measured: if we’d be able to separate the noise from the signal and measure the power of the two components, then we wouldn’t need to write so many papers about filters that remove noise! So instead, the typical PSNR measure in image analysis uses the difference between the filtered image and the original (supposedly noise-free) image, calls this difference the noise, and computes its power (in dB):

(more…)

Separable convolutions

Thursday, August 19th, 2010

The convolution is an important tool in image processing. All linear filters are convolutions (like, for example, the Gaussian filter). One of the reasons linear filters are so prevalent is that they imitate physical systems. For example, an analog electric circuit (containing resistors, capacitors and inductors) can be described by a convolution. The projection of a cell on a slide, through the microscope’s optical systems, onto the CCD sensor, can be described by a convolution. Even the sampling and averaging that occur in the CCD can be described by a convolution.

Two properties of the convolution are quite interesting when looking for an efficient implementation:

  • The convolution is a multiplication in the Fourier domain: f(x)⊗h(x) ⇒ F(ω)⋅H(ω) . This means that you can compute the convolution by applying the Fourier transform to both the image and the convolution kernel, multiplying the two results, then inverse transforming the result.
  • The convolution is associative: (fh1)⊗h2 = f⊗(h1h2) . This post is about the repercussions of this property.

(more…)