isl-org / isl-org/Open3D

Loading of `*.pcd` point clouds ignores decimals after initializing PyQt's QApplication

Open
#4,969 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 load a `*.pcd` point cloud that contains float positions within a PyQt application. When loading the point cloud using `o3d.io.read_point_cloud()` the points are rounded integers and Open3D ignored the decimal places, which do exist inside the file.

I tracked the bug to only happen after initializing the PyQt application with `QApplication(sys.argv)`. Trying to load the point cloud outside the PyQt application (e.g. in ipython) works fine.

So I assume there must be an interdependence between Open3D and PyQt.

I reproduced this bug with a point cloud provided by sb. issuing this problem for my point cloud labeling tool here: https://github.com/ch-sa/labelCloud/issues/68.
The point cloud was provided here: https://github.com/ch-sa/labelCloud/files/8345198/pointcloud_116.zip.

PyQt-Versions:
```bash
$ conda list | grep qt
pyqt5 5.15.4 pypi_0 pypi
pyqt5-qt5 5.15.2 pypi_0 pypi
pyqt5-sip 12.9.0 pypi_0 pypi
pytest-qt 4.0.2 pypi_0 pypi
```

### Steps to reproduce the bug

```python
import sys

from PyQt5.QtWidgets import QApplication

import open3d as o3d

QApplication(sys.argv)

pcd = o3d.io.read_point_cloud("pointcloud_116.pcd")
print(f"First point: {pcd.points[0]}")
```

### Error message

First point: [-0. 11. 0.]

### Expected behavior

A loaded point cloud with floats:
```bash
First point: [-0.20108423 11.055668 0.56653374]
```
This is the case when I comment `QApplication(sys.argv)` out.

### Open3D, Python and System information

```markdown
- Operating system: Distro: Linux Mint 20.3 Una base: Ubuntu 20.04 focal
- Python version: 3.8.11 (default, Aug 3 2021, 15:09:35) [GCC 7.5.0]
- Open3D version: 0.15.2
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip (inside conda)

More details can be found here: https://termbin.com/n0go
```

### Additional information

The issue did not appear so far when loading other point cloud formats.

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.