Knowledge at STEMMER IMAGINGKnowledge at STEMMER IMAGING

A Practical Introduction to Machine Vision

2D vs. 3D Machine Vision: How to Choose the Right Technology

2D vs. 3D Machine Vision: What Is the Difference?

A 2D machine vision system analyses brightness and colour values in a flat image. It is ideal for tasks such as code reading, presence checking, print inspection and outline measurement. In contrast, 3D machine vision measures the height or depth of visible points on an object, representing the result as a height map or point cloud, and is therefore better suited to tasks that depend on shape, volume or position in space. The choice between the two depends on whether the information required by the task is visible as contrast or exists only as geometry.

2D vision is the established standard for most inspection tasks. It is fast and cost-effective, and supported by well-established software tools. However, 3D vision has become far more accessible and is the better option whenever height, volume or the exact pose of a part is important. Many applications use a combination of the two: a 3D sensor measures the shape, while a 2D image is used to check the print, colour or surface marks.

Left side:

Using 2D, measuring the diameter is possible, but the surface cannot be analysed using the same set-up.

Beispiel für die Durchmessermessung in 2D im Vergleich zur Erkennung von Unebenheiten in 3DBeispiel für die Durchmessermessung in 2D im Vergleich zur Erkennung von Unebenheiten in 3D
Beispiel für die Durchmessermessung in 2D im Vergleich zur Erkennung von Unebenheiten in 3D

Right side:

Using 3D it is possible to measure both the diameter and the size of the deformation with the same set-up.

How 2D Machine Vision Works

A 2D camera records the light that reaches each pixel, as grey values or colours. Software then finds edges, patterns, characters, codes or colour differences in the image. With suitable optics, stable backlighting and proper calibration, 2D systems can locate edges and hole positions with subpixel resolution. The achievable measurement accuracy depends on the complete optical, mechanical and software setup.

2D vision depends on contrast. A feature is only visible when lighting, optics and camera make it stand out from its surroundings. That works well for printed information, clear edges and surface marks, and less well for shallow dents, height differences or parts that have the same colour as the background.

What 2D vision does well

  • reading 1D and 2D codes and checking printed text
  • checking the presence, position and orientation of parts on a flat plane
  • inspecting labels, print and colour
  • measuring outlines, diameters and hole positions in one plane
  • detecting surface defects that change brightness or colour, such as scratches, stains and discolouration

Extending 2D vision

Several techniques reach beyond a plain 2D image without a full 3D sensor. Shape from shading and photometric stereo combine images taken under light from different directions to reveal surface topography, such as dents and scratches on glossy metal. Some pattern matching tools estimate the 3D orientation of a known object from a single 2D image. These approaches are useful for detecting surface features, but they generally do not provide the same direct and robust metric height measurement as a calibrated 3D sensor.

How 3D Machine Vision Works

A 3D camera or sensor measures the distance to each point, using laser triangulation, structured light, stereo vision or time-of-flight. The result is a height image or a point cloud in real-world units. Because 3D data describes geometry directly, it is often less affected by variations in colour, print and surface brightness than a purely 2D inspection. However, material properties, reflectivity, transparency and surface texture can still affect 3D measurement quality.

What 3D vision does well

  • measuring height, depth, flatness, volume and gaps
  • detecting dents, bulges and deformations that show little contrast in 2D
  • checking shape and completeness against a reference model
  • estimating the six-degree-of-freedom pose of parts that are stacked, tilted or randomly positioned (robot guidance and bin picking)
  • separating objects from a background of the same colour

Camera Technology Laser Triangulation

What Is 3D Machine Vision Used For?

Take a cylindrical part that needs two checks: its diameter and a dent in its surface. A 2D camera with backlighting can measure the outer diameter very precisely from the part’s silhouette. A dent may not affect the silhouette and may produce little contrast in the 2D image. A calibrated 3D measurement, such as laser triangulation with a suitable scan setup, can capture the surface profile of the dent. In practice, the most robust solution may combine both methods: 2D for the diameter and 3D for the surface geometry.

3d imaging height deviations3d imaging height deviations

Measurement of slightest height deviations (highlighted)

2D vs. 3D Machine Vision at a Glance

Criterion 2D machine vision 3D machine vision

Information

Brightness or colour per pixel

Height or depth per point

Depends on contrast

Yes

Less dependent on colour and print, but still affected by surface properties and reflectivity

Typical tasks

Codes, print, presence, outlines, surface marks

Height, volume, shape, deformation, 3D pose

Speed

Very high

High, but strongly dependent on the sensing method, field of view and required resolution

Data volume and processing requirements

Lower

Higher, more complex algorithms

System cost and setup

Lower, mature tools

Higher, needs calibration

Robot guidance

Parts on a flat plane

Parts in any position, including bins

How to Choose Between 2D and 3D Machine Vision

Ask what the task needs to know:

1.    Is the information visible as contrast?

Print, codes, colour and clear edges suit 2D.


2.    Does the task depend on height, depth or volume?

Fill levels in opaque containers, bead height, flatness or volume point to 3D.


3.    Do defects change shape more than appearance?

Dents, bulges and warping are often clearer in 3D.


4.    Where do the parts lie?

Parts on a flat conveyor in a known plane can be located in 2D. Parts stacked or lying randomly in a bin prefer 3D.


5.    Does colour or print vary?

When appearance varies but geometry is constant, 3D gives more stable results.


6.    What do budget and cycle time allow?

2D systems are usually simpler and faster to process. If 2D solves the task reliably, it is the more efficient choice.

 

When both kinds of information matter, a combined setup or a 3D sensor that also delivers an intensity image covers both.

Applications of 2D and 3D Machine Vision

Print & Packaging

  • 2D for print, code and label inspection
  • 3D for seal height and package shape

Food & Beverage

  • 2D for label and closure checks
  • 3D for portion size, volume and shape inspection of baked goods, meat and fish

Factory Automation

  • 2D for presence and outline measurement
  • 3D for weld seams, adhesive beads, flatness and gaps

Semiconductors & Electronics

  • 2D for component placement and marking
  • 3D for coplanarity and solder paste height

Transport & Logistics & Intralogistics

  • 2D for code reading
  • 3D for parcel dimensioning and depalletising

Pharma

  • 2D for serialisation and print
  • 3D for selected fill-level, container-shape and blister-form inspections, depending on the material and surface properties

Conclusion

There is no universally better choice between 2D and 3D machine vision. 2D is usually the most efficient option when the inspection depends on contrast, colour, print or outlines. 3D becomes essential when height, depth, volume, deformation or spatial position matters. In many demanding applications, combining both technologies provides the most reliable result.

The best approach is to define the required measurement information first and then select the imaging technology, optics, illumination and software accordingly.

How STEMMER IMAGING Helps

MORE Services by STEMMER IMAGINGMORE Services by STEMMER IMAGING

STEMMER IMAGING offers both 2D and 3D technologies from a manufacturer-independent portfolio:

 

Area scan and line scan cameras , illumination and optics for 2D inspection, and 3D Cameras based on laser triangulation, structured light, stereo vision, time-of-flight and line confocal imaging. Line-scan cameras are a 2D technology and are particularly suitable for continuous materials, webs, films and cylindrical surfaces moving through the inspection system.

 

Because we offer both, our recommendation follows the task, not a preferred technology. 3D is not automatically better than 2D. It is the better choice only when the inspection requires geometric information that cannot be obtained reliably from contrast in a 2D image.

Software:

 

Common Vision Blox (CVB) processes 2D images and 3D point clouds in one software environment. 

MORE Services by STEMMER IMAGINGMORE Services by STEMMER IMAGING

Services:

 

Our Engineering Services test 2D and 3D approaches on your parts before you decide, and our Operational Services deliver configured and calibrated systems ready to implement.

MORE Services by STEMMER IMAGINGMORE Services by STEMMER IMAGING

Frequently Asked Questions: 2D vs. 3D Machine Vision

What is the difference between 2D and 3D machine vision?

2D machine vision evaluates a flat image of brightness or colour values, while 3D machine vision measures the height or depth of every point and delivers a height image or point cloud. 2D suits codes, print, presence and outline measurement. 3D suits height, volume, shape and the position of parts in space.

When should I use 3D instead of 2D machine vision?

Use 3D when the task depends on height, depth, volume or shape, when defects change geometry more than appearance, when parts lie randomly in bins, or when colour and print vary while geometry stays constant. If the required information is clearly visible as contrast, 2D is usually the simpler and faster choice.

Is 3D machine vision more expensive than 2D?

3D systems usually cost more and need calibration and more processing power, because they capture and evaluate more data. Prices for 3D sensors have fallen considerably, and pre-calibrated 3D smart sensors reduce setup effort. For tasks that need geometry, 3D is often the only reliable solution.

Can a 2D camera measure height?

A conventional 2D camera does not measure height directly; it records brightness or colour values. Techniques such as shape from shading and photometric stereo can provide information about surface relief from multiple images, but they generally do not offer the same direct, calibrated height measurement as a dedicated 3D sensor.

Can I combine 2D and 3D in one system?

Yes. Many applications use a 3D sensor for shape and a 2D camera for print, codes or colour. Many 3D sensors also deliver an intensity image alongside the height data, so one sensor can cover both tasks.

Is 3D vision needed for robot picking?

Not always. If parts are lying flat in a known plane and their orientation can be determined from a 2D image, 2D vision may be sufficient. For parts that are stacked, tilted or randomly positioned in a bin, 3D vision is often preferred because it provides additional information about height, visibility and spatial pose.

What are the advantages of 2D machine vision?

2D machine vision systems are often fast, cost-effective and comparatively simple to integrate. They are well suited to code reading, print inspection, presence checks, colour inspection and measurements on a flat plane.

What are the limitations of 3D machine vision?

3D systems generally require more complex calibration, data processing and mechanical integration. Their performance can also be affected by reflective, transparent or highly absorptive surfaces, depending on the sensing method.

Do you have an inspection task?

 

We’ll find the right machine vision solution for you.

 

Describe your application in  5 brief steps. We’ll work with you to find the right solution.

Contact our experts

Turn our industry expertise and comprehensive services into your competitive advantage. Our experts will be happy to show you the potential for your company and work with you to realise tailor-made solutions to suit your requirements. We look forward to hearing from you and will get back to you promptly.