tirsdag den 14. juli 2009

The Dice Analyzer

This project is a Flex application I have written, that can perform statistic analysis on a dice. The dice is controlled with a loudspeaker, on which a plastic cup is mounted, and the dice can hop around in the cup. A Webcam takes snapshots of the dice, and the app analyzes the image. The accumulated result is shown in a bar chart.

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:

Om mig

Jeg er født på Frederiksberg 1966 af min mor. Nu bor jeg bare på Vesterbro. Jeg bærer briller.