How to detect nuclei in cell using matlab

i would like to ask you how to detect the nuclei in my picture below. i try watershed segmentation it not working. i dont know why. please give me matlab coding

please help me to give matlab code. i really dont know how to write the code to detect nuclei


What are the objects in the image here? Are the nuclei at the center of the purple objects/cells? What is all the debris? You could try the UnmixColors module, but we would need some more info before we could be of much help.

Please note that CellProfiler (and most other image analysis software) functions best if the the objects of interest are fluorescently marked – brightfield images are harder to analyze. See the FAQ on brightfield here for tips.\

And also note that for 4(?) years now, CellProfiler has been coded in python, not Matlab. Feel free to take a look at our old svn repo here though: … old_matlab


the nuclei at center of cell. the dark purple clolor

I would suggest that you instead use a nuclear stain, like DAPI or Hoechst. I find it difficult to do this counting/detection by eye!

But to do this in CellProfiler:
(1) Images module: Ensure that “color” input is chosen (and by the way, try to avoid lossy JPG images)
(1a) Optionally, you could use an feature enhancing module here, like a tophat filter to highlight objects about the size of the nuclei and which are more-or-less circular (EnhanceOrSuppressFeatures->Speckles)
(2) UnmixColors: You need to convert the color into grayscale, but how to do the color deconvolution with whatever purple marker you have? (And what marker is this?) UnmixColors has a number of preset stains and you can choose a purplish one to start with, e.g. PAS.
(3) IdentifyPrimaryObjects: I would suggest Otsu as the thresholding method set to use 3-classes, because the cytoplasm also stains lighter purple.

Hope this helps!

thank you sir. i will try