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

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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.

You Might Also Like