Post date: Mar 07, 2012 7:5:33 PM
I spent a lot of time trying to figure out how to do this. Ultimately it turned out to be relatively simple. I managed to do it with little more than copying and pasting between a couple of the samples that I downloaded from OpenCV. However it took hours and hours of research to get to that point.
Here I'll build a complete step by step tutorial that will start with an overview of computer vision and object detection and then go into specifics on how to do this on an Android phone.
OpenCV is natively in C++. There may be other great tutorials on how to do this in C++ but I never found one for Java. Java was chosen for this project because it's a language I know. I am not a developer by trade or even a very good one and I didn't want to have to learn C++ from scratch to accomplish the goals of The Visible Kitteh Project when I knew that the resources to do it are out there. OpenCV is widely touted as being almost magic in computer vision (it is) and I was even able to find a package that does some amazing things natively on the Arduino. I was convinced it was possible and simpler than most people thought.
It turns out I was right. It isn't really that difficult. Not any more.
The tutorial will be broken up into multiple steps in order to simplify things and to allow more experienced developers to skip around. The Visible Kitteh Project site is a little disorganized currently but full of resources. Some of them useful others not. If you have specific questions or comments feel free to comment or use the contact section of the site. I will address them as time permits.
Overview:
Tutorial 1: Overview of Object Recognition
Setup and Requirements:
Tutorial 2: Installing Eclipse + AndroidSDK + OpenCV and Requirements
Recognition:
Tutorial 3: Reading from the Android Camera and Applying Image Recognition to the frames - Mostly Just a placeholder with some links to other data as the full tutorial is not completely written
Your cascade classifier file is useless without code to reference it. In short the facial detection sample project can be modified to detect nearly anything simply by creating a new cascade classifier xml file and replacing the original faces one in the project.
Tutorial 4: Building a Cascade Classifier file - Partial as the full tutorial is not yet written. For now there is a fantastic tutorial here which references an older command haartraining instead of the newer traincascade. Traincascade is documented here though not as well as the first tutorial. Read the traincascade document to learn what arguments are there/required. Read Naotoshi Seo's wonderful tutorial to understand what they mean.
If you find anything missing or innacurate please let me know. If you have specific questions also feel free to drop me a line. My response to you might just give me an excuse to write part of the tutorial.