We are using the StereoDisparityEstimator in VPI 3.0 on the OFA backend. This produces a block-linear S16 disparity image. To use this result, we convert it into a pitch-linear S16 VpiImage via vpiSubmitConvertImageFormat (on the VIC). This pitch linear image is wrapped around our own CUDA allocation (an OpenCV GpuMat) via vpiImageCreateWrapper, so that we can use it for further processing.
Our input size for the stereo disparity estimator is 1920x1200. We tried all supported downscale factors on the OFA (1,2,4,8) and noticed that all worked but 8, for which our call to convert the block linear image into a pitch linear one failed with the following error: VPI_ERROR_INTERNAL (NvError_NotSupported). Again, the VIC is used as the backend for all these conversions.
I tried creating the pitch linear S16 image using vpiImageCreate directly, without wrapping it, and the conversion no longer appears to fail. So it seems like there are some limitations when converting a block linear image to a pitch linear one that has been wrapped around external memory. This limitation does not appear to be documented, or at least I could not find much information about it, so I am wondering if any more information can be provided regarding this issue. It would be convenient to get our block linear disparity image into a GpuMat directly if possible, though we can probably convert to a new VpiImage first and then into a wrapped GpuMat instead it seems.
Both the block linear image and pitch linear wrapper are created with the OFA, VIC, and CUDA backends enabled.
* more context:
- both the wrapped image and the image made through VPI have the same pitch as well
- converting from wrapped pitch linear images into block linear images seems to work fine, though not the other way around, as described above.
- after further testing, it appears that we can’t convert from an S16 vpiImage to a wrapped S16 vpiImage either. Such a conversion only appears to be possible on the CUDA backend, not the VIC