Quantcast
Channel: Borglabs » opencv
Viewing all articles
Browse latest Browse all 2

Porting OpenCV to the iGEPv2 : first steps

$
0
0
screenshot of "Lena" sample picture from OpenCV with edge detection

Over the last 3 weeks, I’ve been busy putting together my iGEPv2 embedded development system. Initially my goal was well defined: use the pre-built SDK Virtual Machine provided by ISEE as the cross-compiler, install Android OS on the iGEPv2 board, get the PS3 Eye webcam to work and install OpenCV. With this basic setup, I figured that I can begin experimenting with computer vision on an embedded device which ultimately will be folded into a bigger project, a personal robot.

However as I worked on the project, I learned two important things:

1. The pre-built SDK Virtual Machine is not suitable for everyone. Unless you have a powerful computer with plenty of RAM, the VM runs unbearably slow. I tried it on a Dell Precision 380 desktop (2.8GHz Pentium4 with 1GB RAM) and eventually gave up. Also, the VM uses the older Ubuntu 8.04 version and does not include the latest drivers; the PS3 Eye webcam didn’t work out of the box, and I couldn’t get kaswy’s PS3EyeMT driver patch to work.

2. Make the app work first on your development system before porting it to an embedded platform. Why? Because you’ll likely make significant code changes and run many tests before you get acceptable results, and repeating these tasks is far quicker and easier on a powerful machine. In the case of OpenCV, I’ve found out that much preparation is needed to built a vision system that recognizes objects and faces. You will need to collect hundreds if not thousands of samples of training and test images. (For example, see these Haartraining articles by Naotoshi Seo, Rhonda Ltd. and Florian Adolf). I find this surprising and disappointing, since we humans can learn to recognize with far fewer samples.

I am reminded of Scott Berkun’s words from his book The Myths of Innovation — that innovation is messy, making lots of unexpected twists and turns. I have underestimated the amount of effort needed to build the vision system. This is now obvious in hindsight. But when I started, I was so enamored by the idea of having object recognition working on the iGEPv2 that I jumped right ahead into the embedded development stuff.

Sigh.

On with Plan B. So I decided to develop the object and face recognition app on the PC first. I installed Ubuntu 9.10 on my old Dell PC, then got the PS3 Eye webcam and OpenCV 1.1 running with very little effort.

Here’s what I did:

1. Download the latest Ubuntu and burn it on a CD.

2. Insert the CD on a dedicated PC and install Ubuntu.

3. Install OpenCV 1.1; I chose this over the newer 2.0 because there are more tutorials available. I used The NUI Group’s simple guide.

4. Verify the OpenCV installation. To do this, open a Terminal console and type:

$ cp /usr/share/doc/opencv-doc/examples <your-work-dir>
$ cd <your-work-dir>/c
$ ./edge  lena.jpg

5. Plug in the PS3 Eye. It worked out of the box for me.
6. Check that the PS3 Eye work. I used Guvcview for testing

$ sudo apt-get install guvcview
$ guvcview


Viewing all articles
Browse latest Browse all 2

Trending Articles