I'm a new one and i have problem with segmentation

Hello everyone,
I’m new here, i’m trying to use imageJ for my graduation thesis based on the study of ice cream crystal. With a digital microscope a made same picture like this:

and now i try to process the image. i want to know the area of single ice cream crystal. But i have serious problems with thresholding and segmentation.
Somebody can explain me how to do? I already saw many video tutorials and read almost all the guides and employ the different tecnique and also invent news one but nothing. I’m not able to do the segmentation so when i run analyze particles the edges of single ice crystal are wrong.
Can you show how to do?

Good day Andrada Zabara,

the most important prerequisite for successful image processing and image analysis is a good quality of the images, i.e. the image acquisition process needs to be optimized. Please be aware that if this process is suboptimal, it will take great post hoc processing effort to compensate for deficits and most often a compensation is impossible.

That said, your example image suffers from uneven illumination (from top to bottom). This is especially detrimental for successful thresholding.

You should optimize the process of image acquisition:
Illumination, microscopic imaging and camera.





Have you looked into the plugin Trainable Weka Segmentation(TWS) at all? This might be the ticket in your case… This workshop on Segmentation in Fiji goes over a step-by-step example using this plugin - here are the corresponding slides.

I did a quick try on a cropped section of your image using TWS and got this result:

It’s not perfect. But could be a place to start to get the mask you need for measuring your crystal areas.

Hope this helps get you a start!

eta :slight_smile:


Today i took some new images, like this

I did the segmentation like this:

  1. enhance contrast 40%
  2. smooth
  3. convert mask
  4. fill holes
  5. watershed
  6. analyse particles

My question is: i didn’t use the voice threshold, it is wrong?
The ice crystal didn’t fill all together in the same way. How can i improve this?

I try to use weka but doesn’t run.

What do you mean? Did you get an error message?

Yes. Here you are what i see.

OK, so you run out of memory. Your image is very large and you used many features. You might want to either scale your image to a smaller size, or use less features. Have a look at the recommendations we give in the manual (section 3.5) provided as supplementary material of the plugin publication.


Good day Andrada Zabara,

in fact the image quality appears better now with respect to illumination, although only in the center (about a square-sized area) of the image. Your microscope is either bad or its setup is suboptimum.

What remains on the one hand is severe noise that appears to be due to the camera and on the other hand touching particles. To reduce camera noise by lowpass-filtering isn’t a good idea because it worsens particle separation (segementation). Use a better image acquisition system!

Touching partcicles can be separated by use of watershed-operations but with the present image quality it appears not very satisfying.

With suitable microscopic imaging it should be possible to reduce the structure within the particles which will ease the “fill holes”-process.

Of course classifier-approaches may do a good job, but I think they are overkill when good results can be obtained by adequate image acquisition techniques.