[Bug] 3D Bounding Box Improper Rotation Matrices
- 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).
### My Observation
Using : open3d 0.15.2
TLDR; Orientated Bounding Boxes are inconsistent:
- Mix between proper and improper Rotation matrices
- Mix of reflections in improper Rotation matrices
- Incompatible with other frameworks.
____________________________________________________________________________________________________
Hello,
I am creating bounding boxes from pointcloud clusters. I am using orientated bounding boxes. Rotating the bounding box by its transposed Rotation matrix will align it with the axes (I know allignedbboxes exist, this is just to describe the issue). This works correctly if I stick with open3d.
However other packages (scipy, spatialmath) have issues with the Open3D rotation matrix. Converting to quaternion or vectors and reversing into rotation matrix causes issues and the rotations are incorrect. I have observed that the determinant of the Open3D Rotation matrices are mixed between -1 and 1. This inconsistency is incompatible with all frameworks I have tried (scipy, pytransform3d, spatialmath, etc.) (Picture 1 vs Picture 2. This makes further processing challenging/impossible.
`
bbox = o3d.geometry.OrientedBoundingBox.create_from_points(points=pc.points)
r = R.from_matrix(np.array(bbox.R))
bbox.rotate(np.transpose(r.as_matrix()))
`
This is what it looks like if I transpose the open3d rotation matrix with scipy.

This is what it looks like if I transpose the incorrect Open3D rotation matrices (expected result)

I have found a workaround : [credit](https://bytemeta.vip/repo/intel-isl/Open3D/issues/4006), however, this shows the next issue. See the box of the small window and compare it to the last picture. Within the improper rotation matrices, the reflections are inconsistent. Some aligned boxes "fell over" on their side instead of remaining upright. Others align correctly.

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.