Analyze particles - problems with mean, min, max values

Tags: #<Tag:0x00007fd697e39980> #<Tag:0x00007fd697e39840>



I just started using ImageJ in order to count and measure egg batches of insects but have gotten into problems when it comes to the “Analyze particles” function in ImageJ.

To give you a short summary of what I have done so far in order to count the eggs with the funciton analyze particles.

I started off with importing the picture and chaning the image type to 8bit (image -> Type -> 8-bit) and then set the scale (Analyze->Set scale) adjusting the threshold (Image->Adjust->Threshold) so that the eggs are black with a white background. I then fill in holes ( Process->Binary->Fill in holes) and watershed (Process->Binary->Watershed). The last step is the analyze particles step (Analyze->Analyze particles) and it’s here that something is messing up. As you can see in the picture, the results tables mean,min and max values are all 255 for all the eggs. Does anyone know why this is the case and how I could fix it? If anyone have a better way of doing the egg counting, hit me up.

Kind regards,



Hi Blanca,

So, your current workflow will give you the count of the eggs, but not the correct measurements as you are measuring the black&white, binarized image (I assume). You need to measure the regions you defined in the binarized image in the raw, unprocessed image.

Try checking the Add to manager box in the analyze particles dialog, then apply these regions to your raw image and then measure. You can also check Summarize… to give you a count of the regions directly from analyze particles.

Manual tresholding is not generally recommended, if you share a few samples of your data, maybe someone can suggest a better approach :slight_smile:


Hi Sverre,

I been looking into your solution but didn’t manage to fix it. You are correct that I’ve been trying to measure theblack&white image. I’ll attach one photo of the eggs if anyone out there is willing to give this a shot.

I’ve also had a problem with deattaching the eggs from eachother that are aggregated. I’ve tried using Process->Binary->Watershed with the 8-bit black and white image but still haven’t been successful. However, the most important at the moment is to fix the problem I have with measuring the eggs.

Kind regards,



Can you be more specific please? Is it the transferring of the regions to the raw image that is giving you problems?

I’d say step one for you is to improve image acquisition, you’ll want to even out the illumination and try to get rid of the shine on the surface below the dish.

I’ve had success with the watershed irregular features plugin.


Otsu auto-threshold followed by watershed irregular features gives me this, it’s not perfect but I’d say pretty good. You might have more success with a more sophisticated segmentation such as the trainable weka segmentation plugin.


Hi kid!
When you threshold an image as you will only get two values, the light and dark values, either a 0 or 255 there will be no mean value but these represent the minimum and max values.
From this you can calculate the mean and mid values by hand or use the Trainable Segmentation plug-in trained for 3 Classes using class 2 as the mean if you use a section suitable for it.
Let me know if this helps, I’m not quite sure I understand if this is what you are looking for.