Steve on Image Processing

Color-based segmentation demo on the File Exchange 3

Posted by Steve Eddins,

I have posted a few times about using L*a*b* space to do color segmentation. (See, for example, my 04-Feb-2011 post.) There's also a product demo explaining the idea.

For a different take on the idea, including a GUI tool for selecting a desired color region and for visualizing the segmentation results, see Image Analyst's new MATLAB Central File Exchange contribution, "Color segmentation by Delta E color difference."

screenshot thumbnail

3 CommentsOldest to Newest

hai steve . Am sorry am commenting here. I do not know hw else to ask you my question. I have this image which is an Ir image capturing veins: http://lastqueen21.blogspot.com/2011/04/image.html. I want to retain just the veins as black and get rid of eveything else. This is what I have done till now .
a=imread(’11.jpg’);
figure(1),imshow(a);
cform = makecform(‘srgb2lab’);
for ii = 1:3
a(:,:,ii) = medfilt2(a(:,:,ii),[5 5]);
end
lab = applycform(a,cform);
figure(2),imshow(lab);
b=lab(:,:,1);
c=im2bw(b,0.2);
figure(3),imshow(c);
neg=1-c;
figure(4),imshow(neg);
color=a;
r=color(:,:,1);
r(~c)= 0;
g = color(:,:,2);
g(~c)= 0;
b = color(:,:,3);
b(~c)= 0;

color = cat(3,r,g,b);
figure(5),
imshow(color);
gray=rgb2gray(color);
figure(6),imshow(gray);

I want to make the backgroung white. And then somehow eleiminate the other parts except the veins . So how do I go about this ?? Sorry agin to comment here about this :(

Thank you

Khadeejah—I experimented for a few minutes with your image but did not get a promising result. I don’t think a color-based segmentation technique is going to be promising. Possibly you could use grayscale morphology operations with linear structuring elements oriented at different angles to emphasize and then segment the veins.

These postings are the author's and don't necessarily represent the opinions of MathWorks.