Skip to content
The Outlook server is temporarily down. Please send your requests to us on WhatsApp.
Stock is confirmed when you order, and we will advise you as soon as your order is confirmed. Need help with a part? Email orderdesk@kkmsolutions.com.
Ships worldwide — lead time quoted per part orderdesk@kkmsolutions.com
KKM Industrial and Automation Solutions Industrial Automation & MRO Parts Need a part? Email the order desk orderdesk@kkmsolutions.com
Email the order desk Get a quote
PLC, HMI & Industrial Networking

Machine Vision Basics: Choosing Camera Resolution, Lens and Lighting

KKM Solutions · September 19, 2026

How to specify an industrial vision system: the resolution a defect needs, how field of view sets it, lens choice, and why lighting decides whether an.

Black metal camera lens barrel and ring light on a dark workbench

Short answer

  • A vision system is specified by defining the smallest feature to detect and the field of view, sizing the resolution from that, choosing a lens to fit the field of view and working distance, and then designing the lighting.
  • A feature needs to span at least about 3 pixels to be detected reliably, so a 0.1 mm defect across a 50 mm wide field of view calls for about 1,500 pixels across that dimension.
  • Lighting often decides the result, so the arrangement should suit the surface and the feature and be shielded from ambient light.

Most failed vision projects fail on lighting or on resolution that was never calculated, not on the camera brand. The order that works is: define what must be detected, size the resolution from that, choose the lens to fit the field of view and distance, then design the lighting. This entry covers the first three steps and the one that surprises people most, lighting.

What must be defined first: the feature and field of view?

Write down the smallest feature or defect that must be reliably detected, and the total area the camera must see (the field of view, or FOV) including the part's position variation. A part that shifts a few millimetres on the conveyor needs a larger FOV than the part itself.

How do you calculate the camera resolution you need?

A widely used rule of thumb is that a feature needs to span at least about 3 pixels, and preferably more, to be detected reliably. Pixels per feature depends on the size of the field of view divided by the number of pixels across it. For a worked example with stated assumptions: a part needs a 0.1 mm defect detected across a 50 mm wide field of view. At 3 pixels per defect, the pixel size on the part must be about 0.033 mm, so the sensor needs about 50 / 0.033 = about 1,500 pixels across that dimension. A 2-megapixel camera (about 1,600 by 1,200) just meets it, and a higher resolution gives margin. Measurement accuracy is coarser than detection: repeatable sub-pixel measurement is possible with good edges and lighting, but do not assume it without testing.

More pixels are not free. Larger images take longer to transfer and process, so cycle time can limit the resolution you can use.

How do you choose the right lens?

The lens turns the working distance and field of view into a required focal length. For a lens with the object much farther away than the focal length, the relationship is approximately: focal length ≈ sensor size × working distance / field of view. So a larger sensor, a longer working distance or a smaller field of view all call for a longer focal length. Check the lens is rated for the sensor size, or the image will darken or blur at the corners. Aperture affects depth of field and brightness: a smaller opening (higher f-number) gives a deeper in-focus range but needs more light.

For measurement of dimensions, a telecentric lens keeps magnification constant across a range of distances and removes the perspective error that makes a standard lens see a raised edge as larger. It is larger and costs more, and it can only see an object no bigger than its own front element.

Which lighting arrangement should you use?

  • Backlight. A light behind the part gives a sharp silhouette. It is the most reliable arrangement for measuring outlines and detecting through-holes and gaps.
  • Bright-field (direct) front light. Lights a flat, matt surface evenly but produces glare on shiny parts.
  • Dark-field (low-angle) light. Grazing light makes scratches, engraving and edges stand out against a dark background.
  • Diffuse (dome) light. Removes glare from curved, shiny parts by lighting them from every direction.
  • Coaxial light. Lights a flat reflective surface along the lens axis, and shows up surface marks and texture that a plain front light hides.
  • Colour. A light colour that the part reflects and the background absorbs raises contrast. A filter matched to the light blocks ambient light.

Shield the setup from stray ambient light, since a system that works at night and fails in the morning sun is a lighting problem. Check that the trigger and the strobe timing freeze the part's motion. Blur at speed calls for a shorter exposure and brighter light.

What mistakes cause vision projects to fail?

  • Specifying the camera before the feature size and field of view are known.
  • Testing with three good parts instead of a realistic range of good and bad parts, including the variation seen on the line.
  • Ignoring part position and orientation variation, so the feature is sometimes outside the frame or out of focus.
  • Treating lighting as an afterthought, or using ambient light.

What is the procedure for specifying a vision system?

  1. State the feature size, the defect types and the FOV including position variation.
  2. Calculate the pixels needed and choose the sensor resolution with margin.
  3. Choose the working distance and the lens focal length.
  4. Pick the lighting arrangement to suit the surface and the feature, and shield it from ambient light.
  5. Test on a realistic sample set before committing, and confirm the values with the vision manufacturer.

Search the catalog or browse the Keyence listings. For presence and proximity sensing that does not need an image, the sensor finder lists simpler options. Send us the full catalog number of any vision part you need and we will confirm the exact part before an order is placed.

Need a quote on a specific part?

Our order desk replies within 1 business day. No account needed. Or email orderdesk@kkmsolutions.com.

Request a Quote

Frequently asked questions

How many pixels does a defect need to be detected in machine vision?

A widely used rule of thumb is that a feature needs to span at least about 3 pixels, and preferably more, to be detected reliably. Pixels per feature depends on the size of the field of view divided by the number of pixels across it. A higher resolution gives margin.

How do you calculate camera resolution for a vision system?

Divide the field of view by the pixel size the defect requires. For a 0.1 mm defect across a 50 mm wide field of view at 3 pixels per defect, the pixel size on the part must be about 0.033 mm, so the sensor needs about 1,500 pixels across that dimension. A 2-megapixel camera, about 1,600 by 1,200, just meets it.

How do you choose a lens focal length for a vision camera?

The lens turns the working distance and field of view into a required focal length, approximately sensor size times working distance divided by field of view. A larger sensor, a longer working distance or a smaller field of view all call for a longer focal length. The lens must also be rated for the sensor size, or the image will darken or blur at the corners.

Which lighting arrangement works for shiny parts in machine vision?

A diffuse dome light removes glare from curved, shiny parts by lighting them from every direction, while a bright-field front light produces glare on shiny parts. A dark-field low-angle light makes scratches, engraving and edges stand out, and a backlight gives a sharp silhouette for measuring outlines and detecting through-holes and gaps.