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

Generating Pointclouds from Numpy arrays #2551

Closed
GitwellAnyohub opened this issue Oct 17, 2018 · 8 comments
Closed

Generating Pointclouds from Numpy arrays #2551

GitwellAnyohub opened this issue Oct 17, 2018 · 8 comments
Assignees
Labels

Comments

@GitwellAnyohub
Copy link

Hello,

Using the d415 camera, I'm able to generate a pointcloud starting with rs2::frames. However, rather than generating the pointclouds in realtime, I'd like to take to aligned numpy arrays (depth aligned to color) and THEN create point clouds. It'd be perfect if the pc.calculate() and the points.export_to_ply() functions worked on Numpy arrays and not just realsense frames. Has this been done before?

this is the code that works:

pc=rs.pointcloud()
points=rs.points()

#start pipeline

frames=pipeline.wait_for_frames()
depth_frame=frames.get_depth_frame()
color_frame=frames.get_color_frame()

pc.map_to(color_frame)
points=pc.calculate(Depth_frame)
points.export_to_ply('pointcloud/%06.ply'%(tick), color_frame)
'''```
@dorodnic
Copy link
Contributor

Hello @GitwellAnyohub
In general in the SDK we provide software_device to convert data into SDK frames. It's a bit more complicated than just two arrays, since frames carry a lot of extra information (intrinsic and extrinsic calibration and depth units are all required to generate a point-cloud).
As far as I know, the software_device has not yet been ported to python (but is available for C++ and C#)
You could generate point-cloud not in real-time if you save the scene into a *.bag file using the built-in recorder. We support fairly seamless playback of such files.

@GitwellAnyohub
Copy link
Author

I'll try that at some point. Any idea when software_device will be ported into python?

@lramati
Copy link
Contributor

lramati commented Oct 18, 2018 via email

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
@git'wellAnyohub Any other quesitons for this ticket? Please update. Thanks!

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
@GitwellAnyohub Considering the question resolved, can we close the ticket? Please update. Thanks!

@binflo13
Copy link

Hello, has there been any progress in this topic? It would be very useful to get this.

@jsheo96
Copy link

jsheo96 commented Jul 5, 2023

is there any updates on this issue? cause I'm eagerly looking forward to a way to mask depth frame using numpy array.

@MartyG-RealSense
Copy link
Collaborator

Hi @jsheo96 I am not aware of any progress that has been made on numpy conversion, unfortunately.

gwen2018 pushed a commit to gwen2018/librealsense that referenced this issue Dec 14, 2023
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

7 participants