Machine Vision Camera Resolution: A Practical Guide

Machine Vision Camera Resolution: A Practical Guide

Machine Vision Camera Resolution: A Practical Guide

Matt Wilton

Director

MACHINE VISION
CAMERA RESOLUTION
INDUSTRIAL CAMERAS
FIELD OF VIEW
MACHINE VISION OPTICS
AUTOMATED INSPECTION
QUALITY CONTROL
VISION SYSTEMS
MACHINE VISION
CAMERA RESOLUTION
INDUSTRIAL CAMERAS
FIELD OF VIEW
MACHINE VISION OPTICS
AUTOMATED INSPECTION
QUALITY CONTROL
VISION SYSTEMS
MACHINE VISION
CAMERA RESOLUTION
INDUSTRIAL CAMERAS
FIELD OF VIEW
MACHINE VISION OPTICS
AUTOMATED INSPECTION
QUALITY CONTROL
VISION SYSTEMS
Machine vision PCB image shown at four progressively lower resolutions, demonstrating how reduced camera resolution affects visible detail.

Table of contents

Share

How much resolution do you really need for machine vision?

A 12-megapixel camera might detect a 0.2 mm scratch clearly. It might also miss it completely.

The difference is not simply the camera specification. It is how those pixels are spread across the area being inspected, whether the lens can resolve the detail, and whether the lighting makes the scratch visible.

This is why asking, “How many megapixels do we need?” rarely produces a useful answer on its own.

The better question is:

What is the smallest feature we need to inspect, across what field of view, and how reliably must we detect it?

Once those points are known, the required camera resolution can be estimated surprisingly quickly.

What does camera resolution mean?

Camera resolution is the number of pixels on the image sensor.

A camera with 2,448 × 2,048 pixels contains just over five million pixels, so it is described as a 5-megapixel camera.

But those pixels are spread across the width and height of the image. If a defect is being inspected horizontally, the useful figure in this example is 2,448 pixels, not five million.

Those 2,448 pixels could cover a 50 mm component or a 500 mm tray. The wider the area, the less real-world detail each pixel represents.

Megapixels alone therefore tell us very little about what a camera can inspect.

Three things determine the resolution you need

Before selecting a camera, define:

  1. The field of view: How much of the product or process must appear in one image?

  2. The smallest relevant feature: What is the smallest defect, edge, gap, character or component that matters?

  3. The inspection task: Does the system only need to detect the feature, or must it measure it accurately?

The same 5-megapixel camera may be more than adequate for checking whether a cap is present, but completely unsuitable for finding a fine scratch across a large component.

The basic camera resolution calculation

Start by calculating how much of the real product is represented by one pixel:

Millimetres per pixel = field of view ÷ pixels across that field

For example, a camera with 2,000 horizontal pixels covering a 500 mm-wide area provides:

500 mm ÷ 2,000 pixels = 0.25 mm per pixel

A 1 mm feature would therefore occupy approximately four pixels.

If the field of view and smallest feature are already known, reverse the calculation:

Required pixels across the field = field of view ÷ feature size × required pixels across the feature

Use the pixel count along the relevant axis, not the camera’s total megapixel figure.

Worked example: detecting a 0.5 mm defect

Consider a system inspecting a tray across a 500 mm-wide field of view.

The smallest unacceptable defect is 0.5 mm wide. For an initial calculation, we want it to occupy at least four pixels across its narrowest dimension.

First, calculate the required scale:

0.5 mm ÷ 4 pixels = 0.125 mm per pixel

Then calculate the required horizontal sensor resolution:

500 mm ÷ 0.125 mm per pixel = 4,000 pixels

The camera therefore needs approximately 4,000 horizontal pixels. A sensor around 4,096 × 3,000 pixels, commonly described as approximately 12 megapixels, would meet the initial calculation.

The real requirement is not “12 megapixels”. It is 4,000 pixels across 500 mm, giving four pixels across the smallest defect.

Change the field of view or defect size and the answer changes.

How many pixels should cover a feature?

There is no universal answer.

A feature occupying one pixel is not a reliable industrial target. Its appearance can change significantly with small movements, image noise and lighting variation.

Two pixels may register a simple, high-contrast feature under controlled conditions. Around four pixels across the feature is a more practical starting point for straightforward defect detection. Low-contrast defects and variable surfaces may need considerably more.

Different inspections also place different demands on the image:

Inspection

What matters most?

Presence or absence

Feature size, contrast and presentation

Surface defect detection

Narrowest defect dimension, texture and contrast

Dimensional measurement

Tolerance, calibration, edge quality and repeatability

OCR and code reading

Character stroke or code-module size and print quality

Robot guidance

Calibration, positional repeatability and mechanical variation

The calculation provides a starting point. Representative good, defective and borderline samples determine whether the proposed margin is sufficient.

Detection is not the same as measurement

A system may detect that a hole is present with relatively few pixels. Measuring its diameter to a tight tolerance requires much more control.

Machine vision software can estimate a well-defined edge to a fraction of a pixel using sub-pixel processing. That does not mean the complete system automatically achieves accuracy at the same fraction of a pixel.

Measurement performance also depends on calibration, lens distortion, perspective, focus, lighting, part position and mechanical stability.

For dimensional applications, specify the required tolerance and repeatability first. The camera resolution is only one part of the measurement uncertainty.

Why enough pixels may still not be enough

The calculation tells us whether the sensor has enough pixels available. It does not prove that useful information will reach them.

Four other factors frequently decide whether an inspection succeeds.

The lens

A high-resolution sensor needs a lens capable of resolving the same detail. If the image from the lens is already blurred, adding more pixels simply records the blur more precisely.

The lens must also cover the sensor properly and maintain adequate sharpness across the complete field of view.

The lighting

The camera cannot detect a feature that the lighting does not reveal.

A fine scratch may disappear under frontal illumination but become obvious under low-angle lighting. A profile may be easiest to inspect as a silhouette using a backlight. Reflective metal may require diffuse lighting or polarisation to control glare.

Resolution provides the detail. Lighting provides the contrast.

Focus and part variation

The calculation assumes the feature remains in focus. Changes in product height, angle or position can move it outside the available depth of field.

This becomes important with deep components, assemblies and loosely presented products on conveyors.

Motion blur

If the product moves several pixels while the exposure is open, fine detail becomes blurred regardless of the nominal camera resolution.

Short exposure times, sufficient illumination and accurate triggering are needed to preserve detail at production speed.

Why more megapixels are not always better

Choosing the highest-resolution camera can feel like the safe option. It can also introduce:

  • Lower maximum frame rates

  • Longer transfer and processing times

  • Greater network and storage requirements

  • More expensive lenses

  • Higher computing demands

  • More demanding lighting and exposure requirements

Higher pixel counts are also often achieved using smaller individual pixels, which collect less light under equivalent conditions.

The objective is not maximum resolution. It is sufficient, stable resolution with sensible engineering margin.

What if one camera is not enough?

Large products and very small defects can make a single-camera solution impractical.

The better approach may be to:

  • Reduce the field of view

  • Use multiple cameras

  • Capture several indexed images

  • Separate inspections into different stations

  • Use line-scan imaging for continuous or very wide products

Inspecting a 0.1 mm defect across a one-metre product is fundamentally different from inspecting it across a 20 mm local area. The answer is not always a camera with more megapixels.

What should you prepare before selecting a camera?

Define:

  • The complete field of view

  • The smallest relevant feature or defect

  • The required tolerance or acceptance limit

  • Whether the task is detection or measurement

  • The cycle time or line speed

  • Expected variation in product position, height and appearance

  • The available working distance

Supply representative good, defective and borderline samples wherever possible.

A photograph and a request for a “high-resolution camera” are not enough to specify a reliable inspection.

How AIET helps

AIET Group supports manufacturers across the UAE and GCC with machine vision feasibility studies, camera and lens selection, lighting trials, system development and production-line integration.

We begin with the inspection requirement, not a preferred camera model. Where the application is difficult, representative samples are tested to establish whether the feature can be detected reliably and what engineering margin is available.

The result is a system specified around the real inspection, rather than a megapixel number.

FAQ

How do I calculate the camera resolution needed for machine vision?

Divide the field of view by the required millimetres per pixel. Estimate the millimetres per pixel by dividing the smallest feature size by the number of pixels required across that feature. Perform the calculation using the horizontal or vertical sensor dimension relevant to the inspection.

How many pixels are needed to detect a defect?

It depends on defect shape, contrast, lighting and the required reliability. Around four pixels across the narrowest feature is a practical starting point for straightforward defect detection, but the final requirement must be tested using real samples.

Is a higher-megapixel camera always better for machine vision?

No. More pixels can reveal finer detail or cover a wider area, but they also increase processing, bandwidth, storage and lens requirements. They may also reduce the available frame rate. The correct camera provides enough resolution and margin without unnecessary overhead.

What is the difference between megapixels and spatial resolution?

Megapixels describe the total number of pixels on the sensor. Spatial resolution describes how much of the real product each pixel represents, commonly expressed in millimetres per pixel. It depends on both camera resolution and field of view.

Can machine vision measure features smaller than one pixel?

Sub-pixel processing can estimate the position of a clear edge to a fraction of a pixel. It cannot recover a feature that was never resolved by the optics and sensor. Overall accuracy still depends on lighting, focus, calibration and system stability.

Does the lens affect machine vision resolution?

Yes. The lens must resolve sufficient detail for the camera sensor and field of view. A higher-resolution camera cannot recover detail lost through poor focus, insufficient lens resolution or low image contrast.

Speak to AIET Group

Speak to AIET Group if you are reviewing camera resolution for a machine vision, automated inspection or dimensional measurement application.

Send us the field of view, smallest feature, required tolerance, line speed and representative samples or images. We can help determine the appropriate camera, lens, lighting and inspection approach before you commit to hardware.

Looking for more? Dive into our other articles, updates, and strategies