First the app sends a tone through the audio output of the PC to the loudspeaker, and the dice hops around for a while. Then after a settle pause, the app takes a snapshot with the webcam and makes a binary black and white image with a simple threshold transformation. Very small areas are removed as considered as noise. Then a simple count method, similar to the 'magic wand' tool known from Photoshop, is performed. Then an error check is performed, and if no errors, the count result is accumulated.
Here is the setup:



And here is a small video of the project:
After running the app for 24 hours and 24383 throws, the result looked like this:

Ingen kommentarer:
Send en kommentar