-
Notifications
You must be signed in to change notification settings - Fork 1.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
Potentially damaged during conversion to uint16 depth images using Intel RealSense D435?? #2922
Comments
Hi @monajalal Another RealSense user who was trying to export a 16-bit depth image had a similarly incorrect image at IntelRealSense/librealsense#7081 (comment) They then tried using OpenCV code at IntelRealSense/librealsense#7081 (comment) to perform the conversion of the RealSense image to 16-bit mat.
|
Can you please show the equivalent of the C++ code you wrote above embedded in the Python code below? I did some searching didn't find the equivalent of CV_16UC1 in python cv2. Also, the author of BundleSDF suggested to multiply the depth values by 1000 and also save them as np.uni16 using astype. Any chance you could share how to change the code below?
Also, could you please let me know what is the English term for the problem in the depth image below? What has caused it? I don't see a problem when I do depth align raw depth image in rviz2. I am curious what line of code has caused this problem? |
I was not able to find a Python equivalent of the C++ code either, unfortunately. I believe that this is because Python handles conversion of RealSense data to cv:: differently by accessing data stored in a numpy array and then rendering it as a mat image. The script at IntelRealSense/librealsense#3658 may be a useful Python reference for accessing depth data stored in a numpy array and saving it to a PNG file. I do not have a suggestion to offer about adapting the Python script above either and do not know about BundleSDF. I have also not previously seen others using the approach of multiplying by 1000 to obtain a 16-bit CV image. I sincerely apologize. |
@MartyG-RealSense thanks for sharing the link. When I use this script https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/align-depth2color.py I get so much noise in my capture (light gray colors and such on the blue cup and the object is quite close to the D435 camera). I don't see this problem when I visualize my depth aligned capture by ros inside
and here is what I see if I do depth aligned capture in rviz2 using ros2 humble Further, if it may deem helpful, I documented my question with all details in one post here https://stackoverflow.com/questions/77439308/fixing-the-repetitive-wave-structure-in-depth-map-when-writing-to-disk |
Also @MartyG-RealSense I saw your response here:
and taking only the first channel as in I wonder if any of these two lines is causing it? Thanks for your feedback. |
In close range situations where there are gray areas overlaid then the image may improve if the depth scale is changed from the default 0.001 to 0.0001. Python code for setting the depth unit value can be found at IntelRealSense/librealsense#10976 (comment) In regard to the second question, I do not know but IntelRealSense/librealsense#5414 may be a helpful Python reference in regard to converting 16-bit data and saving it as a PNG.
|
I have an update that I fixed my problem this way (our depth histograms look weirdly different)
specifically, this was the main change:
NVlabs/BundleSDF#115 --> please let me know about your thoughts on why the depth histograms are wildly different? |
@monajalal It's great to hear that you achieved a solution. Thanks very much for sharing the details of it! |
@MartyG-RealSense thanks a lot for your openness in the community and providing excellent service to the customers. |
You are very welcome. Thanks to you too for your kind words :) |
Are these depth maps damaged and if so, how can I fix them? I need them to be 16bit and I need to multiply them by 1000 as author of BundleSDF mentioned.
corresponding rgb image is:

currently, this yields with an example depth image with an identifier like this:
Here's an example of depth images from BundleSDF author:
NVlabs/BundleSDF#82 (comment)
NVlabs/BundleSDF#82 (comment)
NVlabs/BundleSDF#74 (comment)
The text was updated successfully, but these errors were encountered: