You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The value of filed_of_view in the _camera function does not change the final render image? I set one to 60 degrees and the other to 10 degrees, but the picture is the same.
This is photo with value in 10 degrees.
This is photo with value in 60 degrees.
the code is :
import open3d as o3d
import numpy as np
o3d.visualization.gui.Application.instance.initialize()
pcd = o3d.io.read_point_cloud("D:/MPEG/mpeg-pcc-tmc2/mpeg_datasets/longdress/Ply/longdress_vox10_1051.ply")
box = pcd.get_axis_aligned_bounding_box()
min_box = box.get_min_bound()
max_box = box.get_max_bound()
center = (max_box + min_box) / 2
eye = np.array(center) + np.array([0, 0, 700])
vis = o3d.visualization.O3DVisualizer("3DVis", width=1920, height=1080)
vis.add_geometry(name="point_cloud", geometry=pcd, is_visible=True)
vis.point_size = 2
bg_color = np.array([255.0, 255.0, 255.0, 1.0], dtype=np.float32).reshape(4, 1)
vis.set_background(bg_color, None)
vis.post_redraw()
vis.enable_raw_mode(enable=True)
vis.show_skybox(show=False)
field_of_view = 60.0
center = np.array(center, dtype=np.float32)
eye = np.array(eye, dtype=np.float32)
up = np.array([0.0, 1.0, 0.0], dtype=np.float32)
vis.setup_camera(field_of_view, center, eye, up)
vis.post_redraw()
o3d.visualization.gui.Application.instance.add_window(vis)
path = r"D:\photo\photo2.png"
vis.export_current_image(path)
o3d.visualization.gui.Application.instance.run()
The text was updated successfully, but these errors were encountered:
@Zhouwudexiazhou tracked this down (see #7031) and found that the problem is that open3d::visualization::visualizer::O3DVisualizer::SetupCamera(fov, center, eye, up) simply ignores the fov parameter passed to it.
This seems to be a bug, or perhaps two (SetupCamera ignores fov, and perhaps: missing api to set field-of-view). I think the bug tag should be added this issue. As far as I know, I cannot do that myself. Could someone else (@ssheorey ?) look at this and add the bug tag if needed? If so, perhaps the title should be changed.
Checklist
main
branch).My Question
The value of filed_of_view in the _camera function does not change the final render image? I set one to 60 degrees and the other to 10 degrees, but the picture is the same.
This is photo with value in 10 degrees.
This is photo with value in 60 degrees.
the code is :
import open3d as o3d
import numpy as np
o3d.visualization.gui.Application.instance.initialize()
pcd = o3d.io.read_point_cloud("D:/MPEG/mpeg-pcc-tmc2/mpeg_datasets/longdress/Ply/longdress_vox10_1051.ply")
box = pcd.get_axis_aligned_bounding_box()
min_box = box.get_min_bound()
max_box = box.get_max_bound()
center = (max_box + min_box) / 2
eye = np.array(center) + np.array([0, 0, 700])
vis = o3d.visualization.O3DVisualizer("3DVis", width=1920, height=1080)
vis.add_geometry(name="point_cloud", geometry=pcd, is_visible=True)
vis.point_size = 2
bg_color = np.array([255.0, 255.0, 255.0, 1.0], dtype=np.float32).reshape(4, 1)
vis.set_background(bg_color, None)
vis.post_redraw()
vis.enable_raw_mode(enable=True)
vis.show_skybox(show=False)
field_of_view = 60.0
center = np.array(center, dtype=np.float32)
eye = np.array(eye, dtype=np.float32)
up = np.array([0.0, 1.0, 0.0], dtype=np.float32)
vis.setup_camera(field_of_view, center, eye, up)
vis.post_redraw()
o3d.visualization.gui.Application.instance.add_window(vis)
path = r"D:\photo\photo2.png"
vis.export_current_image(path)
o3d.visualization.gui.Application.instance.run()
The text was updated successfully, but these errors were encountered: