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 do I export an xyz file #11046

Closed
1215232494 opened this issue Oct 31, 2022 · 5 comments
Closed

How do I export an xyz file #11046

1215232494 opened this issue Oct 31, 2022 · 5 comments

Comments

@1215232494
Copy link

1215232494 commented Oct 31, 2022

  • 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 D400
Operating System & Version Linux (Ubuntu 20)
Language python

Issue Description

How do I export an xyz file, similar to using pyrealsense2.points.export_to_ply() export ply file in Python?

The format of .xyz file is as follows, representing xyzrgb respectively:
2022-10-31 09-59-57 的屏幕截图

@1215232494 1215232494 changed the title export an xyz file How do I export an xyz file Oct 31, 2022
@MartyG-RealSense
Copy link
Collaborator

Hello, if you are aiming to export a color xyzrgb ply file then the only Python script for doing so with export_to_ply that is known to work is at #6194 (comment)

If you do not require color to be included in the ply file then the RealSense SDK has an export_to_ply example program called export_ply_example.py at the link below.

https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/export_ply_example.py

@1215232494
Copy link
Author

Hi @MartyG-RealSense , thanks for your reply.I got the ply file with color by using points.export_to_ply, but it is a binary file. How do I get the value of xyzrgb from it?Or whether non binary files can be generated, such as using ply.set_option(rs.save_to_ply.option_ply_binary, False)

@MartyG-RealSense
Copy link
Collaborator

A RealSense team member advises at #6677 (comment) that it is not possible to save to ASCII (non-binary) with export_to_ply.

save_to_ply has the option to set binary to false as you mention, though color export has not previously worked with it when its ignore_color parameter has been set to false. It has been a couple of years since the Python script at #7747 (comment) was last tested by a RealSense user though, so you could try it to see whether it can now export color.

@1215232494
Copy link
Author

Apologies for the delay in responding further. I read some answers( #9531) about you and understood the limitations of these methods.
But I found a way to read binary ply files by using plyfile.PlyData.read(). It solves the problem that I want to read xyzrgb.
Thanks for your help! And I have a new problem, so I will close the case and start a new one.

@MartyG-RealSense
Copy link
Collaborator

You are very welcome. Thanks very much for the update!

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