Configure watershed

Hello,
I’m from Brazil, I’m doing a hair counting job and I’m trying to make the counting of bovine skin pores, I’m trying to use Watershed to the division when there are two glued hair, but the division is not made where I need. Is there a way to configure the Watershed?
Thanks

Hello @SuzaneVN,

You can try the BioVoxxel - Watershed Irregular Features plugin and see if it does a better job.

ignacio

1 Like

thanks for the reply, I tried to set the Watershed but still did not work.
I did the steps as follows:
1 Subtract Background
2 8-bit convert image
3 AutoThreshold Triangle
4 watershed
5 Analyze Particles

original image

there is another way to divide hair those who are together?

thank you so much

Is this the image at full resolution or do you have a larger version of it?

2 Likes

this is a full resolution, it was taken with a cellphone

after the Analyze Particles without using Watershed

Can you take a larger photo with higher resolution? The borders of the image you’ve posted are blurred.

1 Like

Most of the pictures came out like this. For now only I need to separate the hair for count, then I see how to improve the photos.

another example:

thank you for help

I could not use watershed to separate connected hairs.
I think you might be able to count connected and single hairs separately. To count the number of connected hairs, you may use the following script (to run it, press [ to open the script editor, and change the language to IJ1 Macro)

open("E:\\Image\\hair\\c8a92e7004814e85aec62aa58c4b7cf05ae3e1f9.jpg");
run("8-bit");
run("Subtract Background...", "rolling=50");
run("Auto Threshold", "method=Default white");
run("Invert");
run("Analyze Particles...", "size=500-Infinity display clear summarize add");
roiManager("Set Color", "red");
roiManager("Set Line Width", 0);
roiManager("Show All without labels");
run("Revert");

This script will find all the connected hairs whose area size is greater than 500 pixels:

Then you can roughly estimate the number of hairs in each ROI depending on its area, e.g. if its area is 500 there are 2 hairs in it, if the area is 600 there are 3 hairs connected in it, etc.

And use the following script to count the number of single hairs (the only difference is that this time I’ve counted areas whose size is 0-500):

open("E:\\Image\\hair\\c8a92e7004814e85aec62aa58c4b7cf05ae3e1f9.jpg");
run("8-bit");
run("Subtract Background...", "rolling=50");
run("Auto Threshold", "method=Default white");
run("Invert");
run("Analyze Particles...", "size=0-500 display clear summarize add");
roiManager("Set Color", "red");
roiManager("Set Line Width", 0);
roiManager("Show All without labels");
run("Revert");

I hope others can help to improve my approach :slightly_smiling:

5 Likes

thank you so much, I will try this :smiley: