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.

Hundreds of capped glass bottles moving across a conveyor table on a bottling line

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.

JobExamples on a lineWhat decides success
Defect inspectionScratches, dents, porosity on a casting, a missing clip, a wrong or crooked labelLighting that makes the defect visible, and example images of good parts and defects
MeasurementA hole position, a gap, an edge length, checked against a toleranceCamera resolution over the field of view, a fixed part position, and calibration
Counting and presenceParts in a tray, fasteners in an assembly, items in a box before it is sealedParts separated enough to tell apart, and a steady trigger
Reading codes and textDate and lot codes, part numbers, 1D and 2D codesPrint 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

  1. 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.
  2. 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.
  3. 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.”
  4. 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.
  5. Label the images. Start with good parts for anomaly detection, add labelled defects for the defects you care about most, and label consistently.
  6. 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.
  7. 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.
Plan for the product changing

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

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.

MeasureWhat it meansHow to get it
False rejectsGood parts the system rejectsCount parts a person returns to the line after review
EscapesBad parts the system passesRun known bad parts through, and track defects found later or by customers
Review loadRejects a person must look at per shiftCount rejects per shift from the system log
Test set resultPass and fail on a fixed set of known good and bad partsRun 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 conversation

AI 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 productWhat the vendor says it doesWorth knowing
Cognex VisionPro Deep LearningIts 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 OCRAlso carries rule-based tools, including measurement and counting
Siemens Inspekto“Only 20 good samples required to commission Inspekto,” and bad samples are optionalSiemens says it can be “fully integrated with PLC or MES/ERP systems”
Zebra Aurora Deep LearningDeep 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 DALSADescribes 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.

Questions people ask

What is computer vision in manufacturing?
Computer vision in manufacturing uses cameras and software to inspect parts on the line: finding defects such as scratches or missing components, measuring dimensions, counting parts and reading codes. On the factory floor it is usually called machine vision, with a camera, a light and software at a fixed station sending a pass or fail signal to the line.
How is AI used for quality control?
In two ways. At the line, AI models trained on images of good and bad parts inspect each part for defects that fixed rules miss. In the office, AI reads quality records such as nonconformance reports, measurement reports and customer complaints, links them by part, lot and supplier, and drafts reports for the quality manager to finish.
How many images do you need to train AI inspection?
Vendors now advertise small starting sets. Keyence says its VS series needs only a few dozen images for learning, and Siemens says 20 good samples are enough to commission Inspekto. Unsupervised tools train on good parts only. Plan to keep adding images as new parts, suppliers and defects appear.
What do you need to set up camera inspection?
A written definition of a reject with known good and bad parts, controlled lighting, a camera and lens sized for the smallest feature, a trigger and a reject mechanism from the PLC, labelled images, and a person who reviews rejects at first. Store each image and decision with the part number and lot.
Why does machine vision fail?
Common failures come from changes the system was not trained on: lighting that shifts, a camera that moved, a new part number or material, shiny or transparent surfaces, and defect types nobody labelled. Running a fixed test set of known parts after every change catches many of these before full production.
How do you measure whether AI inspection is working?
Track false rejects, good parts the system rejects, and escapes, bad parts it passes, against your current manual inspection. Run a fixed set of known good and bad parts before go-live and after every change to the lighting, camera or model, and count rejects per shift that a person has to review.

Contact

Start with the defect your customers find

Tell Derik which defect reaches customers most often and how it is recorded today. He will tell you what your records can show about it, and when a camera is the right fix.

Prefer to talk? Book a meeting.

Your message goes to Derik Lawlis, the founder.