Tuesday, July 12, 2011

Activity 6 - Fourier Transform Model of Image Formation


There was a time when you really have to go for the alternatives in order to finish an activity. I could have done this activity before but I can't use the Fourier transform (FT) in version 5.3.2 so I just use the other version. In this activity, we were tasked to observe the effect of FT.
  1. Familiarization with discrete Fast Fourier Transform (FFT)
  2. In this part of the activity, we were asked to create an 128x128 image with a white circle at the center which is shown in figure 1(leftmost). The figure to its right is the intensity of its Fourier transform which is just by taking its absolute value. It is not clearly seen in the figure but there should be white part along the corner. Beside it, another figure, which is the same as the 2nd figure, but they are centered. It was done using fftshift. The rightmost figure is the intensity of the FFT of the FFT of the original image,which is the centered circle.
    Figure 1. Original image (leftmost), Intensity of FFT of image with(2nd image) and without(3rd image) shifting and (rightmost) Intensity of the double FFT of the image.
    The same was done for figure 2. As one can observe, the two figures in the middle are the similar as the two figures in the middle in figure 1 with the 3rd image to have some kind of a ray emitting outward. The 4th image(rightmost) shown in figure 2 is now inverted.
    Figure 2. Original image (leftmost), Intensity of FFT of image with(2nd image) and without(3rd image) shifting and (rightmost) Intensity of the double FFT of the image.
  3. Simulation of an Imaging Device
  4. Figure 3. Image with letters VIP
    In this part, we were asked to create an image with VIP at its center shown in figure 3. Next is to create another image with white circle in the center with different radius, shown in figure 4 and then get the FFT of the VIP image and use fftshift function for the circles since it is already in the Fourier plane. Multiply the shifted circles and the FFT of the object (VIP image). Next, is to get the inverse FT by applying FFT on the product. Then get the intensity of the image by using abs() as shown in figure 5. It can be observed that as the radius increases, the image can be seen clearly.
    Figure 4. Aperture with radii 0.1 to 0.7
    Figure 5. Intensity after convolution
  5.  Template Matching using Correlation
  6. Next part is to investigate how correlation works. Correlation is simply to relate two independent images and show their similarities.In this activity, an image with sentence on it were created as shown in figure 6 (left) and another image with only a letter A on it (right). Next is to get their individual FFT and multiply the FFT of A with the conjugate of the FFT of the sentence. As one can see at figure 7, the sentence becomes unclear but some of the letters are still recognized because it has a similar property with A. The unclear part is due to the extraction of the letter A feature from each of the characters. So, the more it is similar to the letter A the more it will be seen clearly after the correlation.
    Figure 6. (left) Sentence and the (right) template A.
    Figure 7. Resultant image after correlation.
  7. Edge Detection using Convolution Integral
  8. Finally, edge detection was studied using convolution integral. This is simply taking a new template and correlating it with an image not necessarily the same size as the template. In this activity, similar patterns but different directions were used to get the edge of the word VIP from part B. Figure 8 shows the edge detection using these patterns. There is one matrix that was used that clearly shows the edges of the letters. It can be observed that when the negative values of the template are arranged horizontally, the resulting image will form horizontal lines and the same if it were arranged vertically.
    Figure 8. (1st and 2nd image) These two images are the images from correlation of the letters VIP and the template example in the activity, (3rd image) from the spot template and the last two images are from a random template with a large value elements.

Now, I am done with this activity. A new activity has arrive and must be done quickly. I will rate myself with 10 points. 4 points for the Technical part, 4 points for the Quality part and 2 points for the Initiative part since I extend the template not only with the use of the patterns given in the activity.

Thank you. :)

No comments:

Post a Comment