Get the FULL version

Squares, an openFrameworks application

Squares, an openFrameworks application thumbnail

This is a video from my first try to do something interactive using openFrameworks. It has been quite a learning experience. Capturing and detecting motion from a single webcam isn’t as straightforward as it appears to be.

Luckily, openFrameworks already comes with the OpenCV add-on, that makes things much easier when it comes to background subtraction and blob detection. Before that, I was trying to make my own camera movement detection based on a defined color range. It didn’t work well enough to make a video of it and it didn’t work at night, being that it was extremely susceptible to light condition changes. Using the OpenCV add-on was just a matter of choosing the background subtraction algorithm and using the blob detection at the processed image.

Even with the OpenCV add-on, the background subtraction heavily depends on camera conditions – no matter which algorithm you choose, you are still going to get some inconsistent movement detection here and there, unless, you have a controlled environment, or two cameras for that matter (Microsoft’s Kinect starts to make more sense). It is necessary to adjust the webcam settings to make the most of the background subtraction, although it requires some time to get it right.

I haven’t used any kind of image file, I wanted to make use only squares and triangles for the shapes, and use only colors close to the primary ones. For this app, OpenCV’s Gaussian background subtraction was used and it required a LED flashlight to work correctly, because the lighting conditions weren’t good enough by the time this video was recorded (it works much better with daylight). There are still some stuff to be improved, but I don’t see me doing it in a foreseeable future (unfortunately, there are more urgent things to do).

What do you think?

Be the first to leave a comment!

Leave a Comment

Post Comments RSS