isl-org / isl-org/Open3D

create_from_depth_image doesn't scale when dtype=np.float32

Open
#5,147 1 comment 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 have been using `o3d.geometry.PointCloud.create_from_depth_image` to generate pointcloud. But it won't scale properly when the depth image is of type `float32`, 'create_from_depth_image' basically ignores `depth_scale'.

### Steps to reproduce the bug

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

depth = np.full((480, 640), 12345, dtype=np.float32)
depth = o3d.geometry.Image(depth)
intrinsic = o3d.camera.PinholeCameraIntrinsic(
o3d.camera.PinholeCameraIntrinsicParameters.PrimeSenseDefault)
pcd = o3d.geometry.PointCloud.create_from_depth_image(
depth,
intrinsic,
depth_scale=10000.0,
)
```

### Error message

None

### Expected behavior

The output `pcd` should scale w.r.t to `depth_scale` param for both int16 and float images.

### Open3D, Python and System information

```markdown
- Operating system: Ubuntu 20.04 64-bit
- Python version: Python 3.8
- Open3D version: 0.15.2
- System architecture: x86
- Is this a remote workstation?: no
- 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.