I am trying to run vpiSubmitStereoDisparityEstimator. I use OFA+PVA+VIC backends.
I have 2 questions.
1. How to obtain valid disparity images when using VPI_STEREO_CONFIDENCE_ABSOLUTE or RELATIVE
I observed that, except when confidenceThreshold is set to 0 (i.e., disabling disparities with confidence below the threshold), setting confidenceType to VPI_STEREO_CONFIDENCE_ABSOLUTE or RELATIVE results in a disparity image of all zeros. When I use the CUDA backend, a correct disparity image is produced in either case; I confirmed that the behavior differs by backend. The result was the same regardless of whether a confidenceMap was created.
Working code (produces correct disparity image):
vpiInitStereoDisparityEstimatorParams(&submitParams);
submitParams.confidenceType = VPI_STEREO_CONFIDENCE_ABSOLUTE; // or RELATIVE
submitParams.confidenceThreshold = 0;
vpiSubmitStereoDisparityEstimator(stream, backends, stereo, Left, Right, disparity, confidenceMap, &submitParams));
Non-working code (produces black / zero disparity image):
vpiInitStereoDisparityEstimatorParams(&submitParams);
submitParams.confidenceType = VPI_STEREO_CONFIDENCE_ABSOLUTE; // or RELATIVE
submitParams.confidenceThreshold = 32767; // Default value. Not set to 0.
vpiSubmitStereoDisparityEstimator(stream, backends, stereo, Left, Right, disparity, confidenceMap, &submitParams));
2. Effect of confidenceThreshold when confidence map flags are NULL
When I create a confidence map, the disparity map changes depending on confidenceThreshold (disparities below the threshold are invalidated). However, when the confidence map flags argument is NULL, I cannot obtain a valid disparity image unless confidenceThreshold = 0; otherwise I get a zero disparity image.
Working code (produces correct disparity image):
vpiInitStereoDisparityEstimatorParams(&submitParams);
submitParams.confidenceType = VPI_STEREO_CONFIDENCE_INFERENCE;
submitParams.confidenceThreshold = 32767; // Default value. Not set to 0.
vpiSubmitStereoDisparityEstimator(stream, backends, stereo, Left, Right, disparity, confidenceMap, &submitParams));
Non-working code (produces black / zero disparity image):
vpiInitStereoDisparityEstimatorParams(&submitParams);
submitParams.confidenceType = VPI_STEREO_CONFIDENCE_INFERENCE;
submitParams.confidenceThreshold = 32767; // Default value. Not set to 0.
vpiSubmitStereoDisparityEstimator(stream, backends, stereo, Left, Right, disparity, NULL, &submitParams));
Settings used in all tests
uint64_t backends = VPI_BACKEND_OFA | VPI_BACKEND_PVA | VPI_BACKEND_VIC;
VPIImageFormat InputFormat = VPI_IMAGE_FORMAT_Y8_ER_BL;
VPIImageFormat disparityFormat = VPI_IMAGE_FORMAT_S16;
vpiInitStereoDisparityEstimatorCreationParams(&createParams);
createParams.maxDisparity = 256;
vpiInitStereoDisparityEstimatorParams(&submitParams);
submitParams.numPasses = 1;
submitParams.windowSize = 1;
System details
NVIDIA Jetson AGX Orin
L4T 36.4.7 (JetPack 6.2.1)
Ubuntu 22.04.5 LTS
Kernel Version: 5.15.148-tegra
CUDA 12.6.68
OpenCV 4.8.0
OpenCV CUDA: NO
cuDNN: 9.3.0.75
VPI: 3.2.4
Vulkan: 1.3.204
Sorry for my poor English. Thank you.
