noise removing for image processing
古いコメントを表示
Hi. I still in learning process. I want to remove noise in the image. I found this code where the noise successfully removed but the problem is I don't understand the code. I want to know how it work from row to row. Here the code that I had found.
I=imread('boy_noisy.gif'); %read the image
I=double(mat2gray(I)); %convert to double and change it to gray
I=imresize(I,[256 256]); %why should we re-size it?
[rows,cols]=size(I);
I=I-mean(I(:)); % I don't know the purpose for this code
f=fftshift(fft2(I));%use fourier transform
fabs=abs(f); % I don't know the purpose for this code
roi=3;thresh=400; I don't know the purpose for this function and why use roi?
le=ordfilt2(fabs,roi^2,ones(roi)); % use ordinal filter but I still don't understand this part
figure,imshow(le) %display
%I don't know all this part
r=(fabs==le)&(fabs>thresh);
[r,c]=find(r);
for i=1:length(result)
if (result (i)-128)^2+(c(i)-128)^2>400
f(result (i)-2:result(i)+2,c(i)-2:c(i)+2)=0;
Inew=ifft2(fftshift(f)); %inverse fourier transform
imagesc(real(Inew)),colormap(gray); % turn back the colour
1 件のコメント
William
2015 年 1 月 3 日
highlight code sections using the "{} code" button - makes it much easier to read and more likely to get answered
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!