Image Processing - Counting nuclei

I am trying to create a program that can count the number of nuclei in such an image:

What I've already done is the following, step by step:

1. Apply an Alternating Sequential Filter (closing and opening the image with gradually bigger structuring elements)
2. Apply a distance transform
3. Apply watershed segmentation using the distance transformed image to detect minima

Which yields the following result (where each color represents a new nucleus counted):

As we can see, there are lots of imperfections, specifically, overcounted nuclei. I'd say that the reason for that problem is the way I imposed minima for the Watershed Transform (using the distance transform), but I really have no other ideas for imposing minima in that case.

As the Distance Transform generates minima based on the roundness of objects, I would like to know a better alternative to round up the nuclei than the Alternating Sequential Filter (looking at the image above, we can infer that most of the "overcounts" came from the less rounded nuclei). I would also like to know better ways to impose minima for the Watershed Transform.

• I sometimes get these kind of questions at work and ... don't go into it. I generally ask the user to go back to the microscope and acquire decent images. I am not sure I could count them accurately by hand. Is this an option in your case (redoing the imaging part I mean)? Aug 20, 2013 at 18:55
• Crazy idea, which might work depending on how many images you need to analyze and how often, but knowing that humans are better at this sort of thing: try using Amazon's Mechanical Turk. Aug 22, 2013 at 20:16
• Can you provide a ground truth for your image? (manually delineated by you) I looked at the image and frankly I can't tell you which are nuclei or which are artifacts. There are some nuclei that are composed only of several pixels? The nuclei suppose to be round/ellipse? And ultimately, as @Jean-Yves pointed out, can you get a better picture? We all can adjust contrast and luminosity but we can't re-tint the sample. Oct 29, 2013 at 8:01