Open3D中的open3d.data.DemoICPPointClouds类操作时,可以指定参数transformation_log_path
来记录运行过程中的变换矩阵。该参数表示变换矩阵的输出路径。
import open3d as o3d
source = o3d.io.read_point_cloud("source.ply")
target = o3d.io.read_point_cloud("target.ply")
reg_p2p = o3d.registration.registration_icp(source, target, threshold, trans_init,
o3d.registration.TransformationEstimationPointToPoint(),
o3d.registration.ICPConvergenceCriteria(max_iteration=max_iteration))
transformation_log_path = "transformation.log"
o3d.io.write_transformation(transformation_log_path, reg_p2p.transformation)
print("Transformation is saved to", transformation_log_path)