Below is an image of a circle of size 128 x 128 px. It is created using scilab and saved as an image to process.
The Fourier transform of a circle aperture or a lens is a bessel function that is symmetric at the origin. Although in the image it is quite small but if you zoom in the image you see that is just not a spot.
Taking twice fft2 of the grayscale image before absolute value results in obtaining a circular image again. However, when this procedure is applied to a letter A aperture, it can be noticed that there is flipping from the original aperture.
In the next activity, convolution of two functions is investigated. A circular aperture image is to be convolved with a VIP pattern (as shown below) of the same size.
That is, the fftshifted circular image pattern is element wise multiplied to the fft2 of the VIP pattern image. After getting the inverse fft, the resulting pattern is a flipped image along the diagonal and is distorted a little by the circular aperture.
Decreasing the size of the circular pattern results to a more blurring of the VIP pattern. Physically, as you see through smaller holes your vision is impaired.
In the next activity, we investigated on how correlation works for in pattern recognition. First we have an image phrase shown below. The objective is to allow a search pattern of the letter A on the phrase image. This is done using correlation. The Fourier transform of A pattern is taken and it is multiplied element wise to the conjugate of the fft of phrase image.

The result is that the letters A in the phrase is highlighted. Thus, the highlight means that there is high correlation between the pattern A and to some of the attributes of phrase image.

For the final activity, we do template matching using correlation. Different templates are used like a vertical template = [-1 2 -1; -1 2 -1; -1 2 -1], horizontal and diagonal. The respective templates used are vertical, horizontal, left diagonal, right diagonal and spot for the following processed images. It can be seen that the kind of template used highlights the direction that is in the same direction at.




I give myself 10 points for finishing the activity. I would like to acknowledge Mam Jing and Earl for helping me find loopholes in the code. :)




I give myself 10 points for finishing the activity. I would like to acknowledge Mam Jing and Earl for helping me find loopholes in the code. :)

0 comments:
Post a Comment