Computer Vision System Toolbox

Stereo Vision

Stereo vision is the process of extracting the 3D structure of a scene from multiple 2D views.

Computer Vision System Toolbox provides functions and algorithms to complete the following steps in the stereo vision workflow:

  • Stereo calibration
  • Stereo image rectification
  • Disparity map computation
  • 3D scene reconstruction

Stereo Calibration

Stereo calibration is the process of finding the intrinsic and extrinsic parameters of a pair of cameras, as well as the relative positions and orientations of the cameras. Stereo calibration is a precursor to calibrated stereo rectification and 3D scene reconstruction. Computer Vision System Toolbox provides algorithms and functions to calibrate a pair of stereo cameras using a checkerboard calibration pattern.

Visualizing the extrinsic parameters of a pair of stereo cameras
Visualizing the extrinsic parameters of a pair of stereo cameras.

Stereo Image Rectification

Stereo image rectification transforms a pair of stereo images so that a corresponding point in one image can be found in the corresponding row in the other image. This process reduces the 2-D stereo correspondence problem to a 1-D problem, and it simplifies how to determine the depth of each point in the scene. Computer Vision System Toolbox provides functionality for stereo rectification that includes:

  • Uncalibrated stereo rectification using feature matching and RANSAC to estimate the projective transform between cameras
  • Calibrated stereo rectification using stereo calibration to compute the fundamental matrix
Results from stereo image rectification. Non overlapping areas are shown in red and cyan.
Results from uncalibrated stereo image rectification. Non-overlapping areas are shown in red and cyan.

Disparity Computation and 3D Scene Reconstruction

The relative depths of points in a scene are represented in a stereo disparity map which is calculated by matching corresponding points in a pair of rectified stereo images. The system toolbox provides algorithms for disparity calculation including:

  • Semi-global matching
  • Block matching
Stereo disparity map representing the relative depths of points in a scene
Stereo disparity map (right) representing the relative depths of points in a scene (left).

You can reconstruct the 3D structure of a scene by projecting the 2D contents of a scene to three dimensions using the disparity map and information from stereo calibration.

Reconstructing a scene using a pair of stereo images.
Reconstructing a scene using a pair of stereo images. To visualize the disparity, the right channel is combined with the left channel to create a composite (top left); also shown are a disparity map of the scene (top right) and a 3D rendering of the scene (bottom).
Next: Video Processing, Display, and Graphics

Try Computer Vision System Toolbox

Get trial software

Visión Artificial con MATLAB: Detección y seguimiento de objetos

View webinar