--- author: Sanchayan Maity title: OpenCV on Beagleboard-xM | Getting started tags: beagleboard, facedetection, opencv --- Before I start, let me mention a few things which I am assuming. 1. You know how to use the vi Editor. 2. You are connected over a serial link to the BB - xM and are doing all operations from the terminal.
Get the Angstrom Image from the below link and set up the SD card as per the instructions given.
[http://elinux.org/Getting_a_Workshop_SD_Image](http://elinux.org/Getting_a_Workshop_SD_Image)After following the set up procedure, you will have a boot partition and root filesystem partition on the SD card.
After setting up the SD card, transfer an image in which you want faces to be detected. This image you can transfer to the /home/root directory in the root filesystem on the SD card.
Plug the SD card and boot up. The board will boot up and you will get the login prompt. Log in using root as the password, after which, you will be placed in the /home/root directory. This is the reason I told you to copy the image in this particular directory.
Use vi and open up a file faces.c by typing "vi faces.c" on the command line. Write the below code in it.
```c #includeI have mentioned /usr/lib/libopencv_*.so on the command line, as the compiler would then dynamically link all the OpenCV library files against this code.
This will create a executable called faces. Run it from the command line by typing "./faces". The code would run and print the number of faces detected in the image on the command line.
I didn't have a HDMI to DVI-D cable to connect my monitor to the board, so I printed the output on the command line. If you can connect a monitor, use the functions from the highgui library, and you can display your output on the monitor. You can draw rectangles around the faces detected.
I am currently working on face detection in video and facing a few glitches, but, I will post it when I am successful.
To learn what the functions actually do, refer to the OpenCV 2.2 C reference on the below link.
[http://opencv.jp/opencv-2.2_org/c/](http://http://opencv.jp/opencv-2.2_org/c/).**Disclaimer: I have modified the example code given in the reference documentation to suit my own needs.**