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

在尝试使用Open3D 0.14.1版本进行点云下采样时遇到了AttributeError,`voxel_down_sample`方法在该版本中不可用。根据教程,此功能在0.15.1版本被引入。为了解决问题,改用全局函数`o3d.geometry.voxel_down_sample`,并调整代码以适配0.14.1版本,成功实现点云的下采样操作。
摘要由CSDN通过智能技术生成

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)
<ipython-input-9-d91495e4867a> in <module>
      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])

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误是由于open3d库的版本问题导致的。根据引用\[1\]和引用\[2\]的建议,你可以尝试卸载并重新安装open3d,或者更新到最新版本。如果这些方法都不起作用,你可以考虑使用anaconda创建一个虚拟环境,并在其中安装open3dopen3d-python。另外,根据引用\[3\]中的代码和结果,你可能还需要检查你的代码中是否正确使用了相关的函数。在这种情况下,错误信息指出'open3d.open3d.geometry.PointCloud'对象没有'voxel_down_sample'属性,可能是因为你使用了错误的函数名称或者函数在你的版本中已被移除。你可以查看open3d的官方文档或者参考其他资源来获取正确的函数名称和用法。 #### 引用[.reference_title] - *1* *2* [open3d环境错误汇总](https://blog.csdn.net/weixin_40524689/article/details/123204514)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [问题3:AttributeError: ‘open3d.open3d.geometry.PointCloudobject has no attributevoxel_down_...](https://blog.csdn.net/qq_40837542/article/details/123059665)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值