Sunday, November 27, 2011

Boo, the smoothest dog in the world!

Yesterday night I was too sleepy to code, so I wrote a code for filtering with a kernel that is more than 3x3. Btw, I still like my kernel to be of odd sized and square.

Let's use the image of Boo, the cutest dog in the world and make it the smoothest dog in the world. By using a 5x5 averaging kernel.


>> h=ones(5)/25;
>> u=double(imread('boo.jpg'));
>> uf=ifilter(u, h);m=min(min(min(uf))); M=max(max(max(uf))); figure; imshow((uf-m)/(M-m));

Boo, the cutest dog in the world!

Boo, after smoothing with a 5x5 kernel becomes the smoothest dog in the world!

2 comments:

  1. I don't really follow this blog, and I don't know if you have ever tried bilateral filtering, or if you have heard of it, but if you want to smooth the fur on Boo without blurring the edges, you should try it!

    ReplyDelete
    Replies
    1. Yes. I am aware of the bilateral filter. I will talk about it some time. For now, one can show that the bilateral filter is asymptotically equivalent to the Perona-Malik equation.

      Delete