-
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
Question of Alignment image and Depth Scale unit on D405 #12918
Comments
Question 3: Different intrinsic parameters after alignment
Why are the intrinsic parameters different after alignment? Shouldn't they be the same? |
Hi @qidihan The Align & Background Removal script that you refer to, also known as align_depth2color.py, uses 640x360 for its alignment resolution by default. At #11329 a RealSense user created a specially edited version of this script for use on D405 and set the resolution to 640x480 but found that it had problems with the alignment. In the end they settled for using 640x360. Yes, the default depth unit scale of D405 is 0.01. 9.999999747378752e-05 when input into the RealSense Viewer's depth unit scale option auto-converts it into a value of 0.0001, whilst changing the '05' on the end of the value to '02' is required in order for the Viewer to recognize it as 0.01. It may be unnecessary to retrieve and output the depth scale, as the default scale for a particular camera will be automatically applied (0.01 for D405 and 0.001 for the rest of the 400 Series range) and will not change unless deliberately changed by user input or by a program instruction that sets the depth scale value. Each resolution has different intrinsic fx / fy values. The default resolution of D405 for depth and color is 848x480. After checking the intrinsics of my own D405, I wonder if you are seeing the intrinsics for 848x480 when alignment is not being performed, but when the alignment script is run and resolution is set at 640x360, you are seeing the different intrinsics for 640x360 resolution. |
Thank you for your response. I still have some questions regarding the depth image unit.
I'm unsure what unit the output depth_image.max() value represents. Could you please clarify what unit this value is in? For example, it outputs 65536, which I guess to be equivalent to 655.36mm (how it relates to 0.01 depth scales?). However, I'm unsure how to relate this to the unit millimeter.
Get depth profile and camera intrinsics
|
0 to 65536 represents the depth as a pixel depth value. To convert this value to real-world distance, you multiply it by the depth scale of the camera. For example, if a non-D405 camera was being used then its default scale would be 0.001, so 65535 x 0.001 = would be 65.535 (meters). However, D405 (which is a short-range camera) uses a scale of 0.01 by default. This is centimeter scale instead of millimeter scale. So 65535 x 0.01 = 655.35 (centimeters), equivalent to 6.5535 meters. So you would multiply the centimeter result by 10 to get the distance in millimeters. When the |
Hi @qidihan Do you require further assistance with this case, please? Thanks! |
Issue Description
Question 1: Alignment issue with 640x480 resolution
I've encountered an alignment issue when using the rs.align() function with a 640x480 resolution. I've run the example codes for "Rendering depth and color with OpenCV and Numpy" and "Align & Background Removal". I noticed that alignment fails when using 640x480, but works with 640x320 or 1280x720. Additionally, the example code for "Rendering depth and color with OpenCV and Numpy" also aligns correctly. Does this indicate that using rs.align() with only 640x480 is incorrect or unable to align?
Question 2: Depth scale and unit conversion
I'm trying to record RGB and depth images in PNG files, stored in millimeter units (mm) with uint16 format. However, I'm unsure if my code is correct. (# cv2.imwrite((depthpath+ filename), (depth_image*10).astype(np.uint16)))I've seen issues mentioning that the d405 camera's depth scale is 0.01, but my output shows:
Python
I don't fully understand this unit. Can someone explain it to me and tell me how to set up my code to output the depth image with millimeter units?
The text was updated successfully, but these errors were encountered: