1. Basics of lens selection
Image processing roughly consists of the following four steps.
1. Capturing an image
Release the shutter and capture an image
2. Transferring the image data
Transfer the image data from the camera to the controller
3. Enhancing the image data
Pre-process the image data to enhance the features
4. Measurement processing:
measure flaws or dimensions on the image data
Measure and output the processed results as signals to the connected control device (PLC, etc.)
1.1 Image processing flow chart
Many vision sensor manufacturers focus on explaining Step 3, “Processing the image data”, and emphasize the processing capability of the controller in their catalogs. Step 1, “Capturing an image”, however, is the most important piece for accurate and stable image processing. The key to making Step 1 a success is proper selection of a lens and illumination system. This basic guide details how to successfully capture an image by selecting a suitable lens.
1.2 Creating a highly focused image
Application example: Detecting foreign objects/flaws inside of a cup
Q:When detecting foreign objects/flaws inside of a cup, which of the following two images is more suitable for detecting small defects over the entire inspection area?
A:The image on the right
It will be difficult to consistently detect the defects in the image on the left, even if a high-performance controller is used. With the right combination of knowledge, it will be easy to create a highly focused image like the image on the right.
Clear images are the most important part of image processing.
The following three points are essential for high-accuracy, stable inspection.
Capture a large image of the target ;
Focus the image ;
Ensure the image bright and clear
1.3 Lens basics and selection methods
A camera lens consists of multiple lenses, an iris diaphragm(可变光圈) (brightness) ring and a focus ring(光圈).
The iris diaphragm and focus should be adjusted by an operator looking at the camera’s monitor screen to make sure the image is “bright and clear”.
（Some lenses have fixed adjustment systems）
There are various points that need to be considered when selecting a lens, such as field of view, focal distance, focus and distortion. This guide focuses on two points important for all applications, “Selecting a lens to match the field of view” and “Focusing an image with a large depth of field”.
(2)Focal distance and field of view of lenses
Focal distance is one lens specification. Typical lenses for factory automation have focal distances of 8 mm 0.32”/ 16 mm 0.63”/ 25 mm 0.98”/ 50 mm 1.97”. From the necessary field of view of the target and the focal distance of the lens, the WD (working distance) can be determined.
The WD and view size are determined by the focal distance and the CCD size. When NOT using a close up ring, the following proportional expression can be applied.
Working distance : View angle = Focal distance : CCD size
Example 1: When the focal distance is 16 mm 0.63” and the CCD size is 3.6 mm 0.14”, the WD should be 200 mm 7.87” to make the field of view 45 mm 1.77”.
(3)Focusing an image with a large depth of field (range in which a lens can focus on objects)
1)The shorter the focal distance, the larger the depth of field
2)The longer the distance from the lens to the object, the larger the depth of field
Close up rings and macro lenses make the depth of field smaller
3)The smaller the aperture, the larger the depth of field
A small aperture and bright illumination make focusing easy
A camera is installed as shown in the illustration. A graduated tape that indicates the height is attached on a slope. In this situation, the pictures are taken to compare the apertures.
(4)Contrast differences due to lens performance
The following images are captured with KEYENCE’s high-resolution CA-LH16 lens and standard CV-L16 lens. The difference in the image quality is caused by the lens materials and structures. Higher-contrast images can be produced by using a high-resolution lens.
Field of view:60 mm 2.36”/ Stain size: Approx. 0.3 mm 0.01”
Comparison between a 240,000-pixel CCD and a 2 million-pixel CCD
The following images of the same target captured with KEYENCE’s 240,000-pixel and 2 million-pixel camera and magnified with a PC. Which image shows the characters more clearly? Of course, the 2 million-pixel camera. The difference in image quality directly affects the inspection accuracy when using image processing technology. Camera selection according to the application is also important.
What is distortion（畸变，扭曲）?
Distortion is the ratio of change between the center and edge areas of a captured image. Due to the aberration(偏差) of the lens, the distortion is more noticeable at the edges of a captured image. There are two types of distortion: barrel distortion and pincushion distortion. The general rule is that when the absolute value of the distortion value is small, the lens offers higher accuracy. Lenses with smaller distortion should be used for dimension measurement, for example. Lenses with a long focal distance generally have smaller distortion.
1.4 Summary of lens selection and image processing basics
High-quality images are fundamental for image processing. With some is basic knowledge of lens selection:
1)The suitable field of view for the target is ensured
2)The entire image can be focused
3)The contrast between the target and background can be enhanced with a suitable brightness
1.When the focal distance is 16 mm 0.63” and the CCD size is 3.6 mm 0.14”, the WD should be 200 mm 7.87” to make the field of view 45 mm 1.77”.
2.The general rule is that when the absolute value of the distortion value is small, the lens offers higher accuracy,Lenses with smaller distortion should be used for dimension measurement, for example. Lenses with a long focal distance generally have smaller distortion.
- Basics of lens selection