I pulled this application out of mothballs and recorded some video of it. This represents a few days of playing with the OpenCV library and a webcam about three or four months ago.
I wrote a quick game framework that provides webcam frames, mouse and keyboard events, and a few OpenCV-based services to the game instances. I had a little trouble with the Qt Phonon multimedia library bindings, and I never really got that working right. It would play sounds twice, or cut them off early. It was possibly due to some conflict between my manual Qt 4.5 install and slightly older qt4 packages on Ubuntu. Alternatively, it could have been caused by the horribly convoluted state of Linux sound. I have NO idea how many sound framework adapters in a row it was going through to get to the actual sound device.
In this first video, my son Nathan helps me play the pop-the-balloons game.
The game takes a background frame, then subtracts the current video frame from this background frame. It processes that image delta, and the result is more or less a set of the 'foreground' objects. It would work a lot better if there was a solid background and good contrast from any foreground objects (much like you'd expect green screens to work).
The game mechanics are extremely simple. Balls fall from the top of the screen, and you're supposed to pop them with your finger before they reach the ground.
Due to the Phonon problems I mentioned, I just left out the sound:
Here's an augmented reality painting game. I'm holding a wireless mouse, which I use for the mouse buttons. The mouse has some green tape on the bottom, which the game tracks (after the initial crosshair calibration) using an OpenCV object tracking algorithm. The left button marks the boundary rectangle for drawing objects. The first click starts an object, the second finishes/places it. The middle and right mouse buttons cycle forward and backward through the available drawing objects. The color bar across the top is the color palette.
Cute, huh? Nothing particularly Earth-shattering. There are way more impressive computer vision demonstrations elsewhere. The point here is to explore the OpenCV library a little and learn what could be done with it. I'll probably use it in some kind of robot application eventually.
hi could u tell me how to generate many balloons? =)
my sku assignment is like ur one.. but i dunno how to do..
Posted by: Nyein Su | 02/08/2010 at 06:44 AM