isl-org / isl-org/Open3D

`cx/y` parameters from python PinholeCameraIntrinsic aren't used in the `Visualizer`

Open
#6,016 7 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).

(Note: Had trouble installing `master`, so the below is with 0.16.1.)

### Describe the issue

I wish to adjust the `cx` and `cy` parameters of `PinholeCameraIntrinsic` from the python API.
While I can create an intrinsic matrix with non-default values without problems, when applied to the `Visualizer` camera the `c` parameters revert to their default values.

The focal length parameter is set to arbitrary values without problems.
I am using the `allow_arbitrary` flag.

The same problem occurs if I use the constructor with `intrinsic_matrix` directly instead of passing in named parameters.

Note that this isn't just a problem with `ViewControl.convert_to_pinhole_camera_parameters` because changing `cx/y` produces no difference in the rendered result.

### Steps to reproduce the bug

```python
import open3d as o3d

w = 300
h = 200
f = 100
px = 100
py = 100

vis = o3d.visualization.Visualizer()
vis.create_window(width=w, height=h, visible=False)
ctr = vis.get_view_control()

cam = o3d.camera.PinholeCameraParameters()
cam.intrinsic = o3d.camera.PinholeCameraIntrinsic(
w, h, f, f, px, py)
print(cam.intrinsic.intrinsic_matrix)
# [[100. 0. 100.]
# [ 0. 100. 100.]
# [ 0. 0. 1.]]
ctr.convert_from_pinhole_camera_parameters(cam, allow_arbitrary=True)
print(ctr.convert_to_pinhole_camera_parameters().intrinsic.intrinsic_matrix)
# [[100. 0. 149.5]
# [ 0. 100. 99.5]
# [ 0. 0. 1. ]]
```

### Error message

_No response_

### Expected behavior

The second print statement should produce the same output as the first.

### Open3D, Python and System information

```markdown
- Operating system: macOS 13.2
- Python version: 3.9.11
- Open3D version: 0.16.1
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip (both editable install and pypi install)
```

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