Quality Magazine logo
search
cart
facebook twitter linkedin youtube
  • Sign In
  • Create Account
  • Sign Out
  • My Account
Quality Magazine logo
  • NEWS
  • PRODUCTS
    • FEATURED PRODUCTS
    • SUBMIT YOUR PRODUCT
  • CHANNELS
    • AUTOMATION
    • MANAGEMENT
    • MEASUREMENT
    • NDT
    • QUALITY 101
    • SOFTWARE
    • TEST & INSPECTION
    • VISION & SENSORS
  • MARKETS
    • AEROSPACE
    • AUTOMOTIVE
    • ENERGY
    • GREEN MANUFACTURING
    • MEDICAL
  • MEDIA
    • A WORD ON QUALITY PUZZLE
    • EBOOK
    • PODCASTS
    • VIDEOS
    • WEBINARS
  • EVENTS
    • EVENT CALENDAR
    • IMTS
  • DIRECTORIES
    • BUYERS GUIDE >
      • Supplier Insights
    • NDT SOURCEBOOK
    • VISION & SENSORS
    • TAKE A TOUR
  • INFOCENTERS
    • Digital Quality Management Systems
    • NEXT GENERATION SPC & QUALITY ANALYTICS
  • AWARDS
    • ROOKIE OF THE YEAR
    • PLANT OF THE YEAR
    • PROFESSIONAL OF THE YEAR
  • MORE
    • Expert Columns
    • NEWSLETTERS
    • QUALITY STORE
    • INDUSTRY LINKS
    • SPONSOR INSIGHTS
  • EMAG
    • eMAGAZINE
    • ARCHIVES
    • CONTACT
    • ADVERTISE
  • SIGN UP!
Vision & Sensors

Vision & Sensors - Best Practices

Using Optics to Optimize Your Machine Vision Application

Explaining the fundamentals of using optics to optimize a machine vision application.

By John Lewis
December 3, 2012
The lens is responsible for creating sufficient image quality to enable the vision system to extract the desired information about the object from the image.  In a typical application, the lens is required to locate features within the field of view (FOV), ensure the features are in focus, maximize contrast and avoid perspective distortion. What may be adequate image quality for one application may be insufficient for another. This article will explain the fundamentals of using optics to optimize a machine vision application.
 

BASICS OF MACHINE VISION OPTICS

The object area imaged by the lens is called the field of view (FOV). The FOV should cover all features that are to be inspected with tolerance for alignment errors. The working distance (WD) is the distance from the front of the lens to the object being imaged.
 
The depth of field (DOF) is the maximum object depth that can be maintained entirely in focus. The sensor size is the size of a camera sensor’s active area, typically specified in the horizontal dimension. The primary magnification is the ratio between the sensor size and the field of view. With primary magnification held constant, reducing the sensor size reduces the field of view and increasing the sensor size increases the field of view. 
 

RESOLUTION

Resolution is a measurement of the vision system’s ability to reproduce object detail. Take for instance an image with two small objects with some finite distance between them. As they are imaged through the lens onto the sensor, they are so close together that they are imaged onto adjacent pixels. If we were to zoom in, we would see one object that is two pixels in size because the sensor cannot resolve the distance between the objects. The separation between the objects has been increased to the point that there is a pixel of separation between them in the image. This pattern—a pixel on, a pixel off, and a pixel on—is referred to as a line pair and is used to define the pixel limited resolution of the system. 
In the real world, diffraction, sometimes called lens blur, reduces the contrast at high spatial frequencies, setting a lower limit on image spot size.

Figure 3 shows a spark plug being imaged on two sensors with different levels of resolution. Each cell in the grid on the image represents one pixel. The resolution in the image on the left with a 0.5 megapixel sensor is not sufficient to distinguish characteristics such as spacing, scratches or bends in the features of interest. The image on the right with a 2.5 megapixel sensor provides the ability to discern details in the features of interest.

Targets can be used to determine the limiting resolution of a system and how well the sensor and optics complement each other. 
 

CONTRAST

Contrast is the separation in intensity between blacks and whites in an image. The greater the difference between a black and a white line, the better the contrast. Take for instance, two different images of a UPS label taken with the same high resolution sensor at the same position and focal length with different lenses. The difference is that the lens used to take the image on the right provides higher levels of contrast because it is a better match for the high resolution sensor.
 
Color filtering can be used to increase contrast. A machine vision application designed to distinguish between red and green gel capsules adds either a red or a green filter, increasing the contrast to the point that the vision solution becomes much more robust.
 

DIFFRACTION

In the real world, diffraction, sometimes called lens blur, reduces the contrast at high spatial frequencies, setting a lower limit on image spot size.  Figure 7 shows how these effects degrade the quality of the image. The object on the top of Figure 7 has a relatively low spatial frequency while the object on the bottom has a higher spatial frequency. After passing through the lens, the upper image has 90% contrast while the bottom image has only 20% contrast due to its higher spatial frequency.
 
Now let’s look at lens performance across an entire field of view. The three images enclosed in different colors in Figure 8 are close-up views of the boxes shown in the same color on the larger image. The chart at the bottom of Figure 9 shows the modulation transfer function (MTF) of the lens at each position in the field of view. MTF is a measurement of the ability of an optical system to reproduce various levels of detail from the object to the image as shown by the degree of contrast in the image. The MTF measures the percentage of contrast loss as a function of the spatial frequency in units of LP/mm. The lens in Figure 9 has 59% average contrast in the center section, 56% in the bottom middle and 62% in the corner. The image demonstrates the importance of checking the MTF of a lens over the entire area that will be used in the application. 
 
The same test applied to a different lens with the same focal length and same field of view using the same image sensor will produce a contrast reduced to 47% in the centre, 42% in the bottom middle and 37% in the corner. A third lens is different in that the performance is good in the center of the image at 52% contrast, drops off in the corner position to 36%, and drops even more in the bottom middle to 22%. Note that all three of these lenses have the same FOV, depth of field, resolution and primary magnification. Lens performance can have a dramatic impact on the ability of the sensor to discern the details that are important in the application.
 

DEPTH OF FIELD

Depth of field is the difference between the closest and furthest working distances an object may be viewed before an unacceptable blur is observed. The F stop number (F/#), also called the aperture setting or the iris setting of the lens helps to determine the depth of field. The F/# is the focal length of the lens divided by the diameter of the lens. F/#’s are specified for most lenses at a focal length of infinity. As the F/# is reduced, the lens collects less light. Reducing the aperture setting or making the aperture smaller increases depth of field. Increasing the allowable blur also increases the depth of field. The best focused position in the depth of field is indicated by the green line, which is close to the end of the depth of field closest to the lens.
 
Figure 13 shows a depth of field target with a set of lines on a sloping base. A ruler on the target makes it simple to determine how far above and below the best focus the lens is able to resolve the image.
 
Figure 14 shows the performance of short fixed focal length lens that is used in machine vision applications. With the aperture completely open looking far up the target in an area defined by the red box that’s beyond the depth of field range, we see a considerable amount of blur. When we close the iris to the point where there is very little light coming in the overall resolution is reduced and the numbers and lines both become less clear.
 
Figure 15 shows this same lens but this time looking at the best focus position. With the iris completely open we see the image and numbers clearly. With the iris half open the image has become blurred. The resolution degrades even more with the iris mostly closed.
 
A lens with a different focal length that is designed specifically for machine vision applications will produce the following results: With the iris completely open, the lines are gray rather than black and white and the numbers are somewhat legible but highly blurred; With the iris mostly closed, the resolution improves even more in the area of interest and the image is sharp throughout the range of working distances shown.
 

DISTORTION

Distortion is an optical error or aberration that results in a difference in magnification at different points within the image. Perspective distortion is caused by the fact that the further an object is from the camera, the smaller it appears through a lens. Perspective distortion can be minimized by keeping the camera perpendicular to the field of view.
 
Perspective distortion can also be minimized optically with a telecentric lens. The image on the right shows the objects—four pins mounted perpendicular to a base.
 
Figure 21 shows perspective distortion in a real world scenario. The object in the top center appears through two different lenses in the left and right lower images. Using a conventional fixed focal length lens produces the image on the lower left. The two parts appear to be different heights on the monitor even though they are exactly the same height in real life. In the image on the lower right, the telecentric lens has corrected for perspective distortion and the objects can be measured accurately. 
 

CONCLUSION

Optics is very important to the overall success of a machine vision application. The examples shown here demonstrate the importance of considering the overall system including the optics, lighting and vision system as opposed to simply picking out components. When you are discussing the application with suppliers, be sure to completely explain the goals of the inspection as opposed to just asking for specific components so that the supplier can contribute to the success of the application.

Tech Tips

  • Targets can be used to determine the limiting resolution of a system and how well the sensor and optics complement each other.
  • In the real world, diffraction, sometimes called lens blur, reduces the contrast at high spatial frequencies, setting a lower limit on image spot size.
  • Perspective distortion can also be minimized optically with a telecentric lens.

John Lewis is Market Development Manager of Cognex in Natick, MA.
Email: [email protected]
Web: www.cognex.com
KEYWORDS: field of view optics

Share This Story

Looking for a reprint of this article?
From high-res PDFs to custom plaques, order your copy today!

John Lewis is market development manager of Cognex Corp. (Natick, MA). For more information, call (508) 650-3000 or visit www.cognex.com.

Recommended Content

JOIN TODAY
to unlock your recommendations.

Already have an account? Sign In

  • 2024 Quality Rookie of the Year Justin Wise 1440x750px banner with "Quality Rookie of the Year" logo inset

    Meet the 2024 Quality Rookie of the Year: Justin Wise

    Justin Wise is an exceptional individual who has been...
    Aerospace
    By: Michelle Bangert
  • Man with umbrella and coat stands outside while it rains at night looking at a building.

    Nondestructive Testing: Is there an ethics problem?

    I was a whistleblower who exposed fraudulent activities...
    NDT
    By: Dale Norwood
  • Unraveling Deflategate: Football stadium with closeup of football on field

    Unraveling the Tom Brady Deflategate

    The Deflategate scandal erupted following the 2014 AFC...
    Measurement
    By: Greg Cenker and Henry Zumbrun
Manage My Account
  • eMagazine Subscriptions
  • Newsletters
  • Online Registration
  • Subscription Customer Service
  • Manage My Preferences

More Videos

Sponsored Content

Sponsored Content is a special paid section where industry companies provide high quality, objective, non-commercial content around topics of interest to the Quality audience. All Sponsored Content is supplied by the advertising company and any opinions expressed in this article are those of the author and not necessarily reflect the views of Quality or its parent company, BNP Media. Interested in participating in our Sponsored Content section? Contact your local rep!

close
  • Key Takeaways for Quality Leaders
    Sponsored byComplianceQuest

    Key Takeaways for Quality Leaders from the 2026 Gartner Magic Quadrant™ for QMS

  • This image shows a person seated next to a Bobcat T66 compact track loader.
    Sponsored byPolyWorks by InnovMetric

    Supercharging Digital Gauging at Bobcat North America

  • Dorsey Calibration Lab photo by Tom LaBarbera Picture this Studios
    Sponsored byDorsey Metrology International

    Ensuring Product Quality in a Competitive Manufacturing Landscape

Popular Stories

This image shows a person seated next to a Bobcat T66 compact track loader.

Supercharging Digital Gauging at Bobcat North America

Dorsey Calibration Lab photo by Tom LaBarbera Picture this Studios

Ensuring Product Quality in a Competitive Manufacturing Landscape

a professional in the aviation field performing maintenance, repair, and overhaul (MRO) work

Manufacturing Retention: Strategies for Improving Company Culture, Engagement and Skill Development

2026 Quality Professional of the Year!

Events

June 22, 2026

Automate 2026

Automate is North America's largest robotics and automation event — and the best place to take your ideas from insight to impact.
 
Our show floor features the world’s leading automation solutions, from AI and robotics to motion control, vision systems, and more. Plus, our educational conference is second to none, led by the brightest minds in automation today.
 
Ready to transform the way you work? Take the next step at Automate.
July 14, 2026

Quality Leaders Forum: Better Communication, Better Quality Data

The Quality Leaders Forum is a quarterly, editor-moderated fireside chat series hosted by Quality Magazine, featuring candid conversations with senior manufacturing and operations executives shaping enterprise-level quality.

View All Submit An Event

Products

Lean Manufacturing and Service Fundamentals, Applications, and Case Studies

Lean Manufacturing and Service Fundamentals, Applications, and Case Studies

See More Products
Quality Podcast Channel Custom Content

Related Articles

  • Robot holding glue syringe Injection with robotic machine vision system.

    Do I Need a System Integrator for My Machine Vision Application?

    See More
  • Synchronize Your Machine Vision

    See More
  • Vision & Sensors Integration feature image of business people joining gears.

    Systems integration for machine vision solutions – Driving application success with current and future technologies

    See More

Related Products

See More Products
  • Machine Vision and Error Proofing DVD

  • louis hannigan.jpg

    The Non-Idiot's Guide to ISO 9001:2015: Understanding and Using the Quality Management System Standard to your benefit

  • Quality Brain Teasers: Real World Challenges to Build Your Manufacturing Skills (ebook)

See More Products

Related Directories

  • Machine Vision Store

    Machine Vision Store has a laser-sharp focus on machine vision imaging. We deliver a select group of components - cameras, lenses, lights, industrial vision PC's - from leading manufacturers known for quality. Components we understand, support and stand behind. Components and consulting services that will power your success.
  • Phoenix Imaging Machine Vision

    Porosity Inspection of machined metal components using 3D image acquisition. High resolution laser-based scanning optimizes Porosity detection. Phoenix-Middle-Man™ software package provides image storage and database, SQL query and visual display of defects. High-Speed Surface Inspection Systems from Keyence, Omron and Phoenix Imaging for the tough ICE, BEV & Battery projects.
×

Stay in the know with Quality’s comprehensive coverage of
the manufacturing and metrology industries.

Newsletters | Website | eMagazine

JOIN TODAY!
  • RESOURCES
    • Advertise
    • Contact Us
    • Directories
    • Manufacturing Division
    • Store
    • Want More
  • SIGN UP TODAY
    • Create Account
    • eMagazine
    • Newsletters
    • Customer Service
    • Manage Preferences
  • SERVICES
    • Marketing Services
    • Market Research
    • Reprints
    • List Rental
    • Survey/Respondent Access
  • STAY CONNECTED
    • LinkedIn
    • Facebook
    • YouTube
    • X (Twitter)
  • PRIVACY
    • PRIVACY POLICY
    • TERMS & CONDITIONS
    • DO NOT SELL MY PERSONAL INFORMATION
    • PRIVACY REQUEST
    • ACCESSIBILITY

Copyright ©2026. All Rights Reserved BNP Media, Inc. and BNP Media II, LLC.

Design, CMS, Hosting & Web Development :: ePublishing