我正在windows上与open3d for python3一起工作。它是通过pip通过'pip install open3d-python'安装的。我已经检查了文档,我的脚本似乎一切正常,它试图将点云文件(.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链接
发布于 2020-03-11 11:30:23
我也遇到了同样的问题,发现这个问题的发生是因为通过open3d安装的pip install open3d-python版本错误。对我来说是v0.6.0。这些文档是基于新版本的。从版本开始,v0.8.0 open3d应该安装为conda的pip install open3d或conda install -c open3d-admin open3d。在释出中找到了这些信息。它解决了我的mac电脑的问题。
发布于 2020-12-05 17:07:38
这对我来说很管用:
open3d和open3d-pythonpip uninstall open3d open3d-python的不同版本的open3d-pythonpip uninstall open3d open3d-pythonopen3d 0.8pip install open3d==0.8.0.0pcd.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=0.1, max_nn=30))n来可视化表面法线:
o3d.visualization.draw_geometries([pcd])https://stackoverflow.com/questions/59384134
复制相似问题