问题3:AttributeError: ‘open3d.open3d.geometry.PointCloud‘ object has no attribute ‘voxel_down_sample‘

Issue:

==============    Code  ===============================================
import open3d as o3d
pcd = o3d.io.read_point_cloud("apple_object_50.pcd")
print("Downsample the point cloud with a voxel of 0.05")
downpcd = pcd.voxel_down_sample(voxel_size=0.05)
o3d.visualization.draw_geometries([downpcd])

==============    Result  ===============================================
Downsample the point cloud with a voxel of 0.05

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
 in 
      2 pcd = o3d.io.read_point_cloud("apple_object_50.pcd")
      3 print("Downsample the point cloud with a voxel of 0.05")
----> 4 downpcd = pcd.voxel_down_sample(voxel_size=0.05)
      5 o3d.visualization.draw_geometries([downpcd])

AttributeError: 'open3d.open3d.geometry.PointCloud' object has no attribute 'voxel_down_sample'

Reason:

according to the tutorial of Open3d, I wrote the code in the jupyter. after i run, the unexpected error happend. Firstly, i checked my open3d version. the version-open3d is 0.14.1. Secondly, i cheched the tutorial verison(0.15.1). I think "pcd.voxel_down_sample(voxel_size=0.05)" will be okay when my open3d-version is 0.15.1. However, i can not download the open3d-version-0.15.1. Finally, i changed the code "pcd.voxel_down_sample(voxel_size=0.05)" 

Answer:

error:(version-0.14.1)  

pcd.voxel_down_sample(voxel_size=0.05)

i think the above code can be used in the version-0.15.1 

correct :(version-0.14.1) 

downpcd=o3d.geometry.voxel_down_sample("apple_object_50.pcd",voxel_size=0.001)

Ouput

o3d.visualization.draw_geometries([downpcd])

你可能感兴趣的:(linux问题,linux,python)