Complete by Class 7
DFT
In the following problems, if you did not get your DFT program to work, you may use this one, with appropriate changes. Files are (in addition to the usual img.c and img.h):Filtering
Use your DFT program to perform ideal low-pass filtering. The ideal low-pass filter is parameterized by a cutoff frequency, call it w. The ideal low-pass filter has a response of 1 when the input frequency is less than some input parameter w. In particular, we require that u2 + v2 ≤ w2.
Compute the Fourier Trannforms of your test images and set to zero those components outside the passband. Then transform back to spatial coordinates to view. As before, you may find it convenient to multiply by (-1)x + y to shift the transform to the middle of the image.
Test your program on the moon and (if you have the processing time)
telescope images using various
cutoff frequencies.
There are two versions of the moon
image: moon1
is a 256x256 image
and moon2
is a 64x64 version. Discrete Fourier Transforms can
be quite computationally intensive so you may find it more convenient to
use the second image.
You can find them here:
moon1.img,
moon1.tif,
moon1.gif
moon2.img,
moon2.tif,
moon2.gif
telescope.img,
telescope.tif,
telescope.gif,
Noise
Write a program to add white gaussian noise to an image. The noise standard deviation s should be input as a parameter. If you are wondering how to generate gaussian random variables, a sufficiently good approximation for our purposes is to add 3 samples from a uniform distribution. That is, generate and add 3 random numbers from 0 to X. The mean of the sum will be 3X/2 and the variance will be X2/4. Normalize the sum make a zero-mean random variable with standard deviation s.What happens if you try to bandpass filter the noisy image? Try it.
Convolution
Problem 5.21. Hint: You may find it much, much easier to start with H(u,v) and derive h(r).What to hand in
Hand in to class