pcd.points = o3d.utility.Vector3dVector(point_cloud) TypeError: __init__(): incompatible constructor arguments. The following argument types are supported: 1. open3d.cpu.pybind.utility.Vector3dVector() 2. open3d.cpu.pybind.utility.Vector3dVector(arg0: numpy.ndarray[float64]) 3. open3d.cpu.pybind.utility.Vector3dVector(arg0: open3d.cpu.pybind.utility.Vector3dVector) 4. open3d.cpu.pybind.utility.Vector3dVector(arg0: iterable) Invoked with: PointCloud with 55424544 points.
时间: 2024-03-24 15:41:42 浏览: 123
这个错误是因为你传递给 `Vector3dVector` 的参数类型不正确。根据错误信息,你的 `point_cloud` 是一个包含 55424544 个点的 `PointCloud` 对象,但是 `Vector3dVector` 的构造函数只支持以下四种参数类型:
1. `open3d.cpu.pybind.utility.Vector3dVector()`
2. `open3d.cpu.pybind.utility.Vector3dVector(arg0: numpy.ndarray[float64])`
3. `open3d.cpu.pybind.utility.Vector3dVector(arg0: open3d.cpu.pybind.utility.Vector3dVector)`
4. `open3d.cpu.pybind.utility.Vector3dVector(arg0: iterable)`
因此,你需要将 `PointCloud` 对象转换为一个 `numpy` 数组或者一个可迭代对象,然后再将其传递给 `Vector3dVector` 的构造函数。具体的代码实现可以参考以下示例:
```python
import open3d as o3d
import numpy as np
# 读取点云数据
pcd = o3d.io.read_point_cloud("point_cloud.pcd")
# 将点云数据转换为 numpy 数组
point_cloud = np.asarray(pcd.points)
# 将 numpy 数组转换为 Vector3dVector 对象
points = o3d.utility.Vector3dVector(point_cloud)
```
阅读全文