All guides

What Is Machine Vision? How It Works, Parts and Cost

By Iu Ayala 14 min read Updated

Machine vision is a camera, a light and a computer fitted to a machine so that it can check, measure, identify or locate things without a person looking. A sensor says a part has arrived, the camera takes a picture under controlled light, software judges it in milliseconds, and the result goes back to the line as pass, fail or a position.

Most pages on this are written by companies that sell the cameras, so they define the term, list the benefits and stop. This guide adds the three sums that decide whether a system works (pixels on the flaw, exposure time, false rejects), prices in pounds from pages that show them, and where it goes wrong. We build custom vision systems for a living. The figure you can drag shows the sum we do first on every project.

What machine vision does: four jobs

Nearly every machine vision system does one or more of four jobs. Knowing which one you have matters, because each needs a different light, a different number of pixels and a different kind of software.

JobThe questionExamples
InspectIs anything wrong with it?A chipped cap, a missing screw, a scratch, a short fill, a wrong label
MeasureIs it the right size?Hole diameter, gap width, thread pitch, how far a pin is bent
IdentifyWhich one is it?Barcodes, 2D codes, printed dates and lot numbers, sorting by type or colour
GuideWhere is it?Telling a robot where a part lies and which way round, so it can pick or place it

Inspection on production lines is the classic use: food and drink, pharmaceuticals, car parts, electronics, packaging. The same methods now run outside factories. Parcel hubs read labels on moving belts, farms grade fruit, and warehouses check what is on a pallet. Two of our own: a warehouse vision system for Dendri Design that raised throughput by 40%, and coin recognition for cash machines (ATMs), which is an identify job.

Machine vision vs computer vision

Computer vision is the field: every method for getting information out of an image. Machine vision is that field applied to one fixed job on a machine, together with the camera, lens, light and wiring that make the job easy. A machine vision engineer spends as much time on the light as on the software. The words are used loosely, and many people say machine vision for both.

Machine visionComputer vision
What it isA complete system built for one job on one machineThe field of getting information out of images, and the methods for it
Where the camera isFixed over a line, at a known distance, under its own lightAnywhere: a street, a shop, a phone, a drone
What comes outA signal to a machine: pass, fail, a measurement, a positionA description for a person or program: what is there and where
How fastIn step with the line, often in milliseconds, every partDepends on the use: from real time to overnight
How it copes with varietyBy removing it: the part held in one position, under a hood, with its own lightBy learning it: models trained on thousands of varied images
Typical methodRules on edges and blobs (patches of dark or bright pixels), with deep learning added for hard surfacesDeep learning nearly everywhere

The line between them is fading. Deep learning, which came from computer vision, now ships inside factory cameras, and jobs that were once computer vision, such as detecting objects in a camera feed, are engineered like machine vision when they have to run all day on a fixed camera. The useful question is not which word applies but how much of the scene you control. The more you control, the simpler and more reliable the system.

The parts of a machine vision system, with prices

A system is a chain, and the picture can only get worse at each link. Software cannot recover a flaw the light did not show or the lens did not resolve. So the parts are listed here in the order things happen.

A machine vision station from the side. Parts travel along a conveyor. 1. Trigger. A sensor sees the part arrive. 2. Light. It fires, or is already on, and makes the flaw stand out. 3. Lens. It sets how much of the belt the camera sees. 4. Camera. It takes one picture of the part. 5. Computer. Software finds the part, checks it and decides. 6. Reject. An air jet or pusher removes the part that failed.

  1. 1 Trigger. A sensor sees the part arrive.
  2. 2 Light. It fires, or is already on, and makes the flaw stand out.
  3. 3 Lens. It sets how much of the belt the camera sees.
  4. 4 Camera. It takes one picture of the part.
  5. 5 Computer. Software finds the part, checks it and decides.
  6. 6 Reject. An air jet or pusher removes the part that failed.
One inspection station from the side. A drawing, not to scale: real stations usually add a hood over the camera and light.
PartWhat it doesWhat it costs
TriggerA sensor on the line that fires the camera and the light at the right instantA photoelectric sensor, often already on the line
LightMakes the flaw stand out and stays the same all day£573 for an LED ring light, plus £206 for its power supply
LensSets how wide the view is from where the camera can be mounted£208 to £344 for a fixed lens
CameraTurns the light into pixels, when the trigger says a part is in place£672 for 5 megapixels, £2,320 for 24
Computer and softwareFinds the part in the picture, runs the checks and decidesFrom free libraries on a small industrial PC to licensed software on a GPU (a graphics card, which runs deep learning models quickly)
OutputTells the line what to do: fire a reject gate, stop, log the pictureA digital signal to the PLC, the controller that runs the machine

Prices are UK list prices without VAT, read on 2 December 2026: the 5 megapixel camera, 24 megapixel camera, lenses and ring light from Edmund Optics. With the 8.5 mm lens at £222, a camera (the colour model), a lens, a light and its power supply come to £1,673 ($2,200). Notice that the hardware is cheap next to the engineering, and that a camera with five times the pixels costs three and a half times as much and runs at 4 pictures a second instead of 23.

Two things are in every real system and rarely in the brochure. The first is the mounting: a rigid bracket, and often a hood to keep the factory's own lights and the sun off the part. The second is the reject. Deciding a part is bad is no use unless something removes it, and removes that part and not the one behind it.

Industrial cameras differ from webcams and CCTV cameras in three ways. They take a picture on a trigger signal, most expose all pixels at the same instant (a global shutter), so moving parts are not skewed, and they send every pixel uncompressed. Most connect by GigE Vision, a standard that runs over ordinary network cable up to 100 metres, or by USB3 Vision for short runs. Both follow a common interface called GenICam, so a camera from one maker works with software from another. Very fast or very large cameras, line scan above all, use CoaXPress or Camera Link instead, which need a frame grabber: an extra card in the computer that receives the pictures.

Types of machine vision system

Systems are sorted two ways: by where the thinking happens, and by how the picture is made.

Vision sensor, smart camera or PC-based

TypeWhat it isFits
Vision sensorCamera, lens, light and a few fixed tools in one small housing, set up on its own screen or a laptopOne simple check: is the label there, is the cap on, which way round is the part
Smart cameraA camera with a processor inside and a fuller toolbox, some with deep learning built inSeveral checks on one view, codes and text, where a cabinet PC is unwelcome
PC-based systemOne or more separate cameras wired to a computer that runs the softwareSeveral cameras, high resolution or speed, custom models, anything unusual

A vision sensor costs about £1,400: the list price of an ifm O2D504, which has 1,280 by 960 pixels and its own light, was £1,428 without VAT on 2 December 2026. The big brands quote smart cameras on request, and we found no UK list price to give you. The parts for a PC-based station start at about £1,700 a camera, before the computer and the engineering.

If a sensor like that can do your job, buy it. You do not need us or any other software company. The reasons to go further are a flaw too small for its pixels, a surface too variable for its tools, or a decision that needs more than one view.

Area scan, line scan or 3D

TypeHow the picture is madeFits
2D area scanA normal camera chip: one whole picture per triggerSeparate parts, and most jobs
Line scanOne row of pixels, built into a picture as the material moves pastContinuous material (paper, film, steel, fabric) and round parts turned in front of the camera
3DA laser line, a projected pattern or two cameras give a height for every pointHeight, volume, flatness, dents with no colour change, picking from a bin

Cameras also come in monochrome and colour. Monochrome is the default in factories: for the same sensor it gives a sharper picture and needs less light. Choose colour only when colour is the thing being checked.

Some flaws cannot be seen in visible light at all, and for those there are cameras that use other parts of the spectrum. X-ray finds bone, glass and metal inside sealed food packs. Thermal cameras show heat, so they check heat seals and hot glue lines. Hyperspectral cameras split light into hundreds of narrow bands and can tell materials apart, which is how recycling plants sort one plastic from another. All cost far more than an ordinary camera, so they are a last resort.

How many pixels you need

This is the first sum of any vision project, and it takes one line. The camera spreads its pixels across whatever it is looking at, so the wider the view, the more millimetres each pixel has to cover and the fewer pixels land on the flaw. Drag the width of the view, or change the camera.

A camera looks down on a tray of bottle caps, one of which has a chip 0.5 mm across. The wider the view, the fewer pixels land on the chip. A 1.2 megapixel camera, 1,280 pixels across, keeps 3 pixels on the chip up to a view 213 mm wide and 5 pixels up to 128 mm. A 5 megapixel camera, 2,448 pixels across, keeps 3 pixels on the chip up to a view 408 mm wide and 5 pixels up to 245 mm. A 24 megapixel camera, 5,328 pixels across, keeps 3 pixels on the chip up to a view 888 mm wide and 5 pixels up to 533 mm. Under 3 pixels the chip is found only at very high contrast, and under 2 it cannot be found reliably.

408 mm 3 pixels
← three caps acrossa whole tray →
width of view
600mm
one pixel covers
0.25mm
pixels across the chip
2.0
  • Real edge of the chip, 3 pixels or more across
  • Real edge of the chip, under 3 pixels
A chip 0.5 mm across on a 30 mm bottle cap, drawn to scale. Pixels across the chip = pixels across the sensor × 0.5 mm ÷ width of the view. The thresholds are the rules of thumb published by the Association for Advancing Automation: a flaw of moderate contrast should cover about 3 by 3 pixels to be detected and about 25 pixels to be classified. Real lenses blur a little more than this drawing does.

How many pixels are enough depends on contrast and on what you want to know. The Association for Advancing Automation's guidance on flaw inspection gives the rules of thumb engineers use. A flaw of moderate contrast should cover about three by three pixels to be detected. To be classified, that is, to tell a scratch from a speck of dirt, it needs about 25 pixels, five by five. Below two pixels across, sampling theory says it cannot be detected reliably at all. National Instruments' manual uses that two-pixel floor in its formula, which suits a black part on a white background and little else.

So, with three pixels as the working figure:

Pixels needed across the sensor = width of the view ÷ smallest flaw × 3

A view 300 mm wide and a flaw of 0.2 mm needs 4,500 pixels across. A 5 megapixel camera has 2,448, so it will not do, and a 24 megapixel camera does, with a little to spare. The table gives the widest view each camera can cover for a given flaw.

Smallest flaw1.2 MP5 MP24 MP
1 mm427 mm816 mm1,776 mm
0.5 mm213 mm408 mm888 mm
0.2 mm85 mm163 mm355 mm
0.1 mm43 mm82 mm178 mm

Widest view that keeps 3 pixels across the flaw. To classify a flaw you need 5 pixels across it, so multiply each width by 0.6.

When the sum says no, there are four ways out, in the order we try them:

  • Narrow the view. Look only at the part of the product where the flaw can occur.
  • Raise the contrast. A low-angle light can make a fine scratch show up wider and brighter than it is.
  • Use several cameras side by side. Two 5 megapixel cameras cost less than one of 24 and take nearly six times as many pictures a second.
  • Use a line scan camera for wide, continuous material.

More pixels are not free. Every pixel has to be lit, sent and processed, so the rule in this trade is to use the lowest resolution that reliably does the job.

Choosing the lens

The lens sets the width of the view from where the camera can be mounted. A good first estimate is:

Focal length ≈ sensor width × distance to the part ÷ width of the view

The 5 megapixel camera above has an image sensor (the chip that records the picture) 6.77 mm wide. To see 400 mm from 500 mm away it needs a focal length of about 8.5 mm, so you buy the 8.5 mm lens and move the camera a few millimetres. Check too that the lens covers the sensor: the lenses priced above cover sensors up to 2/3 inch, so they fit the 5 megapixel camera but not the 24 megapixel one, whose sensor is 1.2 inch and needs a larger, dearer lens.

Camera speed: exposure time and motion blur

Parts on a line do not stop for the camera. If a part moves more than about one pixel while the shutter is open, small flaws smear into the background. Texas Instruments' note on freezing motion puts the target at one pixel of blur or less, which gives the second sum:

Longest exposure = size of one pixel on the part ÷ speed of the part

For the 5 megapixel camera over a view 400 mm wide, one pixel covers 0.16 mm:

Belt speedLongest exposure for one pixel of blur
0.25 m/s654 microseconds (1/1,530 of a second)
0.5 m/s327 microseconds (1/3,060 of a second)
1 m/s163 microseconds (1/6,120 of a second)
2 m/s82 microseconds (1/12,240 of a second)

Short exposures starve the sensor. At 1/6,000 of a second it collects 120 times less light than at 1/50, and that is why industrial lights are so bright and are often strobed: fired for a fraction of a millisecond in step with the camera, which freezes the part better than the shutter does.

Check the frame rate as well. A line making 300 parts a minute needs five pictures a second, more than the 24 megapixel camera above can take. And the software has to finish each picture before the part reaches the reject gate.

Machine vision lighting, where most projects are won

A person turns a part in their hand until the scratch catches the light. A camera cannot, so the engineer has to find that angle once and lock it in place. The aim is a picture in which the flaw is obvious to a child. If it is, simple software will do. If it is not, no model will make the system dependable.

The same metal washer with a scratch under three lights. Backlight: The outline and the hole are sharp enough to measure. The scratch has gone. Ring light: The surface shows, with glare. The scratch is there but faint. Low-angle light: The flat surface goes dark. The scratch and the edges shine.

Backlight The outline and the hole are sharp enough to measure. The scratch has gone.

Ring light The surface shows, with glare. The scratch is there but faint.

Low-angle light The flat surface goes dark. The scratch and the edges shine.

One washer with one scratch, drawn as a camera would record it under each light. A drawing of the effect, not photographs.
LightWhere it sitsWhat it shows
BacklightBehind the part, shining at the cameraThe outline as a sharp black shape: the best light for measuring and for holes
Ring or bar light (bright field)Around or beside the lens, shining at the partPrint, colour, labels, presence. Glares on shiny parts
Low-angle light (dark field)Almost level with the surfaceScratches, dents and engraving, which catch the light while the flat surface stays dark
DomeLight bounced from all directionsCurved and shiny parts without glare: foil, cans, ball bearings
CoaxialAlong the camera's own line of sight, through a half mirrorFlat mirror-like surfaces: wafers, polished metal, glass

The light also has to be the same at 3 am in January as at noon in June. The lights in the roof are not: they flicker, age and get switched off, and the sun moves. A hood over the camera costs little and removes the most common cause of a system that worked on the day it was installed and drifted afterwards. Colour helps too. A red light with a matching red filter on the lens shuts out most other light in the building.

Rules or deep learning: is machine vision AI?

For forty years machine vision meant rules: find an edge, measure a gap, count the dark pixels, compare with a limit. Deep learning, in which a model learns from labelled example pictures what good and bad look like, has been added over the last ten. Neither replaces the other.

RulesDeep learning
How it is set upAn engineer picks tools (find this edge, count dark blobs, measure this gap) and sets limitsA model is trained on labelled pictures of good and bad parts
Good atMeasuring, counting, reading codes, presence. Anything you can state as a numberFlaws that vary and surfaces with natural texture: wood, fabric, castings, food, welds
NeedsSteady light and position. A handful of sample partsDozens to hundreds of pictures per flaw type, or only good parts for anomaly detection
Can you say why it rejected?Yes: the gap was 2.31 mm and the limit is 2.20Roughly: it marks the area it disliked
When the product changesChange the limitsCollect new pictures and retrain

Our opinion: use rules wherever a rule can be written, and never measure with a neural network. Reach for deep learning when the flaw has no fixed shape or the good parts themselves vary. Many systems use both, with a rule to find and measure the part and a model to judge its surface.

One kind of deep learning suits factories well. Bad parts are rare, so collecting hundreds of pictures of each flaw can take months. Anomaly detection trains only on good parts and flags anything that looks different. On MVTec AD, the public benchmark of industrial photos for this, the PatchCore method separates good from bad pictures with a score of up to 99.6% (AUROC, where 100% is perfect and 50% is a coin toss). A benchmark is cleaner than a factory, so expect less on your own parts, but it is the quickest way to find out whether a surface can be inspected at all.

For locating and counting things, the usual tool is an object detector, a model that draws a box round each thing it finds. We compare them in YOLO models by version, accuracy and speed, and the licence matters if the system is a product you sell: see which YOLO licences allow commercial use.

How accurate machine vision is, against a person

The fair comparison is with a person doing the same check all shift, and people are worse at it than most managers assume. A review of the research by Sandia National Laboratories reports that error rates of 20% to 30% are frequently quoted across many kinds of inspection task, and that the errors are mostly misses, not false alarms. Having people inspect every part instead of a sample does not fix it. A camera does not get tired, bored or hurried, and it applies the same limit to the first part and the millionth.

A vision system makes two kinds of mistake, and you need a number for each:

  • Escapes: bad parts it passes. These reach your customer.
  • False rejects: good parts it fails. These cost scrap, rework and the operators' trust. A system that cries wolf gets switched off.

The two trade against each other through the limit you set, as our explanation of precision and recall shows. And false rejects add up, which is the third sum. If a product has 40 separate checks and each is right 99% of the time, only 67% of good products pass them all. To falsely reject no more than 1 product in 100, each check may be wrong on a good part only 0.025% of the time, about once in 4,000. The sum follows Control Engineering's example of a car with 40 inspected features, and it is why “99% accurate” on a sales sheet tells you very little.

Before you accept a system, test it on parts it has never seen, with enough bad ones to mean something. Missing none of 30 bad parts only shows the miss rate is under about 10%. Our guide to how big a test set needs to be has the table.

What a machine vision system costs

The hardware is the small part. In round numbers:

  • A vision sensor for one simple check: about £1,400 ($1,900) plus a bracket and a day of setting up. Your own maintenance team can fit it.
  • Parts for one PC-based camera station: about £1,700 for camera, lens, light and power supply at the list prices above, plus a computer, an enclosure and cabling.
  • The engineering: choosing the light and lens on real parts, writing or training the software, wiring it to the line, testing. This is most of the bill for anything beyond a vision sensor, and suppliers rarely publish it.

Our own prices are public. A feasibility study for a vision system is £4,000 to £6,000 (about $5,200 to $7,900): we take your sample parts or pictures, do the sums on this page, test lights and models, and tell you whether it can be done and what it will take. The fee is credited against the build. A working first version on one line or site is £15,000 to £20,000 ($19,700 to $26,200) in four to six weeks. We write software and choose the optics. For guarding, conveyors and reject mechanisms you will also want a machine builder or integrator.

Does it pay back?

Count three things: what a person costs on that station across every shift, what one escaped defect costs you (a returned pallet, a recall, a lost customer) and what the scrap from false rejects will cost.

Here is the first as a sum, with example numbers. One person checks parts on each of two shifts, 37.5 hours a week, at the National Living Wage of £12.71 an hour. That is £49,600 a year in wages, before employer's National Insurance and pension. A £25,000 system that takes over the check pays for itself in wages in about 6 months. That holds only if those two people move to work that is worth as much, and somebody still has to look after the system.

The second number usually decides it. A single rejected delivery or recall can cost more than the whole system.

Where machine vision fails

  • “Find anything wrong.” A system needs a list of flaws with a smallest size for each. Without one there is nothing to design the light or the pixels for, and nothing to test against.
  • Shiny, clear or black parts. Polished metal, glass, film and black rubber can all be inspected, but only with the right light, and finding it is most of the project.
  • Good parts that vary. If acceptable products differ from each other more than a bad one differs from a good one (hand-finished goods, natural materials), rules fail and a model needs many more examples.
  • Parts that arrive in a jumble. Touching, overlapping or tumbling parts need either mechanical handling to separate them or much harder software.
  • Many products on one line. Every variant needs its own settings and its own test. Ask how a new product is added, and who can do it.
  • Drift. Lenses collect dust, lights dim, a bracket gets knocked. Keep a set of known good and bad parts and run them through every week. Save the picture of every reject.
  • Vision added last. If the machine is built before anyone thinks about the camera, there is often nowhere to put the light.

How to start

You can answer most of the feasibility question yourself in an afternoon:

  1. Write down each flaw, the smallest size that matters and how often it occurs today.
  2. Measure the area the flaw can appear in. Do the pixel sum above. That gives you the camera.
  3. Note the line speed and parts per minute. Do the exposure sum.
  4. Collect 20 or more good parts and every bad one you can find. Bad parts are the scarce thing, so start saving them now.
  5. Photograph a bad part with a phone and a torch (flashlight) held at different angles. If you can make the flaw obvious in a photo, a system can very likely be built. If you cannot, the project is a lighting problem first.
  6. Decide how many escapes and false rejects you can live with, in numbers, before you talk to a supplier.

If one simple check comes out of that, try a vision sensor. If it is harder, a short test on your own parts is the safe next step. We describe how to run one, with a template, in our guide to an AI proof of concept, and there is more on the inspection case in computer vision for quality control.

Questions

What is meant by machine vision?

Machine vision means giving a machine the ability to act on what a camera sees. In practice it means a camera, lens, light and computer fixed to a production line or robot, which check, measure, identify or locate each part and send the result to the machine.

Is machine vision the same as computer vision?

Not quite. Computer vision is the whole field of getting information from images. Machine vision is its industrial use: a complete system, including the light and optics, built to do one fixed job on a machine. See the comparison above.

Is machine vision AI?

Some of it. A system that measures a gap between two edges uses geometry, not AI. One that judges a weld from examples of good and bad welds uses deep learning, which is AI. Many use both.

What are the basic principles of machine vision?

Control the scene, then judge the picture. Fix the camera, the distance and the light so that every part looks the same except for the thing being checked, put enough pixels on the smallest flaw, freeze the motion, and turn the decision into a signal the machine can act on.

What are the key elements of a machine vision system?

A light, a lens, a camera, a trigger sensor, a computer with software, and an output to the machine. The table above says what each does and costs.

What are the different types of vision systems?

By hardware: vision sensors, smart cameras and PC-based systems. By picture: 2D area scan, line scan and 3D. By method: rule-based and deep learning.

What is a smart camera?

A camera with its own processor and inspection software inside, so it needs no separate computer. It gives a pass or fail straight to the machine. A vision sensor is a simpler, cheaper smart camera with a few fixed tools.

How much does a vision inspection system cost?

From about £1,400 for a vision sensor doing one simple check, to tens of thousands of pounds for a custom system with several cameras. The camera, lens, light and power supply for one station list at about £1,700. The rest is engineering. Our fixed prices are in the cost section.

Where is machine vision used?

Mostly in manufacturing: food and drink, pharmaceuticals, cars, electronics and packaging, where it inspects products, reads codes and guides robots. Also in logistics for reading labels and measuring parcels, in agriculture for grading produce, and in recycling for sorting.

Who are the leading machine vision companies?

Cognex and Keyence are the best known for complete systems and smart cameras. Basler, Teledyne and Allied Vision make cameras. Omron, SICK, ifm and Zebra sell vision sensors and smart cameras. MVTec's HALCON is the best-known software library. Most are sold through local distributors and integrators.

Is OpenCV still relevant?

Yes. OpenCV is the free, open-source library of image processing functions, under the Apache 2 licence, and it is still what most custom systems use to read cameras, correct lens distortion, find edges and measure. Deep learning models sit beside it, not in place of it.

Sources

  • Association for Advancing Automation, “Understanding Flaw Inspection Applications”: pixels needed to detect and classify a flaw.
  • National Instruments, NI Vision manual, “Setting up your imaging system”: the two-pixel formula.
  • Texas Instruments, technical article SSZT704: exposure time for one pixel of blur.
  • Judi See, Sandia National Laboratories, “Visual Inspection: A Review of the Literature”, SAND2012-8590 (2012): human inspection error rates.
  • Control Engineering, “What happens when automation systems fail”: the false reject example.
  • Roth and others, “Towards Total Recall in Industrial Anomaly Detection” (2021): PatchCore on MVTec AD.
  • Prices from ifm and Edmund Optics UK, list price for one unit without VAT, read on 2 December 2026. Dollars at the European Central Bank reference rate of 27 November 2026.