How to use filter
이전 댓글 표시
Hi all,
I am new to Matlab. I need to know how to use a filter to eliminate non-uniformity in an image.
댓글 수: 11
Ank
2014년 8월 28일
I can help you get started.
close all;
I = imread('11.png');
I = rgb2gray(I);
H = fspecial('disk',8);
background = imopen(I,strel('disk',40) );
background = imfilter(background,H,'replicate');
I2 = I - background;
background = imopen(I2,strel('disk',50) );
background = imfilter(background,H,'replicate');
I3 = I2 - background;
I4 = imadjust(I3);
figure;imshow(I4);
Ank
2014년 8월 28일
More hint
close all;
I = imread('11.png');
I = rgb2gray(I);
H = fspecial('disk',10);
background = imopen(I,strel('disk',77) );
background = imfilter(background,H,'replicate');
I2 = I - background;
background = imopen(I2,strel('disk',77) );
background = imfilter(background,H,'replicate');
I3 = I2 - background;
I4 = imadjust(I3);
I5 = medfilt2(I4,[30 30]);
I5 = I5-I4;
I5 = imcomplement(imadjust(I5));
figure;imshow(I5,[]);
Ank
2014년 8월 28일
Ok i am virtually telling u the answer replace the med filter with some low pass.
close all;
I = imread('11.png');
I = rgb2gray(I);
I2 = medfilt2(I,[20 20]);
I3 = I2-I;
I3 = imcomplement(imadjust(I3));
figure;imshow(I3,[]);
Ank
2014년 8월 28일
Yes. I has posted the first 2 just as some hints. The 3rd one is the closes to the answer. Your approach is correct but u can see from the result that median filter works better. Median filter is also a kind of low pass filter it is not linear that all. I guess after the results of the 3rd answer you need to process your image further like using local thresholding etc depends on what you want to do with it.
Ank
2014년 8월 28일
close all;
I = imread('11.png');
I = rgb2gray(I);
h = fspecial('gaussian',20,3);
I2 = imfilter(I,h);
%I2 = medfilt2(I,[20 20]);
I3 = I2-I;
I3 = imcomplement(imadjust(I3));
figure;imshow(I3,[]);
I = imread('11.png');
I = rgb2gray(I);
I2 = medfilt2(I,[20 20]);
I3 = I2-I;
I3 = imcomplement(imadjust(I3));
I4 = bradley(I3);
I3 = bradley(I);
I3 = I3+I4;
figure;imshow(I3,[]);
where bradley is the function in http://www.mathworks.fr/matlabcentral/fileexchange/40854-bradley-local-image-thresholding
so thing something in similar lines
imcomplement is is used as i am subtracting. check the alternative i posted for color. should be the same for color if you process it on V. I guess u cannot threshold on the V there.
close all;
OI = imread('1.JPG');
OI = rgb2hsv(OI);
I = OI(:,:,3);
h = fspecial('gaussian',20,30);
I2 = imfilter(I,h);
I3 = -I2+I;
I3 = I3-min(min(I3));
OII= OI;
OII(:,:,3) = I3;
figure;imshow(hsv2rgb(OII));
I = OI(:,:,3);
I2 = medfilt2(I,[20 20]);
I3 = -I2+I;
I3 = I3-min(min(I3));
II = I3;
I4 = bradley(I3);
I3 = bradley(I);
I3 = I3+I4;
OI(:,:,3) = II;
figure;imshow(hsv2rgb(OI));
Siam
2014년 9월 4일
Siam
2014년 9월 4일
Siam
2014년 9월 7일
Image Analyst
2014년 9월 8일
Use trial and error until you get some output that you're happy with.
채택된 답변
추가 답변 (1개)
Spandan Tiwari
2014년 8월 28일
0 개 추천
The classical homomorphic filtering might be able to help here. See the following blog post on the blog Steve on Image Processing for details.
댓글 수: 3
Siam
2014년 8월 29일
Image Analyst
2014년 8월 29일
Yes, Basically it assumes that the really, really blurred version of the image is the background or illumination pattern.
Siam
2014년 8월 29일
카테고리
도움말 센터 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!