Silver Ball Tracking

I am trying to find round balls wrapped in aluminium foil against a white background. I am aware that there is a find_circles function but it doesn’t seem to work very well with my experience. It always seems to be a bit off. If I turn down the Threshold, there are many false positives, so I programmed it to ignore anything under a certain y value, it too doesn’t seem to do the trick
I am pretty sure I need to use the find_circles() function but maybe someone might have a suggestion on what to do?


I’d use the find_blobs() method. This tracks using color and makes your job alot easier. You can just set a color threshold for tracking the balls. You can either track silver or not the white background.

That said, silver and white are very similar. Pretty much every computer vision method needs constrast. So, if the scene is low contrast it’s going to be hard to identify anything. You can boost contrast using histeq() and you can also pass the adaptive argument to it if the scene is complex.

I have noticed that when metallic objects are detected, it is best to use red lighting to filter out the reflections and give you better contrast.
Hope this helps…