open3d显示
视点调整
载入json的方式调整视点
- 对视点等参数保存成文件的形式,然后再load
- open3d调整显示点大小?、视点
- https://github.com/intel-isl/Open3D/issues/615
重要补充:https://blog.csdn.net/qq_26623879/article/details/106380014
手动保存json数据
- 其实也可以点击open3d的显示窗口ctrl+c,视图信息就保存在了截切板里面(win10打开剪切板——win+v),然后对再次显示的点云窗口点击并ctrl+v,就可以按照之前的视点信息显示
- 也可以手动对这次的视点等信息win+v,保存到json文件中方便使用
使用get_view_control 调整视点
最后一点是这个脚本的核心。update_geometry通知 vis相关的几何已经被更新。最后,可视化器渲染新的一帧通过调用poll_events和update_renderer来实现。在所有的循环结束之后,调用destroy_window来关闭窗口
set_front设置的是垂直指向屏幕外的向量,set_up设置的是指向屏幕上方的向量,当设置了这两个向量之后,当前视角坐标系就可以确定了,set_lookat也就是当前帧lidar所处的位置,是以世界坐标系为统一坐标系计算出来的(可以理解为,不管哪一帧,在整个地图,只有一个共同的原点),set_zoom是控制视角远近的,因为要实现第一人称视角,所以设置为0.001,因为设置0的话屏幕会出现空白的现象——https://github.com/isl-org/Open3D/issues/2139
import open3d as o3d
coor_frame = o3d.geometry.TriangleMesh.create_coordinate_frame()
visualizer = o3d.visualization.Visualizer()
visualizer.create_window()
visualizer.add_geometry(coor_frame)
view_ctl = visualizer.get_view_control()
# view_ctl.set_up((1, 0, 0)) # set the positive direction of the x-axis as the up direction
view_ctl.set_up((0, -1, 0)) # set the negative direction of the y-axis as the up direction
view_ctl.set_front((0, 0, -1)) # set the positive direction of the x-axis toward you
view_ctl.set_lookat((0, 0, -2)) # set the original point as the center point of the window
view_ctl.set_zoom(2)
visualizer.run()
图形拖拽
点大小调整 `+ -` 号
– Mouse view control –– 鼠标视图控制 –
Left button + drag : Rotate. ——左键+拖动:旋转。
Ctrl + left button + drag : Translate.——Ctrl+左键+拖动:平移。
Wheel button + drag : Translate.——滚轮按钮+拖动:平移。
Shift + left button + drag : Roll.——Shift+左键+拖动:滚动。
Wheel : Zoom in/out.——控制盘:放大/缩小。
– Keyboard view control ––键盘视图控件–
[/] : Increase/decrease field of view.——[/]:增大/减小视野。
R : Reset view point.——R:重置视点。
Ctrl/Cmd + C : Copy current view status into the clipboard.——Ctrl/Cmd+C:将当前视图状态复制到剪贴板。
Ctrl/Cmd + V : Paste view status from clipboard.——Ctrl/Cmd+V:从剪贴板粘贴视图状态。
– General control ––一般控制–
Q, Esc : Exit window.——Q、 Esc:退出窗口。
H : Print help message.——H:打印帮助信息。
P, PrtScn : Take a screen capture.——P、 拍摄屏幕截图。
D : Take a depth capture.——D:进行深度捕捉。
O : Take a capture of current rendering settings.——O:捕获当前渲染设置。
动态显示
- 初始化
vis = o3d.visualization.Visualizer()
vis.create_window()
vis.add_geometry(source)
vis.add_geometry(target)
# vis.get_render_option().load_from_json("../../TestData/renderoption.json")
# 调整显示的视点等
- 转换几何体后显示
for i in range(icp_iteration):
reg_p2l = o3d.registration.registration_icp(
source, target, threshold, np.identity(4),
o3d.registration.TransformationEstimationPointToPlane(),
o3d.registration.ICPConvergenceCriteria(max_iteration=1))
source.transform(reg_p2l.transformation)
vis.update_geometry(source)
vis.poll_events()
vis.update_renderer()
if save_image:
vis.capture_screen_image("temp_%04d.jpg" % i)
vis.destroy_window()
每一次迭代中调用了registration_icp函数。需要注意的是它通过ICPConvergenceCriteria(max_iteration = 1)标志来显示的只执行一次ICP配准。这是一种从ICP迭代中检索轻微更新姿态的技巧。在ICP之后呢相应的旋转源几何形状。
其他显示参考:
https://blog.csdn.net/io569417668/article/details/107013386
https://blog.csdn.net/io569417668/article/details/111830828
http://www.open3d.org/docs/0.10.0/tutorial/Advanced/non_blocking_visualization.html