How a Machine Vision Camera Works: Sensors, Optics, Lighting

A machine vision camera must make the smallest defect visible at line speed: how sensor, shutter, resolution, lens, lighting and interface decide it.

How a Machine Vision Camera Works: Sensors, Optics, Lighting
Written by TechnoLynx Published on 12 Jun 2026

A machine vision camera is an industrial camera that delivers controllable, triggerable images to software, not images processed to look pleasing to people. Headline megapixels alone don’t decide whether it works in inspection. What decides it is whether the sensor, shutter, resolution, lens, lighting and interface together make the smallest defect you must catch visible at production line speed. The camera is one link in an end-to-end vision pipeline, where the image is formed long before any model sees it and the weakest link caps the accuracy you can ever reach.

Machine Vision Camera Versus Webcam: What the Difference Buys You

Under identical lighting, a 20 MP machine vision camera with a high-resolution lens gave a crisp, high-contrast image of the same scene, and a webcam with consumer optics gave poor contrast, even at a wide field of view. The more important difference is out of sight. Webcam and smartphone firmware may smooth values across neighbouring pixels to make an image look pleasing, and that smoothing can erase exactly the defect an inspection is meant to find.

Control is the other half. A machine vision camera comes with a software development kit for setting bandwidth and image format. It also lets you choose between free-running streaming and exposures triggered by hardware or software, so capture can be synchronised to a conveyor. Industry standards such as GigE Vision, USB3 Vision, Camera Link and GenICam let third-party libraries like OpenCV, Halcon and MATLAB control any compliant camera, whoever makes it. Read the image comparison as a demonstration, not a controlled benchmark. The points about firmware and control are structural and hold regardless of who makes the comparison.

How Does a Machine Vision Camera Turn Light into an Image a Vision System Can Analyse?

The sensor converts photons into charge, the shutter defines when that charge is collected, and the exposure time sets how much light and how much motion end up in each pixel.

Sensor. Both CCD and CMOS sensors turn incident light into charge in a photodiode array. They differ in readout. A CCD moves charge across the chip to a few output nodes, which gives high uniformity but slower readout and higher power. A CMOS sensor amplifies and digitises at pixel or column level, which allows higher frame rates and either global or rolling shutters. A sensor primer says high-speed CMOS imagers can be designed with much lower noise than high-speed CCDs because the parallel readout lets each amplifier run at low bandwidth. It also says CMOS area and line scan imagers outperform CCDs in most visible-light applications. CCDs still have niches: TDI sensors for very weak signals at high speed, and some near-infrared work. Silicon sensors respond from roughly 350 to 1050 nm, with 400 to 1000 nm usually quoted as the usable range.

How well a pixel holds signal matters, not only how many pixels there are. A modern CMOS area sensor might offer 10 to 30 ke⁻ full well capacity and more than 70 dB of dynamic range. If exposure and lens f-number are not matched to scene brightness, you can waste half the bit depth and lose defect detectability. Full well capacity, read noise and quantisation (10 to 16 bits) set how much contrast the camera can hold.

Shutter and exposure. Industrial cameras have no mechanical shutter. An electronic shutter resets the accumulated charge, which gives a controlled exposure, typically between 0.1 and 20 ms. With an asynchronous (triggered) shutter, the camera waits for an external signal before it enables the pixels, so a part sensor or encoder can decide when each frame is taken. If the part moves during the exposure, its image spreads across neighbouring pixels in the direction of travel, so moving parts need very short exposures.

Area Scan or Line Scan, Global or Rolling Shutter, Monochrome or Colour

Each of these three choices is a trade-off against the part, its motion and the defect.

Choice Option How it works Fits when Watch for
Geometry Area scan Captures a full rectangular field in one exposure Parts are discrete and not moving very fast, and the object is not extremely large Typical area sensors top out around 4,000 pixels horizontally
Geometry Line scan Builds a 2D image one line at a time as the object moves past Continuous webs, large or fast-moving surfaces; linear arrays above 16,000 pixels are not uncommon Motion must be precise, light must be uniform and intense, and large image circles are needed
Shutter Global All pixels start and stop collecting at the same time Moving targets where geometry must be preserved Choosing it is how you avoid rolling-shutter distortion at line speed
Shutter Rolling Each line is exposed and read at a slightly different time Static or slow scenes Moving objects distort; a strobe timed to the overlap of line integration periods reduces the effect
Colour Monochrome Every pixel samples luminance Contrast can be created with lighting wavelength and filters No colour information
Colour Single-chip colour A Bayer mosaic filter, then demosaicing in software Colour is itself the defect signature Lower effective resolution than monochrome for the same sensor

Teledyne DALSA’s own primer claims that, for a given field of view, one 2k line scan camera gives the same resolution as two megapixel area scan cameras, with no smear and no overlapping frames to process. That comes from a line scan vendor. Check it against your own geometry before relying on it.

How Do You Choose Sensor Resolution, Pixel Size and Frame Rate for the Smallest Feature?

Start from the defect and work back to the sensor. The smallest feature, the number of pixels it needs to cover, and the field of view together fix the millimetres per pixel. That figure fixes the pixel count, and the pixel count, pixel size and interface then bound the frame rate.

Spatial resolution is the real-world size that one pixel samples at the working distance, expressed in mm per pixel. It is the field of view divided by the number of pixels across it, and it is a sampling interval, not the smallest feature the system can resolve. Commonlands (2026) gives the example of a 12 MP camera, 4032 pixels wide. On a 600 mm tote it samples 0.149 mm per pixel. On a 60 mm connector it samples 0.0149 mm per pixel, because only the field of view changed. If one pixel covers 0.1 mm, a 0.05 mm scratch is sub-pixel and usually lost unless its contrast is high.

The pixels set the absolute limit. The highest frequency a sensor can resolve, the Nyquist frequency, is two pixels per line pair, so the smallest resolvable detail spans two pixels. Edmund Optics defines resolution as the spatial frequency, in line pairs per millimetre, at which a specified contrast (usually 20% for lenses) is achieved. Lighting also influences resolution, not only appearance.

Two pixels is the theoretical limit, not a design point. Commonlands gives working heuristics for how many pixels a feature should span:

Task Pixels across the feature
High-contrast presence/absence, such as a dark crack on a bright background under controlled light 3 to 5
Shape or orientation classification 5 to 10
Low-contrast or textured defects 8 to 15
Dimensional measurement (sub-pixel algorithms refine to about 0.1 to 0.3 px on well-resolved edges) 10 or more

Which row applies depends on the defect class. Which defect classes CV inspection can handle today is the question to settle before you size a sensor.

Pixel size trades against noise. Smaller pixels give more resolution on a given sensor, but they hold less charge, which can raise noise and limit dynamic range in low light or at high speed. Larger pixels collect more photons but give fewer pixels in the same format. Typical pixel pitch runs from 2 to 10 µm. Frame rate falls as pixel count rises, because the maximum rate depends on sensor readout speed, interface data rate and data per frame. You can often win frame rate back by binning pixels or restricting the region of interest. Edmund Optics also notes that when you need both high frame rate and high resolution, system price and setup complexity rise quickly, often out of proportion to the pixel count.

How Do You Calculate Minimum Resolvable Defect Size at Production Line Speed?

Work out the sampling first, then the motion. Both must hold at once.

Worked example (figures from Commonlands and Vision-Doctor; arithmetic shown).

  1. Resolution. The target is a 0.2 mm scratch, which needs 5 pixels of coverage. The required spatial resolution is 0.2 ÷ 5 = 0.04 mm per pixel. On a 2448-pixel-wide sensor, the widest horizontal field of view is 0.04 × 2448 ≈ 98 mm.
  2. Motion. Vision-Doctor’s example is a 120 mm part imaged across 2464 pixels on a conveyor running at 600 mm/s. One pixel covers 120 ÷ 2464 ≈ 0.049 mm. The part crosses one pixel in 0.049 ÷ 600 ≈ 81 µs, so an exposure longer than about 81 µs smears the image by more than one pixel (arithmetic from the stated figures).
  3. Tolerance. Blur of 0.5 to 2 pixels is usually invisible to the eye but still degrades measurement accuracy, and it is sufficient for many standard applications.

An 81 µs exposure sits below the 0.1 to 20 ms range that Vision-Doctor calls typical. Strobe overdrive gives a brighter flash at short exposures to freeze motion. The minimum resolvable defect at line speed is therefore the larger of the sampling limit and the blur limit. If both can only be met with more light than the station can deliver, the specification has to change. The full blur calculation and on-site checks belong to lighting and motion-blur validation, which covers how lighting, fixturing and conveyor conditions are measured at the line.

How Do Lens Choice and Lighting Geometry Decide Whether a Feature Makes It into the Image?

The lens has to resolve what the sensor samples, keep parts sharp within the depth of field and, for gauging, hold the image scale constant. Lighting has to create contrast between the feature and its background.

Matching the Lens to the Sensor

Start the resolution calculation at the sensor, then specify the lens to match it. Commonlands lists 145 lp/mm as the Nyquist requirement for a 3.45 µm pixel, and 250 lp/mm for 2.0 µm (1 ÷ (2 × 0.00345 mm) ≈ 145). Smaller pixels only help if the optics can hold that frequency. Edmund Optics warns that a lens may not, because of design limits or diffraction at the aperture. The lens image circle must also cover at least the sensor diagonal, or the corners vignette.

Depth of field is the other constraint. Commonlands sets the circle of confusion as k × pixel pitch, where k (commonly 1 to 2) is how many pixels of blur the task tolerates. At the sensor plane, the depth-of-focus window is only tens of micrometres. That is why a uniformly soft image after assembly points to the sensor position, while parts that are sharp at some distances and blurry at others point to object distance.

For gauging, telecentric lenses remove parallax: magnification does not change with distance, so a vibrating conveyor or an inexact part position does not shift the measurement. Edmund Optics also corrects a common misconception. Telecentric lenses do not inherently have more depth of field, but they blur symmetrically, so edges keep their centre location beyond best focus.

Lighting Geometry, in Brief

Advanced Illumination names four ways to enhance contrast: geometry (the spatial relationship of object, light and camera), structure (the shape of the projected light), wavelength and filters. Geometry and structure matter most on specular surfaces, while wavelength and filtering matter most for colour and transparency. A few examples show the range:

  • Back lighting produces silhouettes for presence, placement and gauging.
  • Diffuse dome lighting evens out reflections on curved, shiny parts.
  • Low-angle dark field lighting sends glare away from the camera and catches the edges of small surface features.

Lighting design is a subject of its own. On the camera side, the point is that lighting geometry is a design input with the same standing as pixel count.

How Does the Choice of LED Lighting Color and Color-Rendering Quality Affect Whether a Defect Signature Shows Up?

Yes. Materials reflect and absorb wavelengths differently, so the colour of the light can raise or suppress a feature’s contrast in both monochrome and colour imaging. Opposite colours on the colour wheel give the most contrast: green light suppresses red reflection more than blue does. Blue light is useful for shallow surface features such as laser etching on black rubber. Infrared tends to neutralise colour-based contrast because its reflection depends more on composition and texture. Narrow-band sources paired with filters also block ambient light: a 660 nm band-pass filter matched to a 660 nm red LED is very effective against overhead plant lighting. Match the source’s peak wavelength to the sensor’s quantum efficiency when the application is short of light.

White light raises a separate issue for colour inspection. A white LED is usually a blue LED with a phosphor coating, and its correlated colour temperature (CCT) ranges from warm to cool, which can affect inspection accuracy and robustness. Colour matching, colour identification and checks of registered colours depend heavily on both CCT and the colour rendering index (CRI), which describes how accurately object colour is reproduced in the image. Most white LED lights have a CRI between 70 and 95. Manufacturing binning means you usually cannot buy a very narrow CCT range. Advanced Illumination also rates a white LED at L70 after 50,000 hours, meaning it is about 70% as bright as when new at that point.

In practice, a replacement white light can come from a different CCT and CRI bin than the lights a colour-defect model was trained under. We would treat the light source’s CCT, CRI and intensity as controlled parameters of the inspection, not as fittings.

USB3 Vision, GigE Vision or CoaXPress: When the Machine Vision Camera Interface Matters

The interface choice depends on data rate, range, latency and cost, weighed against the application.

Interface Rate cited Reach and cabling Typical fit
USB3 Vision 5 Gbps on USB 3.0; version 1.2 covers USB3 and USB4 up to 20 Gbps Single cable can carry video and power Cost-sensitive stations near the host
GigE Vision 1 GigE to 10 GigE; version 3.0 uses RoCEv2 for streaming to 400 Gbps and beyond Standard Ethernet cables over long distances; a protocol running on UDP/IP Cameras far from the PC, multi-camera networks
CoaXPress Up to 12.5 Gbps per cable; multiple cables combine A3 cites 40 m at 12.5 Gbps and longer at lower speeds; power and triggers over the same coax High-speed, high-resolution work such as semiconductor and print inspection
Camera Link HS Version 1.2 (September 2022) raises the line rate to 25 Gbps Off-the-shelf cables, MPO connector Very high bandwidth to a frame grabber

On reach, the CoaXPress standard’s own site says cable lengths above 100 m are achievable but does not give the speed. A3 ties its 40 m figure to 12.5 Gbps, so we would plan against the A3 figure for a full-rate link. GenICam, which EMVA developed in 2006, gives one programming interface across Camera Link, GigE Vision, USB3 Vision and CoaXPress. Changing the physical interface therefore leaves the camera-control programming interface the same. What the camera feeds downstream (frame grabbers, network cards, the PC or edge GPU) is covered in inspection compute hardware.

Why Can a High-Spec Machine Vision Camera Still Produce Images a Model Cannot Learn From?

A high-spec camera records only the image the lighting and optics form on the sensor.

Datasheets make this easy to miss. Pixel count is the most prominent number on them, but in many systems the limiting factor is how well exposure and aperture use the sensor’s full well and dynamic range. To compare those figures across vendors, EMVA 1288 defines one method for measuring, computing and presenting sensor and camera specifications.

The data side points the same way. Andrew Ng told IEEE Spectrum that 50 well-engineered examples can be enough to build a defect-inspection system, and that the focus has to shift from big data to good data. The MVTec AD anomaly-detection benchmark (Bergmann et al., CVPR 2019) was acquired with a 2048 × 2048 industrial sensor and bilateral telecentric lenses, under highly controlled illumination. A line without those conditions is a harder problem than the published results suggest. TechnoLynx’s position is that off-the-shelf vision models that work in demos tend to fail in production on edge cases, lighting conditions and throughput.

How Do 3D Imaging Approaches Like Time-of-Flight or Structured Light Compare to 2D Cameras?

We would reach for a 3D camera when the defect is a height, depth or shape deviation that 2D contrast cannot show reliably. For colour, print and most surface-contrast defects, a well-lit 2D camera usually remains the simpler instrument.

Most 3D methods use some form of triangulation, computing each pixel’s position from different viewpoints or lighting directions:

  • Structured light projects a known pattern, and the way surface features distort it yields a high-resolution 3D model. It suits fine surface imperfections such as small scratches or dimples in automotive paint. Time-coded structured light projects a series of patterns over several images. Zivid, a vendor of these cameras, says time-coded structured light reaches up to 100 times better precision than other techniques but needs the object and camera to stay still during capture.
  • Laser triangulation builds the model line by line from a projected laser line. It gives precise measurements of moving objects, but it needs that motion to capture full data.
  • Time-of-flight measures how long projected light takes to return, per pixel, often by measuring the phase of near-infrared light. In Vision Systems Design, a practitioner describes time-of-flight cameras as smaller, cheaper and easier to deploy than structured-light systems, with no external light source needed.

Two of these methods carry a capture condition: static scenes for time-coded structured light, motion for laser triangulation. That condition has to fit the line in the same way a 2D camera’s exposure does.

How Do Camera-Side Choices Set the Ceiling on Accuracy and False-Positive Rate Before Any Model Is Trained?

The weakest link in the imaging chain caps the accuracy any model can reach. Sampling sets the absolute limit on the smallest feature the data can resolve. Exposure and motion set how sharp it is. Lighting sets its contrast against the background. The image detection model works under that ceiling.

TechnoLynx’s CV inspection feasibility audit profiles the camera, optics and lighting against each defect class to confirm that the imaging chain can resolve each defect before a pilot starts. The honest output of that audit is an achievable accuracy band, not a benchmark number the line cannot sustain. TechnoLynx’s baseline position is that most AI projects fail, and that an engagement that does not start by setting expectations honestly does the client a disservice. TechnoLynx sets out what a feasibility audit delivers and its wider Computer Vision R&D work. The pilot decision this imaging analysis feeds is covered in CV inspection feasibility.