Machine vision lens in systems
The choice of machine vision lens type and angle of view is one of the most important decisions when designing a machine vision system. Common types of lenses project an image onto a surface with so-called perspective projection. This forces us to deal with the properties of projective imaging of a three-dimensional scene into a two-dimensional surface area of ​​a sensor. In this case, the field of view of the lens works with a visible truncated cone. The rectangular area of ​​the image sensor then further reduces this cone to a viewing pyramid. We call its peak the focus of projection. When converting an image of a scene inside a viewing pyramid to an image area, considerable information get lost. Each half-line passing through the projection focus is represented by a single point in the image area.
Even under the theoretical assumption of a perfect machine vision lens with a linear conversion of the angle to the position and scanning of a planar two-dimensional original, we have to deal with the distortion of the image geometry due to the perspective error. Imagine an image of dark dots on a light background with a constant spacing of dots in the x and y axes. In order to achieve a constant dot spacing, assuming accurate perspective projection even in the projected image, the inner surface of the spherical surface must scan the original. With a planar original, the dots in the projected image will move away from each other depending on their distance from the optical axis.
How does machine vision lens work?
The loss of spatial information during perspective projection makes it very complicated, for example, by accurate measurements of the dimensions of three-dimensional bodies. We are not able to correct these errors without prior knowledge of the shapes of the scanned objects. Even with the knowledge of object shapes, the correction of projective errors requires the identification of objects by machine vision software, so a high level of image understanding should exist. In addition to normal lenses with perspective projection, there are also special lenses with orthographic projection.
These machine vision lenses do not display a scene with a focal perspective, but with a vertical parallel projection. Thus, the sizes of the displayed objects are always the same, regardless of their distance. This sounds like a good solution to all the problems with accurate measurements in the image, but it has one catch. With this type of projection, the size of the lens input area must be the same as the area of ​​the scene shot. These so-called telecentric lenses are then very large and expensive. The principle of telecentric lenses is quite simple. Using an aperture diaphragm located in the plane of the image main point (ie the focus of the lens), all rays coming from directions other than parallel to the optical axis should exist.
More info about machine vision lenses
In order not to put an end to all problems, significant limitations in the accuracy of the measurement in the image can cause us geometric distortions in the image field of the lenses, and these also occur with telecentric lenses. By distortion, we mean the difference between the theoretical position of a pixel, which follows from the principle of projection, and the actual position of the point displayed by a real lens. With real lenses, the conversion between the position angle (or distance) of the displayed object from the optical axis and the distance of the image of this object in the image area is never completely linear. The transformation of an angle into a distance has the character of a quadratic, but more often a cubic polynomial.Â
Even very good machine vision lenses, when used with multi-megapixel cameras, usually have radial distortion in the range of units up to tens of pixels. In some applications, such as reading texts, codes or counting components, this may not matter. In applications where accurate dimensional measurements should exist, lens quality becomes an essential criterion.
While we do nothing with the principles of projection, we can correct the distortion of the image field by software and achieve excellent subpixel accuracy even with conventional lenses. The problem can be the computational complexity of correction algorithms. The system performs these corrections using a graphics processor with very minimal impact on the computer load.