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

depth images convert to point cloud #8893

Closed
ShucongYin opened this issue Apr 25, 2021 · 10 comments
Closed

depth images convert to point cloud #8893

ShucongYin opened this issue Apr 25, 2021 · 10 comments
Labels

Comments

@ShucongYin
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

<Describe your issue / question / feature request / etc..>
I have rgb images and depth images, how can i get the point cloud files with a python code?

@MartyG-RealSense
Copy link
Collaborator

Hi @xunyi-yin Are you aiming to create a point cloud from live depth and RGB data streamed from the camera, please? Or are you using pre-made depth and color image files such as PNG format images?

Can you also confirm please whether you want to save the point cloud data as a ply file. Thank you very much.

@ShucongYin
Copy link
Author

ShucongYin commented Apr 25, 2021

Hi @MartyG-RealSense I want to use pre-made PNG depth images only or PNG depth images and JPG color images to create point cloud. I think ply file is OK My computer system version is Ubuntu16.04

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Apr 25, 2021

I looked carefully at what you want to achieve. It may be difficult to implement though, with a number of problems involved. The best reference available for aligning pre-made depth and color image files in Python is the recent discussion in the link below.

#8756

This information does not cover the process of deprojecting 2D pixel information to 3D world coordinates to generate a point cloud. It may be best to approach this project in stages and achieve the 2D depth / color alignment first before subsequently looking at how to deproject it to 3D and export it to ply.

@ShucongYin
Copy link
Author

Hi @MartyG-RealSense Do you know how to get the depth image and color image together? My device is RealSense D455. My system is Ubuntu16.04

@MartyG-RealSense
Copy link
Collaborator

Could you confirm your meaning when you ask about "getting the depth image and color image together", please? If you are aligning pre-made depth and color image files in Python, information about doing this was provided in #8756

@ShucongYin
Copy link
Author

ShucongYin commented Apr 27, 2021

I mean I have D455 camera and my system is ubuntu16.04. how can i get depth images. i ever used 'rosbag record' but i can not extract the depth images from the .bag files. I want to know if i can use python code to do this or other methods. I do not want to use c++ code @MartyG-RealSense

@MartyG-RealSense
Copy link
Collaborator

If you are asking about extracting depth frames from a bag file and saving them as PNG images with Python then the script in the link below may suit your needs.

#1887 (comment)

If you wanted to play back depth frames from a bag but not save them as image files then the SDK's read_bag_example Python example program may be helpful.

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

Intel's Python tutorial distance_to_object.py demonstrates how to align depth and color data from a bag.

https://github.com/IntelRealSense/librealsense/blob/jupyter/notebooks/distance_to_object.ipynb

@ShucongYin
Copy link
Author

ShucongYin commented Apr 28, 2021

Thank you! I have solved it @MartyG-RealSense

@MartyG-RealSense
Copy link
Collaborator

Excellent news that you found a solution, @xunyi-yin :)

@MartyG-RealSense
Copy link
Collaborator

Case closed due to solution achieved and no further comments received.

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