- Welcome
- Getting Started With the NVIDIA DriveWorks SDK
- Modules
- Samples
- Tools
- Tutorials
- SDK Porting Guide
- DriveWorks API
- More
This section explains how to use NVIDIA® DriveWorks Stereo PVA module to compute a disparity map from two rectified dwImageHandle_t
images.
For more information about rectifying images, see Disparity Computation Workflow.
To initialize a dwStereoPVAHandle_t
object, dwStereoPVAParams
is required. To illustrate, the following example initializes stereo parameters with default values:
And the following modifies the parameters according to application requirements:
For mor information regarding all available parameters, please refer to the dwStereoPVAParams
structure.
After initializing the stereo parameters, initialize the module as follows:
where contextHandle
is assumed to be a previously initialized dwContextHandle_t
.
StereoPVA module expects either NvMedia or CUDA image of DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR
format as rectified input images.
StereoPVA module provides functions to determine the size, type and format of the outputs in order to be able to create them on the application side.
The properties of the outputs can be obtained by:
The images can be constructed with the properties:
Call dwStereoPVA_computeDisparity()
to compute the disparity map and the confidence map based on the parameters set in dwStereoPVAParams
. The disparity is computed from left to right.
Disparity is defined as an 8-bit unsigned value. Confidence is defines as a 16-bit unsigned value representing how reliable the associated disparity value is.
The disparity computation pipeline consists of multiple stages and utilizes multiple hardware engines, namely CPU, VIC (Video Image Compositor), PVA (Programmable Vision Accelerator), NVENC (Video Encoder) and GPU.
Finally, release the stereo rectifier and stereo algorithm as follows: