Computer vision in manufacturing: camera inspection for defects, measurement and counting
Computer vision in manufacturing uses cameras and software to inspect parts on the line: finding defects such as scratches, missing components or wrong labels, measuring dimensions, and counting. AI models learn what a good part looks like from example images, so they can catch defects that fixed rules miss. Getting there takes controlled lighting, the right camera and lens, a set of labelled images, and a person who reviews what the system rejects. This guide covers the setup, where camera inspection fails, how to tell whether it works, and the vendors, two of them with roots in Ontario and Quebec.

What computer vision does on a production line
Computer vision is the broad field of software that interprets images. On a factory line it usually goes by machine vision: a camera, a light and software at a fixed station, checking every part as it passes and sending a pass or fail signal to the line. It does four jobs.
| Job | Examples on a line | What decides success |
|---|---|---|
| Defect inspection | Scratches, dents, porosity on a casting, a missing clip, a wrong or crooked label | Lighting that makes the defect visible, and example images of good parts and defects |
| Measurement | A hole position, a gap, an edge length, checked against a tolerance | Camera resolution over the field of view, a fixed part position, and calibration |
| Counting and presence | Parts in a tray, fasteners in an assembly, items in a box before it is sealed | Parts separated enough to tell apart, and a steady trigger |
| Reading codes and text | Date and lot codes, part numbers, 1D and 2D codes | Print quality and a clear view of the mark |
Camera inspection is one of the plant-floor uses of AI that needs its own hardware. Industrial AI sorts those uses from the ones that run on records a plant already keeps, and predictive maintenance covers the other sensor-based one.
Rule-based inspection and AI inspection
Classic machine vision runs on rules a person sets: find this edge, measure this distance, fail the part if the dark area is larger than this. Rules work well when parts look the same every time and the defect is easy to describe in numbers. They are harder to apply to cosmetic defects on surfaces that vary, such as castings, wood or textured plastic.
AI inspection learns from images. Cognex’s documentation describes the two ways it is trained. An unsupervised tool is “trained only with normal, defect-free views” and then judges how far a new part departs from them, which suits a plant with few examples of defects. A supervised tool is trained “with both normal and defective views” and learns to find and locate specific defects. Vendors now advertise small training sets: Keyence says its VS series needs “only a few dozen images for learning,” and Siemens says “Only 20 good samples required to commission Inspekto.” Treat those as starting points and plan to add images as the line throws up new cases.
Many stations mix the two. Measurement suits rules, because it needs exact numbers, and AI suits the cosmetic judgment. Keyence’s VS series, for example, carries AI tools next to rule-based ones for measurement, counting and code reading.
What it takes to set up camera inspection
- Define the reject. Write down what a defect is, with photos, and collect a set of known good parts and known bad parts. If two of your inspectors disagree about a part, settle it before you label images.
- Control the light. Keyence’s lighting guide puts it plainly: “Machine vision lighting is one of the most important factors in reliable inspection.” The right light, it says, improves contrast, reduces glare and highlights “the features that need to be measured.” A hood or enclosure keeps daylight and overhead lights from changing the picture.
- Choose the camera and lens. Keyence’s camera guide gives the arithmetic: “Pixel resolution = Size of field of view in the Y direction (mm) ÷ sensor pixel count in the Y direction.” A 100 mm field of view on a sensor 2,000 pixels tall gives 0.05 mm per pixel. The same guide warns that “High pixel counts cannot compensate for poor lighting or optical issues.”
- Trigger and reject. A sensor or the PLC, the programmable logic controller that runs the line, tells the camera when a part is in place, and the pass or fail signal drives a reject gate or stops the line.
- Label the images. Start with good parts for anomaly detection, add labelled defects for the defects you care about most, and label consistently.
- Put a person on the rejects. At first, a person reviews every reject and every uncertain call. Their decisions become new training labels. Human in the loop covers how to design that review so it does not turn into a rubber stamp.
- Keep the record. Store each image and decision with the part number, lot, machine and time, so a defect found later can be traced back.
A new part number, a new supplier for a raw material or a new colour can look like a defect to a model that has never seen it. Add a step to your changeover checklist: run the test set, look at the reject rate, and retrain before full production.
Where camera inspection fails
- Light that changes. A dirty cover, a failing light or sun through a window changes the image, and the model sees a new kind of part.
- Shiny, clear or dark parts. Reflections hide defects on polished metal, and transparent or very dark surfaces show little contrast without special lighting.
- Defects nobody has seen. A supervised model only finds the defect types it was trained on. An unsupervised model flags anything unusual, which catches new defects and also flags harmless variation.
- A camera that moved. A bumped bracket shifts the field of view and ruins measurements until someone recalibrates.
- A vendor that leaves. AWS stopped taking new customers for Amazon Lookout for Vision on October 10, 2024 and said the service would be discontinued on October 31, 2025. Keep your images and labels in a form you can move to another tool.
How to tell whether camera inspection works
Two numbers matter, and they pull against each other. A false reject is a good part the system rejects; an escape is a bad part it passes. Tightening the settings to catch more defects raises false rejects, and loosening them to cut false rejects lets more defects through. Measure both before and after, against the same manual inspection you run today.
| Measure | What it means | How to get it |
|---|---|---|
| False rejects | Good parts the system rejects | Count parts a person returns to the line after review |
| Escapes | Bad parts the system passes | Run known bad parts through, and track defects found later or by customers |
| Review load | Rejects a person must look at per shift | Count rejects per shift from the system log |
| Test set result | Pass and fail on a fixed set of known good and bad parts | Run the same set after every model or lighting change |
Run the fixed test set of known parts before go-live and after every change to the lighting, camera or model. Keep the test set results and the weekly counts in the same log, so a change in either shows up next to the change that caused it.
Connect inspection results to the rest of your records
Tell Derik where your inspection results, nonconformance reports and customer complaints are kept today. He will tell you what AI can do with those records, and where a camera vendor fits.
Start a conversationAI for quality control beyond the camera
Much of the quality work in a smaller plant happens in paperwork and files, and AI helps there without any camera. A nonconformance report (NCR) records a part that failed a requirement and what was done about it. Coordinate measuring machine (CMM) reports record measured dimensions. Customer complaints, supplier certificates and inspection sheets fill in the rest.
AI can read those records, link them by part number, lot, machine, supplier and customer, and answer questions such as “have we seen this defect on this part before, and what fixed it?” with the reports named. It can draft the first version of an NCR or a corrective action report for the quality manager to finish and sign. Supplier quality ties into buying, which AI in procurement covers, and the records themselves usually live in the ERP, covered in AI for ERP.
Machine vision vendors, and what each says it does
The descriptions are the vendors’ own, checked September 28, 2026. Ask each vendor whether a local integrator will handle the lighting, mounting and PLC connection near you.
| Vendor and product | What the vendor says it does | Worth knowing |
|---|---|---|
| Cognex VisionPro Deep Learning | Its unsupervised tool is “trained only with normal, defect-free views,” and its supervised tools are trained “with both normal and defective views” | Cognex says the two modes “are complementary” and can be used in combination |
| Keyence VS series | “only a few dozen images for learning,” with AI segmentation, detection, classification and OCR | Also carries rule-based tools, including measurement and counting |
| Siemens Inspekto | “Only 20 good samples required to commission Inspekto,” and bad samples are optional | Siemens says it can be “fully integrated with PLC or MES/ERP systems” |
| Zebra Aurora Deep Learning | Deep learning tools that include “optical character recognition (OCR) and features and anomaly detection” | Zebra’s Aurora Imaging Library is “formerly Matrox Imaging Library.” Zebra announced it would acquire Matrox Imaging in a March 2022 release datelined Montreal |
| Teledyne DALSA | Describes itself as designing and making “digital imaging products and solutions” | Lists its headquarters in Waterloo, Ontario, and an R&D facility in Montreal |
Ask each vendor how it charges, for example per camera, per software license or as a quoted project with an integrator, and check its own pricing page. Ask too where images are stored and whether any leave the plant; private AI for business lists the questions to put in writing.
How ThriveAI helps
ThriveAI is an AI engineering company in Ottawa that builds private AI systems on a client’s own data, for manufacturers and distributors in Ontario and Quebec. It does not build cameras, lighting or vision rigs. Its part of quality work is the records: inspection results, nonconformance reports, CMM reports and complaints, linked to the ERP so a question about a defect comes back with the reports named, and draft reports go to the quality manager to finish and sign. The platform is designed to keep each client’s data on its own server in Canada. The client chooses a model on that server or a hosted model under a written zero data retention agreement, a contract under which the provider keeps no copy of a request or its answer. A hosted model may process requests outside Canada. Derik Lawlis, the founder, leads every project and stays close to the build. More is on About ThriveAI.