Digitally enhanced boardgame - Part 2: Fiducial markers
Link to Part 1:
How will the digital game interact with the real-world boardgame?
Playing on a field generated by the game would be possible through something like a table with a build-in monitor or a projector, both of which are quite expensive.
I opted for a solution where the playing field is made up of cardboard tiles that can be placed like described in Part 1.
Next up I needed a solution that lets the game know where the tiles and players are on the playing field. After some searching I came across something called fiducial markers. These are square-shaped patterns that can be detected by a camera. There are a lot of variations so I chose the one where there was a library available in javascript, ArUco.
Let the testing begin!
To get a better understanding of how big the markers need to be, I printed some out between 15mm and 35mm in size and tried out different distances:
As expected the smallest marker cannot be recognized at some point
Distance \ Marker Size | 15mm | 20mm | 25mm | 30mm | 35mm |
---|---|---|---|---|---|
20cm - 40cm | ✅ | ✅ | ✅ | ✅ | ✅ |
50cm - 60cm | ❌ | ✅ | ✅ | ✅ | ✅ |
70cm - 80cm | ❌ | ❌ | ✅ | ✅ | ✅ |
Other things that have impact on the detection
Lighting:
Focus
Angle
Resolution
Conclusion
Having the resolution at 1080p means that the detection is more computation-intensive, but
a) it yields the best results
b) we do not need hyper-realtime-detection of the markers, it's a boardgame.
Having the markers at 20mm seems the best size, not too small, not too big.
Before starting the game, the camera focus should be adjusted manually and the camera should be placed as top-down as possible.