vpi.stereodisp
- vpi.stereodisp(left: vpi.Image, right: vpi.Image, *, backend: vpi.Backend = vpi.Backend.DEFAULT, out: Optional[vpi.Image] = None, downscale: Optional[int] = 1, out_confmap: vpi.Image = None, window: int = 5, maxdisp: int = 64, confthreshold: int = 32767, quality: int = 6, stream: vpi.Stream = None) vpi.Image
Runs stereo processing on two images.
Runs stereo processing on a pair of images and outputs a disparity map and (optionally) a confidence map.
See also
Refer to the algorithm explanation for more details and usage examples.
- Parameters
left (vpi.Image) – Left stereo input image.
right (vpi.Image) – Right stereo input image.
out (vpi.Image, optional) – Image where the disparity values will be written to. Returned values are in Q10.5 format, i.e., signed fixed point with 5 fractional bits. Divide it by 32 to convert it to floating point.
downscale (int, optional) – Output’s downscale factor with respect to the input’s resolution.
out_confmap (vpi.Image, optional) – Image containing a confidence score telling how accurate the disparity is. Returned confidence range from 0 to 65535. The higher the confidence, more accurate is the corresponding disparity.
window (int, optional) – Represents the median filter size (on PVA+NVENC+VIC or OFA+PVA+VIC backend) or census transform window size (other backends) used in the algorithm.
maxdisp (int, optional) – Maximum disparity for matching search.
confthreshold (int, optional) – Confidence threshold above which disparity values are considered valid. Only used in CUDA, PVA+NVENC+VIC, and OFA+PVA+VIC backends. Expects value between 1 to 65280, values outside this range get clamped.
quality (int, optional) – Quality of disparity output. It’s only applicable when using PVA+NVENC+VIC backend. The higher the value, better the quality and possibly slower perf. Expects a value between 1 and 8.
backend (vpi.Backend, optional) – The backend to be used by the algorithm.
stream (vpi.Stream, optional) – The stream to be used by the algorithm.
- Returns
The disparity map output of the algorithm.
- Return type
Caution
Restrictions to several arguments may apply. Check the C API references of the submit function and the group concepts for more details.