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

Reading .raw file into Python numpy array #13758

Open
salilpDev opened this issue Feb 12, 2025 · 2 comments
Open

Reading .raw file into Python numpy array #13758

salilpDev opened this issue Feb 12, 2025 · 2 comments

Comments

@salilpDev
Copy link

salilpDev commented Feb 12, 2025

Hello,

I took some snapshots in the RealSense Viewer, which gave a PNG, CSV, and a .raw file. How do I read the .raw file in python so that the depth values will be in some sort of numpy array?

I'm using a D455F camera. All of these are from .bag videos, so if there is a way to save certain frames from a bag and read their data that would be helpful as well

Thanks,
Sal

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Feb 12, 2025

Hi @salilpDev A discussion at the link below about reading a .raw file with Python may be a helpful reference. It contains links to all the information that is currently available about the subject.

https://support.intelrealsense.com/hc/en-us/community/posts/11024587584915-How-to-get-the-depth-information-from-raw-file-python

In regard to extracting frames from a bag, there are a couple of tools. The RealSense SDK's rs-convert tool can extract frames to a range of file formats, whilst the rs_bag2image tool created by a RealSense user can extract to jpg and png image files.

https://github.com/IntelRealSense/librealsense/tree/master/tools/convert

https://github.com/UnaNancyOwen/rs_bag2image

These tools will extract all the frames of a bag to individual files rather than isolating specific frames though.

@MartyG-RealSense
Copy link
Collaborator

Hi @salilpDev Do you require further assistance with this case, please? Thanks!

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

No branches or pull requests

2 participants