Robot Vision
for Everyone
by John Blankenship and Samuel Mishal
If you have ever tried to add vision to one of your
robotic projects, you probably appreciate why you
seldom see articles exploring the subject at the
hobbyist level. The ability to experiment with vision
— especially in the past — has generally only been
accessible to university researchers or the rare
hobbyists with advanced tools and capabilities.
Some Insightful Thoughts
Let’s start by examining why it is hard to develop vision
applications. First, even though there are numerous low-cost cameras and web cams available, it can be difficult to
capture images from these devices into your programming
environment, especially if you want your programs to
control image acquisition in real time. It can be done, of
course, but generally, your programming language must
allow you to communicate with the camera’s driver.
Often this means you must be able to utilize advanced
programming constructs such
as DLLs, the Windows API, and
so forth.
After acquiring the image,
you will need commands for
manipulating individual pixels in
the image so that appropriate
vision algorithms can perform the
desired analysis. You may need,
for example, routines to alter the
contrast and brightness of the
acquired image. Depending on
the application, you may also
want the ability to alter the
resolution of the image, convert
it to black and white or gray
scale, or detect the edges of
objects in the image. It would
also be nice to have routines that
can detect motion by comparing
two consecutively captured
images, as well as the ability to
track an object by being able to
locate specific colors in the
image. Such routines can be complex and difficult to
develop without advanced tools and programming skills.
With the release of RobotBASIC Version 3.2 (a free
robot control and simulation language), all of the above
capabilities are within the reach of every robot enthusiast.
This article will explore some of these capabilities and how
they can be used to give rudimentary vision to the puppet
discussed in the November ‘08 issue of SERVO Magazine
(see page 36). The goal of this article is to provide a basic
framework that will encourage you to experiment with
robotic vision. After demonstrating how easily the above
operations can be implemented
with RobotBASIC, we will
examine other aspects of vision
with which you can experiment
further on your own.
FIGURE 1. A webcam provides
vision for a humanoid puppet.
42 SERVO 04.2009
Doing a Demo
In order to give vision
capabilities to the puppet
mentioned above, a Creative Lab’s
web cam was added as shown in
Figure 1. It resembles a miner’s
light and mounting it required
only a rubber band strategically
positioned behind the puppet’s
ears. A better setup would be to
integrate the camera into the
eye mechanism, but this simple
approach is adequate for
experimentation.
The goal of this demonstration is as follows: The puppet
should be able to detect one of
three different objects; we used a
red vegetable brush, a yellow fish