Optical basics for machine vision systems Lars Fermum Chief instructor STEMMER IMAGING GmbH www.stemmer-imaging.de
AN INTERNATIONAL CONCEPT STEMMER IMAGING customers in UK Germany France Switzerland Sweden Who? What? Theoretical and applied knowledge General machine vision topics Specific products (hardware / software) Tailored to your needs At our European sites At your premises Online / mobile Where? Why? Learn how to use machine vision even more efficiently Benefit from the extensive knowledge of the experts at STEMMER IMAGING
Specification of lenses
OPTICS Purpose and requirements profile of lenses: Depiction of the complete field of view on the sensor with high resolution, high contrast and, typically, the smallest optical errors possible Optical depiction principle Reproduction scale/ focal width suitable Mechanical mount suitable for the camera Image circle diameter suitable for sensor size
USE OF THE CORRECT LENS Fixed focal lengths Lenses for special wavelengths (UV/IR) Entocentric lenses Lenses for micro head camera Pericentric lenses Boroscopes Zoom lens Colour-corrected lenses Telecentric lenses Lenses for 3CCD cameras Mirror based optical systems Macro lenses
ENTOCENTRIC LENSES Entocentric lens, f =25mm Entocentric lens, f =6mm Entocentric lenses provide a fixed opening angle, with increasing working distance, the field of view will also increase. There are many fixed focal length lenses available with compact design, weight and costs. Caution with shorter focal lengths due to perspectivic effects and distortions. But it could be also very helpful for inspecting threads, holes etc.
ENTROCENTIC VS TELECENTRIC LENSES Entocentric image perspectives Object with different working distance appears with different size Reproduction scale is different for all working distances Telecentric image perspectives Within the telecentric range of lens objects appear with same size Telecentric range is typically bigger than depth of field.
MECHANICAL LENS CONNECTIONS The lenses must be able to illuminate the entire image field of the sensor homogeneously. Lens mounts: CCD sensors 1/3" to 1": VGA 9 mega pixels: C-mount Area scan cameras with high resolution & pixel size (CCD bigger than 1 inch ) and line scan cameras: F-mount or M42 Especially large line scan camera sensors require M72, M96 etc. Rather unusual for area scan cameras
OPTICAL DEPICTION Lens equation: 1/u = 1/v + 1/f Magnification: Beta = (v/ u) or: (Image height / Object height)
SENSOR SIZES & FLANGE BACK DISTANCE Typical sensor sizes for C-mount cameras: The size of the image circle diameter must be selected so that the entire sensor is illuminated as homogeneously as possible. Flange back distance: C-mount: 17.5mm F-mount: 46.5 mm CS-mount: 12.5mm M42: undefined!
OPTICAL DEPICTION (2) "Lenses" calculation (focal length): Focal length f= Working Distance / (Object / Image +1) "Working distance" calculation Working distance u = Focal length * (Object / Sensor size +1) Object is 50 mm, camera 1/3"=4.8 mm CCD lenses used 300 mm f= 300 mm / (50 mm / 4.8 mm +1) f= 26.28 mm focal length Lens required: 25 mm Object is 150 mm, camera 1/2"=6.4 mm CCD lenses used:16 mm u = 16 mm * (150 mm / 6.4 mm +1) u = 391 mm object distance The working distance is approx. 391 mm Focal width calculator >>> LensSensor app for Apple, devices & PC (Android in preparation)
IMAGE QUALITY OF THE LENSES Low geometric distortion High image sharpness and contrast Low scattered light Lens quality 10,0 7,5 5,0 2,5 Spectral transmission Scattered light 6% 12% 24% 0 300 400 500 600 700 800 900 1000 nm Absense of colour fringing Brightness distribution
IMAGE SHARPNESS AND CONTRAST A lens must be able to depict fine structures and details sharply and with high contrast. The sharpness and contrast is determined using black and white test patterns. MTF curve For each line pair, a contrast value can be determined as a contrast transfer function MTF (Modulation Transfer Function). Standard lens high resolution lens
RESOLUTION VS DIFFRACTION AT SLIT The ability to detect the smallest defined structures and be able to separate from each other is called resolution. Structures can eventually no longer be detected, they melt into each other. This effect depends on f-number of lens, wavelength of used light, position in field of view and working distance. f-number 2.8 f-number 16
Intensity DIFFRACTION AT SLIT These effects of blur are caused by diffraction at slit, the light point is represented as diffraction disk ( airy disk ) Light sources Aperture Image 2: Diffraction at circular aperture Image 3: Diffraction at double slit Two nearby light points are just resolved if the main maximum of the diffraction pattern of L1 coincides with the first diffraction minimum of L2 Diameter diffraction airy disk d= 2*1.22 * * ( =f-number, = wave length)
RESOLUTION OF LENSES Lenses are often classified in CCTV, megapixel, 5 - or 10-Megapixel Lenses. This is intended to show what camera sensors can typically be used. Idea: Resolving a certain pixel size or a certain number of line pairs on the sensor. Example: 100 line pairs / mm corresponds to 100 white and 100 black lines with 5 microns thickness. With small camera pixels high resolution lenses are needed. Just cheap cameras with a small sensor and pixels need the best lenses! The optics should ideally reach 2/3 of lp / mm of the sensor, otherwise moiré effects may occur. Sensor resolution pixel size lp/mm 1/3 Sony ICX424 656 x 492 7.40 µm 67 2/3 Sony ICX285 1388 x 1038 6.45 µm 78 1/2 Sony ICX274 1624 x 1234 4.40 µm 114 1/3 Sony ICX445 1292 x 964 3.75 µm 133 2/3 Sony ICX655 2452 x 2056 3,45 µm 145 Line pair 1/2.5 Aptina MT9P031 2588 x 1940 2.20 µm 227 1/2 Aptina MT9J003STM 3840 x 2748 1,67 µm 300
SPECTRAL TRANSMISSION & ANTIREFLECTION COATING Different coatings avoid surface reflections and thus increase transmission. However, anti-reflection coatings also reduce the glare. Although these antireflection coatings are often only a few microns thick, they can increase image quality substantially. Mode of operation Anti-reflection coating Make sure to use a high-quality lens! Caution regarding inspections in IR: Many anti-reflection coatings are only optimised for the visible wavelength range. Result: powerful light diffusion effects. Please clean lenses carefully!
GEOMETRY - ACCURATE REPRODUCTION Ideal case: The image generated by the lens is an exact reproduction of the object. However, lenses involve a certain degree of distortion and the image is often non-linearly distorted. Result: Exact measurements are often very difficult to make. Positioning or pick & place applications are imprecise. Use distortion-free lenses as far as possible. Software-based approaches are only of limited help, as the spatial depth of objects with corrections cannot be taken into account, for example.
FUNCTION OF THE LENS APERTURE Aperture and depth of field Stopping down the lens reduces many optical errors. 2 to 3 f-stops are ideal. (Chromatic longitudinal error, coma, astigmatism, vignetting and spherical aberration) However, from f number 8 and more, effective image resolution will be decreased due to diffraction effects. F-stop (=>depth of field), exposure time camera (=> motion blur?) and sensor gain (=> sensor noise) compete with image brightness. Possibly use multiple or stronger light sources or led flash controller.
TIPS AND TRICKS: EXTENSION RINGS Allow flexible use of the lens Usage of extension tubes Reduction of minimum object distance (MOD) Smaller field of view, increasing reproduction scale Available as 0.5 mm, 1, 5, 10, 20 and 40 mm extension rings
THE KEY TO PERFECT INSPECTIONS CHOOSE YOUR PERFECT LENS There are many different products available, suitable for all application purposes: Macro, Colour, High Res (small pixels), telecentric, auto iris, zoom, shock resistant, different lens mounts, cheap, 3CCD etc. Lens design is always a compromise between price, general quality and image errors. With smaller sensor pixels and smaller imagers, the resolving capacity of lenses and mechanical precision increases and thus gets more expensive. Ask our vision experts at STEMMER IMAGING for your ideal lens, which will fit your demands.
Thanks a lot for your attention! STEMMER IMAGING GmbH Gutenbergstraße 9 13 82178 Puchheim, Deutschland Telefon: +49 89 80902-0 Fax: +49 89 80902-116 info@stemmer-imaging.de www.stemmer-imaging.de Your contact: Lars Fermum