Error in ViewControl::ConvertFromPinholeCameraParameters in ViewControl.cpp

Open Beginner friendly
#6,666 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp

Research direction

Start in ViewControl.cpp at ViewControl::ConvertFromPinholeCameraParameters and inspect the conditional shown in the issue. Reproduce the camera-parameter conversion case and verify that the condition evaluates the principal-point comparison correctly, with the existing warning and return behavior preserved when dimensions do not match.

Written by the indexing model from the issue text.

Description

bug
Checklist
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
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
Open3D = 0.18.0
Additional information

No response

Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from isl-org/Open3D

All issues in isl-org/Open3D

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.