Using the vision library to detect colored objects

A useful task that OpenCV and your webcam can do is to track objects. This might be useful if you are building a system that needs to track and follow a colored object. OpenCV makes this amazingly simple by providing some high-level libraries that can help with this task. I'm going to do this in Python, as I find it much easier to work with than C. If you're a coder who feels more comfortable in C, these instructions should be fairly easy to translate to the C environment.

If you'd like, create a directory to hold your image-based work. From your home directory, you can create an imageplay directory name by typing mkdir imageplay while in your home directory. Then, change directory to the ...

Get BeagleBone Robotic Projects - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.