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 convert depth image to point cloud? #2090

Closed
impet14 opened this issue Jul 19, 2018 · 10 comments
Closed

How do I convert depth image to point cloud? #2090

impet14 opened this issue Jul 19, 2018 · 10 comments
Assignees
Labels

Comments

@impet14
Copy link

impet14 commented Jul 19, 2018


Required Info
Camera Model { D400 }
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version linux
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 }

How do I convert depth image to point cloud? Now, I am doing object detection from color then I get the region on the depth image. I would like to convert dept image to PC. Can anyone give me suggestion?
Thanks

@summer1216
Copy link

In examples of this library there's point cloud generation in OpenGL. In wrappers there's wrapper to convert realsense point could into pcl point cloud.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jul 19, 2018

Have you seen the step by step tutorial on generating a point cloud? I believe that is what Summer1216 is referring to above in regard to 'Examples'.

https://github.com/IntelRealSense/librealsense/tree/master/examples/pointcloud

@impet14
Copy link
Author

impet14 commented Jul 20, 2018

Do we have python example?

@MartyG-RealSense
Copy link
Collaborator

There is an example for saving point clouds as PLY files directly from Pyrealsense.

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

@impet14
Copy link
Author

impet14 commented Jul 26, 2018

How can we visualize point cloud using python?

@MartyG-RealSense
Copy link
Collaborator

I searched very hard but was unable to find a good, clear example of creating a point cloud in Python. One of the Intel support people on this forum such as Dorodnic or RealSense-Customer-Engineering may be able to answer this better, as they have access to resources that I do not.

The best I could find was a page in Japanese, where they apparently create a Python point cloud with a D415 by importing the Point Cloud Library (PCL).

https://qiita.com/mizumasa/items/c6ca2c73fa86c9a5a39c

@baptiste-mnh
Copy link
Contributor

baptiste-mnh commented Jul 27, 2018

I'm also searching an efficient way to visualize in real time the generated pointcloud from the D400 cam from python wrapper.
It's possible with the open3D visualizer but way too slow for now. I recently add two functions in the development branch of librealsense SDK to make it works. : isl-org/Open3D#473 (comment)

You can have a look at python-pcl which is a python binding of the PCL lib but I did not manage to install it...

So I'm trying to find a way to create my own viewer using OpenGL and the python wrapper by getting the vertices and textures coordinate in numpy.
I'll start to apply the same
The exemple in C++ is a good start, I'll try to do the same process in python : https://github.com/IntelRealSense/librealsense/blob/master/examples/pointcloud/rs-pointcloud.cpp

If anyone have a clue about how to do it or a better way to visualise the point clouds It could be very usefull!

@dorodnic
Copy link
Contributor

@baptiste-mnh thank you for the feedback, looking forward to your findings.
In parallel, I've been looking at point-cloud visualisation inside Jupyter notebooks using pyntcloud:

screen shot 2018-07-30 at 15 44 23

@MartyG-RealSense
Copy link
Collaborator

Thanks muchly for the point cloud tutorial, Dorodnic - I'll make sure the link gets promoted and passed on to those on the RealSense Support forum who have been asking about Python point clouds.

@RealSense-Customer-Engineering
Copy link
Collaborator

[Realsense Customer Engineering Team Comment]
@impet14
Still have any question related to this topic?

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

6 participants