DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Stereo PVA Interface

Detailed Description

Runs the stereo pipeline and computes disparity map on PVA.

Runs the stereo pipeline's individual steps and computes disparity map on PVA.

Note
SW Release Applicability: These APIs are available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

Data Structures

struct  dwStereoPVAParams
 Configuration parameters for a Stereo algorithm. More...
 

Typedefs

typedef struct dwStereoPVAObject * dwStereoPVAHandle_t
 A pointer to the handle representing a stereo algorithm on PVA. More...
 

Enumerations

enum  dwStereoPVAMode {
  DW_STEREO_PVA_MODE_MEDIUM_QUALITY = 0,
  DW_STEREO_PVA_MODE_LOW_QUALITY = 1,
  DW_STEREO_PVA_MODE_HIGH_QUALITY = 2
}
 Stereo computation modes. More...
 
enum  dwStereoStage {
  DW_STEREO_STAGE_CPU_SYNC_CONVERT_DATA = 0,
  DW_STEREO_STAGE_VIC_ASYNC_CONVERT_DATA = 1,
  DW_STEREO_STAGE_PVA_ASYNC_PREPROCESS = 2,
  DW_STEREO_STAGE_NVENC_ASYNC_PROCESS = 3,
  DW_STEREO_STAGE_PVA_ASYNC_POSTPROCESS = 4,
  DW_STEREO_STAGE_GPU_ASYNC_POSTPROCESS = 5,
  DW_STEREO_STAGE_CPU_SYNC_PROCESS = 6
}
 Defines stages of the pipleine. More...
 

Functions

DW_API_PUBLIC dwStatus dwStereoPVA_bindInput (dwImageHandle_t left, dwImageHandle_t right, dwStereoPVAHandle_t obj)
 Binds the input images to stereo module. More...
 
DW_API_PUBLIC dwStatus dwStereoPVA_bindOutput (dwImageHandle_t disparity, dwImageHandle_t confidence, dwStereoPVAHandle_t obj)
 Binds the output images to stereo module. More...
 
DW_API_PUBLIC dwStatus dwStereoPVA_computeDisparity (dwImageHandle_t disparityMap, dwImageHandle_t confidenceMap, const dwImageHandle_t leftImage, const dwImageHandle_t rightImage, dwStereoPVAHandle_t obj)
 Executes the full pipeline and computes disparity map. More...
 
DW_API_PUBLIC dwStatus dwStereoPVA_getConfidenceImageProperties (dwImageProperties *props, dwStereoPVAHandle_t obj)
 Get output confidence image properties. More...
 
DW_API_PUBLIC dwStatus dwStereoPVA_getCUDAStream (cudaStream_t *stream, dwStereoPVAHandle_t obj)
 Gets CUDA stream used by the stereo algorithm. More...
 
DW_API_PUBLIC dwStatus dwStereoPVA_getDisparityImageProperties (dwImageProperties *props, dwStereoPVAHandle_t obj)
 Get output disparity image properties. More...
 
DW_API_PUBLIC dwStatus dwStereoPVA_initialize (dwStereoPVAHandle_t *obj, uint32_t width, uint32_t height, const dwStereoPVAParams *stereoParams, dwContextHandle_t ctx)
 Initializes the stereo algorithm with the parameters. More...
 
DW_API_PUBLIC dwStatus dwStereoPVA_initParams (dwStereoPVAParams *stereoParams)
 Initializes the StereoPVA parameters. More...
 
DW_API_PUBLIC dwStatus dwStereoPVA_process (dwStereoStage stage, dwStereoPVAHandle_t obj)
 Executes a given stage of the pipeline. More...
 
DW_API_PUBLIC dwStatus dwStereoPVA_release (dwStereoPVAHandle_t obj)
 Releases the stereo algorithm. More...
 
DW_API_PUBLIC dwStatus dwStereoPVA_reset (dwStereoPVAHandle_t obj)
 Resets the Stereo module. More...
 
DW_API_PUBLIC dwStatus dwStereoPVA_setCUDAStream (cudaStream_t stream, dwStereoPVAHandle_t obj)
 Sets CUDA stream used by the stereo algorithm. More...
 

Data Structure Documentation

◆ dwStereoPVAParams

struct dwStereoPVAParams
Data Fields
dwStereoPVAMode estimationMode Estimation mode that determines the speed and quality of stereo algorithm.
dwProcessorType processorNVENC Specifies the processor type for the stages of the pipeline which run on NVENC.

Supported options are DW_PROCESSOR_TYPE_NVENC_0, DW_PROCESSOR_TYPE_NVENC_1

dwProcessorType processorPVA Specifies the processor type for the stages of the pipeline which run on PVA.

Supported options are DW_PROCESSOR_TYPE_PVA_0, DW_PROCESSOR_TYPE_PVA_1

Typedef Documentation

◆ dwStereoPVAHandle_t

typedef struct dwStereoPVAObject* dwStereoPVAHandle_t

A pointer to the handle representing a stereo algorithm on PVA.

This object allows the computation of a disparity map given two rectified stereo images

Definition at line 65 of file StereoPVA.h.

Enumeration Type Documentation

◆ dwStereoPVAMode

Stereo computation modes.

Enumerator
DW_STEREO_PVA_MODE_MEDIUM_QUALITY 

High performance with medium quality.

DW_STEREO_PVA_MODE_LOW_QUALITY 

Ultra high performance with lowest quality.

DW_STEREO_PVA_MODE_HIGH_QUALITY 

High quality with low performance.

Definition at line 70 of file StereoPVA.h.

◆ dwStereoStage

Defines stages of the pipleine.

Enumerator
DW_STEREO_STAGE_CPU_SYNC_CONVERT_DATA 

Convert format of the image on CPU.

This stage is only executed if input images are NvMedia. It's NOOP otherwise.

DW_STEREO_STAGE_VIC_ASYNC_CONVERT_DATA 

Prepares data by converting pitch linear NvMedia image to block linear.

DW_STEREO_STAGE_PVA_ASYNC_PREPROCESS 

Generates hints for stereo disparity computation by executing the algorithm on PVA on the downscaled image.

DW_STEREO_STAGE_NVENC_ASYNC_PROCESS 

Computes disparity on NVENC.

DW_STEREO_STAGE_PVA_ASYNC_POSTPROCESS 

Refines the output of DW_STEREO_STAGE_NVENC_ASYNC_PROCESS based on the confidence map received from the DW_STEREO_STAGE_PVA_ASYNC_PREPROCESS.

DW_STEREO_STAGE_GPU_ASYNC_POSTPROCESS 

Schedules extracting disparity information and streaming of data from PVA back to GPU.

DW_STEREO_STAGE_CPU_SYNC_PROCESS 

A blocking stage to ensure that the computation is finalized.

Definition at line 58 of file StereoPVA_processpipeline.h.

Function Documentation

◆ dwStereoPVA_bindInput()

DW_API_PUBLIC dwStatus dwStereoPVA_bindInput ( dwImageHandle_t  left,
dwImageHandle_t  right,
dwStereoPVAHandle_t  obj 
)

Binds the input images to stereo module.

Parameters
[in]leftLeft image of format DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR
[in]rightRight image of format DW_IMAGE_FORMAT_YUV420_UINT8_SEMIPLANAR
[in]objSpecifies the StereoPVA handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
Note
If an image is provided in CUDA, it'll be streamed to NvMedia internally.
If an image is provided in NvMedia, the first stage will be executed

◆ dwStereoPVA_bindOutput()

DW_API_PUBLIC dwStatus dwStereoPVA_bindOutput ( dwImageHandle_t  disparity,
dwImageHandle_t  confidence,
dwStereoPVAHandle_t  obj 
)

Binds the output images to stereo module.

Parameters
[in]disparityDisparity image of format DW_IMAGE_FORMAT_R_INT16
[in]confidenceConfidence image of format DW_IMAGE_FORMAT_R_UINT16
[in]objSpecifies the StereoPVA handle.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST
Note
If an image is provided in CUDA, it'll be streamed to NvMedia internally.
If an image is provided in NvMedia, the first stage will be executed

◆ dwStereoPVA_computeDisparity()

DW_API_PUBLIC dwStatus dwStereoPVA_computeDisparity ( dwImageHandle_t  disparityMap,
dwImageHandle_t  confidenceMap,
const dwImageHandle_t  leftImage,
const dwImageHandle_t  rightImage,
dwStereoPVAHandle_t  obj 
)

Executes the full pipeline and computes disparity map.

The pipeline runs on the following engines:

  • VIC (scaling & converting data)
  • PVA (hint generation)
  • NVENC (stereo disparity computation)
  • PVA (refining results)
  • GPU (copying memory back to GPU)
Parameters
[out]disparityMapDisparity map
[out]confidenceMapConfidence map
[in]leftImageLeft image. Expected YUV
[in]rightImageThe left 8 bit rectified image pyramid.
[in]objThe stereo algorithm handle.
Returns
DW_NVMEDIA_ERROR - if the underlying stereo algorithm had an internal error.
DW_INTERNAL_ERROR - if the underlying stereo algorithm had an internal error.
DW_INVALID_HANDLE - if given handle is not valid, i.e. null or of wrong type .
DW_SUCCESS

◆ dwStereoPVA_getConfidenceImageProperties()

DW_API_PUBLIC dwStatus dwStereoPVA_getConfidenceImageProperties ( dwImageProperties props,
dwStereoPVAHandle_t  obj 
)

Get output confidence image properties.

Parameters
[out]props
[in]obj
Returns
DW_INVALID_HANDLE if the given context handle is invalid,i.e. null or of wrong type
or DW_SUCCESS otherwise.

◆ dwStereoPVA_getCUDAStream()

DW_API_PUBLIC dwStatus dwStereoPVA_getCUDAStream ( cudaStream_t *  stream,
dwStereoPVAHandle_t  obj 
)

Gets CUDA stream used by the stereo algorithm.

Parameters
[out]streamThe CUDA stream currently used by the stereo algorithm.
[in]objThe stereo algorithm handle.
Returns
DW_INVALID_HANDLE if the given context handle is invalid, i.e. null or of wrong type
or DW_SUCCESS otherwise.

◆ dwStereoPVA_getDisparityImageProperties()

DW_API_PUBLIC dwStatus dwStereoPVA_getDisparityImageProperties ( dwImageProperties props,
dwStereoPVAHandle_t  obj 
)

Get output disparity image properties.

Parameters
[out]props
[in]obj
Returns
DW_INVALID_HANDLE if the given context handle is invalid,i.e. null or of wrong type
or DW_SUCCESS otherwise.

◆ dwStereoPVA_initialize()

DW_API_PUBLIC dwStatus dwStereoPVA_initialize ( dwStereoPVAHandle_t obj,
uint32_t  width,
uint32_t  height,
const dwStereoPVAParams stereoParams,
dwContextHandle_t  ctx 
)

Initializes the stereo algorithm with the parameters.

Parameters
[out]objA pointer to the stereo algorithm on PVA.
[in]widthThe width of one input image.
[in]heightThe height of one input image.
[in]stereoParamsA pointer to the configuration of the stereo algorithm.
[in]ctxthe handle to DW context.
Returns
DW_CUDA_ERROR - if the underlying stereo algorithm had a CUDA error.
DW_INVALID_HANDLE - if given handle is not valid, i.e. null or of wrong type .
DW_SUCCESS

◆ dwStereoPVA_initParams()

DW_API_PUBLIC dwStatus dwStereoPVA_initParams ( dwStereoPVAParams stereoParams)

Initializes the StereoPVA parameters.

Parameters
[out]stereoParamsParameters to be initialised with default values.
Returns
DW_INVALID_HANDLE - if given handle is not valid, i.e. null or of wrong type .
DW_SUCCESS

◆ dwStereoPVA_process()

DW_API_PUBLIC dwStatus dwStereoPVA_process ( dwStereoStage  stage,
dwStereoPVAHandle_t  obj 
)

Executes a given stage of the pipeline.

Parameters
[in]stageStage to execute.
[in]objSpecifies the StereoPVA handle.
Note
The stages must be executed in the order of the enumeration.
Returns
DW_SUCCESS, DW_INVALID_HANDLE, DW_BAD_CAST, DW_INVALID_ARGUMENT

◆ dwStereoPVA_release()

DW_API_PUBLIC dwStatus dwStereoPVA_release ( dwStereoPVAHandle_t  obj)

Releases the stereo algorithm.

This method releases all resources associated with a stereo algorithm.

Note
This method renders the handle unusable.
Parameters
[in]objThe object handle to be released.
Returns
DW_SUCCESS
DW_INVALID_HANDLE - If the given context handle is invalid,i.e. null or of wrong type
DW_BAD_CAST

◆ dwStereoPVA_reset()

DW_API_PUBLIC dwStatus dwStereoPVA_reset ( dwStereoPVAHandle_t  obj)

Resets the Stereo module.

Parameters
[in]objSpecifies the stereo handle to reset.
Returns
DW_SUCCESS
DW_INVALID_HANDLE - If the given context handle is invalid,i.e. null or of wrong type
DW_BAD_CAST

◆ dwStereoPVA_setCUDAStream()

DW_API_PUBLIC dwStatus dwStereoPVA_setCUDAStream ( cudaStream_t  stream,
dwStereoPVAHandle_t  obj 
)

Sets CUDA stream used by the stereo algorithm.

Parameters
[in]streamThe CUDA stream.
[in]objThe stereo algorithm handle.
Returns
DW_INVALID_HANDLE if the given context handle is invalid,i.e. null or of wrong type
or DW_SUCCESS otherwise.