Board mount webcam and lens.
‘C’ mount camera and lens.
easily affect is the angle of view of the lens. We
primarily do this by selecting a lens with an
appropriate focal length to the task at hand. A
lens with a larger number for the focal length will
have a narrower angle of view and will be called a
“longer” lens. Conversely, a lens with a smaller
number for focal length will have a wider angle of
view and be called a “shorter” lens. The actual
focal length you select will be determined by the
size of the sensor you are trying to fill and the size
of the object you are looking at.
Now, unfortunately it is time for some math.
Let’s assume that you have a sensor with a
horizontal dimension of 5 mm and a lens that has
a focal length of 25 mm. You would use the
angle= 2*arctan(5mm/2*25mm) or 11 degrees
Let’s further assume you are using this lens
and sensor to find a cola can on a surface at a
robotics event where you will start three meters
away from the can. We can roughly calculate that
40 SERVO 01.2010
the area we are viewing at a given distance can be
Size=sin( 11 degrees)*3000mm (3m) or an area
570 mm across
Those of you that are trigonometrically
inclined will note a certain symmetry here. The
basics of lens design all come down to math, and
a good chunk of it is geometry based.
So, back to our real world application. We are
actually considering two approaches. One way
would be to put retroreflective tape behind the
cameras and sense when a hammer moved by
sensing the reflected light behind it. This would
involve a wide angle lens that would allow us to
insert the camera deep into the area of the
hammers, and sense them all at once.
The second approach would be to image the
type-face surface as it comes in to strike. This
would require a lens that was looking at a very
narrow angle of view. It also requires focusing up
close. There are easier ways to do this, but this
gives us the opportunity to play with image
processing algorithms. This is the most difficult of
the two, as we have to recognize the type on the
face, not where the hammer is that moved. So,
we’ll go with this idea.
Taking this approach, we need a camera that
can image the typeface and fill the imager with as
many meaningful pixels as possible (at least for
now, more data may be better than less).
Fortunately, I took a handful of webcams apart,
and have a semi-wounded webcam with a bit of
life in it. The webcam’s existing lens has an IR
cutoff filter installed, so if I wish to replace it, I will
have to ensure we block IR.
With this camera, we are using a standard
“board mount” configuration. This allows us to
easily focus the lens. Focusing a lens is generally
done by moving the lens further away from or
closer to the imager. The closer it is to the imager,
the further away it focuses, until it reaches
‘infinity’ focus. The opposite is also true. The
further the lens is from the imager, the closer it
focuses. In order to get a close-up image of the
type-face and use the existing lens, I had to
unscrew the lens a considerable distance.
In the world of lenses, we actually think of
the lens in terms of the camera it is meant to
attach to. There are different names for the
different lens mounts, and they are all different
styles. This scheme gives us the ability to
mix/match cameras and lens manufacturers, and
to swap one lens type for another.