Week 7 Homework: Image Processing

 

This week you will use a software program called Digital Filter PPC to alter greyscale images of faces, text and gratings. This exercise is to be completed in the Electronic Classroom, and the files to be used are in the folder named "SpatFreq" - copy this folder to the local workspace on the computer you're working on.

You're going to alter the images by FILTERING them - this means you will remove certain spatial frequencies from the image while leaving other spatial frequencies intact. The purposes of the exercise are: 1) to become familiar with the consequences of different forms of filtering, and 2) to simulate what an infant and what an old person might see, based on your knowledge of their contrast sensitivity.

Before tackling this homework assignment, you must familiarize yourself with the concept of spatial frequency and the contrast sensitivity function. To do this, study the tutorial that has been prepared for this purpose. Once you've familiarized yourself with the concepts of spatial frequency, contrast and contrast sensitivity, proceed to the homework.


Open the folder and double-click on the application:

This will bring up a menu bar and a "Filter Controls" window that looks like this:

 

The scale at the top - running from Low to High - denotes the spatial frequencies that will be removed from the image you're filtering; the number to the left denotes the "cutoff" frequency for the filter you're working with. The blue "slider" allows you to set the cut-off frequency, and as you vary the slider's position you'll notice that the cut-off value changes. The lower left-hand part of the Filter Control window tells you what kind of filtering you're using: Low Pass, High Pass, Band Pass and Notch. You select the filter type using the "Filter" option on the menu bar:

 

Low Pass filtering removes all spatial frequencies ABOVE the cutoff frequency; "low pass" means, in other words, that the filter passes low spatial frequencies but not high spatial frequencies.

High Pass filtering removes all spatial frequencies BELOW the cutoff frequency; "high pass" filter passes high spatial frequencies but not low spatial frequencies.

Band Pass filtering removes low and high spatial frequencies, leaving just a band of frequencies in the middle.

Notch filtering removes a band of frequencies in the middle of the spatial frequency range, leaving high and low spatial frequencies in the filtered image.

The best way to gain appreciation for the visual consequences of these various filtering techniques is to try each one, varying the cutoff frequencies as you do. Here are the steps involved:

1. Select an image to filter - to do this, select "open" under the File menus; this will reveal the images available to you for this exercise and homework. Start with the LisaOriginal.PICT.

2. Select the type of filtering you want to apply to this image from the "Filter" menu. Start with Low Pass.

3. Set a cut-off frequency for the filter (i.e., the value beyond which spatial frequencies will be removed) using the blue slider control. You'll try lots of different values, so don't worry about which one you start with.

4. Select the "Filter Image" option under the Filter menu:

5. Click "OK" when the following dialog box appears:

(Later you should try using different filter efficiencies, to see the consequence.)

At this point the application converts the original image into a "data representation" which then has certain spatial frequency values removed (i.e., filtered). Technically, this program is implementing a 2D Fast Fourier Transform on the original, filtering that FFT'ed image, and the inverse filtering it to return it to a visible representation.

5. Compare the resulting, filtered image to the original to see the consequence of removing the frequencies you selected.

6. Repeat these steps using different cutoff frequencies.

7. Select another type FILTER (high-pass, notch, band-pass) and explore what happens with those.

8. Based on the CSF for an infant and the CSF for an elderly person (see tutorial notes), simulate what a face (use Lisa) would look like to these two categories of individuals.


Homework questions

1. What low-pass cut-off frequency do you have to select in order to get the Sinewave High image to be invisible (i.e., appear uniform grey)? How about the Sinewave Med image? The Sinewave Low image?

2. What high-pass cut-off frequency values are necessary to achieve this same effect for these three images?

3. How much can you low-pass filter the Text Large and still make out the words? How about the Text Small?

4. Suppose you had to transmit greyscale images from Mars to Earth electronically. To save time and file space, you decide to filter the images before transmitting them, but you want the images to contain sufficient detail that humans on Earth can make out what the images portray. What bandpass filter type and filter values would you recommend for conveying a useful image of the "Stooges"? What properties of this image (indeed, of most natural scene images) make it possible to achieve savings by filtering?

5. How is this filtering business related to receptive fields in the visual system? Do neurons behave like filters?

You may turn in your answers to these questions on paper or as typed answers in a file posted to the Homework folder. You should have answers completed by Friday 2/26.


Return to Home Page