Pong with IR Tracking

Gernot Tscherteu approached me because he wanted a game that could be played on the boxLEDs wall he built together with Wolfgang Leeb for the Media Architecture Biennale 2010. He wanted something simple that could be played by everyone without a controller. Gernot, being a long time fan of Pong, asked me to programm a camera tracked version of the old time classic.
For me it was a good starting point for my diploma thesis Mass|kerade and opportunity to get familiar with OpenFramworks and its many addon libaries. The addons used in this Project are ofxOpenCV, ofxBox2D, ofxThread, ofxNetwork, ofxTweenzor.
The use of OpenFrameworks aswell as Box2d for this game is a little overblown, but as I said, it is a stratingpoint for my diploma project, where I need all this. The game would have been much easier to implement in Processing, with libaries that are more simple to use.
The tracking is done with a simple Hercules HD720 USB WebCamera. The boxLEDs wall emits quite a lot light, that changes the scene the camera sees. As this is a terrible environment to do computer vision, I decided to track just inside the IR spectrum as the LEDs do not emit light above 800nm. Most consumer webcams have an IR blocking filter inside their optical system. In the case of the Hercules aswell as the PS3 Eye it is a plastic element at the back end of the lens, infront of the imaging sensor. But removing the element, changes the focal point of the lens (PS3 Eye) or destroys the lens (Hercules). The workaround is to glue or screw a M10 mount on the chipboard and use screw-in lenses that are used for surveillance cameras. Those lenses come without an IR blocking filter most of the time. Still I needed a filter for blocking light below 800nm. A low cost solution for this is to stick a piece of exposed and developed camera film at the back and of the lens. Its not perfect and makes the recorded image a little blurry but it is cheap in comparision to a real high quality filter.
To light the scene below the camera I mounted 3 IR lights close to the camera on the ceiling. Each light consisted of 96 IR LEDs that emit light around 850nm. In comaprison to LEDs that emit light around 940nm the human eye can still see a small red glimming dot inside the LED, but the IR light output is much stronger. The IR light that illuminates the floor for the camera is invisible for humans in both cases. Good lighting conditions are essential for tracking, to provide good contrast and prevent motion blur as a result of long shutter speeds. Positioning the lights near the camera is essential too, as the shadows projected by the lights are not visible for the camera. The lights and the camera are positioned around 6 meters above the floor. The lights, like all LEDs, are focused on tight spots. Adding a diffusor results in lot of light loss. So in retrospect using 6 lights would have been best. Eacht LED head needs 2 ampere at 12 volts and I soldered them parallel to a 12 volts, 10 ampere power supply (why the stronger powersupply? we ordered 4 lights but only 3 arrived from china).

Open Gallery

0 Responses to “Pong with IR Tracking”

  • No Comments

Leave a Reply