导入open3d
-
遇到报错:
File “D:\ProgramData\Anaconda3\envs\open3d\lib\site-packages\zmq\backend\cython_init_.py”, line 6, in
from . import (constants, error, message, context,
ImportError: DLL load failed: 找不到指定的模块。 -
原因:
缺少某些dll文件,但我又觉得是某个模块的版本不对,版本不够高级。 -
解决方法:
重装了pyzmq: pyzmq-18.0.0会报错。 pyzmq-19.0.1不会出错
pip uninstall pyzmq
pip install pyzmq
我参考了https://blog.youkuaiyun.com/lwgkzl/article/details/85202207
可视化
-
遇到报错:
TypeError: draw_geometries(): incompatible function arguments. The following argument types are supported:
1.(geometry_list: List[open3d.open3d_pybind.geometry.Geometry], window_name: str = ‘Open3D’, width: int = 1920, height: int = 1080, left: int = 50, top: int = 50, point_show_normal: bool = False, mesh_show_wireframe: bool = False, mesh_show_back_face: bool = False) -> None
Invoked with: [geometry::PointCloud with 301154 points., geometry::PointCloud with 297368 points.]; kwargs: zoom=0.4559, front=[0.6452, -0.3036, -0.7011], lookat=[1.9892, 2.0208, 1.8945], up=[-0.2779, -0.9482, 0.1556] -
定位错误代码:
o3d.visualization.draw_geometries([pcd], zoom=0.4559, front=[0.6452, -0.3036, -0.7011], lookat=[1.9892, 2.0208, 1.8945], up=[-0.2779, -0.9482 ,0.1556]) -
原因:
估计是版本不对吧?查看draw_geometries()的函数定义就知道了 -
解决办法:
o3d.visualization.draw_geometries([pcd]) # 把各种参数去掉,只剩点云数据就好
点云配准
-
遇到报错:
RuntimeError: [Open3D ERROR] TransformationEstimationPointToPlane and TransformationEstimationColoredICP require pre-computed normal vectors. -
定位报错代码:
result = o3d.registration.registration_icp(source, target, distance_threshold, result_ransac.transformation, o3d.registration.TransformationEstimationPointToPlane()) -
原因:
使用TransformationEstimationPointToPlane()需要提前计算点云的法向量 -
解决办法:
因为该代码传入的是源数据,没有估计过法线的。而降采样的点云有计算过法向量。故在此处可以把两个点云参数改为降采样后的点云(应该有算过的,在程序比较前面)