Retroreflective tape behind the typewriter’s
hammers clearly shows a missing one.
The easiest, inexpensive realm of cameras
with the greatest flexibility is a USB or Firewire
camera with what is called a “board mount” lens.
UniBrain is a decent camera with a troublesome
(at times) driver, but a lot of the $10 webcams fit
into the “board mount” category. These cameras
generally take the same size lens (threaded with
an M12x. 5 thread). Since this is a common size, if
you ever have to make your own mounts, you’ll
be able to find a tap set for this in catalogs like
McMaster Carr (if your local industrial supply
house doesn’t carry them). Companies like
Detection Dynamics carry a huge variety of lenses
in different focal lengths, so you just need to
keep in mind the size of the imager chip that you
want to fill with your images.
The next size camera is one that has either a
“C” mount or a “CS” mount. Generally, you will
spend more for these lenses and the cameras
they mount to. By now, you may have been
looking online for different lenses and found a
term called the “f#” of a lens. This is important to
anyone building lenses, but until you get to this
type of lens, you will not have much control over
it. It is a bit complex but, f# is essentially a
measure of the focal length of a lens divided by
the diameter of the first element. This is a
measure of the lens’ ability to gather light, but it
also controls how much of the area fore and aft
of the object you are focusing on is in focus. The
lens will most often have a ring on it which
controls the iris — the thing that adjusts the
amount of light entering the lens. This ring will be
labeled with numbers which are the f# setting of
These C mount lenses also have a unique
focusing method. The mount of the lens screws
into a mount on the camera that has a flange
that is a very specific distance from the sensor
surface. To focus, an internal mechanism allows
the focusing of the lens, and there is a ring on
the outside that shows you what distance you are
Going beyond this, you get into the realm of
lenses for SLR cameras, scientific imagers, and
line scan imagers. These lenses are made to a
higher level of quality, and can cost several orders
of magnitude over board mount lenses. Line
scanning is an interesting technique.
When you build light sources, be mindful of
using pulse width and pulse frequency to dim
them. Fluorescent lights can drive webcams crazy
because the flickering of the camera and the
frequency of images captured interfere.
If you are imaging a fast moving subject, use
a “global shutter” if you can. A “rolling” shutter
captures the image row by row, which can create
sheared images — a bad thing for metrology.
Shorter focal lengths create more distortion.
This can be bad if you must calibrate this out
before your robot’s tasks can be completed.
If you are using color, make sure there is an
infrared blocking filter in the system somewhere.
You will saturate your sensor without it.
Get a pair of cheap plastic calipers. Use them
to measure where lenses sit so you can refocus
The most important thing that I have found
that makes life playing with optics easier is
darkness. In a darkened space, you can add light
as you need it. First, add an illuminated target —
just an LED and a piece of frosted tape will work.
Add some permanent ink marks and you can
check focus. You can slowly introduce
environmental factors like ambient illumination as
your algorithms get more robust.
In closing, be methodical, take your time, and
have fun. Lenses aren’t voodoo; they can be easily
mastered by us mere mortals. Robots are a
different story. Keep them on a short leash. SV
SERVO 01.2010 41