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
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 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Image Processing Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by