Light Qualities Applied to Machine Vision

coatiarfAI and Robotics

Oct 17, 2013 (3 years and 11 months ago)

54 views

Light Qualities Applied to Machine Vision

Many people have written guides and tutorials to machine vision lighting and how to apply first
principles to specific applications. This guide is intended as a su
pplement to examine light qualities that
govern those basic principles. While this
theoretical perspective is not mandatory to solving
ap
plications, it will make your

lighting selection and troubleshooting much easier.

We examine the
following five light

qualities: amount, direction, color, polarization, and
interference

and especially how
these can be used to enhance contrast on the features of interest
.

Amount

The amount of light tha
t you use in your application
has a major
effect on the contrast that
you will be able to achieve. By the same
token, the consistency of the amount of light that you use affects
the consistency of the contrast that you will be able to achieve.
If
you are not using enough light you may notice that the features you
want to i
lluminate are too dim relative to their background because
the CCD in your camera
does not

absorb enough of the
photons.
You can usually deal with the condition of having too much light by

closing

apertures and reducing shutter times.
However, there is

a
lways

a tradeoff with depth of focus when
changing

apertures.
It is
very important to think about the consistency of your
lighting
when
developing an application because conditions are almost never the same in a lab as they are on a
machine.

By reducing
ambient light through shrouding or filtering and providing reliable, consistent
lights for the area under inspection you can resolve most consistency issues.

You want the light that
enters the camera coming from
your
light source, not from ambient sources

(sunlight, overhead
fluorescents, etc.)

Direction

The direction
that

light strikes the object determines
what features will be brighter or darker
than

the
background. It is helpful to ask yourself what
features you want to illuminate and what you will
a
ctually consider to be your background, in
conjunction with how transparent/opaque and
reflective your object is.
A situation

for which direct
lighting is unsuitable may

thrive with back lighting or side lighting. For our purposes there are three
primary directions to consider for machine vision lighting: direct lighting originating near the camera
lens and shining straight at the object, side lighting originating at a 9
0
-
degree angle to the camera lens
and shining straight at the object, and back lighting originating from directly opposite the camera lens
and shining towards the camera. There are also intermediary directions (such as at a 45 degree angle
from the camera

lens) and combinations of these directions (such as with dome lights which provide
fairly even lighting between 0 and 90 degrees in a half
-
sphere around the camera).

Color

A light source’s wavelength
determines

what we perceive as color
.
Objects r
eflect

and absorb colors differently due to their unique
atomic structures. As a result, objects will display more or less
contrast to their background depending on the color of light you
select to illuminate them. A similar concept to this e
xists in
filtering
; using a color filter allows

you to pass only certain
wavelengths of light to the camera

because it is absorbing all the
other wavel
engths. Some applications
utilize colors that are
invisible to our eyes


infrared (wavelength longer than what is
visible
) and ultraviolet (wavelength shorter than what is visible).
Light color and filter color selection not

only
impact
s
what objects
(or portions of an obj
ect) you illuminate
, but it also dramatically affects

ambient light control. It is often
wise to use a

narrow
-
bandwidth light source (not white) and allow only this color to pass to the camera
using a filter so that you eliminate most of the ambient light. Ambient light is often inconsistent in both
amount and direction but consistent in color, so filteri
ng it out is usually repeatable. By using only
consistent light sources you help your image to be more consistent.


Polarization

In machine vision, polarization refers to the
planes that light waves
are propagating in. To visualize t
his concept we can u
tilize the
“picket fence” analogy. Light originating from the sun or other
ambient sources is un
-
polarized, meaning that it propagates in all
planes. When it hits a polarizer which is essentially a grating like a
picket fence, it will emerge from the oth
er side propagating in only
one plane. If it then hits another polarizer oriented exactly in the
same direction as the first, the light will be transmitted and very little
loss will occur between the first and second polarizers. However, if
the light hit
s another polarizer oriented at 90 degrees to the first
polarizer, it will block almost all the light. Light can also become polarized in a single plane due to
reflection
off meta
l
lic

surfaces and refraction through some solids. In practice machine visio
n utilizes
polarization by
implementing polarized filters which can pass only light propagating in a single plane. By
utilizing the picket fence analogy above you can use two polarized filters (one on your controlled light
source and one on the camera len
s) to strongly cut down the
unpolarized
ambient light and pass only
the light
from a controlled source.

Keep in mind that this technique requires the two polarized filters to be aligned correctly and
consistently. Some machine vision applications also u
se polarizers to enhance images of transparent
objects (like glass or plastics) that refract light in polarized waves. By utilizing polarization you can
sometimes obtain contrast between r
egions where they appear the same without polarization.


Interfere
nce

A group of light waves can increase or decrease in amplitude
depending on how they interfere with each other. This results in
brighter and darker spots which may be unpredictable and create
inconsistent contrast in machine vision. This effect shows

up most
frequently in coherent light sources such as lasers, which frequently
appear as well
-
defined spots with a high degree o
f granularity within
the light. For good, consistent contrast you will typically use a light
source that is not extremely coher
ent to avoid this granularity.
While laser sources have a very narrow bandwidth and a very tight
beam, this spectral and spatial coherence makes them unsuitable
for most machine vision applications.