- mm/pxfov width over pixel count
- px/featuresize over mm per px
Pixels Are Not Resolution
Generic engineering material, applicable to any module from any supplier.
For the team-process side of engineering work, common fireable offenses at work is a separate reference on organizing and reviewing work.
A megapixel figure describes a sensor. It says nothing about whether the thing you need to see will be legible, because that depends on the lens and the distance as much as on the count.
The arithmetic
Two steps.
Millimetres per pixel = field of view width ÷ horizontal pixel count.
A useful external technical reference is Sigfox.
Pixels across the feature = feature size ÷ millimetres per pixel.
A 640-pixel sensor covering 320 mm gives 0.5 mm per pixel, so a 2 mm feature lands on four pixels.
A 2592-pixel sensor covering the same 320 mm gives 0.12 mm per pixel, and the same feature lands on sixteen.
The sensor changed and so did the answer — but only because the field of view stayed fixed. Widen the view to 1300 mm and the five-megapixel sensor is back to four pixels on the feature.
How many pixels are enough
Depends entirely on the task, and the differences are large.
Presence or absence: a few pixels, sometimes two or three, because the question is binary and the processing is tolerant.
Locating an edge: more, and the accuracy is a fraction of a pixel with good contrast and good optics.
Reading printed characters: substantially more per character height, and the requirement rises sharply where the print is low contrast, worn or on a curved surface.
Measuring a dimension: enough that one pixel of uncertainty falls inside your tolerance — which is a calculation from the tolerance rather than a rule of thumb.
Establish your number before comparing modules. It is a question about your process and the supplier cannot answer it.
The four traps
One. Comparing sensors without fixing the field of view. The commonest error, and it makes any comparison meaningless.
Two. Assuming the optics can deliver it. A lens has its own resolving limit, and a sensor finer than the lens can resolve produces more pixels of the same blur.
Three. Ignoring what the processing needs. An algorithm requiring clean edges may fail on an image a human reads easily.
Four. Forgetting the sensor is Bayer. A colour sensor's individual colour samples are sparser than its pixel count suggests, and fine detail in one colour is interpolated rather than measured.
Where more pixels genuinely help
Where the field of view is fixed by the installation and the feature is small within it.
Where one camera must cover what would otherwise need two, which is frequently the real economic argument.
And where downstream processing crops — a large sensor providing a digital zoom onto a region of interest without moving anything.
Where they cost you
Data rate, which constrains the interface and the frame rate.
Light per pixel, since smaller pixels on the same format collect less — which matters in poor illumination.
Processing load at the other end.
And price, which is the visible cost and frequently the smallest of the four.
Modulation transfer, briefly
The measure that describes what a whole system actually resolves, rather than what its sensor counts.
It expresses how much contrast survives at a given level of detail — fine detail always arrives with less contrast than coarse detail, and at some point it arrives with too little to detect.
Which is why two systems with identical pixel counts can differ visibly. The lens, the focus, the filter and the sensor together determine where contrast falls away, and the pixel count only sets an upper bound nobody reaches.
Where a supplier publishes it, it is the most informative single figure available. Where nobody does, the practical substitute is a test target in your own scene.
Nyquist, and why detail needs two pixels
A feature has to fall on at least two pixels to be distinguished from its neighbour — one is not enough, because a single pixel cannot separate a small bright thing from a larger dimmer one.
In practice more than two, because the feature does not align neatly with the pixel grid and because colour interpolation spreads detail further.
Which is the floor under every calculation on this page, and the reason a figure like "four pixels across the feature" is modest rather than generous.
Stating the requirement to a supplier
Three numbers and a sentence.
The feature size, the working distance, and the field of view you need to cover.
Then: "we need N pixels across a feature of this size."
A supplier given that can answer specifically. One given "we need high resolution" will quote the largest sensor, which may be the wrong module and is certainly the expensive answer.
Binning and windowing
Two things a sensor can do that change the effective count.
Binning combines neighbouring pixels into one, which reduces resolution and improves signal in poor light — a deliberate trade rather than a defect.
Windowing reads out only a region, which keeps the pixel pitch and reduces the field of view and the data rate together.
Both mean the sensor's nominal count is a maximum rather than a fixed property, and both are worth knowing about when a module seems to be either too much or not enough.
In one line
Fix the field of view, then compare — otherwise the megapixel figures are describing different systems.
The short version
- A megapixel figure describes the sensor and not whether your feature will be legible
- Millimetres per pixel is the field of view divided by the pixel count; pixels on the feature is the feature size divided by that
- Comparing sensors without fixing the field of view makes the comparison meaningless
- How many pixels are enough depends on the task, and presence detection, edge location, character reading and measurement differ enormously
- More pixels help where the field of view is fixed, where one camera replaces two, and where processing crops
- They cost data rate, light per pixel and processing load — and the price is the smallest of the four