-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Obtaining Actual Depth Values with the L515 #12904
Comments
Hi @CCCCCCCT The RealSense SDK's rs-hello-realsense C++ example program demonstrates printing the actual real-world depth (distance) value in meters as a plain-text value. https://github.com/IntelRealSense/librealsense/tree/master/examples/hello-realsense If you have installed the RealSense SDK (librealsense) and its tools and examples then you can find a pre-built executable version of rs-hello-realsense at the following locations on your computer. Windows Linux If you are using the Python language then #9939 provides an example of code for printing the distance value. |
Hi @CCCCCCCT Do you require further assistance with this case, please? Thanks! |
import pyrealsense2 as rs pipeline = rs.pipeline() Start streamingpipeline.start() frames = pipeline.wait_for_frames() width = depth.get_width() dist = depth.get_distance(int(width/2), int(height/2)) print(dist) Stop streamingpipeline.stop() Hello! I have carefully tried it out, so the values I have here need to be multiplied by the default depth scale of the L515 to obtain the actual depth distance, right? |
If you are using get_distance then you do not need to multiply the values by the depth scale, as get_distance() outputs the real-world distance in meters. |
Hi @CCCCCCCT Do you require further assistance with this case, please? Thanks! |
Hello, I can now import photos, but I still can't use python code to get the distance in the photo. Now I can use the L515 to directly turn on the camera to check the distance inside the camera, but this is not what I want. Now I use opencv to check the depth of the pixel in the photo, but I think this is not right because my depth map is a png file. |
I am thinking whether I should read the raw file, because my Depth file is png |
Saving RealSense depth data to PNG causes a lot of the depth information to be lost, whilst a .raw file preserves the depth. An example of Python code for exporting depth to .raw that was verified as correct by a RealSense team member is at IntelRealSense/realsense-ros#1312 For C++ users there is an example provided at #1485 (comment) |
Thank you very much, I'll do it right away |
Hi @CCCCCCCT Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
I currently have a depth map of 320240, and I also have an RGB image of 640480. How can I obtain the actual depth values in the depth map captured with my L515?
I can directly see the depth values using an application, but now I want to obtain the depth values from the captured images. I think this is a simple problem, but I've been stuck on it for a while. Please help me resolve this confusion. I would be very grateful.
The text was updated successfully, but these errors were encountered: