Showing posts with label Fourier Transform. Show all posts
Showing posts with label Fourier Transform. Show all posts

Thursday, July 14, 2011

Activity 7 - Properties of the 2D Fourier Tranform


Hello guys.. I have done the new activity. It is about how Fourier Transform (FT) works or simply, FT's properties.

  1. Familiarization with FT with Different Patterns

    In this part of the activity, we were tasked to create several patterns and then apply FT in each of the patterns and of course, observe what happened.

    1. Square

      Figure 1 shows the pattern(top row) I created with two different sizes with their FT (bottom row). The top-left image has an area of 0.64 and the top-right image has 0.16. Applying FT on both images resulted to the image on the bottom row of Figure 1. As you may observe, the larger the area of the square produces smaller pattern in the Fourier plane.
    2. Figure 1. Square with size of 0.8 (top left) and 0.4 (top right) with their corresponding Fourier Transform
    3. Annulus

      Next pattern is an annulus which is like a donut. Figure 2 shows the object(top row) and their corresponding FT(bottom row). The thickness of the annulus(top-left) is 0.2 while the thickness of the other annulus(top-right) is 0.4. The same observation will be seen with the Square in part A1.
    4. Figure 2. Annulus with thickness of 0.2 (top left) and 0.4 (top right) with their corresponding Fourier Transform
    5. Square Annulus

      This pattern is quite tricky to create but obviously, it is not that hard. Figure 3 shows the object(top row) and their FT(bottom row). The top-left image has an aperture area of 0.36 while the top-right image has an aperture area of 0.04. It is observable that the FT of a smaller aperture area produces sharper image compared to that of a bigger aperture area.
    6. Figure 3. Square Annulus with aperture area of 0.36 (top left) and 0.04 (top right) with their corresponding Fourier Transform
    7. Two Slits along the x-direction

      This pattern is the same with a famous experiment, Young's double slit experiment. Figure 4 shows two parts, with a separation distance of (a)0.1 and (b)0.3. Diffraction patterns are seen in their FT which differs between the slit width and the separation distance of the two slits. When their separation distance are the same and differs in slit width(a,b), more order of diffraction is seen as the slit width increases(a - bottom left to a - bottom right). When their separation distances differs and the same slit width(a - bottom left and b - bottom left), still, more order of diffraction is seen as separation distance increases.
    8. Figure 4. Two slits separated by (a) 0.1 and (b) 0.3 and slit width of (a,b - left) 0.05 and (a,b - right) 0.15 with their corresponding Fourier Transform
    9. Two Dots Symmetric about the Origin

      I encountered some difficulty in creating this dot but fortunately, I managed to create them. Figure 5 shows the objects(top row) and their FT(bottom row). Both all 3 objects are separated by 1.0 with radii, both 0.1 for the 1st image, 0.1 and 0.4 for the middle image, and both 0.4 for the 3rd image. It can be seen the pattern in the Fourier plane decreases in the number of diffraction order as the dot size increases.
    10. Figure 5. Two dots with sizes of 0.1 (top leftmost), 0.1 and 0.4 (top middle), and 0.4 (top rightmost) with their corresponding Fourier Transform
  2. Anamorphic Property of Fourier Transform

    There are many things that are needed to do in this activity but those things are not really that hard but needed a lot of time to do it.

    First in the tasks is to create sinusoid of different frequencies and applying FT on each pattern which is shown in figure 6. It can be seen that the pattern separates as the frequency increases.
    Figure 6. Sinusoid with frequency (top row, leftmost) 4, (top row, middle) 8, and (top row, rightmost) 16 with their corresponding FT

    After that, a constant bias is added to the sinusoid in order to simulate a real image that has no negative values. Figure 7 shows this simulated real image with its FT. Comparing with figure 6, it can be seen that there is an additional information at the center of the image. When a non-constant bias is added to the sinusoid, it is easy to separate the two frequencies by getting its FT and locate the frequency where the maximum value is.

    Figure 7. Biased sinusoid with frequency (top row, leftmost) 4, (top row, middle) 8, and (top row, rightmost) 16 with their corresponding FT

    Figure 8 shows the rotation of the sinusoid and their corresponding FT. It can be seen in the FT figure that the whole figure rotate.
    Figure 8. Rotated sinusoid with frequency 10 and θ = (top row, leftmost) 30°, (top row, middle) 60°, and (top row, rightmost) 90° with their corresponding FT

    Figure 9 shows the (a)combination of two sinusoid along the x- and y-directions together with their corresponding (b)FT. When two sinusoid were added to one another, its FT form a diamond structure where only the edges are seen(b - top row). When two sinusoid were multiplied to one another, its FT form a square structure where only the edges are seen(b - bottom row). After obtaining the sinusoid, a rotated sinusoid were added. Figure 10 shows the (a)combination and their (b)FT. When the rotated sinusoid was added, only the sinusoid that was rotating rotates from 30° to 90°.
    Figure 9. Addition (a,top row) and multiplication (a, bottom row) of sinusoid with frequency (left) 4 and 8, and (right) 10 and their corresponding (b)FT.

    Figure 10. Multiplication of sinusoid of frequency 10 and added to a rotated sinusoid with the same frequency at and angle θ = (top row, left) 30°, (top row, right) 60°, (bottom row, left) 90°, (bottom row, right) 120° with their corresponding FT.
Finally, once again, I have completed this activity. It was not that hard but need some time to work on it. I will rate myself with 12 points. 5 points for the Technical part, 5 points for the Quality part and 2 points for the Initiative part because I compared the patterns in different sizes.

Thank you. :0

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. :)