MACHINE VISION

Computer Vision for Industrial Inspection: How It Works and How to Learn It Free

Most inspection problems are solved by lighting before software. The parts of a vision station, when OpenCV is enough, when YOLO is worth it, and a free route.

By EDWartens engineering team 18 February 2026 Updated 5 October 2026 8 min
Computer Vision for Industrial Inspection: How It Works and How to Learn It Free

Computer vision training for industrial use teaches you to build inspection that works on a real line: lighting and lens first, then classical OpenCV processing, and deep learning only where defects vary too much for rules. The result must reach a PLC in time to reject the part. You can learn it free on edwartens.com with a phone camera.

“Machine Vision: Overview | Machine Vision pt1” by Breen Machine Automation Services LLC, 10 min. Played from the creator's own YouTube channel; the video belongs to them.

This overview by Breen Machine Automation Services LLC opens the free Machine Vision and Quality Inspection course. Its module teaches the six stages of an inspection station and where failures start, the difference between rule-based, deep and edge learning, and why stations often run rules and a model in sequence. The practice task: for a product you know, write the six stages of its inspection station and which kind of processing each check needs. Use the rest of this post as your written companion.

The six stages of an inspection station

The six stages of an inspection station
The six stages of an inspection station

A camera on a line is only one sixth of the system. The failures that reach a quality manager's desk usually start somewhere else:

  • Trigger. If the photo is taken a few milliseconds late, the part is half out of frame. A sensor or an encoder position triggers the capture; NPN vs PNP sensors explains how that sensor is wired.
  • Lighting. The single biggest factor. Backlighting gives a sharp silhouette for measuring. Dark-field light makes scratches and embossing glow. A dome gives even light on shiny, curved parts.
  • Optics. The lens sets the field of view and working distance. Pick it from the part size and the distance you have, not the other way round.
  • Camera. Resolution must give several pixels across the smallest feature you need to see. Exposure must be short enough that a moving part does not blur.
  • Processing. Classical rules, a trained model, or both in sequence.
  • Output. A pass or fail signal and data to the PLC, with enough time left for the rejector to act.

The rule most integrators repeat is: fix the image first. A clean, repeatable image makes simple software work. No model rescues a picture with glare in the wrong place.

Classical vision: what OpenCV does

OpenCV is a free, open-source library for image processing, and most classical inspection can be built from a small set of its operations:

  1. Colour and thresholding. Convert to HSV to detect by colour, or threshold brightness, with Otsu's method or an adaptive threshold when lighting varies.
  2. Morphology. Erode and dilate to clean noise and separate touching parts.
  3. Edges and contours. Find outlines, then measure area, perimeter, bounding box and shape.
  4. Measurement. Convert pixels to millimetres using a known reference in the image.
  5. Template matching and Hough transforms to find a known pattern, lines or circles.
  6. Video. Background subtraction and a tracker to count parts crossing a line.

Each step is visible and each limit can be written in a validation document. That transparency is why classical tools still do most measuring, presence checks, code reading and OCR on real lines.

When deep learning is worth it

Rule-based vision against deep learning
Rule-based vision against deep learning

Deep learning is worth its cost when the defect varies too much to describe: scratches of any shape, stains, texture faults on wood or fabric, cosmetic flaws on a moulded part. A convolutional network learns from labelled examples instead of hand-set rules. Object detectors in the YOLO family, documented by Ultralytics, find and box several defect types in one pass. A trained model is often exported to a portable format such as ONNX so it can run on the station's own hardware.

It brings its own work. You need a labelling standard written down before labelling starts, so two people would mark the same image the same way. You need enough images of each defect, and the rare ones are the hardest to collect. You need to choose the operating threshold with the quality team, because it trades escapes (bad parts passed) against false rejects (good parts scrapped). Many stations use both kinds: rules to locate and measure the part, a model to judge the surface.

Connecting to the PLC

A vision system that is right but late is wrong. Build a timing budget from the trigger to the rejector: capture, transfer, processing, result message, PLC scan and the rejector's travel. Add a heartbeat so the PLC knows the vision system is alive, and decide what happens when it is not. Usually that means stopping the line or diverting every part rather than passing uninspected product. Many vision "faults" found at commissioning are really handshake faults. Where processing runs on a device beside the line, edge AI in industrial automation covers the hardware choices.

A free computer vision training route

  1. [Computer Vision with OpenCV](/free/computer-vision-with-opencv), beginner. Images as arrays, HSV, thresholds, morphology, contours and millimetre measurement, video, counting across a line, and choosing camera, lens, lighting and trigger. It needs basic Python and NumPy; Python for AI and Engineering Data covers that from zero.
  2. [Deep Learning with TensorFlow and Keras](/free/deep-learning-with-tensorflow), intermediate. CNNs, augmentation and transfer learning, ending with a surface-defect project. The deep learning guide explains the ideas.
  3. [Machine Vision and Quality Inspection](/free/machine-vision-quality-inspection), intermediate. Sizing the camera, lens and lighting with the arithmetic shown, the timing budget and PLC handshake, validating classical tools, a labelled dataset, a YOLO detector, the operating point with QA, and export with measured latency.

For the business side, including where AI inspection pays and how to judge a vendor's demo, see AI quality inspection in manufacturing. The Industrial AI engineer path groups machine vision with predictive maintenance and plant data.

Practise with what you have

A phone, a desk lamp, a torch and a sheet of white paper are enough to learn lighting properly. Photograph the same part with front light, a low-angle light and a backlight made from a lamp behind paper, and compare how easy each image is to threshold. Then count coins or washers on a tray with contours and check your count against the truth. That habit of scoring against ground truth is the one that transfers to a real station. Google Colab runs the notebooks in a browser, so a laptop is enough.

Start the free courses

Create a free account and start with Computer Vision with OpenCV. All AI courses are listed under free AI courses for engineers. Each course ends with one final assessment of 15 questions from the whole course, a 60% pass mark and three attempts, then a 24-hour wait and a fresh paper.

Learning is free in full. The optional EDWartens Certificate of Completion is a small one-off fee, US$8.99 for a beginner course such as OpenCV and a little more for an intermediate one such as Machine Vision. Anyone can check it at edwartens.com/verification. It is not a camera-vendor certification and not an accredited qualification.

Take the free course

Questions

What is the difference between computer vision and machine vision?

Computer vision is the broad field of getting information from images. Machine vision usually means its industrial use: cameras, lighting and software inspecting, measuring or guiding on a production line, connected to a PLC.

Do I need an industrial camera to learn?

No. The free EDWartens courses use Google Colab and a phone camera, with a torch, a lamp and white paper for the lighting exercises.

Is deep learning always better than classical vision?

No. For measuring, reading codes and checking presence, classical tools on a well-lit image are faster, cheaper and easier to validate. Deep learning is worth it for defects that vary too much to describe with rules.

Do I need to know PLCs for machine vision work?

It helps a great deal. The camera's result has to reach a PLC in time to fire a rejector, and many vision faults are really timing or handshake faults.

What does the computer vision certificate cost?

Learning is free. The optional certificate is a small one-off fee, lowest for the beginner OpenCV course and a little more for the intermediate machine vision course.

Sources

Written by the EDWartens engineering team for general education. Product names are trademarks of their owners; mentioning them does not imply endorsement. Prices and terms of other providers were checked on the date shown and can change.