Please help. I need some help to do yellow segmentation from my retina images. The goal is to use the LAB colour space, and then by means of distance calculation, obtain the new image with everything that is yellow become white and the background black.
Here is my code. I used gtool to select the yellow, and then it must be that yellow that the user has clicked on to determine which are the nearest distance to that colour. What must I further do?
cform = makecform('srgb2lab');
lab = applycform(OriginalRGB,cform);
euclidean_distance = norm(((pixel(:,:,2)-a).^2+ (pixel(:,:,3)-b).^2).^0.5);
end I need to obtain the segmented image?
I have several color segmentation demos in my File Exchange. I doubt that LAB would be the best color space for finding yellow, though it could be depending on what your image's gamut looks like. But most likely, you're better off using hsv color space. Here's one demo of mine that finds yellow: http://www.mathworks.com/matlabcentral/fileexchange/28512-simple-color-detection-by-hue Check out the other segmentation tutorials I've uploaded also.