Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

How to run online point cloud generation using RealSenseD435?

Open ad1t7a opened this issue 3 years ago • 0 comments

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?

ad1t7a avatar Jul 14 '22 00:07 ad1t7a