-
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
Conversion between disparity map and depth map #7431
Comments
Hi @anguyen216 Depth values displayed as a large 16-bit uint value (in a range between 0 and 65535) can be converted to meters by multiplying the value by the depth unit scale. You can retrieve the current depth unit scale from the camera, though it is easier just to multiply by 0.001 (the default depth unit scale value of the 400 Series cameras). For example, a unint of 65535 becomes 65.535 meters when multiplied by 0.001. This is discussed further in this link: Regarding displaying a disparity map with Python, the tutorial in the link below for doing so with Python and OpenCV may be a useful alternate reference to the guide that you already found: https://docs.opencv.org/3.4/dd/d53/tutorial_py_depthmap.html The subject of disparity map generation is also discussed in detail at this link: I will refer your question about casting values into floats to @dorodnic as he was the RealSense team member who discussed it originally |
@anguyen216 , to clarify:
dp_filter = rs.disparity_transform()
dp = dp_filter.process(depth)
dp_data = np.asanyarray(dp.get_data()) The values obtained with
The depth information that is retrieved using Librealsense API is in meters, e.g. |
Hi @anguyen216 Do you require further assistance with this case, please? Thanks! |
@MartyG-RealSense @ev-mp Thank you both for helping. |
@MartyG-RealSense Thank you for all the help! I have resolved all my issues so far. |
Great news - thanks very much @anguyen216 for the update! |
What is the value of this constant that the disparity is multiplied with? |
Issue Description
How do I convert a frame's depth map (extracted using the following code) to disparity map. Especially in the case where I only have access to the depth frame data and not the composite depth frame object.
I followed the following tutorial to transform the depth frame using disparity transform and get the following values (first matrix in the image below). What is the meaning of these values? The tutorial mentioned casting the values into floats, but that doesn't make much sense to me. Can somebody elaborate more on the casting part?
Also, the documentation on D400 camera mentioned that the depth information is in meters. However, the values in the depth matrix are all over 1000 (refer to the second matrix in the image below). I don't suppose that it is indeed 1000 meters. How do I get the depth values in meters?
The text was updated successfully, but these errors were encountered: