Lighting and Optics: Objectives

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Objectives

At the end of this section Participants will be able to:


Lighting and Optics
Section 9
- 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

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

Section 9 | Slide 1 Section 9 | Slide 2


Lighting and Optics are Important

Optics

• The success of machine vision applications depends on good lighting


and optics
• Garbage in, garbage out

Section 9 | Slide 3 Section 9 | Slide 4

Why are Lighting and Optics important to capturing a good image in machine In this section we will look at Optics.
vision?

• The success of machine vision applications depends on proper lighting


• Cameras do not see objects; they see the light reflected from the object towards
them.
• Light allows the camera to see – if the camera cannot see the part or the mark, it
can’t be read and it can’t be inspected.
• Images with poor contrast and uneven illumination require more effort from the
user, increasing processing time.

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.

Section 9 | Slide 3 Section 9 | Slide 4


Terms – Field of View (FOV) Terms – Working Distance (WD)

Section 9 | Slide 5 Section 9 | Slide 6

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.

Section 9 | Slide 5 Section 9 | Slide 6


Terms – Focal Length (mm) Terms – Depth of Field (DOF)

Large Opening Small Opening

Section 9 | Slide 7 Section 9 | Slide 8

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.

Section 9 | Slide 7 Section 9 | Slide 8


Parameters of Image Quality Parameters of Image Quality

Distortion

Resolution

Contrast Perspective Error

Section 9 | Slide 9 Section 9 | Slide 10

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.

Section 9 | Slide 9 Section 9 | Slide 10


Lens Advisor Lighting Advisor

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.

Section 9 | Slide 11 Section 9 | Slide 12


What do I do …?

Lighting
12mm 16mm 25mm

Section 9 | Slide 13 Section 9 | Slide 14

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

If you’re focused on a part and need to mount camera closer (WD)


- Go to a smaller focal length lens
25mm -> 16mm

The smaller the focal length number, the closer the WD and larger the FOV.

Section 9 | Slide 13 Section 9 | Slide 14


Lighting Considerations Light

NF Radio Waves Micro Waves Optical Radiation X-Ray Gamma

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

1 mm 50 µm 2500 nm 700 nm 400 nm 315 nm 280 nm 100 nm 1 nm

640 nm 600 nm 570 nm 555 nm 505 nm 490 nm 430 nm


V(λ) V‘(λ)

Section 9 | Slide 15 Section 9 | Slide 16

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?

Section 9 | Slide 15 Section 9 | Slide 16


Bright Field Dark Field

Section 9 | Slide 17 Section 9 | Slide 18

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.

The shape and contour are enhanced:


- Diffuse surfaces are dark
- Flat, polished surfaces are bright
- Used to emphasize height changes

Section 9 | Slide 17 Section 9 | Slide 18


Lighting Techniques

Lighting Techniques Diffuse Off-Axis


Back Light

Structured Diffuse On-Axis

Section 9 | Slide 19 Section 9 | Slide 20

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.

Section 9 | Slide 19 Section 9 | Slide 20


Back Light Back Light Applications

Ring Light Back Light

Section 9 | Slide 21 Section 9 | Slide 22

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.

Section 9 | Slide 21 Section 9 | Slide 22


Structured Light Structured Light Applications

Line Light Change in Depth

Section 9 | Slide 23 Section 9 | Slide 24

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.

The more it is offset, the more difference in height.

Section 9 | Slide 23 Section 9 | Slide 24


Diffuse On-Axis Light (DOAL) Diffuse On-Axis Light (DOAL) Applications

Ambient Light Diffuse On-Axis (DOAL)

Section 9 | Slide 25 Section 9 | Slide 26

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.

Section 9 | Slide 25 Section 9 | Slide 26


Diffuse Off-Axis Light Diffuse Off-Axis Light Applications

Direct Front (Ring) Diffuse Off-Axis


(Cloudy Day Illumination)

Section 9 | Slide 27 Section 9 | Slide 28

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).

Section 9 | Slide 27 Section 9 | Slide 28


Ambient Lighting

Filters and Colored Light

• Ambient lighting is external lighting that strikes your parts


Examples: ceiling lights, skylight

• It is a problem because it can vary and affect your


inspection results
Section 9 | Page 29 Section 9 | Slide 30

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.

Ways to deal with ambient lighting:


1. Get rid of it (ex: cover skylights)
2. Cover (shroud) the parts being inspected
3. If you can’t do 1 or 2, use a color filter and flood the part with your own lighting of
the same wavelength (ex: red)

Section 9 | Slide 29 Section 9 | Slide 30


Polarizing Filters Polarizing Filters

Section 9 | Page 31 Section 9 | Page 32

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.

Section 9 | Slide 31 Section 9 | Slide 32


Polarized Light Application Color Filters

Ring Light without Polarizer Ring Light with Polarizer

Section 9 | Slide 33 Section 9 | Page 34

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.

Section 9 | Slide 33 Section 9 | Slide 34


Color Color Application

Red Purple

Actual Colors White Light


Orange Blue

Yellow Green

Red Light Green Light Blue Light

Section 9 | Slide 35 Section 9 | Slide 36

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

- Use opposite colors or families to darken:


- Green light makes red features darker

Section 9 | Slide 35 Section 9 | Slide 36


Colored Light Application Infrared Light (700 nm - 1 mm)

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.

Section 9 | Slide 37 Section 9 | Slide 38


Infrared Light Application Ultraviolet Light (10 - 400 nm)

Ambient Light IR Light and IR Filter*


(IMIF-BP850)

Section 9 | Slide 39 Section 9 | Slide 40

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.

Section 9 | Slide 39 Section 9 | Slide 40


Ultraviolet Light Application Summary

• Good lighting is important, with the goal of making the


features stand out from the background

• There are many choices in lighting and optics. The


positioning of a light is also important

• Ambient light should be blocked or minimized

No Filter Longpass UV Filter • The use of filters and colored lights can enhance the
image, even in a greyscale camera

Section 9 | Slide 41 Section 9 | Page 42

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

Section 9 | Slide 41 Section 9 | Slide 42


Question 1

What lighting technique is best suited to illuminate


round metal shiny parts?

A. Dark Field
Quick Quiz B. Back Light
C. Bright Field
D. Diffuse Off-Axis (Cloudy Day Illumination/Dome)

Section 9 | Slide 43 Section 9 | Slide 44

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: ____________________

Section 9 | Slide 43 Section 9 | Slide 44


Question 2 Question 3

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

Section 9 | Slide 45 Section 9 | Slide 46

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: ____________________

Section 9 | Slide 45 Section 9 | Slide 46

You might also like