Open3d Python问题:没有属性'estimate_normals'

问题描述 投票:1回答:1

我正在Windows上使用适用于python3的open3d。它是通过'pip install open3d-python'通过pip安装的。我检查了文档,发现脚本似乎一切正常,该脚本试图将点云文件(.ply)转换为网格(.stl)。但是,在执行时,我得到了attribute error: 'open3d.open3d.geometry.PointCloud' has no attribute 'estimate_normals'。任何帮助,将不胜感激。谢谢

这是我的剧本

import open3d as o3d
import trimesh
import numpy as np

pcd = o3d.io.read_point_cloud("pointcloud.ply")
pcd.estimate_normals()
#pcd = pcd2.normals
# estimate radius for rolling ball
distances = pcd.compute_nearest_neighbor_distance()
avg_dist = np.mean(distances)
radius = 1.5 * avg_dist

mesh = o3d.geometry.TriangleMesh.create_from_point_cloud_ball_pivoting(pcd,o3d.utility.DoubleVector([radius, radius * 2]))

trimesh = trimesh.Trimesh(np.asarray(mesh.vertices), np.asarray(mesh.triangles),vertex_normals=np.asarray(mesh.vertex_normals))

trimesh.export('stuff.stl')

编辑

我读过某个地方,从源代码编译原始软件包可以解决这个问题,但是我是mac用户,并且正在Windows上尝试这样做,所以我不知道该怎么做。这是包https://github.com/intel-isl/Open3D]的github链接>

我正在Windows上使用适用于python3的open3d。它是通过“ pip install open3d-python”通过pip安装的。我已经检查了文档,脚本似乎一切正常,试图执行...

python numpy mesh trimesh open3d
1个回答
1
投票

我遇到了同样的问题,发现问题是由于通过pip install open3d-python安装的open3d版本错误而发生的。对我来说是v0.6.0。该文档基于新版本。从版本v0.8.0开始,open3d应该安装为conda的pip install open3dconda install -c open3d-admin open3d。在releases中找到了该信息。它解决了我的Mac上的问题。

© www.soinside.com 2019 - 2024. All rights reserved.