Open3d: Viewer and camera height and width issue

Created on 6 Sep 2019  路  5Comments  路  Source: intel-isl/Open3D

Describe the bug
[ViewControl] ConvertFromPinholeCameraParameters() failed because window height and width do not match.
Setting the view to a specified camera fails even when the window height and width of the viewer and the camera match.

To Reproduce
https://gist.github.com/arunmallya/41374d7eed6a52923b6ca2eb864b420a
Data file: https://uofi.box.com/s/spqlqx6c6tggpedv6ehs6muz0deyogy0

Environment (please complete the following information):

  • OS: Ubuntu 16.04
  • Python version: 3.5.2
  • Open3D version: 0.7.0.0
  • Is this remote workstation?: no
  • How did you install Open3D?: pip
possible bug

Most helpful comment

@germanros1987 So there is still no solution to this problem? Adding -0.5 as suggested above did not work for me. I am trying to run the example script customized_visualization.py

Edit: After lots of gruesome pain I was able to get it to work. The key is to look at the code in ViewControl.cpp located at Open3D/cpp/visualization/visualizer/ViewControl.cpp.
image

All conditions need to be fulfilled in order to make it work.

All 5 comments

Could you check these lines? You may need to replace

K = [[focal * width, 0, width / 2],
     [0, focal * width, height / 2],
     [0, 0, 1]]

as

K = [[focal * width, 0, width / 2 - 0.5],
     [0, focal * width, height / 2 - 0.5],
     [0, 0, 1]]

@errissa we will take care of this after the 0.11 release...

@germanros1987 So there is still no solution to this problem? Adding -0.5 as suggested above did not work for me. I am trying to run the example script customized_visualization.py

Edit: After lots of gruesome pain I was able to get it to work. The key is to look at the code in ViewControl.cpp located at Open3D/cpp/visualization/visualizer/ViewControl.cpp.
image

All conditions need to be fulfilled in order to make it work.

@germanros1987 so curious... Stuck with this issue for a week

@tfy14esa thank you for your effort!

Adding -0.5 as suggested above did not solve the problem for me either. Turns out the window size also has to match with the intrinsic parameters and resolution. As follows:

viewer.create_window(width=width, height=height)

Was this page helpful?
0 / 5 - 0 ratings