Skip to content

Tools

The calculations every machine vision project starts from. Each result links straight to the products in the catalogue that satisfy it.

Choosing a lens

Solve for
Focal length
24 mm
Magnification: 0.08×
Resolution per pixel
0.0408 mm/px
Smallest detectable feature: 0.123 mm
In the catalogue
With the nearest lens the field of view becomes 96 mm.

The formula holds for standard (entocentric) lenses and assumes the working distance is much larger than the focal length. It does not apply to telecentric lenses, and it accounts for neither depth of field nor distortion.

Required resolution

Required resolution
1500 × 1125 px
Sensor
1.7 MP
Round up to a model that exists

One pixel per feature is detection in theory and noise in practice. Three is the rule for presence/absence; measurement to a tolerance wants more.

Maximum exposure with motion

Maximum exposure
100 µs
0.05 mm/px
Smallest detectable feature
0.15 mm
At 3 pixels per feature

If that exposure is beyond what the lighting can support, the answer is more light, not a longer exposure. On a moving part a rolling shutter does not merely blur but skews, and no exposure time fixes that. Why a rolling shutter distorts → Global shutter cameras →

Depth of field and diffraction

Depth of field
9.32 mm
Magnification: 0.08×
Effective f-number
f/8.6
Diffraction spot
12 µm
The spot is 3.4× the pixel — closing further buys depth at the cost of sharpness.

An approximation. Real depth also depends on the particular lens's aberrations. Diffraction is the limit on stopping down: past it the image softens everywhere instead of staying sharp over a longer range.

How the calculations work

The calculators above solve the standard optical relationships for whichever value you do not know. They apply to standard (entocentric) lenses, which cover most inspection tasks.

The input values

Working distance (WD) is the distance from the front of the lens to the inspected object, in millimetres. It is usually dictated by the machine layout.

Field of view (FOV) is the width or height of the area the camera must see at that distance. It should be slightly larger than the object, so that part position tolerances do not push features out of the image.

Sensor size is the physical width or height of the camera's imaging sensor, in millimetres. Inch format names such as 1/2" or 2/3" are legacy designations from the video tube era and do not describe real dimensions — a 2/3" sensor has a diagonal of only about 11 mm. Take the actual dimensions from the camera datasheet.

The formulas

FOV = sensor size × WD / f
f   = sensor size × WD / FOV
WD  = FOV × f / sensor size

Worked example: with an 8 mm wide sensor, a camera 300 mm from the part and a required 100 mm field of view: f = 8 × 300 / 100 = 24 mm. Lenses come in standard focal lengths, so you would pick 25 mm and recalculate: FOV = 8 × 300 / 25 = 96 mm. If the margin is no longer sufficient, adjust the working distance.

The calculator does that second step for you — it offers the nearest focal lengths the catalogue actually holds and shows the field of view you end up with.

What focal length does not account for

  • Resolution. The smallest feature you need to detect must span at least 3 pixels, which sets the required camera resolution regardless of the lens.
  • Depth of field. How much of the scene stays in focus depends on aperture, focal length, distance and pixel size.
  • Distortion. Standard lenses show some geometric distortion (several percent is common), and stopping down the aperture does not correct it.
  • Measurement tasks. For dimensional measurement a telecentric lens — constant magnification, no perspective error — is often the correct choice, and the formula above does not apply to it.

If your application involves precision measurement, very short working distances, large sensor formats or highly reflective surfaces, we recommend a short consultation with one of our engineers before ordering.

Get in touch

Frequently asked questions

How do I calculate the focal length for a machine vision camera?
Use the formula f = sensor width × working distance / field of view, with all values in millimetres. For example, an 8 mm wide sensor at 300 mm working distance with a 100 mm field of view gives f = 24 mm. Select the nearest standard focal length and recalculate the field of view to confirm coverage.
What is working distance in machine vision?
Working distance is the distance from the front of the lens to the inspected object, usually fixed by the mechanical layout of the machine. Together with sensor size and focal length it determines the field of view: at a given focal length, a longer working distance enlarges the visible area proportionally.
What is field of view (FOV)?
Field of view is the area the camera sees at the working distance, stated as width and height in millimetres. It grows with working distance and shrinks as focal length increases. In practice it should be somewhat larger than the object itself.
Is a "2/3 inch" sensor really 2/3 of an inch?
No. Inch-based format names are legacy designations from the video tube era and do not represent the actual sensor diagonal — a 2/3" sensor measures roughly 11 mm diagonally. For lens calculations, always use the true sensor width and height in millimetres from the camera datasheet.
When do I need a telecentric lens instead of a standard one?
Choose a telecentric lens for precision measurement, parts with features at different heights, or variable part positioning. Its parallel optical path gives constant magnification and eliminates perspective error, so object size in the image does not change with distance. For general inspection, a standard entocentric lens is more economical.
What is resolution per pixel, and why does it matter more than megapixels?
Resolution per pixel is the field of view divided by the pixel count: how many millimetres of the object one pixel covers. Megapixels alone say nothing — 5 MP over a 50 mm field gives 0.025 mm per pixel, while the same camera over 500 mm gives 0.25 mm and no longer separates a feature it used to see. Every inspection decision rests on this number.
How do I choose the exposure time for a moving part?
The maximum exposure is the allowed blur in pixels multiplied by the resolution per pixel and divided by the object speed. At 0.05 mm per pixel and a part moving at 500 mm/s, one pixel of blur allows 100 µs. If the lighting cannot support an exposure that short, the answer is more light rather than a longer exposure. On a moving part a rolling shutter does not merely blur but skews the geometry, which no exposure time fixes and which calls for a global shutter camera.