Image Illumination Correction problem
이전 댓글 표시
Dear All;
I am trying to image correction for illumination and i have tried to use the same way the matlab presented but it does not work for me, can you help me in that.
The code that I wrote:
a = imread('Slug Flow.jpg');
% Convert the image to gray level image
b= rgb2gray(a)
% Apply adaptive histogram eqaulization to enahnce the contrast of the
% image
c=adapthisteq(b);
% Illumination Correction
MN=size(c);
background = imopen(c,strel('rectangle',MN));
I2 = imsubtract(c,background);
I3= imadjust(I2);
% Convert to binary image
level = graythresh(b);
d=im2bw(I3,level);
bw = bwareaopen(d, 50);
답변 (1개)
Image Analyst
2013년 9월 14일
0 개 추천
What does your image look like?
You don't want a structuring element the size of your entire image! That will give you an image out that's just a single uniform gray level. Make your structuring element smaller, like 5 or 9 pixels in diameter.
What's all the stuff about binary image for?
Do you have a "blank shot"? If so, that would be better than using adapthisteq() which is really a last resort if you don't have a background image at all and need to estimate one from the image itself, assuming that some part of the background "shows through" your sample and you know that your sample is either brighter or darker than the background.
After you have the background image what you do depends on your image. For radiology and fluorescence you subtract the background, for most other image modalities you divide by the background.
댓글 수: 2
mustafa alnasser
2013년 9월 14일
Image Analyst
2013년 9월 15일
Where did you upload your image to (so I can try something)?
카테고리
도움말 센터 및 File Exchange에서 Contrast Adjustment에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!