isl-org / Open3D

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

Kernel crashes when running the ICP algorithm in Python. #6928

Open qinjiaying opened 3 months ago

qinjiaying commented 3 months ago

Checklist

My Question

Attempting to register two frames of point clouds using the ICP algorithm, but the kernel crashes. Conda version is 24.5.0, Python version is 3.9.19, and the latest Python packages are installed. There are no issues with the CPU or RAM. Where might the problem be?

加载数据库

# import open3d as o3d
# import numpy as np
# import laspy
# import copy
# import os
# import subprocess
# accumulated_target_pcd = o3d.geometry.PointCloud()

处理第一个点云文件

# first_ply_path = f"E:/Auguest_collect_data/c83-b/ply/1.ply"

读取第一个点云并

# accumulated_target_pcd = o3d.io.read_point_cloud(first_ply_path)

# ply_path = f"E:/Auguest_collect_data/c83-b/ply/2.ply"
# source = o3d.io.read_point_cloud(ply_path)

执行ICP配准,将源点云与累积的目标点云对齐

# icp_result = o3d.pipelines.registration.registration_icp(
    # source, accumulated_target_pcd, 0.05, np.eye(4),
    # o3d.pipelines.registration.TransformationEstimationPointToPoint(),
    # o3d.pipelines.registration.ICPConvergenceCriteria(max_iteration=1000)
# )

# 应用变换
# source.transform(icp_result.transformation)
# o3d.io.write_point_cloud(f"E:/Auguest_collect_data/c83-b/test_ply/ply_{i}.ply", source)

将变换后的源点云合并到累积点云中

# accumulated_target_pcd += source

# o3d.io.write_point_cloud(f"E:/Auguest_collect_data/c83-b/test_ply/accumulated_target_pcd.ply", accumulated_target_pcd)

“”” “”” {

"name": "",

    # "message": "",
    # "stack": "The Kernel crashed while executing code in this or the previous cell. Please review the code in the cell to     # identify the possible cause of the failure. For more details, click <a     # href='https://aka.ms/vscodeJupyterKernelCrash'>here</a>. For more detailed information, check the Jupyter <a     # href='command:jupyter.viewOutput'>log</a>."
# }

“””

Rektino commented 3 weeks ago

Same problem here using Python 3.11 and open3d 0.18.0. The kernel crushes unexpectedly when running :

reg_p2p = o3d.pipelines.registration.registration_icp( source, target, threshold, trans_init, o3d.pipelines.registration.TransformationEstimationPointToPoint() )