isl-org / isl-org/Open3D

`open3d.t.geometry.PointCloud.create_from_depth_image` crash with `with_normals` and `extrinsics`

Open
#4,845 3 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

`open3d.t.geometry.PointCloud.create_from_depth_image` crashes when `with_normals` and `extrinsics` is used. Note that it doesn't crash if `extrinsics = np.eye(4, dtype=np.float32)`

### Steps to reproduce the bug

```python
import numpy as np
import open3d as o3d

depth = np.ones((2, 2), dtype=np.uint16)
intrinsics = np.eye(3, dtype=np.float32)
extrinsics = np.eye(4, dtype=np.float32)
extrinsics[0, 3] = 1.0

pcd_depth_cam = o3d.t.geometry.PointCloud.create_from_depth_image(
depth=o3d.t.geometry.Image(o3d.core.Tensor(depth)),
intrinsics=o3d.core.Tensor(intrinsics, dtype=o3d.core.Dtype.Float32),
extrinsics=o3d.core.Tensor(extrinsics, dtype=o3d.core.Dtype.Float32),
with_normals=True,
)
```

### Error message

```
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
[](https://p0tivv8r9af-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20220302-060057-RC00_431884419#) in ()
11 intrinsics=o3d.core.Tensor(intrinsics, dtype=o3d.core.Dtype.Float32),
12 extrinsics=o3d.core.Tensor(extrinsics, dtype=o3d.core.Dtype.Float32),
---> 13 with_normals=True,
14 )

RuntimeError: [Open3D Error] (open3d::core::Tensor open3d::core::Tensor::Matmul(const open3d::core::Tensor&) const) /root/Open3D/cpp/open3d/core/Tensor.cpp:1806: Tensor has dtype Float64, but is expected to have Float32.
0;m
```

### Expected behavior

No crash

### Open3D, Python and System information

```markdown
- Operating system: Colab / macOS
- Python version: Python 3.7.12
- Open3D version: 0.15.2
- How did you install Open3D?: pip
```

### 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.