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

need help with pointcloud creation and visualization given only the depth data #8255

Closed
monacv opened this issue Jan 28, 2021 · 5 comments
Closed

Comments

@monacv
Copy link

monacv commented Jan 28, 2021

I saw https://github.com/dorodnic/binder_test/blob/master/pointcloud.ipynb however it also makes use of RGB frames.

If I only have the depth data and color_intrinsics, how can I create a pointcloud using RealSense API and how can I visualize it?

I also saw this method but I am unsure how I could visualize it:
pointcloud = convert_depth_frame_to_pointcloud(original_depth_frame, color_intrinsics)

Also for the line above I get this error:
module 'pyrealsense2' has no attribute 'convert_depth_frame_to_pointcloud'
where:

def set_intrinsics(intrinsics_dict):
    intrinsics = rs.intrinsics()
    intrinsics.width = intrinsics_dict['width']
    intrinsics.height = intrinsics_dict['height']
    intrinsics.ppx = intrinsics_dict['ppx']
    intrinsics.ppy = intrinsics_dict['ppy']
    intrinsics.fx = intrinsics_dict['fx']
    intrinsics.fy = intrinsics_dict['fy']
    intrinsics.model = intrinsics_dict['model']
    intrinsics.coeffs = intrinsics_dict['coeffs']
    return intrinsics


color_intrinsics = set_intrinsics(camera['color_intrinsics'])

Please also have a look at https://stackoverflow.com/questions/65930029/visualizing-the-pointcloud-from-realsense-api-or-open3d-library

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jan 28, 2021

Hi @monacv I wonder if what you are hoping to do is to generate a color-shaded point cloud in Python without using RGB. Is that correct, please?

image

@monacv
Copy link
Author

monacv commented Jan 28, 2021

Hi @MartyG-RealSense, thanks a lot for your reply.

I'd be interested to learn how you did this? Do you have the code snippet for reproducing it for Intel RealSense camera? Yes, I want to create the 3D pointcloud only using the depth frame and depth intrinsics and depth scale.

I have created a version using O3D for now but would like to learn how to use this other version too.
isl-org/Open3D#2959

@MartyG-RealSense
Copy link
Collaborator

The image I provided above was produced in the RealSense Viewer, but you can control depth colorization with code too so that Python point clouds look more like the ones produced by the Viewer.

A range of resources for configuring depth colorization in Python are provided in the link below.

#7767 (comment)

@MartyG-RealSense
Copy link
Collaborator

Hi @monacv Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

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