write_pose_graph 是 Open3D 的 I/O 功能模块中的一个函数,用于将 PoseGraph 对象写入到磁盘中的文件中。
open3d.io.write_pose_graph(filename, pose_graph, compressed=True)
filename : str
.json 和 .pb 格式。pose_graph : open3d.geometry.PoseGraph
compressed : bool, optional (default True)
此函数没有返回值。
import open3d as o3d
pose_graph = o3d.io.read_pose_graph("PoseGraph.json")
o3d.io.write_pose_graph("PoseGraph.pb", pose_graph, compressed=True)
此示例读取名为 PoseGraph.json 的文件中的 PoseGraph 对象,并将其写入名为 PoseGraph.pb 的 protocol buffer 格式文件中,同时进行压缩。
FileNotFoundError : 文件路径不存在或文件名错误。ValueError : PoseGraph 对象或文件格式错误。protocol buffer 格式是一种轻量级的结构化数据交换格式,支持跨语言、平台独立、可扩展的数据交换。PoseGraph 对象是用于描述相机或者激光雷达之间的转换关系,以便于后续的地图建立或场景重建等应用,详见 open3d.geometry.PoseGraph。