The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Improving cell detection using watershed function for segmentation
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

Posts: 1
Registered: 4/28/13
Improving cell detection using watershed function for segmentation
Posted: Apr 1, 2013 6:30 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have a rather noisy image with stained nuclei of cells. I want to detect single nuclei and then recognize their center.
I'm quite new to image processing, I've read through a bunch of cell detection posts.
The one I found especially useful:
I completely understand what he does and my code is pretty much the same so far, besides that I adjusted parameters:

close all;

I = imread('Captured DAPI 20x 1.jpg');
figure, imshow(I),title('I')

figure, imshow(Igray)

%I_eq = adapthisteq(Igray);
%figure, imshow(I_eq), title('I_eq')

bw = im2bw(I_eq, graythresh(I_eq));
figure, imshow(bw)

bw2 = imfill(bw,'holes');
figure, imshow(bw2)
bw3 = imopen(bw2, ones(5,5));
figure, imshow(bw3)

bw4 = bwareaopen(bw3, 40);
figure, imshow(bw4)

bw4_perim = bwperim(bw4);
figure, imshow(bw4_perim)

overlay1 = imoverlay(I_eq, bw4_perim, [.3 1 .3]);
figure, imshow(overlay1)

mask_em = imextendedmax(I_eq, 15);
figure, imshow(mask_em)

mask_em = imclose(mask_em, ones(5,5));
figure, imshow(mask_em)

mask_em = imfill(mask_em, 'holes');
figure, imshow(mask_em)

mask_em = bwareaopen(mask_em, 40);
figure, imshow(mask_em)

overlay2 = imoverlay(I_eq, bw4_perim | mask_em, [.3 1 .3]);
figure, imshow(overlay2)

I_eq_c = imcomplement(I_eq);

I_mod = imimposemin(I_eq_c, ~bw4 | mask_em);

L = watershed(I_mod);
figure, imshow(label2rgb(L))

figure, imshow(I_eq), hold on
himage = imshow(label2rgb(L));
set(himage, 'AlphaData', 0.3);
title('Lrgb superimposed transparently on original image')

Especially important is the mask line:
mask_em = imextendedmax(I_eq, 15);

The Problem I have is if I lower the second parameter too much, I'll get a lots of point that I don't want and are mostly due to noise. But with the current setting it doesn't find a maxima region in every cell.
Does anybody have a good idea how to improve the mask for the watershed so I'll detect all my cells individually?

Here are some pictures for you to see what I mean:
starting image: [IMG][/IMG]
watershed: [IMG][/IMG]
watershed overlay: [IMG][/IMG]

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.