Items with no label
3335 Discussions

Depth Data Extraction Real Sense SR300

PBal
Beginner
1,743 Views

Hello!

This may be a silly question, but I've been trying to figure out how to extract the depth data from my SR300 real sense depth frames. I've seen some people say that you need to extract the depth at a certain point (using OpenCV by the way), such as: image.at(i,j); however this was in relation to getting values from a kinect, where the output was in millimeters.

So basically, do I still use an unsigned integer, or something else (and I suppose moreover why?), as well as what does the output mean (ie is it millimeters, some relative depth info, or something else?)

Thanks in advance, I'm having a hard time finding this information online.

0 Kudos
5 Replies
MartyG
Honored Contributor III
287 Views

If you are using the RealSense SDK 2.0 software with your SR300, there is a simple OpenCV example script for getting the depth.

https://github.com/IntelRealSense/librealsense/tree/master/wrappers/opencv/imshow librealsense/wrappers/opencv/imshow at master · IntelRealSense/librealsense · GitHub

0 Kudos
PBal
Beginner
287 Views

Ah yes I'm aware of how to get the depth frames, but how to I get the depth value at a certain point? Like how deep something is at a certain pixel or region?

0 Kudos
MartyG
Honored Contributor III
287 Views

Like you, I researched the internet thoroughly about finding the pixel depth in OpenCV. The best I could locate was this one, which doesn't relate specifically to RealSense cameras:

https://answers.ros.org/question/243901/the-pixel-depth-value-opencv-image-coming-out-of-zed/ https://answers.ros.org/question/243901/the-pixel-depth-value-opencv-image-coming-out-of-zed/

0 Kudos
PBal
Beginner
287 Views

Ah gotchu. Well just so it's on the internet I think the kind of image in open c.f. for the sr300 series is a CV_8UC3 meaning it has an 8 bit unassigned integer type and has 3 channels. Not 100% sure but that's what your earlier link implies. Thank you for your help.

0 Kudos
MartyG
Honored Contributor III
287 Views

You're very welcome. I'm sorry I could not provide a more definite answer. When it comes to the mysteries of OpenCV, I am always learning as I go with each new case. Good luck!

0 Kudos
Reply