isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.16k stars 2.27k forks source link

view control does not work on the latest vesrion, had to downgrage it to 0.16.0 #6617

Open Pushover-1 opened 7 months ago

Pushover-1 commented 7 months ago

Checklist

Describe the issue

I tried to rotate the pcd object using view control, but the changes did not translate to the view window. But when I downgraded to 0.16.0 it worked.

Steps to reproduce the bug

import open3d as o3d 

def custom_view(pcd):
    vis = o3d.visualization.Visualizer()
    vis.create_window()
    ctr = vis.get_view_control()
    vis.add_geometry(pcd)   
    ctr.rotate(1,90)
    ctr.set_zoom(2)

    vis.run()
    vis.destroy_window()

Error message

No response

Expected behavior

I want the object to be rotated and scaled in the view control panel

Open3D, Python and System information

Additional information

No response

saurabheights commented 7 months ago

@Pushover-1 This issue has been fixed and you can upgrade to version 0.18.0

shengjie-lin commented 7 months ago

No, it is not @saurabheights . To test it, simply run python -m open3d.examples.visualization.load_save_viewpoint. 0.16.0 would produce the desired behavior, while 0.18.0 does not.

ssheorey commented 7 months ago

I get this warning on running the example:

[Open3D WARNING] [ViewControl] ConvertFromPinholeCameraParameters() failed because window height and width do not match.

Needs a look.

saurabheights commented 7 months ago

@shengjie-lin Hi, sorry. I thought it was related to the earlier issue which happened before 0.17.0 was released. I have also replicated the problem locally.

KazukiYoshiyama-sony commented 6 months ago

I might encountered this issue several times.

ctl.convert_from_pinhole_camera_parameters(cp, allow_arbitrary=True)

This will fix the issue, I am not sure this is a root fix, but in my case, it seems to work expectedly.

xiaomingHUST commented 6 months ago

I might encountered this issue several times.

ctl.convert_from_pinhole_camera_parameters(cp, allow_arbitrary=True)

This will fix the issue, I am not sure this is a root fix, but in my case, it seems to work expectedly.

thanks, it works! but i met a new problem, when i use ctl.convert_from_pinhole_camera_parameters(cp,allow_arbitrary=True) to set camera param ,the fx and fy of intrisic matrix must be the same, but actually it could be different.

ctl.convert_from_pinhole_camera_parameters(cp, allow_arbitrary=True)
test = ctl.convert_to_pinhole_camera_parameters()  
print(cp.intrinsic)  
print(test.intrinsic)

something wrong?

wcyjerry commented 4 months ago

I fixed with allow_arbitrary=True, thx

ZhaoLizz commented 2 months ago
import numpy as np
import open3d as o3d

points = np.random.rand(30000, 3) * [1,2,3]
colors = np.random.rand(30000, 3)
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(points)
pcd.colors = o3d.utility.Vector3dVector(colors)

vis = o3d.visualization.Visualizer()
vis.create_window()
ctr = vis.get_view_control()
vis.add_geometry(pcd)   
ctr.rotate(1,90)
ctr.set_zoom(2)

vis.run()
vis.destroy_window()

@shengjie-lin @saurabheights I have tested the above code, view control now works for pip install open3d==0.18.0.

And note that, add_geometry must be called before the view control. I'm not sure exactly why, but the following test demo won't work, since the add_geometry is called after setting ctr. Does anyone have any idea what might be the cause?

ctr = vis.get_view_control()
ctr.rotate(1,90)
ctr.set_zoom(2)

# add_geometry AFTER view control will not work
vis.add_geometry(pcd)  

vis.run()
vis.destroy_window()