Choosing Cameras and Lenses for Computer Vision

No algorithm can recover detail the camera never captured. A vision system starts with the question of what must be seen, how small it is, how fast it moves and under what light. Those answers decide the sensor resolution, the shutter type, the lens and the illumination. This article works through each choice and gives the simple calculations that size a camera for a task.

At a glance

Global
A global shutter exposes every pixel at once, so moving objects are not skewed.
Rolling
A rolling shutter exposes rows in sequence; common and economical, but distorts fast motion.
px per mm
Resolution on the object, which decides the smallest feature that can be seen.
Lighting
Controlled illumination is often the cheapest way to better images.

The problem

Cameras are often chosen by headline resolution. A high pixel count does not help if the lens cannot resolve it, if motion blurs the image during exposure, or if reflections and shadows change with the time of day.

Motion is a frequent cause of trouble. A rolling shutter reads rows at slightly different times, so objects moving across the frame appear slanted or wobbled, which corrupts measurements.

Size the camera from the smallest feature and the fastest motion. The megapixel count follows.

Sizing the system

Divide the field of view by the smallest feature and multiply by the pixels you want across it; a few pixels per feature is a common starting point, and measurement needs more. Motion blur in pixels is the object speed times the exposure time, divided by the object size each pixel covers.

For focal length, a useful approximation is sensor width times working distance divided by field of view. Check the lens is rated for the sensor size and pixel pitch, and remember that a wider aperture reduces depth of field.

What good looks like

Define the field of view, the smallest feature, the object speed and the working distance.

Calculate the resolution and maximum exposure time, then choose the shutter type and a lens that covers the sensor.

Test candidate cameras and lighting on real parts in the real environment before freezing the mechanical design.

Pixels needed across a 200 mm field of view
Smallest featureFeatures across the fieldPixels needed
2 mm100300 px
1 mm200600 px
0.5 mm4001,200 px
0.25 mm8002,400 px
0.1 mm2,0006,000 px
Calculated at 3 pixels across the smallest feature, a starting point rather than a rule. Measurement tasks often need more.
Rolling and global shutter
Rolling shutterGlobal shutter
Moving subjectsSkew and wobbleNo skew
CostLowerHigher
Sensor choiceVery wideNarrower
Strobe synchronisationFlash must fall while all rows exposeStraightforward
The shutter type matters most when the scene or the camera moves.

What it changes

Usable Images

The detail the algorithm needs is present in every frame.

Sharp Motion

Exposure and shutter type are matched to object speed.

Stable Results

Controlled lighting reduces sensitivity to the surroundings.

Right Cost

Resolution and optics are sized to the task, not over-specified.

Where to go next

Consider lighting geometry as carefully as the camera: backlighting for silhouettes, diffuse light for shiny parts and low-angle light for surface texture.

Plan camera calibration if the system measures distances or positions, and protect the mount from vibration and knocks.

Problems this prevents

  • Motion blur from a long exposure
  • Skewed images from a rolling shutter
  • A lens that cannot resolve the sensor
  • Results that change with daylight

Discuss your project

Email support@aavico.com or use Get in Touch when the website finishes loading.