Steve on Image Processing

April 23rd, 2011

Color-based segmentation demo on the File Exchange

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 Responses to “Color-based segmentation demo on the File Exchange”

  1. khadeejah replied on :

    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

  2. Steve replied on :

    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.

  3. khadeejah replied on :

    hai steve …. thank u so much …! :D I will try what you have suggested :D !


MathWorks
Steve Eddins is a software development manager in the MATLAB and image processing areas at MathWorks. Steve coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.

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