How to implement LAB color space to detect yellow in image?
2 次查看(过去 30 天)
显示 更早的评论
>>Hello, I need some help to detect yellow exudates in a retinal image. LAB or HSV colour space can be used. I have chosen the LAB colour space. How must the if statement look if the user use gtool and clicks on yellow dot to segment that or identify that as a yellow exudate?
here is my code:
RGB2=im2double(OriginalRGB);
cform = makecform('srgb2lab');
lab = applycform(RGB2,cform);
figure,imshow(RGB2);
[d1 d2]=size(RGB2);
yellow_redThreshold = 200;
yellow_greenThreshold = 200;
[X Y]=ginput(2);
x=round(X);
y=round(Y);
punt=[x y];
for a=1:x
for b=1:y
if (yellow_redThreshold < punt <yellow_greenThreshold)
figure,imshow(punt, []);
title('Yellow exudate');
end
end
I want it to do something like this
1 个评论
Narges M
2013-7-23
Do you mean something like this?
punt=lab(x,y,:);
if ((punt(1,2,1) < greenThreshold) && (punt(1,3,1) > redThreshold))
...
end
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!