1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
3 @page stereo_mainsection Stereo
5 @note SW Release Applicability: This module is available in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
9 The Stereo module provides two functionalities: stereo rectification and disparity estimation.
10 A graphical representation of the two functionalities is given in the following image.
12 @anchor stereo_module_image
13 
15 The module is agnostic of the device acquiring the images and can be used with NVIDIA<sup>®</sup> DriveWorks if images are presented as `dwImageCUDA` objects.
19 The Stereo Rectifier can be used to rectify a pair of stereo images acquired from a calibrated stereo camera.
20 Rectification is the transformation projecting two images onto a common plane that is parallel to the line joining the two optical centers.
21 This transformation is such that all epipolar lines are horizontal and parallel, as it is visually represented in step I in the figure above.
24 The Stereo Rectifier algorithm must be initialized with the intrinsics and extrinsic parameters of the stereo
25 camera pair, which can be extracted from a rig configuration. Furthermore, the Stereo Rectifier algorithm
26 computes a region of interest (ROI) that can be used to crop the two rectified images to an area of equal size
27 that has only valid pixels and no interpolated data.
29 ## Disparity Estimation
31 The Stereo algorithm can be used to estimate the disparity between two rectified images.
32 It computes a map where each element represents the horizontal displacement between each pair of corresponding pixels, as it is visually represented in step II in the figure above.
33 That is, each disparity map pixel \e d(x,y) is such that <VAR>I<SUB>R</SUB>(x,y) = I<SUB>L</SUB>(x,y)</VAR>,
34 where <VAR>I<SUB>L</SUB>(x,y)</VAR> and <VAR>I<SUB>R</SUB>(x,y)</VAR> are corresponding pixels in the left and right image, respectively.
35 Disparity can be further used to compute the three-dimensional depth of the point.
37 The Stereo algorithm can be executed on GPU or on a combination of multiple hardware engines on Drive AGX boards, namely VIC (Video Image Compositor), PVA (Programmable Vision Accelerator), NVENC (Video Encoder), GPU and CPU.
39 Two Gaussian pyramids are required to perform the smoothed multi-resolution image decomposition on which the GPU-based stereo algorithm is based.
40 The number of decomposition levels as well as the possibility to compute the disparity map on one or both images can be set at initialization time.
41 The algorithm also returns a confidence map associated to the disparity map providing a reliability measure of its estimation.
43 The Stereo algorithm that runs on different hardware engines requires two single input images. The performance and the speed of the algorithm can be adjusted at the initialization time.
44 Similar to the GPU-based algorithm, in addition to the disparity map, it returns a confidence map associated to the disparity map to provide a reliability measure of the estimation.
48 - @ref stereo_usecase1
49 - @ref stereo_usecase2