isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.09k stars 2.26k forks source link

How to run online point cloud generation using RealSenseD435? #5313

Open ad1t7a opened 2 years ago

ad1t7a commented 2 years ago

Checklist

My Question

I wanted to run a simple example to use Realsense D435 camera to generate a continuously refreshing pointcloud. I went so far:

import open3d as o3d
import matplotlib.pyplot as plt
rs = o3d.t.io.RealSenseSensor()
rs.start_capture(True)  # true: start recording with capture

while True:
    im_rgbd = rs.capture_frame(True, True)  # wait for frames and align them
    img = o3d.geometry.RGBDImage.create_from_color_and_depth(im_rgbd.color, im_rgbd.depth)
    cam = o3d.camera.PinholeCameraIntrinsic()
    pcd = o3d.geometry.PointCloud.create_from_rgbd_image(im_rgbd, cam)
rs.stop_capture()

When I run this, I get the error:

Traceback (most recent call last):
  File "test.py", line 10, in <module>
    img = o3d.geometry.RGBDImage.create_from_color_and_depth(im_rgbd.color, im_rgbd.depth)
TypeError: create_from_color_and_depth(): incompatible function arguments. The following argument types are supported:
    1. (color: open3d.cpu.pybind.geometry.Image, depth: open3d.cpu.pybind.geometry.Image, depth_scale: float = 1000.0, depth_trunc: float = 3.0, convert_rgb_to_intensity: bool = True) -> open3d.cpu.pybind.geometry.RGBDImage

Invoked with: Image[size={480,640}, channels=3, UInt8, CPU:0], Image[size={480,640}, channels=1, UInt16, CPU:0]

What am I doing wrong?

Christian-Prather commented 1 year ago

Any updates on this, its pretty ridiculous how many docs for the API are broken how can this make it through testing? I want to recommend this library for my company but this is a tough sell as it sits now.