-
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
Capturing and exporting raw file #10431
Comments
Hi @NguyenKhanh27 An example of Python code for exporting depth to .raw that was verified as correct by a RealSense team member is at IntelRealSense/realsense-ros#1312 For C++ users there is an example provided at #1485 (comment) |
Thanks @MartyG-RealSense for replying my problem, the mentioned topic seems not to have the way to save depth to raw, it was focused onto how to read the bag file mostly :< |
Exporting to PNG is a much more common method of exporting RealSense depth data to an image file but yes, most of the depth information is lost when saving as a PNG, whereas the .raw format preserves the depth information. I researched converting to .raw in OpenCV and Python with imwrite but did not find any useful leads either or other methods in librealsense for .raw export. An alternate approach in Python to preserve the depth information during export may be to save it as an .npy file, which can then be imported into other Python applications such as PyTorch. A librealsense Python script for doing so is at #4934 (comment) |
Yes I could do it, but just further question, has there been any post relating to process the NPY file for depth information? If there is, please mention for it. Thank you sm! |
gdlg/panoramic-depth-estimation#3 - whilst not a librealsense case - advises loading an .npy file containing depth data with the numpy instruction np.load to retrieve the depth values. https://numpy.org/doc/stable/reference/generated/numpy.load.html |
Im not yet found the way to work with npy file since it save a 3x3 matrices for each pixel and it seems to save 848x160 instead of 848x480, but thank you so much for the support ! |
Hi @NguyenKhanh27 Do you require further assistance with this case, please? Thanks! |
Hi, Yes I'm done with the case and thanks for the help! Topic closed |
You are very welcome. Thanks for the update! |
|
I have used numpy load for that,
And when I save raw value to .npy file, I save depth_image only, not depth_color_image:
I didnt work with .bag file tho so yea homie x.x |
Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):
All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)
Issue Description
Im newbie to IntelRealsense camera. Is there anyway to capture and save raw file (image) so that I can later use it to extract depth data. I work with Python for the project, Thanks for any helps, I appreciate!
The text was updated successfully, but these errors were encountered: