Many teams start to choose an industrial camera for machine vision by asking, "how many megapixels?" That is the wrong question to ask first. A 20 MP camera can still miss your defect if the defect covers only one or two pixels, if the lens cannot resolve the detail, or if the part moves and the image blurs. The reliable method works from the problem to the specification: the smallest defect you must see, the field of view (FOV) and the line speed come first, then the camera, lens and lighting.

This guide is for production engineers, QA staff and system integrators. It shows how to size resolution from the smallest defect with a worked example, how to select the lens and shutter type, and which four mistakes appear most often. The numbers in the examples only illustrate the arithmetic; they are not customer data.

Start from the problem, not the catalogue

Before you open any camera datasheet, answer five questions:

  • What is the smallest defect you must detect (for example a scratch 0.2 mm wide)?
  • What FOV must you cover: the part size plus positioning tolerance?
  • Is the part stationary or moving, and how fast does the line run?
  • What working distance (lens to part) does the mechanical design allow?
  • What is the surface like: glossy, matte, transparent, dark? This decides the lighting method.

These five answers settle most of the configuration. If any are unclear, BeeVision engineers can help you pin them down on real samples; see the end of this article.

Sizing industrial camera resolution from the smallest defect

A practical rule: the smallest defect should span at least 3 to 5 pixels across its smallest dimension. At one or two pixels a defect blends into noise or surface texture, and algorithms struggle to give stable results. This is a widely used rule of thumb; precision measurement or heavily textured surfaces may need more pixels.

Worked example (illustrative)

Suppose a part fits inside a FOV of 200 mm × 150 mm, the smallest defect is a scratch 0.2 mm wide, and you want it to cover 4 pixels.

  1. Pixel size on the part (spatial resolution) = 0.2 mm ÷ 4 = 0.05 mm/pixel.
  2. Pixels across = 200 ÷ 0.05 = 4,000; pixels down = 150 ÷ 0.05 = 3,000.
  3. Minimum resolution = 4,000 × 3,000 = 12 MP.

Changing the number of pixels per defect changes the requirement quickly, because resolution grows with the square:

The table shows why the megapixel figure must come after the calculation, not before. If the result exceeds what common cameras offer, consider splitting the FOV across several cameras, using a higher-magnification lens, or moving to a line scan camera (see below).

Choosing a machine vision lens: from magnification to focal length

Once resolution is known, the machine vision lens follows from the sensor size, the FOV and the working distance. Continuing the example, assume a sensor with 3.45 µm pixels and 4,000 pixels across, which makes the sensor about 13.8 mm wide.

  • Magnification ≈ 13.8 mm ÷ 200 mm ≈ 0.069×.
  • With a working distance of about 300 mm, focal length is roughly f ≈ WD × m ÷ (1 + m) ≈ 300 × 0.069 ÷ 1.069 ≈ 19 mm. In practice you pick the nearest standard focal length and adjust the distance.

That is only the first estimate. Three more conditions keep the lens from wasting the camera's resolution:

  • The lens must resolve the pixel. Small pixels need a lens designed for high-resolution sensors, with an image circle that covers the whole sensor.
  • Aperture and depth of field. Closing the aperture keeps parts of varying height in focus but darkens the image, so you need stronger lighting or longer exposure.
  • Distortion. For measurement, a telecentric lens keeps size constant over distance. BeeVision has an article on the OPT BP20-65-LQVTC telecentric lens for this kind of task.

Lenses and lighting are grouped under machine vision accessories at BeeVision.

Global shutter vs rolling shutter: choose by motion

A global shutter sensor exposes all pixels at the same moment. A rolling shutter sensor reads out row by row, so a fast-moving part can look skewed or stretched because each row is captured at a slightly different time.

Work out two values for a line running at 500 mm/s with the 0.05 mm/pixel from above:

  • Maximum exposure time to keep blur under 1 pixel = 0.05 mm ÷ 500 mm/s = 0.0001 s = 100 µs. Getting enough light in such a short exposure usually calls for strong, strobed LED lighting.
  • Rolling shutter skew: if full-frame readout takes 10 ms (an assumed figure), the part moves 500 mm/s × 0.01 s = 5 mm between the first and last row, about 100 pixels. For a 0.2 mm defect that distortion is unacceptable.

In practice: for stationary or slow parts a rolling shutter can be enough and economical; for fast-moving, triggered captures choose a global shutter.

Area scan vs line scan: choose by part shape and motion

Area scan captures a full frame at once, and suits discrete parts and triggered capture. Line scan captures one row of pixels at a time as the part passes, and suits continuous material such as sheet, web or film, or cases needing very high resolution across the width. In our example, a line scan camera would need a line rate = speed ÷ pixel size on the part = 500 mm/s ÷ 0.05 mm = 10,000 lines per second. A deeper comparison is in line scan vs area scan cameras.

4 common mistakes when choosing a camera and lens

1. Choosing too many megapixels

More pixels do not automatically mean better defect detection. High-resolution cameras often have smaller pixels that collect less light, produce larger data volumes (bandwidth, storage, processing PC) and may run slower. Calculate the pixels you need, then choose enough with a sensible margin.

2. Ignoring the lens and the lighting

A weak lens or the wrong lighting method can hide a defect even from an excellent camera. A scratch often appears only under dark field or well-matched coaxial light. Treat lighting as part of the problem; see the article on the OPT BC50-W coaxial light.

3. Using a rolling shutter for fast-moving parts

As the calculation above shows, skew and blur can be larger than the defect itself. Check the shutter type in the datasheet of the specific model rather than assuming it from the product family.

4. Too few pixels on the defect

Sizing the FOV to "just fit" without checking how many pixels the smallest defect covers is the leading reason a system works in trials but misses defects on the line. Aim for at least 3 to 5 pixels on the defect.

Camera and lens selection checklist

Frequently asked questions

Is a 5 MP camera enough?

It depends on the FOV and the smallest defect. Follow the steps above: if the smallest defect covers 3 to 5 pixels at your FOV, it is enough; if not, it is not.

Can software make up for low resolution?

Algorithms can improve stability but cannot recover information the pixels never recorded. Fix the optics first.

When should I use a line scan camera?

For continuous material or when very high horizontal resolution is needed. If you are new to the building blocks of a system, start with what machine vision is.

How BeeVision helps

Calculation is only the starting point; the final answer depends on real samples, lighting and line conditions. Browse the BeeVision industrial camera range, or sign up for a free consultation with an engineer to choose the camera and lens. You can send OK/NG samples for a trial; the engineering team will test them and recommend a setup based on real images. Follow BeeVision on LinkedIn and YouTube for more guides and practical videos.