Overview
Cameras and lenses are essential components of computer vision. Appropriate camera and lens selection determines overall system performance. Many computer vision engineers find it difficult to choose suitable industrial cameras and lenses. This article explains how to select a camera and the corresponding lens.
Basic imaging principle
Pinhole imaging is a fundamental concept. For a convex lens, remember these key points about object distance relative to focal length f:
- Object distance greater than 2f: real image.
- Object distance equal to 2f: real image.
- Object distance between f and 2f: real image.
- Object distance equal to f: no image formed.
- Object distance less than f: virtual image.
Camera selection: key parameters
Camera selection covers both line-scan and area-scan cameras. In either case, the following parameters are required in advance:
- Resolution (sensor imaging size), e.g., 1024 pixels x 1024 pixels.
- Frame rate (area-scan): number of frames captured per second.
- Line rate (line-scan): number of image lines captured per second; effectively the acquisition rate.
- Pixel size: physical size of a single photosite on the sensor, e.g., 7.4 μm x 7.4 μm.
- Sensor size: pixel size multiplied by resolution.
- Focal length: distance from lens principal point to the focal point for collimated light.
- Object distance: distance from the object to the lens principal point.
- Optical magnification: generally a fixed value, often in ranges such as 0.35×–2.25× or 0.75×–4.5×.
- Working distance: same as object distance.
- Exposure time: time the shutter (or electronic exposure) is open to expose the sensor.
- Field angle: angle formed by the extreme incident rays at the lens center.
- Image plane size: the physical imaging area of the sensor.
- Spatial resolution: real-world size represented by one pixel (e.g., mm/pixel).
- Depth of field: the range in front of and behind the measured object where the image remains acceptably sharp.
Line-scan camera selection
Line-scan cameras are suitable for high-speed moving objects. As a rule of thumb, objects moving around 40 km/h can be imaged with a line-scan camera.
Define the following:
- Object size: A × B (mm).
- Working distance: C (mm).
- Required spatial resolution: D (mm/pixel).
- Object speed: V (mm/s).
- Depth of field: E (mm).
Required acquisition rate (to determine line rate) = V / D.
Minimum imaging width in pixels (assuming A is imaging width) = A / D.
With these two parameters, you can select a line-scan camera model. Example: line rate 55 kHz, sensor size 2048 × 1, and other specs meeting requirements.
Area-scan camera selection
Area-scan cameras are better for slower-moving objects, with a similar guideline of about 40 km/h as a dividing point. Use these parameters:
- Object size: A × B (mm).
- Working distance: C (mm).
- Required spatial resolution: D (mm/pixel).
- Object speed: V (mm/s).
- Depth of field: E (mm).
The field of view must be larger than the physical object size. For margin, pick a field of view of about 2A × 2B.
Required horizontal sensor size (pixels) = A / D. Required vertical sensor size (pixels) = B / D. Choose a camera with pixel dimensions a × b greater than these values.
Now consider exposure time to avoid motion blur. Exposure time must satisfy:
Exposure time < D' / V
where D' is the recalculated spatial resolution after the camera size is fixed. For example, if the chosen sensor width is a pixels and the target width is 2A, then D' = 2A / a.
Lens selection
A lens is required once the camera is chosen. Lens selection steps:
- Magnification F = pixel size / required spatial resolution. (Pixel size is known after camera selection.)
- Focal length f = working distance × F / (F + 1). After calculating this value, choose the nearest standard focal length that is smaller than or equal to this value.
- Image circle diameter = pixel size × number of horizontal or vertical pixels. The lens image circle must be larger than this diameter; otherwise the sensor will not be fully covered.
Also pay attention to the field of view:
Horizontal field of view angle = 2 × arctan(A / C)
Vertical field of view angle = 2 × arctan(B / C)