Archive for the ‘tutorials’ Category

Having fun with C++11 — how to pass flags to a function

Wednesday, January 4th, 2017

I’ve never been very active posting here, and since I left academia it has been even slower. All of 2016 passed without a single post! Since I now work for a company, it’s become more difficult for me to post about the fun little things that I work with. Nevertheless, I wanted to share a C++ construct that I came up with to pass flags (a collection of yes/no options) to a function.


The curse of the big table

Wednesday, June 3rd, 2015

As an Area Editor for Pattern Recognition Letters, I’m frequently confronted with papers containing big tables of results. It is often the deblurring and denoising papers that (obviously using PSNR as a quality metric!) display lots of large tables comparing the proposed method with the state of the art on a set of images. I’m seriously tired of this. Now I’ve set my foot down, and asked an author to remove the table and provide a plot instead. In this post I will show what is wrong with the tables and propose a good alternative.


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]


    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.


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.


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?