Not sure why its not working


I am hoping someone will be able to help me. I have quite a simple picture:

And I am wanting to segment out the larvae to get some data regarding their morphology, colour, size etc.

I have a pipe line that currently consists of:
ColorToGray - convert the image to gray scale
ImageMath - Invert the image so the larvae are bright and the background dull
IdentifyPrimaryObjects - to segment out the larvae.

Now this is where it falls down - the IdentifyPrimaryObjects doesn’t seem to pull out any of the larvae regardless of the settings I use even know the larvae are clearly easily identifiable.

This is the output I see if I use Global Threshold strategy and Otsu threshold method:

The interesting part is if I ask it to filter the objects by size it perfectly identifies the larvae not issue. So why are they not being found as accepted objects.

My hunch is it is because of the broken outline around the larvae and it is causing it not to be accepted, but I can not seem to change this and I have tried every setting there is.

Any help would be greatly appreciated.




Hi Dominic,

My guess is actually that it’s something to do with your object size settings; typically pink outlines in IdentifyPrimaryObjects mean “I would have called this but it’s the wrong size”. Can you test to see if setting those arbitrarily low and high (ie setting the bottom and top as 2-400 pixels) ends with you getting some accepted objects?

If not, can you post your pipeline so that our team can take a look at it? Thanks.


Ah yes you were correct I had the size setting set to stringently I thought that I had to have them as close to the size of the object a possible so I had 65 to 150 but this was to smaller range. Resetting them to 50 - 400 works perfectly.