Search
Menu
Hamamatsu Corp. - Earth Innovations LB 2/24

Playing to Type: Choosing the Right Class of Lens for Machine Vision

Facebook X LinkedIn Email
Nicholas James, Edmund Optics

Machine vision systems have one general task: to collect and process optical information so measurements, observations or decisions can be made without direct human intervention. In other words, machine vision systems are supposed to augment or serve as surrogates for people in specific industrial roles. But machine vision systems lack one essential component of human systems: They don’t have brains.

Our brains allow us to interpolate and extrapolate poor and contradictory visual information to make decisions about reality. Because machine vision systems lack that powerful information processor, they don’t function well with poor or inconsistent visual information. That means you need to design your machine vision system to meet specific performance requirements and to provide high-quality, consistent images. And it all starts with the optics.

As you evaluate your system requirements, you’ll be driven to decide on the class of lens for your imaging system. You should be aware that you have three lens options: endocentric, telecentric or hypercentric. Endocentric lenses produce images with the same kind of perspective as the human eye – these are standard fixed-focal-length lenses. Telecentric lenses eliminate perspective errors (also called parallax), and hypercentric lenses invert normal perspective to see nearly the entire surface of a three-dimensional object. Although all three lens classes can be defined in terms of their optical design, an example can more easily illustrate how characteristics of each class can provide specific performance benefits. This hypothetical example will illustrate the characteristics that will drive you to select an imaging lens from a particular class.

Optimizing factory performance

Whether your machine vision system is being used for process control or quality inspection, it will have a specific task. For example, say you’re working in a syringe-manufacturing factory. You might have to verify the placement and number of syringes before sealing the packages. An easy enough job for a person – but a bit slow and mind-numbing. So you want to replace that function with a machine vision system.

This particular task – counting and verifying placement of syringes within a package – does not require great precision. You’ll have to define the image parameters of a syringe, but you can do that with edge-detection or some other pattern-recognition algorithm. It won’t matter to that algorithm whether the syringe image is 17 or 22 pixels across. Why is that important? Because an endocentric lens acts just like your eye: Objects that are farther away appear smaller in the image. With an endocentric lens, the physical size of the syringe image on the detector will be different for syringes at different distances from the lens.

For tasks that don’t require precise measurements, such as the syringe-counting application, you can most often comfortably use an endocentric lens. If you need to verify that bar codes are legible on a package of razors, or that the color of your cereal boxes is within an acceptable range, an endocentric lens is usually the best option (Figure 1).


Figure 1.
Most standard fixed-focal-length lenses are endocentric, which is good for general imaging applications.


Remember, though, that just because your application might not need metrology-class imaging doesn’t mean you don’t need high-quality images. A lens that distorts can make it difficult for your pattern-recognition routine to consistently identify syringes, particularly at different places within the field of view. Similarly, a lens with illumination/resolution falloff in the corners, or with poor contrast at the spatial frequency of your bar code, will make it difficult to verify legibility; a lens with lots of chromatic aberration will make it problematic to test the color of your cereal boxes. Put another way, just because you can use a traditional endocentric-class lens doesn’t mean you can use a poor-quality lens.

Going telecentric

Imagine now that your first machine vision project at the syringe factory has gone so well that you decide to use machine vision elsewhere. Assume that another task at your factory is to verify that the internal and external diameters (IDs and ODs) of your syringes are within specification – all along the length of the barrel. Right now this is done by a technician randomly selecting syringes from the production line and measuring the ID and OD of each by hand with a micrometer.

Choosing an endocentric lens for this task will create problems because endocentric lenses image with the same kind of perspective as the human eye. For example, if you decide to image the syringes as they lie flat on a conveyor belt, their distance from the imaging lens will vary from syringe to syringe – and even from one end of the syringe to the other – as they bounce along the belt.

If you decide to image the syringes on end, looking down the barrels, the problem becomes even more difficult. Why? Because even if you line up the barrels perfectly with the optic axis of your lens, you still have the problem that nearer objects appear larger than more distant ones. Specifically, the closest ends of the syringes will produce circle images that appear larger than the circle images of the farther ends of the syringes. Another way of saying this is that the magnification of endocentric lenses is a function of object distance. For this function, you will need a lens where the magnification does not vary with object distance – the telecentric lens.

Telecentric lenses create their images from light that comes right along the optic axis. They come in three varieties: object-space, image-space and bilateral (or double) telecentricity. Object-space telecentric lenses have their entrance pupil at infinity, image-space telecentric lenses have their exit pupils at infinity, and bilaterally telecentric lenses have both entrance and exit pupils at infinity. For typical metrology applications, you’ll want an object-space or bi-telecentric lens (Figure 2).

DataRay Inc. - ISO 11146-Compliant


Figure 2.
The complex design of telecentric lenses can create accurate and consistent images for metrology.


Those details of optical design have one very practical effect: The magnification in an object-space telecentric lens does not vary with object distance. So, when you image along a syringe, you will see the ID and OD of the barrel along the entire length simultaneously. If there’s a “bump” anywhere along the length of the barrel, the image will show it. In addition, once you calibrate your lens, you can accurately and consistently measure diameter directly from the images.

Shifting perspective with hypercentric lenses

Your success at addressing the packaging and metrology problems was so dramatic that you’ve decided to address another inspection problem with a machine vision system: The syringe markings all around the top of the perimeter of the barrel need to be consistent and clear. Currently, you have a technician pull some random samples and spin them around to examine the markings all around the syringes. You could use an endocentric imaging lens to acquire images as you rotate the syringe, but it would be a lot more convenient if you could image the entire outside of the barrel in one simple acquisition. That’s a job that a hypercentric lens is made to address, and it allows you to use one lens instead of two, three or even four endocentric lenses.

When you look at the field of view of an endocentric lens, it’s a cone that diverges from the front of the lens. A telecentric lens has a cylindrical field of view. A hypercentric lens goes a step further – it’s a cone that converges from the front of the lens. For example, at 10 cm away, a 6-cm diameter endocentric lens could have a field of view that’s 12 cm wide, a telecentric lens would have a field of view about 6 cm wide, and the field of view of a hypercentric lens could converge to a point at that same 10-cm distance (Figure 3).


Figure 3.
(a) Hypercentric lenses invert normal perspective to simultaneously image the top and sides of objects within the working area. (b) Here, a die is imaged using (bottom) a hypercentric lens and (top) a fixed-focal-length lens.


As you might expect from that description, the perspective of a hypercentric lens is exactly the opposite of that of an endocentric lens. With an endocentric lens, nearer objects create larger images than more distant objects, while in a hypercentric lens, nearer objects create smaller images than more distant objects. In practice, this has the effect of transforming an on-axis cylinder into an annular disk at the image plane.

For example, with your syringe, the innermost circle of the image will be the near end of the syringe, while the far end of the syringe will be projected onto a larger circle in the image. The cylindrical surface of the syringe at a given distance from the lens is projected onto a circle of a specific radius on the image plane. If your syringe has a colored band halfway down its length, the band will appear as a circle on the image plane. With one acquisition, you can image the entire outer circumference of the syringe. If you insert a spacer between a hypercentric lens and a detector, you create a borescope capable of imaging the interior of a cylinder with the same kind of circular projection.

The rest of the story

The examples given here illustrate situations appropriate for different types of lenses. That’s just the start of specifying your machine vision system. You’ll want to evaluate the resolution you need, the wavelengths you want to acquire, the field of view of your scene, the detector geometry, the image acquisition rate, the scene illumination and other factors. But understanding the fundamental characteristics of endocentric, telecentric and hypercentric lenses gives you a head start on an efficient machine vision system. If you are in a situation where the unique features of telecentricity or hypercentricity match your imaging needs, you can streamline the rest of your system design.

Meet the author

Nicholas James is the product line manager for imaging at Edmund Optics in Barrington, N.J.; email: njames@edmund optics.com.



Limitations of telecentricity and hypercentricity

You might be tempted to take advantage of the inherent accuracy of telecentric lenses for all your applications – after all, why not get the most accurate, consistent measurements out of every image? But telecentric lenses aren’t always the optimum choice.

The narrow acceptance angle of telecentric lenses means that the maximum linear field of view can be no larger than the lens diameter (often 10 to 20 percent smaller). If your object is large, the lens must be equally large. But as the lens diameter goes up, so do the cost and weight of a telecentric lens.

Telecentric lenses also have a relatively limited working distance. That’s also an issue of lens diameter (and cost), because the diameter of a telecentric lens grows as the working distance increases.

Hypercentric lenses have similar issues. The field is smaller than the lens diameter, and the working distance is also relatively small. The usable portion of the converging-cone field of view of a hypercentric lens is called the “near-view cone” or “working area,” and it’s typically on the order of tens of millimeters.

So it’s best to consider telecentric and hypercentric lenses as valuable and efficient tools for unique imaging applications – tools that can justify their higher cost with increased performance and efficiency where warranted.

Published: October 2014
Glossary
metrology
Metrology is the science and practice of measurement. It encompasses the theoretical and practical aspects of measurement, including the development of measurement standards, techniques, and instruments, as well as the application of measurement principles in various fields. The primary objectives of metrology are to ensure accuracy, reliability, and consistency in measurements and to establish traceability to recognized standards. Metrology plays a crucial role in science, industry,...
machine vision
Machine vision, also known as computer vision or computer sight, refers to the technology that enables machines, typically computers, to interpret and understand visual information from the world, much like the human visual system. It involves the development and application of algorithms and systems that allow machines to acquire, process, analyze, and make decisions based on visual data. Key aspects of machine vision include: Image acquisition: Machine vision systems use various...
parallax
The optical phenomenon that causes relative motion between two objects when the eyepoint is moved laterally. When parallax appears in a telescope between the image and reticle, this indicates the image has not been formed in the plane of the reticle.
FeatureslensesmetrologyImagingSensors & DetectorsMaterialsindustrialAmericasmachine visionlens classTest & MeasurementOpticsendocentrictelecentrichypercentricfixed focal lengthperspective errorparallaxperspective imagingNicholas James

We use cookies to improve user experience and analyze our website traffic as stated in our Privacy Policy. By using this website, you agree to the use of cookies unless you have disabled them.