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

Python save to disk example #9448

Closed
chain-tech opened this issue Jul 20, 2021 · 6 comments
Closed

Python save to disk example #9448

chain-tech opened this issue Jul 20, 2021 · 6 comments
Labels

Comments

@chain-tech
Copy link

  • 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 :)


Required Info
Camera Model { R200 / F200 / SR300 / ZR300 / D400 }
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version {Win (8.1/10) / Linux (Ubuntu 14/16/17) / MacOS
Kernel Version (Linux Only) (e.g. 4.14.13)
Platform PC/Raspberry Pi/ NVIDIA Jetson / etc..
SDK Version { legacy / 2.. }
Language {C/C#/labview/nodejs/opencv/pcl/python/unity }
Segment {Robot/Smartphone/VR/AR/others }

Issue Description

Hi, I have been exploring the node and python examples. I was able to play with node module to capture and save using the available examples.
However, for python wrapper, I don't get a straight forward answer to save depth and color images. I searched a lot in the issues as well but could not get a simple answer.
All i'm looking is a python equivalent of nodejs-save-to-disk.js that can save color and depth image. Please help

@MartyG-RealSense
Copy link
Collaborator

Hi @chain-tech The link below provides an example of Python scripting for exporting depth and color frames as PNG images using the imwrite instruction.

#2877 (comment)

A more advanced example that makes use of alignment is here:

#3658

@chain-tech
Copy link
Author

chain-tech commented Jul 20, 2021

Thanks @MartyG-RealSense , I have already gone through those links you shared. But was searching a lot to see if there's more better/easier option. I will try to work more with those examples you shared.
I am wondering why the python save to disk part is more complicated compared to the node version and why there's predefined example in the list of sample examples.

@MartyG-RealSense
Copy link
Collaborator

Another approach to color and depth file export is to save the color as a PNG and the depth as an array of scaled matrices in an .npy file, like in the Python script in the link below.

#4934 (comment)

An alternative export method is to use the save_single_frameset instruction to save each individual frame as a bag file instead of an image file.

#2588 (comment)

@MartyG-RealSense
Copy link
Collaborator

Hi @chain-tech Do you require further assistance with this case, please? Thanks!

@chain-tech
Copy link
Author

Hi @MartyG-RealSense , Thanks for your help on this so far. Closing the ticket now.

@MartyG-RealSense
Copy link
Collaborator

Thanks very much @chain-tech for the update!

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

No branches or pull requests

2 participants