Monday, July 18, 2011

Properties of the 2D Fourier Transform


For this activity, we investigated the properties of a 2D Fourier transform (FT) of an image. For the first part of the activity, we produced different images and obtained their FTs.  As we can see from figure 1, a straight edge (i. e. square) produces a line in the FT perpendicular to the edge of the image. An annulus also produce ring in its FT and the FT of an annulus with a straight edge has broken line perpendicular to the image’s edge. The FT of a double slit is a single straight slit along the horizontal. The FT of a double pinhole along the x- axis created a series of slits of different widths and spacing. 

For the second part of the activity, we simulated a sinusoid and obtained its FT. what we obtained is an image with two pinholes at the y-axis a few pixels apart.


However if we increase the frequency of the sinusoid, we can see in the FT that the pinholes moved further apart. This is because the pinholes are the spatial frequencies of the sinusoid. They are in the y-axis because the sinusoid propagates through the y-axis. The reason they move apart is that the center on the FT is equal to a DC signal or a frequency of zero. As we move further from the center, the frequency would increase so higher frequency structures can be found further from the center.



Rotating the sinusoid also causes a rotation in its FT. also like before the structures in the FT align to where the sinusoid is propagating.


If we take the FT of two superimposed sinusoids, we would obtain something like four dots in a corner of a square. I wasn’t actually expecting this since I thought that the FT would look like a cross at the center.


By superimposing another sinusoid thing get even weirder. My prediction is that upon adding another sinusoid another pair of dot would appear in the FT. Instead, there became 8 dots that are shifted from the center. 




All in all it wasn’t a particularly hard activity so I would give myself an 8/10

Wednesday, July 13, 2011

Fourier Transform Model of Image Formation


For this activity we familiarized ourselves with the technique of using Fourier transforms in image manipulation. Fourier Transform is a powerful and useful technique because it has the ability to isolate the different details of an image by separating structures of varying spatial frequencies. This allows the manipulation of only certain details (like noise and speckles) without distorting other details.

The first part of the activity is the familiarization of the Fast Fourier Transform (FFT) algorithm used to compute the discrete Fourier transform of an image. Figure 1 shows the images created for this part. We used the FFT algorithm on a circle to obtain its Fourier transform (top row second column).The image may look empty but that is because the signal can be seen at the four corners of the image. This is because the algorithm rearranges the image so that the diagonal quadrants switch with each other. This can be resolved be using fftshift()which swaps the quadrants back(top row third column). An Inverse Fourier transform is also possible by using the FFT algorithm a second time. This returns the image from frequency domain to space domain. However, as we can see in the bottom right corner figure, the image is flipped after it is subjected to another FFT.

Figure 1.

The second part of the activity is the familiarization of one of the most useful applications of FFT. Convolution is the combination of 2 mappings through the multiplication of their Fourier transform. This method allows one to create a function such that it looks both like the two original images.
For this part of the activity, we convolve circular apertures of varying sizes with an image to see its effect on the quality of the image. We can see that by convolving a small aperture to the image, we can se a low resolution image that has something like diffraction patterns. As we increase the aperture size, the convolve image’s quality improves.

Figure 2.

For the third part of the activity, we show one of the applications of convolution, which is text recognition. By convolving a text image with what you want to find, the convolution automatically correlates the image as to pinpoint matching results.

Figure 3.
 
For the Last part of the activity we used convolution for edge detection. What we did was to create a 3x3 matrix with a total sum of zero like the one below.

Figure 4.
 
This pattern is then convolved with the text image to obtain the edges of the image. The accuracy of the edge obtain seems to rely on the orientation of the negative integer in the pattern. The first edge was obtained by convolving the pattern above with the image. The second used a vertical pattern as opposed to the first one. And lastly, the third edge used a pattern were the whole edge was negative. If I were to choose, I think that the third one has the best formed edge.



All in all, I think this was an easy activity since it was basically a familiarization of something I normally use. However because there was no internet connection in the room I forgot to post this on time T^T. That is why I would give myself an 8/10 for this activity.