isl-org / isl-org/Open3D

Error in ViewControl::ConvertFromPinholeCameraParameters in ViewControl.cpp

Open
#6,666 0 comments 1 reaction 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](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).

### Describe the issue

I found that, in the code "ViewControl.cpp", there is an error in bool ViewControl::ConvertFromPinholeCameraParameters.
The conditional statement mistakenly uses = instead of -:
‘’‘
if (!allow_arbitrary &&
(window_height_ <= 0 || window_width_ <= 0 ||
window_height_ != intrinsic.height_ ||
window_width_ != intrinsic.width_ ||
std::abs(intrinsic.intrinsic_matrix_(0, 2) -
((double)window_width_ / 2.0 - 0.5)) > threshold ||
std::abs(intrinsic.intrinsic_matrix_(1, 2) =
((double)window_height_ / 2.0 - 0.5)) > threshold)) {
utility::LogWarning(
"[ViewControl] ConvertFromPinholeCameraParameters() failed "
"because window height and width do not match.");
return false;
}
’‘’

### Steps to reproduce the bug

```python
if (!allow_arbitrary &&
(window_height_ <= 0 || window_width_ <= 0 ||
window_height_ != intrinsic.height_ ||
window_width_ != intrinsic.width_ ||
std::abs(intrinsic.intrinsic_matrix_(0, 2) -
((double)window_width_ / 2.0 - 0.5)) > threshold ||
std::abs(intrinsic.intrinsic_matrix_(1, 2) =
((double)window_height_ / 2.0 - 0.5)) > threshold)) {
utility::LogWarning(
"[ViewControl] ConvertFromPinholeCameraParameters() failed "
"because window height and width do not match.");
return false;
}
```

### Error message

The conditional statement mistakenly uses = instead of -:

### Expected behavior

_No response_

### Open3D, Python and System information

```markdown
Open3D = 0.18.0
```

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