Can Not Downsample a Point Cloud in Open3D

Can Not Downsample a Point Cloud in Open3D

I am new to open3D pythong binding.

I am trying to downsample a point clout and I have this code:

import open3d as o3d
input_file='mypoints.ply'
pcd = o3d.io.read_point_cloud(input_file)
voxel_down_pcd = o3d.geometry.voxel_down_sample(pcd, voxel_size=0.02)
o3d.visualization.draw_geometries([voxel_down_pcd])

but when I run the code I am getting this error:

module 'open3d.cpu.pybind.geometry' has no attribute 'voxel_down_sample'

I got the sample from Open3D website tutorial

What is the problem and how I can fix it?

1 Answer

You need to call the voxel_down_sample() on the pcd object. For ex, in your case, it will be like this:

import open3d as o3d
input_file='mypoints.ply'
pcd = o3d.io.read_point_cloud(input_file)
voxel_down_pcd = pcd.voxel_down_sample(pcd, voxel_size=0.02)
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.