Segmentation of images of related objects with a watershed

I am trying to split related objects. Python and the watershed algorithm (scipy implementation) seem to be well suited to solve this problem.

Here is my image and automatically created sowing points of the watershed (local image maxima with threshold and distance):

seeds = myGenSeeds( image_grey ) 

enter image description here

So far so good; there is a seed for each object.

Things break when I start the watershed, though:

 segmented = ndimage.measurements.watershed_ift( 255 - image_grey, seeds)` 

enter image description here

Both the upper middle cluster and the central cluster are poorly separated. In the upper cluster, one object is poured around the other two. In the central cluster, although it may be too small to see here, the central seed is flooded with just a few pixels.

I have two questions:

  • Is a watershed algorithm a good choice for separating such objects?
  • If so, is there some kind of pre-processing that I did to make the image more suitable for segmentation of watersheds?
+6
source share
3 answers

I found this thread because I have the same problem with watershed_ift . I recommend using the watershed function in skimage.morphology . It accepts float inputs, so you don’t lose the grayscale resolution of the image, and it actually floods the entire pool, and the ift approach seems to flood the isovalues ​​where the markers lie.

EDIT: Remember to multiply the distance conversion by -1 so that the peaks become valleys, otherwise you won't get the watersheds!

+1
source

The watershed algorithm is a simple and reliable segmentation algorithm. Your data seems to be suitable for such a segmentation algorithm. As far as I know, special preprocessing is not needed. Of course, you yourself have already seen that in some cases it is a little on the verge.

Watershed is often used, but does not require any special knowledge about the objects that you want to identify. Thus, more complex algorithms may be available.

There may also be more complex versions of the available watershed algorithm. This Python module, called Watershed 2.0 , has parameters (unlike the scipy version). I would change the parameters a bit and see if the result can be improved.

Ilastik is a tool often used for automatic segmentation. It includes semi-automatic training (basically you give him training, giving examples, and from this he learns important functions).

0
source

You should apply the multi-level threshold method after the distance conversion step. The center of your objects will have the highest pixel value in the resulting gray level image after converting the image converting the distance to a gray level image. Here you can find the centers of objects, starting with the highest threshold value. Check out this article https://www.researchgate.net/publication/303703322_A_Multi-level_Thresholding_Based_Segmentation_Method_for_Microscopic_Fluorescence_In_Situ_Hybridization_FISH_Images

0
source

Source: https://habr.com/ru/post/955993/


All Articles