isl-org / isl-org/Open3D

Wrong check for identity transformation as a result of registration

Open
#6,153 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

At several places in the code, after registration, the scripts check if the transformation is identity by by checking its trace (e.g. `if (result.transformation.trace() == 4.0):`):
- https://github.com/isl-org/Open3D/blob/03231bb99b1b02fbca5ca79285e4a2e3d157218e/examples/python/reconstruction_system/register_fragments.py#L59
- https://github.com/isl-org/Open3D/blob/a5be78cfe3da627ce6a38a7905e3e5cd6a64d811/examples/python/benchmark/benchmark_ransac.py#L67
- https://github.com/isl-org/Open3D/blob/03231bb99b1b02fbca5ca79285e4a2e3d157218e/examples/python/benchmark/benchmark_fgr.py#L69
- https://github.com/isl-org/Open3D/blob/03231bb99b1b02fbca5ca79285e4a2e3d157218e/examples/python/reconstruction_system/register_fragments.py#L59

While this is OK to check if a rotation is identity, it doesn't work for a 4x4 matrix, because the translation term may be nonzero. A correct check would be `if (result.transformation == np.eye(4)).all():`

### Steps to reproduce the bug

```python
- translate a pcd by a small amount
- register it with the untranslated pcd, the translation will be found
- the registration codes above will report a registration failure
```

### Error message

_No response_

### Expected behavior

accept a pure translation as a valid result

### Open3D, Python and System information

```markdown
- Operating system: macOS 12
- Python version: Python 3.8
- Open3D version: 0.16.1 and 0.17.0
- System architecture: apple-silicon
- 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.