0

I am trying to segment colored cells from original images like this:

enter image description here

The blue colored cells are targets that I want to segment and counted.

Here is the code I use:

global ButtonDown

img=imread('Zoom.png');
hsv=rgb2hsv(img);
s=hsv(:,:,2);
bw = imbinarize(s,graythresh(s));
figure

imshow(bw)
se=strel('disk',5);
bw2=imclose(bw,se);
bw3=bwareaopen(bw2,200);
figure
imshow(bw3);

D=-bwdist(~bw3);
mask=imextendedmin(D,2);
D2=imimposemin(D,mask);
Ld=watershed(D);
Water_splited=bw3;
Water_splited(Ld==0)=0;
%axes(handles.axes1);
show_img=Water_splited;
figure
imshow(show_img)


if ButtonDown == 1
 pos = get(handles.axes1, 'CurrentPoint');
 row=floor(pos(1,2));
 col=floor(pos(1,1));
 Diy_splited=show_img;
 Diy_splited(row,col)=0;
 show_img=Diy_splited;
 axes(handles.axes1);
 imshow(show_img);
end

I used a watershed algorithm to segment adherent cells, however, over-segmentation occurred.
The results are:

enter image description here

So how to avoid this over-segmentation issue?

Cris Luengo
  • 55,762
  • 10
  • 62
  • 120
HAOYANG MI
  • 151
  • 11
  • Over segmentation? You are just segmenting a small part of that image you posted, right? somewhere the top left part these cells are there with the same shape – Ander Biguri Jan 10 '19 at 17:36
  • I think Haoyang meant the multiple lines for the bottom right cell. Well, I ran the code and did not get the same image. If you can, make the code work with the image you gave so we can see what went wrong – Yuval Harpaz Jan 10 '19 at 19:21
  • Hi Yuval, thank you for your notice. I realized that I posted wrong original images and I re-uploaded the correct one and know the codes should work. – HAOYANG MI Jan 11 '19 at 03:29

0 Answers0