python-pcl icon indicating copy to clipboard operation
python-pcl copied to clipboard

cropbox example failing

Open PeterTor opened this issue 7 years ago • 5 comments

Hi I got the following exception when I execute the cropbox example: AttributeError: 'pcl._pcl.PointCloud' object has no attribute 'make_cropbox'

any idea?

PeterTor avatar Sep 22 '17 10:09 PeterTor

The Pointcloud object has the following methods for me:

['class', 'delattr', 'doc', 'format', 'getattribute', 'getitem', 'hash', 'init', 'new', 'pyx_vtable', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', '_from_pcd_file', '_from_ply_file', '_to_pcd_file', '_to_ply_file', 'extract', 'from_array', 'from_file', 'from_list', 'get_point', 'height', 'is_dense', 'make_kdtree_flann', 'make_moving_least_squares', 'make_octree', 'make_passthrough_filter', 'make_segmenter', 'make_segmenter_normals', 'make_statistical_outlier_filter', 'make_voxel_grid_filter', 'resize', 'sensor_orientation', 'sensor_origin', 'size', 'to_array', 'to_file', 'to_list', 'width']

PeterTor avatar Sep 22 '17 10:09 PeterTor

After deleting the module containing pip, Can I reinstall the module?

I delete the related file by calling the following file.

Linux/MacOSX

bash ./clear.sh

Windows

clear.bat

Sirokujira avatar Oct 03 '17 06:10 Sirokujira

@PeterTor and @Sirokujira I am facing the same issue. Can anyone help me with this issue?

niranjanreddy891 avatar Mar 20 '18 05:03 niranjanreddy891

For everyone facing the same problem until we've figured out what happened to make_cropbox:

I just had the same problem with PCL-1.9.1 and python-pcl. I solved it (temporarily) by applying a make_passthrough_filter twice - once for X and once for Y. Z you can filter the same way; in my case I needed to deal with Z differently.

f_x = cloud1.make_passthrough_filter()
f_x.set_filter_field_name("x")
f_x.set_filter_limits(X-0.1, X+0.1)
c_x = f_x.filter()
logging.debug( "X: Got %i points", c_x.size )
f_y = c_x.make_passthrough_filter()
f_y.set_filter_field_name("y")
f_y.set_filter_limits(Y-0.1,Y+0.1)
z_cloud = f_y.filter()
logging.debug( "Y: Got %i points", z_cloud.size )

It's probably not terribly efficient, but if you need something that works at least then this seems to do. :-)

Miriup avatar Jan 05 '19 10:01 Miriup

The solution in issue #187 worked for me. I just wrote "outcloud = clipper.filter()" instead of "clipper.Filtering(outcloud)" and it saved the resulting pcd-file in the python-pcl/examples folder.

Me817 avatar May 11 '20 12:05 Me817