isl-org / isl-org/Open3D

No point cloud/white screen created for o3d.geometry.PointCloud.create_from_rgbd_image

Open
#7,139 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [x] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [x] For Python issues, I have tested with the [latest development wheel](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [x] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).

### My Question

Hello, I've been searching for what I could be doing wrong for a while, but can't get the point cloud creation from rgbd to work. I have captured rgb and depth frames from realsense D455 cameras and stored them as png and now using them to create a point cloud. Below are the details:

`# Function to load RGB and depth images and convert to point cloud
def create_point_cloud(rgb_image_path, depth_image_path, intrinsic):
if not os.path.exists(rgb_image_path) or not os.path.exists(depth_image_path):
print(f"Error")
exit()

color_raw = o3d.io.read_image(rgb_image_path)
color = o3d.geometry.Image(np.array(np.asarray(color_raw)[:, :, :3]).astype('uint8'))
depth = o3d.io.read_image(depth_image_path)

# Convert to numpy array
depth_array = np.array(depth)
rgb_array = np.array(color)
print(rgb_array.shape, rgb_array.dtype)
print(depth_array.shape, depth_array.dtype)
print(rgb_array[0])
print(depth_array[0])

rgbd_image = o3d.geometry.RGBDImage.create_from_color_and_depth(
color, depth, depth_scale=1000, convert_rgb_to_intensity=True)

plt.subplot(1, 2, 1)
plt.title('RGB Image')
plt.imshow(rgbd_image.color)
plt.subplot(1, 2, 2)
plt.title('Depth Image')
plt.imshow(rgbd_image.depth, cmap='gray')
plt.show()

print("rgbd created")
pcd = o3d.geometry.PointCloud.create_from_rgbd_image(rgbd_image, intrinsic)
print("pc created")
return pcd

intrinsic = o3d.camera.PinholeCameraIntrinsic(
width=480, height=640, fx=384.0992736816406, fy=383.57464599609375, cx=320.2293395996094, cy=245.76773071289062)`

OUTPUT:

![Image](https://github.com/user-attachments/assets/3d1e2ed6-8e92-477a-a03d-aeda8c9a2a54)

The rgbd images and the pointcloud are created as well but the visualizer displays an empty white screen.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.