Cognex
Cognex Machine Vision Applications: What Vision Does on a Plant Line
Cognex machine vision applications by task: presence, date codes, labels, fill, seals, code reading, defects and guidance, and how each is scoped.
Cognex machine vision applications are, at bottom, a short list of questions a camera answers on a moving line: is it there, is it the right one, is it readable, is it the right size, is it damaged, where is it. This page goes through the common ones one by one, maps each to the Cognex tool family that Cognex itself assigns to it, shows how an application is scoped before anyone buys a camera, and describes how inspections fail in the field. It sits under the Cognex technology hub.
The product pages cover the hardware: In-Sight smart cameras, DataMan code readers, VisionPro on a PC, 3D vision and deep learning. Here the starting point is the task. Facts about Cognex products are as of November 2026 and come from Cognex guides and documentation, which are marketing material and are attributed as such. For the plant context, see our guide to food and beverage automation.

Cognex machine vision applications by task
Presence and absence. Is the cap on, the scoop in the tub, the item in the carton? Cognex states that In-Sight vision sensors perform simple pass/fail counts and presence checks, and its guides show them confirming that bottles, vials or products are present under shrink wrap (Cognex Packaging Guide). This is the cheapest class and the most forgiving.
Date and lot code reading (OCR and OCV). Optical character recognition reads the characters. Verification (OCV) checks that what was printed matches what was expected and is legible. Cognex lists its font-trainable OCRMax tool for this on In-Sight, and its guides describe AI-based reading for damaged or distorted print on flexible film and case packaging (Cognex Food and Beverage Guide).
Label verification. Label present, straight, correct, and legible. The guides show In-Sight pattern matching for presence and skew, colour tools for colour errors, and edge learning for classifying label defects. The food and beverage page goes deeper, including allergen labels.
Fill level, cap and seal. Fill level by measuring liquid volume (Cognex’s wording), caps by measuring cap height and skew against the neck, seals by looking for voids, wrinkles and trapped matter. Cognex shows 3D laser displacement for seal and cap height on boxes of bottles. The packaging page covers seals and closures.
Code reading and verification. Reading 1D and 2D codes for routing and traceability is the DataMan job. Grading a printed code against ISO/IEC 15415, 15416 or TR 29158 is a verifier’s job, a different device with fixed lighting. The barcode verification page explains the difference, and the pharmaceutical serialization page shows where it matters most.
Measurement. Distance, angle, diameter, gap. Needs calibration so pixels become millimetres, and a lens and camera with enough resolution. The error is set by the optics and the lighting as much as by the software.
Defect detection. Scratches, cosmetic flaws, contamination, torn film. This is where rules struggle and trained models help. Cognex says its AI tools learn from example images and tolerate natural variation, which it contrasts with rule-based tools. Those are vendor claims, and the number of images needed varies by vendor until measured on your product.
Guidance. Locating a part so a robot or a motion axis can act on it. Cognex shows In-Sight locating objects for pick and place. The output is a coordinate, so calibration and latency decide whether it works.
Which Cognex tool family fits which application
The table is built from what Cognex states in its application guides and product documentation, plus our reading of where each family stops. It is not a recommendation for a specific model, and the lineup changes, so check Cognex’s current documentation.
| Application | Typical Cognex family | What decides the choice |
|---|---|---|
| Presence, absence, counting | In-Sight vision sensor or smart camera, rule-based tools | Part variation and speed. Lowest cost class |
| Date and lot code OCR and OCV | In-Sight with OCRMax or Edge AI Read tools | Print quality, surface, font stability |
| Label presence, skew, position | In-Sight with pattern matching (PatMax family) | Label stock changes, lighting on curved surfaces |
| Label and package defects | In-Sight with Edge AI tools, or VisionPro Deep Learning on a PC | How variable the defects are, how many examples exist |
| Fill, cap height, seal geometry | In-Sight edge and measurement tools, or 3D laser displacement | Needs a stable, repeatable view of the edge |
| Code reading, 1D and 2D | DataMan fixed-mount reader, or In-Sight Read ID | Code quality, speed, protocol set of the model |
| Code grading | DataMan verifier (DM475 series) | Needs the standard’s lighting accessory, or the grade is “standards-based” only |
| Dimensions, volume, height | 3D vision | Laser profiling needs motion or an encoder |
| Guidance | In-Sight or VisionPro with calibration | Calibration accuracy, handshake latency |
The selection between In-Sight models is on choosing an In-Sight camera, and the AI tiers on Edge AI tools.
How a machine vision application is scoped
Scoping is arithmetic done before anything is bought. Four numbers drive it.
- Smallest feature. The narrowest thing the camera must resolve: a character stroke, a bar width, a defect width. Width, not area. A fibre of 0.5 mm² can be 0.05 mm wide, which is less than one pixel at most fields of view.
- Field of view. The area the camera must see, set by the lane width plus margin for product wander.
- Pixels per feature. Required pixels along an axis equal field of view times pixels-per-feature divided by feature size (see Edmund Optics for the underlying resolution relations). Sources disagree on the right figure (two is the theoretical minimum, and this page uses three), so it is design margin, not a standard. The formula is our arithmetic, in line with the pixel and magnification relations in Edmund Optics’ notes.
- Takt time and speed. The time the product is in view, the exposure time, and the interval between products.
An illustrative worked example. A date code with a 0.3 mm stroke on a 100 mm wide label area, three pixels per stroke:
- Pixel size = 0.3 mm / 3 = 0.1 mm per pixel
- Pixels across the field = 100 mm / 0.1 mm = 1,000 pixels, so a camera of about 1.3 megapixels or more fits, with the lens and lighting also able to resolve it
- Line at 300 products per minute, 100 mm pitch: one product every 200 ms and a belt speed of 0.5 m/s
- Motion blur = speed times exposure / pixel size = 500 mm/s × 0.0001 s / 0.1 mm = 0.5 pixel at a 100 µs exposure. At 1,000 µs the blur is 5 pixels and the stroke is gone, so short exposure or strobed light is needed
The same arithmetic at other line speeds, with a 100 mm pitch (illustrative):
| Products per minute | Interval between products | Belt speed | Blur at 100 µs exposure |
|---|---|---|---|
| 60 | 1,000 ms | 0.1 m/s | 0.01 mm |
| 300 | 200 ms | 0.5 m/s | 0.05 mm |
| 600 | 100 ms | 1.0 m/s | 0.10 mm |
At 0.1 mm per pixel, the 600 per minute case blurs a full pixel at the same exposure, and the whole cycle must complete in 100 ms.
The camera, image processing, result handshake with the PLC and reject timing all have to fit inside that 200 ms, with margin. The lens can also cap performance below what the sensor offers, so check depth of field and distortion too.
Lighting comes before the camera model. Lighting creates the contrast the tools work with. The standard techniques are backlight (silhouette, for edges), dark field (low-angle light so surface irregularities glow), coaxial (flat reflective surfaces), and dome (diffuse light for curved or shiny surfaces) (Keyence). Choose by trial on real samples, including bad ones. Cognex’s In-Sight 3800 documentation describes an integrated multi-colour light with polarised and diffuse options, which narrows the choices on that camera, and Cognex completed its acquisition of Moritex, a machine vision optics maker, on 18 October 2023 (Cognex release).
How machine vision applications fail
This section is our view, drawn from general field practice and from how plants run these systems, not from a Cognex statement.
- Lighting drift. LEDs age, a power supply changes, a skylight or a forklift beam enters the image, a lens window gets dirty. Fixes: shielding, constant-current drivers, a reference target checked on a schedule.
- Product changeover. The wrong recipe is selected, or the new pack has different colour, film finish or label stock. Most changeover failures are procedural, not algorithmic.
- False rejects and operator overrides. When good product is rejected often enough, operators tape over the sensor or accept the rejects by hand. The inspection then exists on paper only. Track false-reject rate and override count as metrics.
- Reject that does not happen. The camera fails the product, but the gate misses or the product is carried past. Without a confirm sensor the line ships it. This is why the station above has a fifth device.
- Focus, vibration and mounting. A knocked lens or a loosened bracket changes the field of view.
- Print quality. Codes that pass at the printer fail in the plant as ribbon, ink or laser mark degrade.
- Configuration drift. An untracked edit to a job, and no backup of the camera program. This ties to wider change management for plant systems.
- Deep learning. A defect type never seen in training, drift in the product, and unmanaged model updates.
What we do here
Our team has programmed in-line inspection on Cognex In-Sight cameras at large food and consumer-goods manufacturers, and we integrate Cognex cameras and readers with PLCs, line controls and data systems as part of controls projects. In practice that means:
- Specification: turning a quality question into a feature size, field of view, lighting approach and cycle time before a camera is chosen
- PLC handshakes: trigger, result and job-change logic, and reject timing with confirmation, in the controller
- Commissioning: testing with known good and known bad samples, at line speed, before sign-off (commissioning support)
- Troubleshooting: finding whether a false-reject problem is light, product, mounting or logic
- Data: moving results and images to the systems that keep them (systems integration)
We have no commercial relationship with Cognex and do not resell its products.
Limits and open questions
- Cognex’s guides are marketing. The tool-to-application mapping is Cognex’s, and we found no independent benchmark of read rates, false-reject rates or training-image counts.
- Vision does not replace other detectors. A camera finds what it can see under set lighting. X-ray and metal detection serve other contaminants.
- Model-level support is unverified. Whether a given In-Sight or DataMan model reads and parses GS1 2D codes, or provides the audit-trail features a regulated site needs, must be checked in Cognex’s current documentation.
- Pixels per feature is a design margin that sources disagree on.
Deeper
- Food and beverage inspection: labels, date and lot codes, fill and seal, allergen labels, washdown and reject confirmation
- Pharmaceutical serialization: DSCSA and EU FMD, aggregation, grading and validation
- Packaging inspection: cartons, case coding, label placement, seals and the GS1 2D transition
Back to the Cognex hub, or across to PLC integration, which covers how results reach the controller.
Frequently asked questions
What are the most common machine vision applications on a packaging line?
Presence and absence checks, date and lot code reading, label presence and position, fill level, cap and seal inspection, and barcode reading are the common ones. Cognex's own food and beverage and packaging guides list these same tasks. Defect detection and robot guidance are the next tier, and they cost more to scope because the images vary more.
How many pixels do I need across the smallest feature?
Sources disagree. Two pixels across the feature is the theoretical minimum (Edmund Optics treats the Nyquist limit as two pixels), and the worked examples here use three. Treat the number as design margin, not a standard, and confirm it on real images from your line at line speed.
Can machine vision replace X-ray or metal detection for foreign matter?
No, in our view. A camera finds what it can see under the lighting you set, such as a visible particle on a surface. X-ray and metal detection serve contaminants a camera cannot see. Vision adds a check on visible defects. It does not retire the other detectors or the plant's food safety plan.
Why do vision inspections reject good product?
The usual causes are lighting drift, a changed product or label stock, a lens or camera that has moved, and thresholds set on too few examples. Operators then override the rejects, which defeats the inspection. Track the false-reject rate and the override count, and re-check lighting and focus first.
Do I need deep learning for these applications?
Not for most. Presence, code reading, position and measurement are rule-based jobs that older tools handle well and that are easier to lock down for validation. Deep learning earns its place where defects or products vary in ways hard to specify, such as cosmetic flaws or damaged print. Cognex's image counts are vendor claims.
References and further reading
- Cognex Food and Beverage Solutions Guide · Cognex (copy hosted by an exhibition organiser)Cognex's own list of food and beverage applications and the tools it assigns to each.
- Cognex Packaging Inspection Applications Guide · Cognex (copy hosted by an exhibition organiser)Seal, cap, label, allergen label, code and kitting applications.
- Resolution (application note) · Edmund OpticsField of view, pixels and spatial resolution, with worked arithmetic.
- Basics of lighting selection · KeyenceA competitor's neutral primer on lighting techniques.
- Machine Vision on Packaging Lines · Association for Advancing Automation (A3)
- Cognex Corporation Form 10-K for fiscal 2023 · U.S. Securities and Exchange CommissionCognex's description of vision sensors and edge learning.