IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.6k stars 4.83k forks source link

How can I get the depth values from the raw image/png images in centimeters/millimeters? I want to get the high precision values. Not by just converting the meters into centimeters. #4577

Closed arake001 closed 5 years ago

arake001 commented 5 years ago

Required Info
Camera Model { R200 / F200 / SR300 / ZR300 / D400 }
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version {Win (8.1/10) / Linux (Ubuntu 14/16/17) / MacOS
Kernel Version (Linux Only) (e.g. 4.14.13)
Platform PC/Raspberry Pi/ NVIDIA Jetson / etc..
SDK Version { legacy / 2.<?>.<?> }
Language {C/C#/labview/nodejs/opencv/pcl/python/unity }
Segment {Robot/Smartphone/VR/AR/others }

Issue Description

<Describe your issue / question / feature request / etc..>

ev-mp commented 5 years ago

@ankith001 , to convert the raw depth data (uint16_t) into metric values you need to multiply those by the depth_scale value ,e.g. Link:

depth_scale = profile.get_device().first_depth_sensor().get_depth_scale()

This multiplication is also performed internally in rs-hello-realsense example

You cannot extract depth values from the exported PNG (colored) depth images. The color mapping is a one-way function due to histogram equalization.

RealSenseCustomerSupport commented 5 years ago

@ankith001, can we close this ticket if there is no further question?