Making OpenCV Prettier

So while I’m on what ThoughtWorks calls the beach, which is the really nice place to go when you’re not assigned to a project, I’ve been playing with OpenCV, a lovely opensource library originally developed by Intel. It’s got a gigantic set of really interesting features related to real-time image manipulation and especially around real-time motion detection and face, hand and body recognition. If you’ve never played with computer vision, I highly suggest giving it a try. It’s tons of fun – and you get to brag about actually knowing what the hell a cascade of boosted classifiers working with Haar-like features means.

While I’m at it, I’ve been building a very small set of wrappers to make it all look a bit more OO (and probably a lot easier to read and write). As the README says:

This project has been set up only as a way of representing the knowledge the authors have gathered about OpenCV and is not intended to be a complete set of OO wrappers for the library – but contributions of any kind are definitely welcome.

Still, I’d much rather see code like:



sub = cvCreateImage(...)
cvSub(currentFrame, initialFrame, sub)
result = cvCreateImage(...)
cvThreshold(sub, result, thresholdAmount, 255, CV_THRESH_BINARY)

But then maybe that’s just me.

Oh, while I’ve got your attention – doesn’t Apple make or sell those external Firewire iSights anymore? I managed to get ahold of one, and they’re lovely. Now that pretty much every Mac laptop has a built-in camera, maybe there’s no point, but they’re still incredibly useful in these kinds of setups.