Remove noises from image
5 次查看(过去 30 天)
显示 更早的评论
I should remove noises from attached image. I saw gaussian noise and I tried to remove it. However there are other noises at low frequency (in my opinion) that I should remove to make the image more visible. Can I apply hight pass filter? Are there other kind of noises in your opinion? this is the code that I wrote:
im=imread('lenaNoise.jpg');
%remove gaussian noise
h=fspecial('gaussian',13,.9);
s=imfilter(im,h,'conv');
figure(5)
subplot(1,2,1),imshow(im,[])
subplot(1,2,2),imshow(s,[])
then I tried to apply hight pass filter but I got wrong
%hight pass filter
sd=im2double(s);
[f1,f2] = freqspace(31,'meshgrid');
Hd = ones(31);
r = sqrt(f1.^2 + f2.^2);
Hd(r<0.6) = 0;
im_filtered=imfilter(sd,Hd,'conv');
%im_filtered=uint8(im_filtered);
figure(6)
subplot(1,3,1),imshow(im,[])
subplot(1,3,2),imshow(s,[])
subplot(1,3,3),imshow(im_filtered,[])
Can someone help me to remove all noises from this image or suggest me how to do?
0 个评论
回答(1 个)
Image Analyst
2015-4-27
Gaussian noise does not mean that you should blur with a Gaussian filter. I think you're getting the concepts mixed up. The noise is on the intensity while the filter blurs spatially. Anyway, a Gaussian, or any blur, will reduce the noise, though I think the wiener2 filter is probably a better choice as far as not blurring the original image that you want to recover.
You wouldn't want to do a high pass filter, at least not one with a fairly high cutoff frequency. Your other noise looks like a very very broad sinusoid vertically so you'd have to have a very very low cutoff frequency. You might see what it looks like in the Fourier domain. A cosine would have a couple of bright spikes in the spectrum that you could zero out. If you don't see them, then you could just try to fit the image to a sine wave and divide it out. Normally a high pass filter makes the image look noisier so if you use one by doing a convolution, to have a really low cutoff frequency, you'll need a huge window - that's why I suggested doing it in the Fourier domain. See my attached demo (which works on a different image).
3 个评论
Image Analyst
2015-4-28
That wave is such a low frequency it would be the pixels right next to the DC spike, not away from it, so they won't show up as distinct and separate spikes. With this kind of noise you might have to use some non-linear spatial denoising method like median filter or non-local means or something. How did the image get corrupted in the first place? Or did you intentionally add noise?
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!