How to specify an inspection lens, in order
Every inspection lens specification starts with the defect, not the focal length and not the sensor. The output of the first step is one number: minimum detectable feature size. A 50 micron scratch on a painted surface and a 500 micron dimensional deviation on a machined part drive completely different specifications downstream. When the defect type is unclear, design to the smallest feature you expect to care about. You can open the aperture or reduce magnification later, but you cannot recover detail that was never captured.
Calculate the required resolution
Once you have a minimum feature size, calculate sensor resolution: 3 to 5 pixels per smallest feature. Three pixels gives marginal detection; five gives reliable detection with enough signal margin for thresholding algorithms. Inspecting a 100mm part, detecting defects down to 50 micron, at 5 pixels per defect: 5 divided by 0.05mm gives 100 pixels per millimeter, so 10,000 pixels along the critical axis. Lens resolution must meet or exceed the sensor's pixel pitch. A 12MP sensor at 1.1" has 3.45 micron pixels; a lens rated for 12MP resolves at that pitch. Pairing a lower-rated lens with a higher-resolution sensor means the optical blur, not the sensor, sets your effective resolution.
Set the working distance, then compute focal length
Working distance is set early by conveyor height, robot reach, enclosure dimensions, and part-loading clearance, not a free variable to pick after browsing a catalog. Once you have working distance and required field of view, focal length follows exactly for rectilinear projection:
At a 300mm working distance, a required 100mm field of view, and a 14.1mm sensor width (1.1" sensor): EFL = 300 × 14.1 / 100 = 42.3mm, pointing to a 50mm lens. C-mount lenses refocus by moving internal groups on a cam; M12 lenses focus by threading the entire barrel in and out of the holder. Treat working-distance tolerance and refocus behavior as a property of the mount type you have chosen. Verify your own numbers with the field of view calculator or the EFL calculator before ordering.
Choose the right aperture
Aperture trades depth of field against diffraction. For flat parts at a fixed working distance, open the aperture for maximum light throughput and resolution, typically F/2.8 to F/5.6 on many C-mount industrial lenses, MTF permitting. For 3D parts or components with height variation, stop down using the depth of field calculator. Diffraction sets a practical ceiling: above F# of about 2 times the pixel pitch in microns, diffraction softening typically exceeds the gain from stopping down further. For 3.45 micron pixels, that ceiling is roughly F/7; for 25MP sensors with 2.74 micron pixels, closer to F/5.5. M12 lenses typically ship with a fixed aperture, which removes this lever entirely.
Distortion matters for measurement more than pass/fail
Distortion displacement is radial: it scales with a point's distance from the field center, not with total field width. At 0.5% distortion on a 100mm field, a point at the field edge can be displaced by roughly 0.25mm from its true position: noise against a plus or minus 1mm tolerance, a dominant error source against plus or minus 0.1mm. Print registration is the tightest case; seal-width and label-code geometry sit in the middle, where a sub-0.5% spec is usually sufficient; fill-level threshold checks are the most forgiving because the reference mark and meniscus sit in the same frame and a consistent error affects both similarly. See the low distortion lens guide for the difference between TV distortion and rectilinear distortion conventions.
Match the sensor format to the lens
The lens image circle must fully cover your sensor diagonal. A lens rated for 2/3" has an image circle of roughly 11mm; a 1.1" sensor has a diagonal of roughly 17.6mm. Put a 2/3" lens on a 1.1" sensor and you get severe vignetting. Oversizing the lens is the safer direction; undersizing produces vignetting that no amount of software correction recovers. A compact M12 lens is often a fraction of the cost of a comparable C-mount lens: on an eight-lane fill system, the difference between a $19 M12 lens and a $119 C-mount lens is roughly $800 across the station. That advantage only holds if the M12 image circle actually covers the sensor with margin. Full rules are in the sensor size and lens compatibility guide.
















