SENSOR
  • Ccolour, one per pixel
  • Mmono, all the light

Colour, Monochrome and Bayer

Generic engineering material, applicable to any module from any supplier.

For teams separating technical work from project administration, employee PC activity tracking provides additional workflow context.

A colour sensor does not measure three colours at every pixel. It measures one, and computes the other two from the neighbours — which has consequences for resolution, sensitivity and artefacts that a specification sheet does not mention.

How a Bayer sensor works

A mosaic of colour filters over the pixels, arranged so that half respond to green and a quarter each to red and blue.

Each pixel therefore records one colour only.

An independent reference for adjacent engineering topics is Texas Instruments.

Demosaicing — interpolation from surrounding pixels — produces a full-colour value at every position, which is a reconstruction rather than a measurement.

Which is why the pattern carries a name and appears in datasheets: it describes what the raw data actually is, and whether your processor or your software will do the demosaicing is a real integration question.

What it costs

Sensitivity. Each filter absorbs the light it does not pass, so a colour pixel receives a fraction of what the same pixel would receive unfiltered.

Effective resolution. Fine detail in one colour is interpolated rather than measured — which means the true resolving power for coloured detail is below the pixel count in a way the arithmetic does not capture.

And artefacts. Fine repeating patterns can produce false colour fringes and moiré, since the interpolation has insufficient information to distinguish a real pattern from an aliased one.

When monochrome is the better answer

Whenever colour is not part of the task, which in industrial inspection is most of the time.

A monochrome sensor gets substantially more light per pixel, resolves fine detail properly rather than by interpolation, and produces no colour artefacts.

And it combines with chosen illumination to do what colour does, more effectively: a specific wavelength that separates the feature from the background outperforms a colour image analysed for the same difference.

The reasons monochrome gets skipped are not technical. A colour image looks like more information, it is easier to show to somebody, and it feels safer.

When colour is genuinely needed

Sorting or verification by colour, where the property being judged is colour itself.

Human review, where somebody looks at the image and colour aids interpretation.

Reading colour-coded markings.

And any case where the scene is uncontrolled and colour helps distinguish things that illumination cannot be arranged to separate.

Where it appears in a variant code

Sensor type is frequently one position of a module ordering code, alongside the filter and the lens.

Which means the decision is made at ordering and is not a setting — and it is worth deciding deliberately rather than taking the colour variant because it was the one in the example.

A module family offering both against the same optics makes the comparison clean: the same lens, the same distance, one variable.

Raw against processed output

A Bayer sensor can deliver raw mosaic data or a demosaiced image, depending on whether the module contains processing.

Raw is smaller per frame, since it carries one value per pixel rather than three, and needs work at the other end.

Processed is convenient and fixes decisions — the demosaic algorithm, the white balance, the sharpening — which somebody else chose and which your task may not want.

For measurement work, raw is frequently preferable, since processing designed to make images look pleasant is not designed to preserve what an algorithm measures.

White balance

A colour image needs it and it is a decision rather than a fact.

Automatic white balance adjusts to make the scene look neutral, which under changing illumination means the same object photographs differently at different times.

Where colour is being judged, fix the white balance and fix the illumination, or the measurement drifts with the light.

And where a reference is available, a known grey or white patch in the frame turns white balance from an assumption into a calibration.

Other filter arrangements

The Bayer mosaic is the common one and not the only one.

Variants exist with different arrangements, with clear pixels added to recover sensitivity, and with filters for wavelengths outside the visible range.

Each trades colour accuracy against light collection differently, and each needs processing that knows the arrangement.

Which is a compatibility question before it is an image quality one: a processor expecting a standard mosaic and a sensor producing something else is an integration problem, and it belongs with the interface decision.

In one line

Ask whether colour is used by the processing — and where it is not, monochrome is more light, more resolution and fewer artefacts for nothing.

The test that settles it

Photograph the same scene with both, and run your processing over each.

Not compare the images by eyewhich is the failure mode this whole approach avoidsbut measure whether the algorithm separates the feature better from one than the other.

Where a family offers both behind the same optics, this is one afternoon and one variable.

And where the answer is that both work, take monochrome for the light and the resolution, which are gains you keep.

Where a colour sensor is used monochrome

Possible and occasionally sensible.

Taking the green channel alone from a Bayer sensor gives a monochrome image at half the pixel count, with no interpolation artefacts in it.

Useful where a colour module is already designed in and the task turns out not to need colour — a software change rather than a hardware one.

It does not recover the lost light, since the filters are still absorbing it, which is why it is a salvage rather than a substitute for choosing monochrome at the start.

The short version

  • A colour sensor measures one colour per pixel and interpolates the other two, which is a reconstruction rather than a measurement
  • The cost is sensitivity, effective resolution for coloured detail, and artefacts including false colour on fine patterns
  • Monochrome gets substantially more light, resolves properly rather than by interpolation, and produces no colour artefacts
  • Where colour is not the task, monochrome plus chosen illumination outperforms colour analysed for the same difference
  • Colour is genuinely needed for colour sorting, human review, coded markings, and uncontrolled scenes
  • Sensor type is usually an ordering decision rather than a setting, so decide it deliberately