Professional Documents
Culture Documents
Lighting and Optics: Objectives
Lighting and Optics: Objectives
Lighting and Optics: Objectives
Section 9 | Slide 2
The ninth section of the In-Sight EasyBuilder Standard training will focus on Lighting At the end of this section Participants will be able to:
and Optics.
- Explain Lighting and Optics terms
- Discuss the different Lighting Techniques
- Describe how the use of filters and colored lights will affect the quality of the
image
Optics
Why are Lighting and Optics important to capturing a good image in machine In this section we will look at Optics.
vision?
The saying “garbage in, garbage out” goes back to the early days of computers,
meaning if incorrect data is input into a computer, the results are likely to be wrong.
Similarly, if lighting is not good, inspection results may be wrong: good parts may be
rejected, and bad parts may be accepted.
Field of View is the imaged area of an object under inspection. This is the portion of Working Distance (WD) is the distance from the front of the lens to the object.
the object that fills the camera’s sensor. Field of View is critical for choosing the Working distance determines how far to position an imaging lens from the object
correct optical components to use in an imaging application. Since resolution is under inspection. Working distance is critical when considering space constraints
dependent of field view, determining field of view affects what one is trying to analyze and lighting geometry.
or measure.
Focal Length (mm) is the distance from the center of the lens to the image sensor. Depth Of Field (DOF) is the maximum object depth that can be maintained entirely
The focal length of a lens is the distance from the mid-point of the lens to the point at in focus. DOF is also the amount of object movement (in and out of focus) allowable
which light rays parallel to the center-line of the lens are focused, as in the diagram. while maintaining a desired amount of focus.
The difference between the closest and farthest distances an object may be shifted
The shorter the focal length, the more the lens bends the light rays, the wider its before an unacceptable blur is observed. Depth of Field is also referred to as Depth
angle of view, so a lens with a focal length of 28mm can fit a lot more of an object into of Focus.
the field of view than can a lens with a focal length of 200mm.
NOTE: Depth of Field should not be confused with Working Distance.
The focal length of a lens is also considered an expression of its magnification power,
and is usually stated in millimeters.
For example: A lens with a range of focal length from 5.8mm to 17.4mm is called a 3x
zoom, because 17.4 = 3 x 5.8.
Distortion
Resolution
Resolution is a measurement of an imaging system’s ability to reproduce object The term Distortion is often applied interchangeably with reduced image quality.
detail, and can be influenced by factors such as the type of lighting used, the pixel Distortion is actually an individual aberration that does not technically reduce the
size of the sensor, or the capabilities of the optics. The smaller the object detail, the information in the image; while most aberrations actually mix information together to
higher the required resolution. It is often expressed in terms of line pairs per create image blur, distortion simply misplaces information geometrically. This means
millimeter (lp/mm), or microns (μm). that distortion can actually be calculated or mapped out of an image.
Contrast describes how well black can be distinguished from white at a given Note: In extreme high distortion environments, some information and detail can be
resolution on an object. The lens, sensor, and illumination all play key roles in lost due to resolution change with magnification or because of too much information
determining the resulting image contrast. Each one can detract from the overall being crowded onto a single pixel.
contrast of a system at a given resolution if not applied correctly and in concert with
one another. Conventional lenses have angular fields of view such that as the distance between
the lens and object increases, the magnification decreases. This is how the human
vision behaves, and contributes to our depth perception. This angular field of view
results in parallax, also known as Perspective Error, which decreases accuracy, as
the observed measurement of the vision system will change if the object is moved
(even when remaining within the depth of field) due to the magnification change. The
angular field of view of the Fixed Length in the image translates to parallax error in
the image and causes the two cubes to appear to be different sizes.
http://www.cognex.com/Resources.aspx http://www.cognex.com/Resources.aspx
Section 9 | Page 11 Section 9 | Page 12
The Cognex Lens Advisor makes it easy to select the right lens for each Vision or ID The Cognex Lighting Advisor lets you simulate different kinds of lighting on a
application. Depending on the information you have available about your application, variety of types of parts. At the top, choose a part that has characteristics similar to
select the tab that gives the information you would like the lens advisor to calculate. the part you are inspecting. On the right, choose a height of the light above the part.
Then try out different lights from the list at the left.
There are three lens parameters that are related: Focal Length, Field of View, and
Working Distance. If you specify two of these, the Lens Advisor will calculate the
third for you.
Lighting
12mm 16mm 25mm
If you’re focused on a part and need larger FOV: In this section we will explore Lighting.
- Go to a smaller focal length lens
25mm -> 16mm
The smaller the focal length number, the closer the WD and larger the FOV.
3000 km 10 km 30 cm 300 µm 1 mm 1 nm 10 pm
Visible Light
Thermal Radiation Mid-IR Close-IR UV-A UV-B UV-C X-UV
What should you consider when selecting your lighting? As defined by Encyclopedia Britannica, light is electro-magnetic radiation that can be
detected by the human eye. Electromagnetic radiation occurs over an extremely wide
? Is the surface finish specular (smooth and glossy) or diffuse (rough and range of wavelengths, from gamma rays, with wavelengths less than about 1 × 10−11
dull)? meters, to radio waves measured in meters.
? Does the surface exhibit directional reflectance (reflects light in a specific
direction)? Within that broad spectrum the wavelengths visible to humans occupy a very narrow
? Does the appearance of the part change under different colors of light band, from about 700 nanometers (nm; billionths of a meter) for red light down to
(darken or lighten)? about 400 nm for violet light. The spectral regions adjacent to the visible band are
? Is the part’s surface flat or 3-dimensional? Curved? Irregular? Etched? often referred to as light also, infrared at one end and ultraviolet at the other.
Embossed? Raised?
? Is the surface of the part stable or will it change over time (tarnish,
oxidize, fade)?
? How might ambient (all around) light affect the part?
Let’s talk about Bright Field first. Dark Field has the opposite effect. Here the lights strike away from the part.
How bright field work? If it’s a flat surface, the light will reflect away from the camera, so you’re going to get
dark edges. As light hits anything that’s an indentation or a raise it will reflect back up
The light strikes down on the flat surface of the part and then back up into your into the camera. So thus, you’re going to be getting a dark field for the back and any
camera. If you have any indentations or any raises upon your part what will happen indentations or raises are going to be light.
is the light will strike down into it and then away from your camera. This creates a
dark edge. The rays are at an angle to the surface.
If we look at this coin, we’ll notice that the flat surface of the coin gives you a bright The shape and contour are enhanced:
field behind it and any of the indentations or raisings on the coin gives you the dark - Diffuse surfaces are bright
effect. - Flat, polished surfaces are dark
- Use to emphasize height changes
The rays are perpendicular to the surface.
In this section we will look at various Lighting Techniques. A lighting technique is a combination of a light source and how it is placed respective
to the part and the camera. A particular technique can enhance your image such that
it negates some features on your image or by accentuating others like silhouetting a
part to allow measurement of edges while negating the surface details.
There are five basic techniques – Direct, Back, Diffuse On Axis as well as Diffuse
Off Axis, and finally Structured. Over the next few slides we will take a look at each
technique in more detail.
We’ll start with the Back Light. It creates a silhouette to accentuate shape of the part In this application we are looking to take measurements on the filament of the bulb. In
to allow for measurement but negates all surface detail. It creates the optimal the image on the left, you can see a light bulb taken with a normal ring light (also
contrast of basically black on white. known as a direct light source). Note the glare off of the glass - this actually takes
away from the ability to clearly see the filaments of the bulb.
As seen in the image on the right, by using a back light we can see the inside
circuitry quite clearly.
Another technique is called Structured Lighting. Structured lighting makes use of a In this application, we are looking for a change in depth on the part being inspected.
known light pattern (normally a plane of light creating a line) that is used to determine On the left, you see there is no change, the line is flat and therefore we can assume
dimensional information. They are usually highly collimated lights sources such as the surface is flat.
lasers or fiber optic line lights.
On the right, the line is broken and we can see where there is a step in the middle.
Uses laser or fiber optic line light. It’s that change in that line that is used to determine the z dimension.
Diffuse On-Axis Lighting, also known as a DOAL, allows for light to get reflected Here is a dot-pinned connector that has a rough surface. The image on the left shows
directly at the part without the light source getting in the way of the camera. This is the connector under ambient light.
being done by using a 50% silvered mirror, where the light is shining directly onto the
mirror and then reflected down onto the part, while the camera can see through the The image on the right shows the connector under a DOAL light. Notice how the dots
mirror and capture the image of the part being illuminated. are accentuated and the rough background is negated – there are also no hotspots
or glare.
And the last lighting technique is Diffuse Off-Axis Lighting known as a cloudy day Here is a foil lid application. With a ring light, there is a tremendous amount of glare.
illuminator (CDI) or a Dome Light. With diffuse off-axis lighting, the light is not But with the cloudy day illuminator, the lid can be totally inspected for possible holes
reflected directly onto the part but first onto a diffuse surface then onto the part. or tears.
In the image above, the lights at the bottom of the dome shine up into the dome area
and then the reflected light comes down on the part.
To remember the difference between Diffused On-axis lights versus Diffused Off-axis
lights, remember that Diffused On-axis (DOAL) lights shine light directly onto the part
(On-axis – on the part) where the Diffused Off-axis lights shines the light off
something else first (Off-axis – off something else).
Ambient light tends toward the visible spectrum, meaning it includes red, orange, In this section we will focus on Filters and Colored Lights.
yellow, green, blue, indigo, and violet. If you use a red filter, then you are filtering out
all but the red component of the ambient light. Then, if you add your own bright red
light, all of your light will get through the red filter, and “overwhelm” the smaller red
component from the ambient light.
A polarizing filter is analogous to slatted blinds, in that it “slices” 3d light waves into
parallel planes of light. Two of these filters are used. The first, the “polarizer,” does
the first slice. If the background is shiny and flat, the parallel planes are reflected as
parallel planes. They then pass through the second polarizer, the “analyzer.” The
analyzer is rotated in such a way that its slates are perpendicular to the incoming
planes. This blocks most of the parallel light.
But if the feature is not flat, it will scatter some of the incoming planes, so that some
of the feature’s reflected light will get through the analyzer to the camera. The net
effect is to reduce the background glare.
Polarizers are used in imaging applications to reduce glare or hot spots, enhance There are many different types of filters in machine vision that can be utilized to
contrast, or to perform stress evaluations. Polarizers can also be used to measure improve or change the image of an object under inspection.
changes in magnetic fields, temperature, molecular structures, chemical interactions,
or acoustic vibrations. It is important to understand the different technologies behind the various types of
filters in order to understand their advantages and limitations. Although there is a
In this application we want to read the information on the lid of the Grape Jam. As wide variety of filters, almost all can be divided into two primary categories: colored
seen in the image on the left, when a Ring light without a polarizer is used there is a glass filters and coated filters.
glare on the part of the lid that is raised, while the information that is in the
indentation is visible.
By adding the polarizer to the ring light, as on the right, it reduces the glare and the
entire lid is recognizable.
Red Purple
Yellow Green
The next thing to talk about is the spectrum and color because we live in a color In this image there is a red, green, and blue strip.
world. We can use color light with grayscale cameras to enhance or to negate some
of the features that we’re interested in. What we need to keep in mind is that opposite In a grayscale world, you’ll notice that it just becomes varying shades of gray. Now
colors on the color wheel darken the colors across from them. yes, we do know which order it goes in, so if you were asked, “What’s the green
one?” You could easily say it’s the middle. But what if you didn’t know the order?
- Like colors make it look more white in the background.
Well, we could use a different light. So if we used a red light, what we would see is
- Use colored light to create contrast. that the red would be the lighter color. If we used the green light, we would notice
that the green would be the lighter color and if we used the blue light, then the blue
- Use like colors or families to lighten: would be the lighter color.
- Yellow light makes yellow features brighter
Ambient Light
White Light
Blue Light
Section 9 | Slide 37 Section 9 | Slide 38
Here’s an application where we want to enhance the date code on a jar lid but we There’s also infrared light. Infrared is in the range above 700 nanometers. Operators
want to negate the other printed lettering. Since we’re interested in the red print and won’t even know that it’s there and the intensity moves down through it.
we want to get rid of the blue print, then we could use a blue light. Notice how the
blue kind of blends away into the background while that red print really stands out Infrared (IR) light is invisible to the human eye.
crisply. Now you can use an OCV or OCR vision tool very easily. - Operators don’t know they are there
- Negates all color – everything is gray
The Date information is accentuated with blue light. - Does not permeate materials
- Blue print is negated
- Red print is now darkened Some of the different uses – barcode and shrinkwrap, credit cards, cows, and color
crayons.
Now, one of the great things with infrared light is that it’s great with produce. The other type of light is ultraviolet light which is below the 400 nanometer range.
Ultraviolet light can fluoresce ink or glue. It’s not the actual light itself that you need,
Here’s an image where you see an avocado in normal ambient light that looks but the fact that you’re fluorescing the glue or the ink up into the visible range.
perfectly good but if you put an IR light on it, notice how there’s a bruise there.
Anytime you’re using infrared or ultraviolet light, you really should use a filter on your Many materials fluoresce under ultraviolet (UV) light:
camera. This allows for you to make sure that you’re only looking at the light or rather - Ink, Labels, Glue
what is being fluoresced from the light and not the light itself because that can
sometimes throw off your application. By putting Direct UV (or Near-UV) light on part - visible light is emitted.
NOTE: Filters should be used in most IR and UV applications. NOTE: Filters should be used to block out UV light and only allow fluorescent
wavelengths into the camera.
No Filter Longpass UV Filter • The use of filters and colored lights can enhance the
image, even in a greyscale camera
Here’s an example of ultraviolet light. In this section we covered the following topics:
If we take a look at this part underneath the ultraviolet light with no filter, you’ll notice - Good lighting is important, with the goal of making the features stand out
that it’s making the text of the number fluoresce but you’re also seeing the glare of from the background
the light behind there as well. But if we add a UV filter, the UV light is blocked and - There are many choices in lighting and optics. The positioning of the light
only lets the fluorescing ink up into the visible range to the camera. is also important
- Ambient light should be blocked or minimized
The UV ink lettering is illuminated using a Black Light. - The use of filters and colored lights can enhance the image, even in a
greyscale camera
A. Dark Field
Quick Quiz B. Back Light
C. Bright Field
D. Diffuse Off-Axis (Cloudy Day Illumination/Dome)
Quick Quiz! What lighting technique is best suited to illuminate round metal shiny parts?
A. Dark Field
B. Back Light
C. Bright Field
D. Diffuse Off-Axis (Cloudy Day Illumination / Dome)
Answer: ____________________
If you had this part to inspect and were only concerned One lighting technique will inspect all parts in any
about the blue vertical print, what color light would you application.
use?
– True
A. Red
– False
B. Green
C. Blue
D. Infrared
If you had this part to inspect and was only concerned about the blue vertical print, One lighting technique will inspect all parts in any application.
what color light would you use?
- True
A. Red - False
B. Green
C. Blue Answer: ____________________
D. Infrared
Answer: ____________________