今天在安装probreg的时候,没有报错,但是在运行代码的时候报错了:
安装命令为:
pip install probreg
示例代码为:
import copy
import numpy as np
import open3d as o3
from probreg import cpd
# load source and target point cloud
source = o3.io.read_point_cloud('bunny.pcd')
target = copy.deepcopy(source)
# transform target point cloud
th = np.deg2rad(30.0)
target.transform(np.array([[np.cos(th), -np.sin(th), 0.0, 0.0],
[np.sin(th), np.cos(th), 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0]]))
source = source.voxel_down_sample(voxel_size=0.005)
target = target.voxel_down_sample(voxel_size=0.005)
# compute cpd registration
tf_param, _, _ = cpd.registration_cpd(source, target)
result = copy.deepcopy(source)
result.points = tf_param.transform(result.points)
# draw result
source.paint_uniform_color([1, 0, 0])
target.paint_uniform_color([0, 1, 0])
result.paint_uniform_color([0, 0, 1])
o3.visualization.draw_geometries([source, target, result])
错误信息为:
No dq3d python package, filterreg deformation model not available.
解决方法
➜ pip install dq3d
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting dq3d
Downloading http://mirrors.aliyun.com/pypi/packages/9c/8d/ee51122c59d39a3fad1b8fb50988bf23386ea09e8d909129b151abd3a11e/dq3d-0.3.6.tar.gz (882 kB)
|████████████████████████████████| 882 kB 323 kB/s
Requirement already satisfied: pybind11>=2.2 in /home/eric/anaconda3/lib/python3.6/site-packages (from dq3d) (2.5.0)
Building wheels for collected packages: dq3d
Building wheel for dq3d (setup.py) ... done
Created wheel for dq3d: filename=dq3d-0.3.6-cp36-cp36m-linux_x86_64.whl size=1446765 sha256=7d8b094646b3e332475646b50c0def531ee7a916d6812d0e1fd5c70d58f516bc
Stored in directory: /home/eric/.cache/pip/wheels/e8/dc/91/c9b0c8156038febce1c17d910af516053e4b22668a42ea1e15
Successfully built dq3d
Installing collected packages: dq3d
Successfully installed dq3d-0.3.6
只需要安装pip install dq3d 就行了