A simple object classifier with Bag-of-Words using OpenCV 2.3 [w/ code] Just wanted to share of some code I've been writing.
So I wanted to create a food classifier, for a cool project down in the Media Lab called FoodCam. It's basically a camera that people put free food under, and they can send an email alert to the entire building to come eat (by pushing a huge button marked "Dinner Bell"). Really a cool thing. OK let's get down to business. I followed a very simple technique described in this paper. Edit (6/5/2014): Another great read for selecting the best color-space and invariant features is this paper by van de Sande et al. The method is simple: - Extract features of choice from training set that contains all classes. - Create a vocabulary of features by clustering the features (kNN, etc). Turns out, those crafty guys in WillowGarage have done pretty much all the heavy lifting, so it's up for us to pick the fruit of their hard work.
That's pretty cool! But recognizing faces in images is not something terribly new and exciting. Wouldn't it be great if we could tell OpenCV to recognize something of our choice, something that is not a face? Let's say... a banana? That is totally possible! Here's the good news: we can generate our own cascade classifier for Haar features.
Done! Install OpenCV and Python on your Raspberry Pi 2 and B+ My Raspberry Pi 2 just arrived in the mail yesterday, and man is this berry sweet.
This tiny little PC packs a real punch with a 900mhz quadcore processor and 1gb of RAM. To give some perspective, the Raspberry Pi 2 is faster than the majority of the desktops in my high school computer lab. Anyway, since the announcement of the Raspberry Pi 2 I’ve been getting a lot of requests to provide detailed installation instructions for OpenCV and Python. So if you’re looking to get OpenCV and Python up-and-running on your Raspberry Pi, look no further! In the rest of this blog post I provide detailed installation instructions for both the Raspberry Pi 2 and the Raspberry Pi B+. I’ve also provided install timings for each step.
Finally, it’s worth mentioning that we’ll be utilizing the Raspberry Pi inside the PyImageSearch Gurus computer vision course. Here’s a quick example of detecting motion and tracking myself as I walk around my apartment on the phone: