isl-org / isl-org/Open3D

Depth image from point cloud blank Summarize the bug (e.g., "Segmentation Fault for Colored Point Cloud Registration")

Open
#5,170 0 comments 0 reactions 0 assignees View on GitHub
bug
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).

### Describe the issue

I am trying to use the "project_to_depth_imag" function, but the resulting pointcloud is coming up empty.
Here is the code to reproduce. I am filling the file with my original points

Thank you very much in advance!

### Steps to reproduce the bug

```python
import open3d as o3d
import numpy as np
import matplotlib.pyplot as plt

if __name__ == '__main__':

device = o3d.core.Device('CPU:0')

intrinsic = o3d.core.Tensor([[1428.0,0,966.0],[0,1428.0,726.0],[0,0,1]])

pcd_2 = o3d.io.read_point_cloud('point_cloud.ply', format="ply")

pts = np.array(pcd_2.points)
pcd = o3d.t.geometry.PointCloud(device)

dtype = o3d.core.float32

pcd.point["positions"] = o3d.core.Tensor(pts,dtype,device)

o3d.visualization.draw([pcd]). # here the point cloud is being able to be visualized, OK
depth_reproj = pcd.project_to_depth_image(1920,
1440,
intrinsic,
depth_scale=5000.0,
depth_max=10.0)

fig, axs = plt.subplots(1, 1)
axs[0].imshow(np.asarray(depth_reproj.to_legacy()))
plt.show()
```

### Error message

_No response_

### Expected behavior

_No response_

### Open3D, Python and System information

```markdown
- Operating system: Ubuntu 20.04 / macOS 10.15 / Windows 10 64-bit
- Python version: Python 3.8 / output from `import sys; print(sys.version)`
- Open3D version: output from python: `print(open3d.__version__)`
- System architecture: x86 / arm64 / apple-silicon / jetson / rpi
- Is this a remote workstation?: yes or no
- How did you install Open3D?: pip / conda / build from source
- Compiler version (if built from source): gcc 7.5 / clang 7.0
```

### Additional information

_No response_

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.