Can it be measured? Forty-five minutes is enough to find out.Talk to us about your processLanguageENFR

Imaging and machine vision

“My mean content conforms, but is it uniform? How many objects, and of what shape? Is this one like the others?” Three questions a point measurement, which returns a mean, does not answer.

Imaging returns a map, and it can count. Two distinct techniques sit under the word.

Where you meet it: counting and morphology of organisms in food, distribution of an active in a tablet.


The essentials in four points

  • Returns a map, not a mean: blend uniformity, coating coverage, segregation, agglomerates.
  • Counts, measures and classes objects one by one, and spots the odd one, with constant reproducibility.
  • Two techniques under one word: machine vision tells you how many objects, of what shape; hyperspectral imaging tells you which constituent, and where.
  • Reference texts: in pharma, Ph. Eur. 5.24 and USP <1776>; outside pharma, ISO 13322-1 and -2 for particle size.

How the measurement works

A blend at 5.0 % active can be 5.0 % everywhere, or 0 % here and 15 % three millimetres away. A point measurement returns the mean; imaging returns the map.

Two batches with the same mean, and what a point measurement saysTwo batches have exactly the same mean content. A point measurement returns the same value on one and on the other: it cannot separate them. The map shows that the first is homogeneous and the second is not. SAME MEAN, TWO DISTRIBUTIONS what a single value cannot tell apart Batch A homogeneous blend Batch B two rich domains, two poor low high What a point measurement returnsone value, averaged over the volume it probedBatch ABatch Bsame value What the map returnsthe spread of values across the fieldBatch ABatch Bthe spread separates them Two batches compliant on the mean can have nothing in common. Both fields share the same mean, imposed by construction. No value is graduated.
Two batches with the same mean. A point measurement returns the same value on both; only the map shows that the second is not homogeneous.

It can also count: enumerating objects, measuring their size one by one, classing their shape.

The movement. Reworked lighting, ten frames a second. Each green trace is one individual followed from frame to frame. What separates it from the grain is its displacement.

Typical applications

Content uniformity

How matter is distributed across the surface, where a mean value settles nothing.

100 % in-line inspection

Every unit seen whole: what that is worth against a sampling check.

Counting and morphology

Counting, measuring and classing objects one by one, and spotting the one that is out of line.

Application examples

Counting; colour at the baking-oven exit, in food; visual inspection, in pharma.

The worked case further down shows a count of living organisms, from the raw signal to the decision.


Identity card of the technique

CriterionImaging and vision
What the measurement seesA geometry in machine vision: object count, size, shape, colour, presence of a defect. In hyperspectral, one spectrum per pixel — a data cube.
SelectivityNot applicable in machine vision: the image says how many and what shape, not what the objects are. That of NIR or RAMAN in hyperspectral, on markedly noisier spectra.
What interferesLighting decides, not the camera. An ageing lamp, a fouled window, vibration, ambient light: a vision chain drifts through its mechanics before it drifts through its model.
Sample presentationContactless, in line, on a hundred per cent of the units — but a surface, or a few tens to hundreds of microns below it in hyperspectral.
What the model requiresNothing for a geometric quantity. A model, and its justification before an auditor, as soon as classification is learned.
Reference textsIn pharma: Ph. Eur. 5.24, Chemical imaging, is the general chapter on the subject; USP <1776> Image Analysis of Pharmaceutical Systems describes the descriptors. The method is validated on its own terms, in the sense of ICH Q2(R2). Outside pharma: ISO 13322-1 (static image analysis) and ISO 13322-2 (dynamic) for particle size; for counting or classing, validation against your laboratory’s reference method.

Two techniques under one word

The word imaging covers two worlds. They share a camera and optics, and neither the entry cost, the nature of the information, nor the validation work.

Machine vision, where the image carries a geometry

A camera, a light, an algorithm. Each pixel carries an intensity or a colour. What comes out is morphological: a number of objects, a length, an area, an aspect ratio, a colour, a defect.

The quantity comes out of the geometry of the image rather than a model learnt on reference analyses. A dimensional standard converts pixels into microns. There is no chemometrics here, which is separate from there being nothing to build.

Hyperspectral imaging, a spectrum per pixel

The same scene, each pixel carrying a full spectrum, NIR or RAMAN according to the variant. What comes out is a data cube, two dimensions of space and one of wavelength.

It is the spectroscopy of this site with the spatial dimension added. It inherits all the chemical power, and all the calibration burden, applied to every pixel.

The rule that avoids the misunderstanding: machine vision tells you how many objects, of what shape. Hyperspectral imaging tells you which constituent, and where. The first stays out of the chemistry, and the second counts objects less well than a fast camera.

The same pixel, in the two imaging worldsOn the left, machine vision: each pixel carries an intensity, from which come a number of objects, a size, a shape. On the right, hyperspectral imaging: each pixel carries a full spectrum, the third dimension of the cube is wavelength, and from it come which constituent and where — at the price of a model applied pixel by pixel. AN IMAGE, OR A CUBE the same pixel does not carry the same thing Machine vision a pixel carries an intensity intensity Hyperspectral imaging wavelength a pixel carries a full spectrum wavelength What you gethow many objectswhat sizewhat shapeA dimensional standard is enough to turn pixels into microns. What you getwhich constituentand whereA model per pixel, and all the calibration that comes with it. The dividing line is not the camera: it is the calibration the second demands and the first ignores. Schematic. No value is graduated, no instrument is depicted.
The same pixel, in the two imaging worlds. On the left it carries an intensity, on the right a full spectrum — and the third dimension of the cube is wavelength. What you get out differs, and so does what you must build to get it.

A project that starts with we will put a camera in, before settling which of the two questions it asks, usually ends with an oversized instrument.

What the instrument really returns

QuantityWhere it comes fromWhat it covers
Number of objects in the fieldSegmentation of the image: the object is separated from the background, the regions countedA count, with what those objects are chemically, and the ones that overlap, as separate questions
Size and size distributionArea or dimension of each region, converted by a dimensional standardA projection in two dimensions. The third is estimated rather than measured
Shape, elongation, morphological classGeometric descriptors, then a decision rule or a learnt modelA class is worth what the learning population is worth, and identity is a separate question
Distribution map of a constituentSpectral model applied pixel by pixel on the hyperspectral cubeContrasts between zones. Per-pixel statistics are far noisier than a single averaged spectrum
Blend homogeneity indexStandard deviation of the distribution map, or a statistic on domain distributionThe state, with the cause of the heterogeneity coming from the process

The engineering factor that decides projects

The lighting decides, rather than the camera.

It is the least intuitive truth in this family, and the most constant. A modest sensor correctly lit gives a usable measurement. An excellent sensor poorly lit gives an image no algorithm will draw anything stable from. The lighting geometry, grazing incidence, backlight, ring light, structured light, determines whether the contrast you care about exists in the image.

A surface defect visible at grazing incidence fades under diffuse light. A transparent object becomes countable in backlight and stays out of reach otherwise. The choice is made by trial, and it comes before the choice of camera.

The same scene under four lighting geometriesA plate carrying a surface defect and a transparent object, seen by a fixed camera. Four lighting geometries follow one another: grazing incidence, ring light, diffuse dome, backlight. The defect shows only under grazing light, the transparent object only under backlight. No geometry shows both. LIGHTING DECIDES, NOT THE CAMERA same scene, same sensor, four geometries the scene, seen from the side camera translucent support surface defect transparent object what the camera sees Grazing incidencelight skims the surfacesurface defectsharptransparent objectnot seen Ring lightlight arrives almost on axissurface defectbarelytransparent objectnot seen Diffuse domelight comes from everywhere, no shadowsurface defectnot seentransparent objectnot seen Backlightlight comes from underneathsurface defectnot seentransparent objectsharp None of the four geometries shows both objects. Choosing a light is choosing what you give up seeing. Canonical machine-vision lighting behaviour; the page states two of them. Constructed scene.
The same scene, four lighting geometries. The surface defect shows only under grazing light, the transparent object only under backlight. None of the four shows both: choosing a light is already choosing what you measure.

What holds, and what moves

A vision chain moves through the mechanics and the optics before it moves through the model. A lamp that ages, a window that fouls, a vibration that shifts the field, ambient light entering when a door opens. The enclosure and the shielding of the station are part of the measurement rather than part of the trim.

It is the exact counterpart of what optical coherence tomography asks on the working distance. The entry cost exists, and it has simply moved from the calibration to the installation.

Where another route serves better

It reads a surface

A camera sees a surface, and NIR hyperspectral a few tens to a few hundred microns below it. For the inside of an opaque volume, electrical tomography answers. For a packed product, TERAHERTZ.

Contrasts rather than an absolute value

A hyperspectral map is excellent for comparing zones and detecting a heterogeneity. A point measurement carries further where an absolute value has to be stated. The statistics of one pixel are not those of an averaged spectrum.

A learnt classifier is still a model

A deep-learning classification is one more model, and one whose decision is hard to explain. In a regulated environment that is exactly the question an auditor will put. What an analytical procedure has to demonstrate.

The point to size before you start: the data volume

A point spectrum is a few kilobytes. A hyperspectral image is a cube. And a production line producing several a second generates a flow of another order from everything else on this site. The storage question arises before the installation. What is kept, what is discarded, and what you will be able to find again in three years for an inspection.

It is the one case where the computing sizing can decide the fate of a measurement project. What becomes of the data, and who carries it.

A worked case: counting living organisms

A culture of living organisms grown under controlled conditions poses a counting problem that sums this page up rather well.

The question is other than it looks. Counting the individuals is useful, and the aim is to know when to stop the culture. A population grows, passes through a maximum, then declines. And what the culture has to yield follows the population. Harvesting on a fixed date means harvesting beside the peak.

The usual check leaves that peak unseen. It rests on an enumeration of live individuals per gram, done by eye under a binocular loupe, on a few samples spaced weeks apart. Four points do not locate a maximum. Nor do they say why two trays run the same way behave differently.

Four points per batch, and what they do not saySix batches followed by the usual control: four counts from the first day to harvest. The segments joining them are drawn by the chart, not measured. On one batch, three interpolations passing exactly through the same four points place the maximum on three different dates. FOUR POINTS DO NOT LOCATE A MAXIMUM six batches, four counts each, from the first day to harvest D1 D30 D60 harvest live individuals per gram one batch, three interpolations 1 The usual control Four counts per batch, weeks apart. 2 The segments are not measurements The straight line between two points is drawn by the chart. 3 Three curves, the same points All pass through the four measurements. Their maxima: seventeen days apart. What is missing is not the precision of the count. It is the frequency. Trajectories taken from the original figure. Hermite interpolations, free central slopes. Ungraduated ordinate.
Six batches followed the usual way, four counts each. The segments between two points are drawn by the chart, not measured — and on one batch, three interpolations passing through the same four points place the maximum seventeen days apart.

The problem is markedly less simple to solve than to state. The objects are small and mobile, they overlap, and the background is a culture medium that in places resembles what is being looked for.

What decides: the light and the geometry

What decides here is the imaging geometry and the light. Transmission is set aside, since nothing usable crosses the substrate, and reflection retained. It is the lighting band that separates the object from its background: the one that tells them apart is found by comparing, and nothing says in advance which it will be. And a dome light, from beneath the tray, removes the reflections that make the images unusable.

The enumeration works from there. With shape descriptors as a bonus, area, circularity, elongation, which open the way to telling the development stages apart.

The raw image. Direct light, colour macro. The individual has the colour and the grain of its substrate: nothing separates it by eye.
The count. Every individual detected is boxed, and its trace follows it from one frame to the next. That count, repeated frame after frame, is what produces the population curve.
The stages. The same field, classed egg, juvenile or adult, with a confidence index per detection. The age pyramid announces the population maximum before it arrives. The overall count announces it once it is there.

What this case says about the whole family. None of the decisions above bears on the camera. All of them bear on the lighting and the geometry. That is what is written higher up this page, and this case is the demonstration of it.

It is also what makes vision a lighting project before it is a software project. Better known at the start than at the end.

Frequently asked questions

Machine vision or hyperspectral imaging: how do I know which I need?

Put the question in one sentence. If it contains how many, what size, what shape, is there a defect: machine vision, and the project is first a lighting project. If it contains which constituent or is it well distributed: hyperspectral, and the project is a chemometrics project with one more dimension. If it contains both, they are two projects, and that is the order to run them in.

Does hyperspectral imaging call for more calibration than classical NIR?

Yes, for a reason that is underestimated. The model is the same in principle, and it applies to far noisier spectra. A pixel receives a fraction of the flux a point probe receives. So either more references, or a decision to read contrasts rather than absolute values. The second route is often the sound one, and it is rarely proposed.

Can deep learning be used in a regulated environment?

Nothing forbids it, and it is sometimes the one approach that works on a complex morphology. The burden of demonstration moves, though. The learning population is documented, the behaviour on edge cases shown, and a mechanism put in place to flag an input outside the learnt domain. A model that cannot be explained can at least say when it is out of its depth. That is validation work rather than a box to tick.

Can a camera replace a release check?

For a criterion of presence, integrity or shape, a hundred per cent unit check is a very strong argument, often stronger than a sampling check. For a criterion of composition, the bound stated above on absolute values applies. As always on this site, the answer follows the question put rather than the technology.

Do we find out quickly whether it works?

Very quickly for machine vision, and that is its quality: short lighting trials on your material say whether the contrast exists. Where it does not, no software development will create it, and you will have learnt that at little cost. Longer for hyperspectral, where the lead time is that of an ordinary chemometric proof of concept.

The instruments we implement

ClearView Imaging, machine vision and imaging. Cameras, optics, lighting and vision systems. Our partner on this family of applications.

It is the most recent of our nine families, and the one whose offer is the least standardised. Every application is built to measure, from components. We say so because it is true, and because it changes how a project starts.

Send us images of your product, phone photographs included. That is where it starts.

Forty-five minutes is enough: whether the contrast you care about can exist in an image, which lighting geometry would bring it out, and whether the question belongs to machine vision or to hyperspectral. Where the contrast is not in the image, we will say so — and where to look instead.