Click here to Skip to main content
15,895,538 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
hello
I've got an Image processing homework and need help
I've got a noisy camera man photo
when I used fft transform to know exactly where the noise is located I found it like a circle so I have to filter the image using a band-stop filter
my code in matlab is:
i = imread('D:/MY UNIVERSITY/FIFTH/IMAGE PROCESSING/practical/homework/9.jpg');
i=im2double(i);
i1 = fft2(i);
i2 = fftshift(i1);
figure,imshow(log(1+abs(i2)),[]);
[x,y]=meshgrid(-128:127,-128:127);
z=sqrt(x.^2+y.^2);
c = (z<30 & z>40);
c1 = fft2(c);
c2 = fftshift(c1);
figure,imshow(log(1+abs(c2)),[]);
cm = c2.*i2;
cm1=ifft2(cm);
figure,imshow(log(1+abs(cm1)),[]);

but it didn't work, when I showed the filter photo it was totally black and it isn't what I need to filter the image
Is it wrong what I did
any help will be appreciated
Posted
Comments
Sergey Alexandrovich Kryukov 25-Dec-14 12:19pm    
Maybe the only really wrong thing is that you did not try to troubleshoot the solution? :-)
—SA
Mujeeba Haj Najeeb 25-Dec-14 13:23pm    
What do you really mean by saying I didn't try to troubleshoot the solution, I've been working on this problem for three days
Sergey Alexandrovich Kryukov 25-Dec-14 15:04pm    
I said "maybe". Did you really use the debugger, etc..?
—SA
Mujeeba Haj Najeeb 25-Dec-14 15:23pm    
Yes, I did every thing, as you see in code I used imshow instruction in every step and the result of the filter was totally black(without any pass areas)
Sergey Alexandrovich Kryukov 25-Dec-14 16:29pm    
Right...
—SA

1 solution

finally I've solved it
the error was there is no reason to make fourier transform to the filter
thanks for time you gave to help
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900