DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

Stereo Disparity PVA Sample
Note
SW Release Applicability: This sample is available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Description

The Stereo Disparity sample demonstrates the stereo pipeline running on multiple hardware engines, namely:

  • CPU: Input images are converted from YUV420 Semiplanar to Y for the stereo pipeline.
  • VIC: Input images are transformed according to the requirements of the engines.
  • PVA: Hints are generated in the preprocessing step, and the output is refined in the postprocessing step.
  • NVENC: Stereo disparity is computed.
  • GPU: Operations are performed on the output to get the disparity values.

The sample reads frames from two stereo videos and rectifies them on the basis of the camera calibration contained in the rig configuration file. Then, it runs the frames through the stereo pipeline mentioned above and displays final stereo output.

Running the Sample

The command line for the sample is:

./sample_stereo_disparity_pva --rigconfig=[path/to/rig/configuration/file]
                              --video-left=[path/to/the/left/video]
                              --video-right=[path/to/the/right/video]
                              --sensor-left=[name/of/left/camera/in/rig/file]
                              --sensor-right=[name/of/right/camera/in/rig/file]
                              --maxDistance=[maximum/distance/in/meters/for/depth/rendering]
                              --estimationMode=[LQ|MQ|HQ]
                              --nvencNo=[0|1]
                              --pvaNo=[0|1]

where

--rigconfig=[path/to/rig/configuration/file]
    Points to the rig file that contains the intrinsics and extrinsics for the stereo camera.
    Default value: path/to/data/samples/stereo/full.json

--video-left=[path/to/the/left/video]
    Is the path to the video recorded from the left camera.
    Default value: path/to/data/samples/stereo/left_1.h264

--sensor-left=[name/of/left/camera/in/rig/file]
    Is the name of the left input sensor in the rig file.
    Defaul value: left_60FOV

--sensor-right=[name/of/right/camera/in/rig/file]
    Is the name of the right input sensor in the rig file.
    Defaul value: right_60FOV

--video-right=[path/to/the/right/video]
    Is the path to the video recorded from the right camera.
    Default value: path/to/data/samples/stereo/right_1.h264

--maxDistance=[maximum/distance/in/meters/for/depth/rendering]
    Maximum distance in meters for depth rendering.
    Every pixel with a depth greater than maxDistance is rendered as blue
    Default value: 40.0

--estimationMode=[LQ|MQ|HQ]
        Indicates the quality and the performance of Stereo algorithm:
        - LQ: Low Quality
        - MQ: Medium Quality
        - HQ: High Quality
        Default value: MQ

--nvencNo=[0|1]
        Indicates on which Nvidia Video Encoder the corresponding stage of the pipeline is to be executed.
        Default value: 0

--pvaNo=[0|1]
        Indicates on which PVA engine the corresponding stage of the pipeline is to be executed.
        Default value: 0

Output

The sample creates a window and displays the disparity view composed by:

  • Left: Anaglyph of left and right image
  • Right: Stereo disparity

The stereo output is color coded for clarity.

sample_stereo_disparity_pva.png
Stereo Disparity on NVENC & PVA

Additional information

For more details see Stereo .