isl-org / isl-org/Open3D

project_to_rgbd_image return ERROR

Open
#6,158 0 comments 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](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).

### My Question

I tried to use the function project_to_rgbd_image() to map my point cloud file to a RGBD image or depth map, however it returns the ERROR:
> in void __cdecl filament::FCamera::setProjection(enum filament::Camera::Projection,double,double,double,double,double,double) noexcept:89
reason: Camera preconditions not met. Using default projection.

and the returned RGBD image and depth map are empty:
![image](https://github.com/isl-org/Open3D/assets/20593723/900d86a8-a316-4b1f-80ed-cc8847edae6b)

Here is my code:
```
import open3d as o3d
import numpy as np
import matplotlib.pyplot as plt

path = 'exp_5_15\\'
device = o3d.core.Device('CPU:0')
pointcloud = o3d.t.io.read_point_cloud(path+"//1_Output//WB.ply").to(device)
o3d.visualization.draw([pointcloud])

fx = 433; fy = 433; cx = 241; cy = 319
intrinsic = o3d.core.Tensor([[fx, 0, cx], [0, fy, cy], [0, 0, 1]])
rgbd_reproj = pointcloud.project_to_rgbd_image(480, 640, intrinsic, depth_scale=1, depth_max=10.0)
color = np.array(rgbd_reproj.color.to_legacy())
color = np.array(rgbd_reproj.color.to_legacy())

plt.figure()
plt.subplot(1,2,1)
plt.imshow(np.array(rgbd_reproj.color))
plt.subplot(1,2,2)
plt.imshow(np.array(rgbd_reproj.depth))
```

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.