Skip to content
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

How to get depth values from the depth PNG image? #4427

Closed
kcshum opened this issue Jul 14, 2019 · 3 comments
Closed

How to get depth values from the depth PNG image? #4427

kcshum opened this issue Jul 14, 2019 · 3 comments

Comments

@kcshum
Copy link

kcshum commented Jul 14, 2019

| Camera Model | D435 |
| Firmware Version | 05.11.06.250 |
| Operating System & Version | Win 10 |
| SDK Version | 2.24.0 |

I have converted a recorded bag file to RGB and depth image(PNG format) using rs-converter. Now I want to get the depth values of each pixel directly from the depth image without using the RealsenseD435 device.

I noticed that there is a similar issue posted before. For the code provided(#2200 (comment)), 'cout << frame.at(i,j)[0]<< frame.at(i,j)[1]<< frame.at(i,j)[2]<< endl;' gets three values from the png file.

I am wondering what these three values mean for the depth image. Do I need to do some extra work to get the actual depth value? Do all these three values represent a single pixel?

Looking for your reply.

@MartyG-RealSense
Copy link
Collaborator

If you wanted to get depth data from a saved file, I would be inclined to use the rs-convert tool to convert the bag to .raw format instead of .png. With PNG, depth data will be be lost when the PNG is created, whilst a .raw file preserves the depth information.

#3640

The link below provides some code for getting depth information from a .raw file.

#2231 (comment)

@dorodnic
Copy link
Contributor

As discussed here several times before, there is no effective way to get depth back from PNG representation.

@kcshum
Copy link
Author

kcshum commented Jul 14, 2019

Thank you for your reply. It solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants