jon wise
Posts: 49
Joined: Thu May 31, 2012 8:21 pm

Boules

Thu Mar 21, 2019 8:43 am

A game of boules could be improved by simplifying the measurement of the relative distances between two balls and the jack. It could be simplified by taking an image vertically down over the jack, recognising the three circles and calculating the distances. What pattern recognition software could I try on a Raspberry Pi?

scotty101
Posts: 4010
Joined: Fri Jun 08, 2012 6:03 pm

Re: Boules

Thu Mar 21, 2019 10:43 am

OpenCV and Python.

Task will be significantly easier if you use brightly coloured balls that have a high contract from each other and the background. Silver Balls on sand won't be a good contrast.

OpenCV will be able to filter the image by colours and then detect circles. Once you've detected the circles you can measure how many pixels apart they are.

Getting the camera in a good position might be challenging though.

You might want to start your project by testing the positioning of the camera and take some test photos which you can then use to develop your code. Then if you get stuck you can share the code and the photos with others to ask for help.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
omegaman477
Posts: 148
Joined: Tue Feb 28, 2017 1:13 pm
Location: Sydney, Australia

Re: Boules

Fri Mar 22, 2019 9:05 am

Use a high contrast IR filter on the camera lens and they should shine like crazy. At night you will need IR illumination from some IR leds.
..the only thing worse than a stupid question is a question not asked.

jon wise
Posts: 49
Joined: Thu May 31, 2012 8:21 pm

Re: Boules

Mon Mar 25, 2019 10:26 am

Could you please offer more advice on the IR filter. My first attempt with a standard image does not recognize the outline of the shiny balls.

scotty101
Posts: 4010
Joined: Fri Jun 08, 2012 6:03 pm

Re: Boules

Mon Mar 25, 2019 1:28 pm

jon wise wrote:
Mon Mar 25, 2019 10:26 am
Could you please offer more advice on the IR filter. My first attempt with a standard image does not recognize the outline of the shiny balls.
I say again
Silver Balls on sand won't be a good contrast.
Then if you get stuck you can share the code and the photos with others to ask for help.
Share some photos.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

Return to “Automation, sensing and robotics”