Reader small image

You're reading from  BeagleBone Robotic Projects

Product typeBook
Published inDec 2013
PublisherPackt
ISBN-139781783559329
Edition1st Edition
Right arrow
Author (1)
Richard Grimmett
Richard Grimmett
author image
Richard Grimmett

Richard Grimmett has more fun that should be allowed working on robotics projects while teaching Computer Science and Electrical Engineering at Brigham Young University Idaho. He has a Bachelors and Masters degree in Electrical Engineering and a PhD in Leadership Studies. He also has 26 years of experience in the Radar and Telecommunications industries, and even has one of the original brick phones. He has written books on the basics of using the BeagleBone Black for robotics projects, and another for the Raspberry PI and yet another for the Arduino.
Read more about Richard Grimmett

Right arrow

Using the vision library to detect colored objects


Now that you have access to the OpenCV library, let's see what it can do.

Prepare for lift off

OpenCV and your webcam can track objects. This might be useful if you are building a system that needs to track and follow a colored ball. OpenCV makes this amazingly simple by providing some high-level libraries that can help you with this task. I'm going to do this in Python, as I find it much easier to work with than C. If you feel more comfortable in C, these instructions should be fairly easy to translate. Also, performance will be better if implemented in C, so you might create the initial capability in Python, and then finalize the code in C.

Engage thrusters

If you'd like, create a directory to hold your image-based work. From your home directory, create a directory named imageplay by typing mkdir imageplay. Then change directory to imageplay by typing cd imageplay.

Once there, let's bring over your camera.py file as a starting point by typing...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
BeagleBone Robotic Projects
Published in: Dec 2013Publisher: PacktISBN-13: 9781783559329

Author (1)

author image
Richard Grimmett

Richard Grimmett has more fun that should be allowed working on robotics projects while teaching Computer Science and Electrical Engineering at Brigham Young University Idaho. He has a Bachelors and Masters degree in Electrical Engineering and a PhD in Leadership Studies. He also has 26 years of experience in the Radar and Telecommunications industries, and even has one of the original brick phones. He has written books on the basics of using the BeagleBone Black for robotics projects, and another for the Raspberry PI and yet another for the Arduino.
Read more about Richard Grimmett