Stuck on homeworks about Image processing

Discussion in 'Homework Help' started by imagelam, Nov 1, 2010.

  1. imagelam

    Thread Starter New Member

    Nov 1, 2010
    I hope this is the right place to ask, I've stucked deeply in the assignment and seeking for help. Also I have bunch of concepts want to clear about Fourier Transform of Image.

    1) I've been told to apply the Low and High pass filter of 2 images respectively to see the effect of different cutoff frequency of ideal low pass and high pass filters and turn out that the image which I have applied high pass filter with cut off frequency 10 and 20 are not as expected (My friend's image show some ripples outside the "head" but mine doesn't shown). I use matlab to implement this and does not know which part of my coding goes wrong, is there any nice guy can give me a hand?

    Here is the original image

    Here is my High Pass Filtered image (with cut off frequency Dcutoff(u^2+v^2)^1/2=20))

    Here is my implementation code

    %read the image

    %do the 2D DFT
    A =fft(fft(image).').';

    %Open new clean copies of matrix for Q4 and Q5
    BQ4L = B;
    BQ4H = B;
    BQ5L = B;
    BQ5H = B;
    %Q5 HPF image01 and image02
    for u=1:256
    for v=1:256
    %ideal low-pass filter for 2 images
    if u^2+v^2<400

    %Do the Inverse FFT
    KKKQ5aHN=(KKKQ4aH-min(min(KKKQ5aH)))*1/(max(max(KKKQ5aH))-min(min(KKKQ5aH))) *255;
    KKKQ5bHN=(KKKQ4bH-min(min(KKKQ5bH)))*1/(max(max(KKKQ5bH))-min(min(KKKQ5bH))) *255;


    Here is the end of my implementation code

    2) This is about Fourier transform concept
    Is the spectrum shown after FT only the "magnitude" part of the image?
    And is "magnitude" of image actually means "How many different frequency components an image contains"?

    3) Why in the following spectrum, the distance between the zero part is actually the opposite in the spatial domain? What I mean is the length to width rato (1:2) when observed from the frequency domain, just reverse with each other?

    Thank you very much for your attention!
    Last edited: Nov 1, 2010