“How many are there in this field, and what size is each one? Does this one have the right shape? How many are still alive?” Three questions whose answer is not a mean but a count, object by object.
A spectroscopic measurement returns a value over the volume it probed. It cannot say how many, nor of what shape, nor which one is not like the others. Those three questions belong to the image.
Counting by eye, under a binocular microscope or on a cell, remains the reference method in many laboratories, and its value is the one that counts. It calls for time and sustained attention, and its result carries the mark of the operator who produced it.
What a camera brings is not speed first. It is reproducibility: the same criterion applied to every object, every field, every shift.
In short
Machine vision returns number, size, shape and position, without contact and without calibration for a geometry. Hyperspectral imaging adds the constituent present at each point. SR-DLS returns a size distribution in concentrated media, without counting.
What is actually measured
A count, not a concentration
The result is a number of objects in a field of known area or volume. Concentration follows from the volume analysed, which moves the question from precision towards the representativeness of the field observed.
A size and a shape, object by object
Every object detected carries its own descriptors: equivalent diameter, elongation, circularity, area. You get a real distribution rather than a mean, and the tail of that distribution is often what decides.
The one that is not like the others
Detecting the exception is a question distinct from counting, and a more demanding one. It supposes that normality has been defined on a large enough population, and that you know what happens to the object once detected.
Counting and measuring a geometry call for no chemometric model. A diameter, an area, an elongation come out of the geometry of the image and of the calibration in pixels per millimetre. The quantity comes out of the physics of the measurement.
A model reappears as soon as something has to be classed: alive or dead, conforming or not, stage A or stage B. A learned classification then defends itself in front of an auditor like any other model — on its training population, its performance and its upkeep. Why some measurements call for a model and others do not.
Which technology for which case
| Technology | What it returns | Where it sits | Calibration burden | Known condition |
|---|---|---|---|---|
| Machine vision | Number, size, shape, position. Movement, where the frame rate allows | Contact-free, above a flow, a belt or a cell | None for a geometry. Full for a learned classification | It does not know chemistry. Two objects of the same shape and different composition are identical to it |
| Hyperspectral imaging | The same geometry, plus the constituent present at each point | Contact-free, on a line or on a stationary surface | Full as soon as a constituent is attributed | Counts less well than a fast camera, and produces a data volume that has to have been planned for |
| SR-DLS | A size distribution in a concentrated medium, without counting | Through a transparent wall, or on a bypass loop | None | Returns neither the shape of the objects nor their number. It is a complementary route, not an alternative |
Pharmacopoeial chapters already govern image analysis — but not this use of it. At least three address the subject head on: USP <1776> Image Analysis of Pharmaceutical Systems, which defines image analysis as “primarily a size and shape analysis” and lists the descriptors this page names — equivalent circular diameter, Feret’s diameter, elongation, circularity; USP <776> Optical Microscopy, harmonised with Ph. Eur. 2.9.37, which covers size and shape and sets a limit test by counting; and USP <1788.3> Flow Imaging Method for the Determination of Subvisible Particulate Matter, where the count comes with morphological parameters.
Their scope is bounded, and that is where the difference lies. They address particulate contamination of injections and ophthalmic solutions — USP <788>, Ph. Eur. 2.9.19 and 2.9.20 — and the characterisation of powders and excipients: particles suspended in a liquid, measured on a sample, against thresholds in micrometres. None of them describes counting and morphological classification of objects moving along a line.
Outside that scope there is no compendial method that applies as it stands: the method is validated entirely on its own terms, against a reference count that has been established and frozen — trueness, precision, working range, and behaviour towards objects it has never seen. The same holds for the other two routes in the table: dynamic light scattering is standardised (USP <430>, harmonised), its spatially resolved variant is not; and hyperspectral imaging is the subject of no dedicated general chapter to date. In food and feed, it is your food safety management plan that sets what this control must demonstrate and how often; the reference to ICH Q2(R2) holds only for pharmaceutical use.
The lighting decides, not the camera
This point is often underestimated in imaging projects, and it often decides their fate.
A transparent object on a light background disappears. The same object under grazing light shows its relief. The same again, backlit, gives a clean outline and nothing else. It is not the camera that changes, it is what is made visible.
The practical consequence is that the engineering work is about lighting geometry, the stability of ambient light, and how the object is presented to the sensor. Once that is settled, image processing is often simple. Settled the wrong way round, no algorithm makes up the shortfall.
It is also why an imaging trial starts with images of your product, in your conditions, rather than with the choice of a sensor.
What is worth preparing on your side
- Representative images, the difficult cases included. Touching objects, crowded fields, products at the edge of conformity. A set of images containing only easy cases says nothing about what will happen in production.
- A ground truth. For a count, that is a manual count on the same fields. For a classification, it is the judgement of an experienced operator, object by object. It is the least rewarding work of the project, and it has no substitute.
- The criterion, written down. What is an object to be counted, and what is not? Does a fragment count? Do two touching objects make one or two? Those rules have to be settled beforehand, because the machine will apply them to the letter.
- What is done with the result. A count that feeds no decision stays an indicator. Knowing in advance which threshold triggers which action is what gives the measurement its value.
Conditions for success, and limits
Imaging sees the surface
What is masked by another object is not counted. On a dense field, overlap becomes the first source of error, and it is the preparation of the field — dilution, spreading, setting in motion — that solves it, not the image processing.
A learned classification has to be kept alive
A population that drifts, a different batch of material, ageing lighting: a classification model loses its relevance like any other. The review frequency follows from the process, never from a calendar. What keeping a model alive calls for.
The rate is decided before the sensor
Counting stationary objects and counting objects passing at a metre per second are not the same problem. Exposure time, lighting and depth of field follow from it. That is the first constraint to set, and it is mechanical before it is computational.
Data volume is a real constraint
A camera producing images continuously generates a stream that has to be stored, or deliberately not stored. The question is settled at scoping: do you keep the images, the results, or both, and for how long? What the data asks of the systems.
What it changes, in practice
A manual count is done on a few fields, because it costs time. An automatic count is done on all of them, because it no longer does. The change is not one of degree: you move from a sample to a population.
The most immediate consequence is statistical. A difference between two batches that was not detectable on fifty objects becomes so on fifty thousand. Slow trends become visible. Drifts that were lost in the variability of manual counting appear.
The second consequence is organisational, and it matters as much. A criterion applied by a machine is a criterion that is written down. Formalising it forces decisions on cases that custom left to judgement, and that clarification is often worth having on its own, independently of the instrument.
Frequently asked questions
Do you need artificial intelligence to count objects?
Most often, no. Counting, measuring and classing by shape belong to classical image processing: thresholding, morphology, geometric descriptors. It is deterministic, explainable and easy to justify. Learning becomes useful when the criterion cannot be written down — telling two biological stages apart, recognising a defect an operator identifies without being able to describe it. The choice follows the criterion, not the fashion.
How many images are needed to start?
To know whether counting is feasible, a few dozen images are enough, provided they cover the difficult cases. To build a learned classification the order of magnitude is quite different, and it depends on the number of classes and how alike they are. The first question is settled quickly; the second is sized afterwards, once you know the image carries the information.
Can living objects be counted?
Yes, and movement is often the surest criterion: what moves from one frame to the next is alive, what stays still is not. That calls for a sufficient frame rate and lighting that holds for the duration of the observation. It is a case where vision does what no spectroscopy can.
What becomes of manual counting?
It remains the reference, and it is what qualifies the automatic measurement and then verifies it periodically. What changes is its frequency: from a routine control it becomes a verification. It is the same movement as for every in-line measurement on this site.
Send us images of your product, the difficult cases included. That is where it starts.
Forty-five minutes is enough to know whether your objects are detectable, what the lighting would call for on your equipment, and whether the criterion you care about belongs to image processing or to a learned classification. Where the image does not carry the information, we will say which route to look at instead.