Wednesday, August 11, 2010

Activity 7: Properties of the 2D Fourier Transform

Results:
In mathematical terminology there always pairs in fourier transforms, wherein whatever pattern is operated with fourier transform results in its fourier transform pair. Figures 1 to 5 show some Fourier transform pairs.


Figure 1: The Fourier pair of the square centered at the origin


Figure 2: The Fourier pair of the Annulus


Figure 3: The Fourier pair of the Square Annulus


Figure 4: The Fourier pair of two slits on the x-axis


Figure 5: The Fourier pair of two dots on the x-axis


It can be seen that the patterns produced are just combinations of the different fourier transforms. For example in Figure 4, the resulting figure is the combination of the sine pattern from the dots and the sinc function from the square or step function.

There are other properties of the FFT like the inverse space relation from its source. This can be seen on Figures 6, 7 and 8.



Figure 6: Pair for sinusoid with f = 4



Figure 7: Pair for sinusoid with f = 8


Figure 8: Pair for sinusoid with f = 2


It can be seen that as the spacing between the peaks on space increases the separation between the points on the fourier space decreases. This is a direct consequence of the dimension of fourier space which is space frequency of inverse space. Thus it is intuitive to predict that the separation change in one space is the opposite on the other.

Another property of the fourier transform is its rotation. Figures 9 and 10 shows the result of rotating in space and it's effect in the fourier domain.



Figure 9: Rotation by 30 degrees from the horizontal



Figure 10: Rotation by 45 degrees from the horizontal


It can be seen that a rotation on the x-axis in space results in a rotation in the fy axis in the Fourier domain.

Effects of products in fourier space is shown in Figure 11.



Figure 11: Product of the sinusoids resulted in a product of their fourier pairs


Applying the properties of the fourier transform we try to sum all of our results and try to predict the resulting fourier transform. Figure 12 shows the resulting image of the sum.


Figure 12: Summed Sinusoids


Since it is just the sum of all our results then the resulting fourier transform would be the sum of all their fourier pairs.


Figure 13: Resulting FFT

Self Evaluation: 9. Late again in posting but all concepts are well explained and the results required are presented.

References:
[1]M.Soriano,Activity 7: Properties of the 2D Fourier Transform, July 2010

Activity 6: Fourier Transform Model of Image Formation

Results:
Analysis in Fourier space can further improve the quality of an image through filtering of undesired frequencies. It is in also in Fourier space that we can filter out noise due to the concentration of the its frequencies near the center. Likewise the Fourier transform of an aperture is the pattern formed by the diffraction of a a plane monochromatic light with the pattern as the aperture. Figure 1 and 2 shows the object and the Fourier transform respectively.


Figure 1: Circular Object


Figure 2: FFT of the Circulat Object


Due to the algorithm the orientation of the Fourier Transform Image is disarranged, we must operate an fftshift on the image to return it to its original structure.


Figure 3: fftshift operation on the fft of the Circle


It can be seen that the Fourier Transform of the Circle is the Airy pattern which is also the diffraction pattern produced by a pinhole by diffracting plane wave light source.

Application of FFT on the FFT of the circle will reproduce the circle. However for the Case of the letter A this becomes the result.


Figure 4: Letter A to FFT(A) to FFT(FFT(A))


This examples shows that 2 fft operations will flip the image which we did not notice on the circle since it is radially symmetric.

A lens or an apperture in mathematical form acts on the images through convolution or in Fourier space, the multiplication of their Fourier transforms and taking its inverse fourier transform. Figure 5 shows the process of convolving the VIP image with a circle that acts as an apperture of the lens.
Figure 5: Comparison of Convolved Image(left) with the original Image(right)


Figure 6 shows the effect of the aperture size with the projected image.


Figure 6: Increasing apperture size resulting Image(0.05, 0.2, 0.5)



The correlation is like finding the pattern present on the image using a template for comparison. Figure 7 shows an example text with the same font type and font size used as the letter A in the earlier discussion. Here we try to find what would be the resulting form of the image if we determine the correlation of the letter A with the Image.



Figure 7: Sample Image to find the correlation between A


Figure 8: Result of the correlation


Figure 8 shows that the highest intensities or the whitest part coincide with the parts of the text that really do contain the same letter A which is why the are perfectly correlated and the correlation shown obtained the highest value.

Finding the correlation is like template matching and using certain matrices one can detect edges from images which is important in contour mapping of land and other image processing applications.

Figure 9 shows samples of edge detected images. Note that the template to be used must have an overall element sum of 0 for the primary reason that we are trying to prevent biases in the edge detected image.


Figure 9: Samples of edge detected images of VIP


It can be seen that the template matching or edge detection depends on the gradient of the template in which the priority edge of detection is the portion of large gradients.

Self Evaluation: 9, Late again but complete and extensive results.

References:
[1] M. Soriano, Activity 6: Fourier Transform Model of Image Formatting, July 2010



Activity 5: Enhancement by Histogram Manipulation

Results:
Images taken from cameras usually contain undesired forms which may not be appropriate or desirable for presentation. Histogram Manipulation is one way of enhancing or improving the visual quality of an image through mapping a desired CDF(Cummulative Distribution Function) on the image. Figure 1 shows a sample colored image for testing different CDFs and its effect on the image.

Figure 1: Original Colored Test Image


The First Step in the process in the conversion of the Test Image into Grayscale. Histogram manipulation can be done on colored images however the each primary color (RGB) must be manipulated for the desired result. Figure 2 shows the gray scale image converted using Scilab's gray_imread function.

Figure 2: Original Image converted into grayscale


The original information of the image can be extracted from the histogram of the pixels values on the image. Likewise, summing the histogram value generates the CDF of the Image. Figures 3 and 4 show the Histogram and the CDF of the Image respectively.

Figure 3: Histogram of the Original Image


Figure 4: CDF of the Original Image


We can manipulate the histogram of the image by choosing a desired CDF for the image and mapping the values of the desired CDF to the corresponding pixel value from the original CDF into the image. Figure 5 shows a linear CDF and Figure 6 shows the manipulated image.


Figure 5: Linear Desired CDF


Figure 6: Resulting Image from Linear CDF manipulation


To confirm the results of the mapping, we take the histogram and CDF once again

Figure 7: Histogram of Figure 6 Image


It can be seen that in takin the CDF of this Histogram we will recover the linear CDF that we mapped on the image. For the next images different CDFs are used to manipulate the original image and proofs on the mapping are also shown.


Figure 8: From Left to Right (Desired CDF, Image Manipulated, Histogram, CDF of image)
This is for Inverse Square CDF.



Figure 9: Logarithmic CDF Process



Figure 10: Sine CDF process


Note that we can't use the full Sine Function for our CDF since there is a negative portion in the derivative of sine then the CDF will have a decreasing part which represents a negative part in the histogram. It is physically impossible to have negative pixel occurrences.



Self Evalutaion: 9. Showed and understood well the results and showed proofs on the success of the Histogram Manipulation although late posting again.

References:
[1] M. Soriano, Acitivty 5: Enhancement by Histrogram Manipulation, June 2010