

I had the urge to get some computer vision analysis going on my droid. Something simple, something done before, like a live image coming through my camera with some face detection or edge detection. Along the installation process I found a few difficulties, and here I’ll outline what worked for me to hopefully save you some time. I’m installing on Mac OS 10.6.8.
A quick aside
But before we start, you might ask:
When would using computer vision be helpful? Just trying to get a context for its utility.
Well, here is why I’m excited about it:
-games! I want to try and make some games using the real time feed from the camera. There have been a few, but not enough that are fun to convince me the market is saturated.
-augmented reality! I’m not really into many of the augmented reality apps I’ve seen… maybe knowing some more CV stuff could lead to some insights in that direction.
-science! People are doing analysis of facial expressions for emotions, or even for health diagnostics. Tools to facilitate quantitative analysis of behavior can be made more mobile, and more cheaply.
-cameras of the future! I crashed the media lab sponsor week a couple weeks back. When I was wandering by the Camera Culture group, one of the researchers mentioned to me that for the most part the camera is pretty similar to what it was 40 years ago- despite significant advances in technology. That group explores the potential of newer technologies for cameras. Mobile 3D reconstruction has emerged in the last year for mobile devices- and I think there is much more we can do.
Ok, back to getting it installed
First, there is this awesome post that will get you started even if you have never done any android development. As recommended, I used the Tegra downloads to get up and running fast- it’ll get you the SDK and eclipse and whatever else you need.
Then you need to get opencv-android, its basically hooking up all the power of opencv with android, by the folks at willowgarage. The tutorial recommends you to download it from here, but when I did, I got the following issue when I had everything in Eclipse:
ERROR: resource directory <path-to-opencv-android>\OpenCV-2.3.1\modules\java\android\res’
does not exist
[Same error posted on the boards]
After trying several things in Eclipse and wondering what was going on, I found this post on the boards recommending to build from the trunk. On this page you can find installation instructions for the trunk.
For me it didn’t work the first time. You may have some error about ‘install_name_tool’, and fortunately thats covered in the Troubleshooting part right after the Linux and Mac OS build instructions. There may be a couple other issues that come up.
After searching for ‘install_name_tool’ (as the troubleshooting describes) you may find it elsewhere. I found it in:
/Developer/usr/bin/install_name_tool
The CMake file ‘CMakeFindBinUtils.cmake’ I had to edit was not in /opt/local/share/… , and instead was in
/usr/local/Cellar/cmake/2.8.4/share/cmake/Modules/CMakeFindBinUtils.cmake
since I installed with Homebrew.
After I made those minor changes, the build worked. Point to the OpenCV library in this build folder when you are in Eclipse, hit F5 to refresh the library, and things should load up correctly (this will make sense when you read through the tutorial).
I loaded the projects straight onto the phone by this process. Its kind of exciting when it first works. My favorite is the puzzle example. Looking forward to diving into the code and making some kooky real time CV toys. Maybe even a synth! (hah-I just came back from music hack day).