Quoted from rosh:
As I mentioned earlier, it was some of the toy ideas that got me to move forward with Casino. One of the ideas was to use real craps dice in a ‘dice popper’. Many of us played the game Trouble, when we were kids that had the dice bubble in the middle that you would press down on to roll the dice (well in that case it was one die), so the idea was do that kind of a thing and then use a camera to read the dice.
The first challenge is that webcams are not designed to focus on something that close, so it required a custom one. Then after I got it working, I found that changes in lighting could impact the accuracy of reading the dice, duh. So I recently added a ‘housing’ at the top that holds the camera and an LED ‘ring’ to provide more consistent lighting. PBL did the 3d Printing of the housing for me and I'll add a transparent label to it, so that when craps is open, the lighting in the housing will turn on and also illuminate the signage. Below is a video showing my recent testing of the popper with the new housing and light to test the accuracy of the reading of the dice. In the most recent test of 100 ‘throws’ it got the correct number 98 times, but on one of those the split between the dice was wrong and in two cases, it missed read a 6, due to how close the pips are to each other. I should be able to fix that issue with some tweaks to the software.
» YouTube video
That is impressive.