Technical archive

    How to Select a Machine Vision Lens

    A task-based method for selecting focal length, sensor, working distance, resolution, depth of field, and illumination for robotics and inspection.

    Palo Alto Optics Engineering9 minUpdated Jul 31, 2026
    How to Select a Machine Vision Lens

    How to Select a Machine Vision Lens

    Select a machine-vision lens from the decision the machine must make, not from megapixels or focal length alone. Define the smallest feature, required field, working distance, depth range, surface behavior, motion, and calibration accuracy first. Those inputs determine sensor sampling, magnification, aperture, lens class, illumination, and whether a catalog lens has sufficient margin.

    Start with the feature and decision

    State what the system must detect, locate, measure, or classify. A dimensional measurement, cosmetic inspection, and robot-guidance task may view the same part but require different optics and acceptance metrics.

    Define the smallest relevant feature and the contrast it produces under representative lighting. Decide how many sensor pixels must cover it after accounting for blur, noise, demosaicing, calibration, and process variation. A nominal two-pixel sampling argument is rarely enough for robust production inspection.

    Connect field of view to the sensor

    Required field and sensor size establish magnification. For a fixed sensor, a wider field places fewer pixels on the feature. A larger sensor can recover sampling but requires a larger image circle and potentially a more demanding lens.

    Working distance and package clearance constrain focal length and lens position. Check the resulting geometry in CAD for occlusion, robot motion, lighting access, collision envelope, and service.

    Resolution is a system property

    Pixel count does not equal resolved detail. Lens MTF, focus, aperture, diffraction, aberrations, motion blur, vibration, cover glass, illumination spectrum, and processing all contribute.

    Evaluate resolution at required field points, wavelengths, working distances, and focus states. Center-field MTF at one distance is not sufficient when corners or a deep working volume matter.

    Depth of field and aperture

    Closing the aperture increases geometric depth of field but reduces light and eventually increases diffraction blur. Longer exposure recovers signal only if the part and camera remain stable. Strobing freezes motion, but source intensity, pulse duration, duty cycle, and thermal behavior must be engineered together.

    The correct aperture is a trade among depth, resolution, signal, motion, and illumination power.

    Distortion, perspective, and telecentricity

    For classification, calibrated distortion may be acceptable. For dimensional measurement, perspective error caused by object-height variation may dominate. A telecentric lens reduces magnification change with depth but is larger and more expensive because its entrance aperture must support the object field.

    Choose telecentricity only when the measurement uncertainty requires it.

    Illumination and calibration

    Bright-field, dark-field, coaxial, diffuse, strobed, polarized, and spectral illumination reveal different features. Test real parts covering finish, contamination, pose, and acceptable variation.

    Intrinsic calibration corrects lens geometry. Extrinsic calibration relates the camera to the robot or stage. Neither remains valid if mounts, focus, windows, or target geometry move. Define datums, locks, recalibration triggers, and service procedure with the optics.

    When a custom lens is justified

    Custom design is reasonable when catalog options cannot close field, package, distortion, depth, spectrum, telecentricity, environment, or production margin. First confirm that illumination, viewpoint, calibration, or sensor changes cannot solve the problem more economically.

    For a productive review, send representative images, difficult parts, geometry, CAD, sensor, current lens and lighting, motion conditions, cycle time, and failure examples. PAO supports robotics and machine-vision optics through calibrated prototype hardware.

    Need engineering support?

    Apply the technical context to your system.

    Discuss a program