Saturday, 4 April 2015

Vision Guided Robot- Video Processing with BeagleBone Black and OpenCV C++

This is what kept me really busy for two months!. As I was new to BeagleBone Black and to Linux operating system, I struggled a bit during the starting stage of the project. But excellent tutorial of Dr.Derek Molly helped me a lot with the BeagleBone Black. (This project was done as a part of the Texas Instruments Innovation Challenge)

I was aiming at developing a simple robot that have the ability to bring the required object to the user. For this purpose, the robot was mounted with a robotic arm to grasp the object and a camera to sense the objects in its surroundings. 

Detailed description of the various parts of the robot and the operational demo can be seen in the following video,

If you are very curious about the programming part of the robot, you can see the BeagleBone Black coding of the robot in my github repository. I have tested the coding with the Ubuntu 14.04 LTS and latest version of Debian Operating System on the BeagleBone Black(BBB) and it worked fine. Object Recognition with OpenCV was faster in Ubuntu than in Debian (I have no idea why recognition is slower is Debian..trying to figure it out!!)

For those who would like to try this project, here are few tips,

1. Boot your BBB with any OS of your choice following the instructions from here (I`ve installed Ubuntu)

2. Install OpenCV to the BBB (some OS comes with pre installed OpenCV) using the following command,

                  sudo apt-get install libopencv-dev

3. Download my code from here to the BBB.

4. I have used simple template matching to identify objects. So choose your object of interest and specify the path to the image in the program.

5.Connect the webcam to the BBB. Make sure your webcam works with BBB first. I was initially testing with a webcam that worked fine with the computer but not with the BBB. So I have bought a new Logitech C70 webcam and it worked fine.

6. Thats it!, Compile the code and run it. I have coded in such a way that the GPIO pins(14,15,16,17,18) of P8 header of the BBB will respond to the object based on its coordinates. and a log file of the processed video output will be stored as a media file in .avi format. If you are using Windows OS and Putty to develop the coding you can use Win SCP software access the logged file from your windows machine. Also if you are using lxde session in Debian OS, you can very well use imshow() function of OpenCV to see the realtime object recognition.

1 comment:

  1. Hi, I am Extremely impressed by this project. I could see the instructions for only software part of it. Since I am beginner , It would be really helpfull if you can provide detailed step by step procedure along with Hardware components .. Software components.

    Please send me an email