CS 7321 Winter 1998
PS#2 Solutions by Tahia Infantes Morris
                       Images and Spatial Properties
 
 



How I solved it

        Take a look at the code below. Otherwise, what I did was create my own 256x256 image of three black lines on a white background. I then wrote a low and high pass filter and filtered the image. I had to rotate the image approximately 30 degrees before I high-pass filtered the image to obtain something close to result (b). Next, I took the fft of the original, low-passed, and high-passed image to get the results below. I also created a synthetic image and used a scanned-in black and white image I drew to see what the results of the function would look like. The results are also included below.


Assumptions and Weaknesses

        Well, for one thing. I assumed that the images will be 256X256. I could have changed this quite easily to accomodate for variable size images, but didn't feel like. Also, result (f) in the book..... I assumed that this was zoomed in or something. I do not see how it would be possible to get a circle that big with a 256X256 image with only black three lines. I tried playing with the image by increasing the line numbers and image size and got better results - or at least results that looked closer to that of the book. However, I stuck with 256x256 with only three lines because that is what was implied by the figure text. hmmmph.


Improvements and Possible Future Work

        I could write it accomodate for variable size images and possibly tune it some so that it runs faster. Perhaps use another technique for filtering the images?


Results

 
 
(A) An image, f(x,y) (B) A rotated version of (A), filtered to enhance high spatial frequencies
(C) Similar to (B), but filtered to enhance low spatial frequencies (D) The logarithm of the power spectrum of (A) 
(E) The logarithm of the power spectrum of (B)  (F) The logarithm of the power spectrum of (C) 
 
 
(2A) A second synthetic  image, f(x,y) (2B) A rotated version of (2A), filtered to enhance high spatial frequencies
(2C) Similar to (2B), but filtered to enhance low spatial frequencies (2D) The logarithm of the power spectrum of (2A) 
(2E) The logarithm of the power spectrum of (2B)  (2F) The logarithm of the power spectrum of (2C) 
 
 
(3A) A 'real'  image, f(x,y) (3B) A rotated version of (3A), filtered to enhance high spatial frequencies
(3C) Similar to (3B), but filtered to enhance low spatial frequencies (3D) The logarithm of the power spectrum of (3A) 
(3E) The logarithm of the power spectrum of (3B)  (3F) The logarithm of the power spectrum of (3C) 

 
Source Code