Taking the input from opencv and pass to ZED SDK to calculate Depth

Hi Team,

We are working on getting the Depth Sensing output out of ZED2i camera. We are able to get the depth sensing output on ZED 2i camera using the Sample code given in the official Github Repository.Now trying to take live input from ZED 2i camera using opencv commands, and get Depth map as output.

We see
“sl.InitParameters(depth_mode=sl.DEPTH_MODE.ULTRA”
“zed.grab(runtime_parameters)”
“zed.get_camera_information().camera_model”
“zed.retrieve_measure(point_cloud, sl.MEASURE.XYZRGBA,sl.MEM.CPU, res)”

we are replacing .grab with cap.read() there by to capture frames with CV command
so could you please let us know that is this scenario possible or not and if possible please give the code.

Thank you

Hi,

if you want to use the ZED SDK data within opencv you can refer to this:

on the other hand if you want to use opencv for the whole workflow, you can use this:

Hi SL-PY R&D - Stereolabs,

Thank you for the response, but we want to take input live feed from ZED camera but by giving opencv commands “cap = cv2.VideoCapture(0)” and cap.read(). and get the Depth sensing output using “zed.get_camera_information().camera_model" and “zed.retrieve_measure(point_cloud, sl.MEASURE.XYZRGBA,sl.MEM.CPU, res)”.
So could you please give like that.

Thank you

this can not be done.
The ZED SDK is only compatible with ZED Camera.
To able to use our depth algorithm you have to open the ZED Camera and use the Camera::grab() function.