Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Counting tablets

I have developed a pill counter. It uses something similar to this tutorial and to [this other tutorial].(https://www.pyimagesearch.com/2015/11/02/watershed-opencv/)

However (as the next step) I want to count also tablets such as: The problem

Although the segmentation process is a bit complicated (because of the semi-transparency of the tablets) I have managed to get this

segmented

My problem is here. How can I count the elongated tablets, separating each one from the image, similar to the final results in the linked tutorials? I would appreciate if someone can help me to find a solution. So far I have applied distance transform, then smooth it with a Gaussian filter and then watershed and I got

failed

As you can see, it does not work well, specially for adjacent tablets.

The solution does have to work for this image and also for other arrangements of the tablets, the most difficult being for example

problem2

Thank you very much for any pointer or help on how to solve this problem. (My project has to address more complicated problems too, but would like to start with this)

Counting tablets

I have developed a pill counter. It uses something similar to this tutorial and to [this other tutorial].(https://www.pyimagesearch.com/2015/11/02/watershed-opencv/)this tutorial

However (as the next step) I want to count also tablets such as: The problem

Although the segmentation process is a bit complicated (because of the semi-transparency of the tablets) I have managed to get this

segmented

My problem is here. How can I count the elongated tablets, separating each one from the image, similar to the final results in the linked tutorials? I would appreciate if someone can help me to find a solution. So far I have applied distance transform, then smooth it with a Gaussian filter and then watershed and I got

failed

As you can see, it does not work well, specially for adjacent tablets.

The solution does have to work for this image and also for other arrangements of the tablets, the most difficult being for example

problem2

Thank you very much for any pointer or help on how to solve this problem. (My project has to address more complicated problems too, but would like to start with this)