I’m currently running vpi 2.1 stereo disparity example from vpi_sample_02_stereo_disparity on Jetson (Jetpack 5.0.2).
The results have a lot of noise in the background – mainly in the sky.
The sky in this example image (input) is clear.
It looks like the confidence of the sky is much lower.
You can try to update the disparity value if the confidence value is not high enough in that region.
Thanks for giving it a try.
As mentioned above, I’ve tried different combinations of disparity values block sizes, confidence threshold, and quality to see if I can get a better result.
I was not able to get rid of the sky noise.
Could you share the script that generates OpenCV and VPI results?
So we can discuss this with the internal team to see if any parameter can be adjusted.
More, since there is a maximum limitation in the searching region.
Could you try the algorithm with a downscaled image pair?
Thanks for the reply!
The script I’m using is the sample application code from vpi2 pkg:
/opt/nvidia/vpi2/samples/02-stereo_disparity/
Except I added a few lines to configure the parameters mentioned above (confidence threshold, max disparity, quality, and window size)
// Set algorithm parameters to be used. Only values what differs from defaults will be overwritten.
VPIStereoDisparityEstimatorCreationParams stereoParams;
CHECK_STATUS(vpiInitStereoDisparityEstimatorCreationParams(&stereoParams));
stereoParams.maxDisparity = 256;
VPIStereoDisparityEstimatorParams stereoDispParams;
stereoDispParams.confidenceThreshold = 65280;
stereoDispParams.maxDisparity = stereoParams.maxDisparity;
stereoDispParams.quality = 6;
stereoDispParams.windowSize = 7;
I’ll attach the main.cpp anyway: main.cpp (16.5 KB)
I have tried down-sampling which seemed to have made a difference in CUDA backend, but not with PVA-NVENC-VIC backend. In the script, the latter backend option down-samples already so this would not be beneficial.