strawlab / python-pcl

Python bindings to the pointcloud library (pcl)
http://strawlab.github.com/python-pcl/
Other
2k stars 700 forks source link

setAxis and setEpsAngle for cylinder RANSAC #251

Open bimtauer opened 5 years ago

bimtauer commented 5 years ago

Hi, I'm trying to detect vertical cylinders in a pointcloud. Thanks to your documentation of examples I managed to detect cylinders within the radius limits that I am looking for - however I would also like to specify their direction.

In the original pcl documentation I found the member functions setAxis and setEpsAngle of the sac_model_cylinder class. To my understanding they allow specifying an axis and a maximum deviation from that axis for the model fitting. How would one call these in python?

Below is the code I am using so far - could someone point out how I integrate setAxis and setEpsAngle here?

seg = pointcloud.make_segmenter_normals(ksearch=50) seg.set_optimize_coefficients(True) seg.set_model_type(pcl.SACMODEL_CYLINDER) seg.set_normal_distance_weight(0.05) seg.set_method_type(pcl.SAC_RANSAC) seg.set_max_iterations(10000) seg.set_distance_threshold(0.3) seg.set_radius_limits(0.05, 0.2) indices, model = seg.segment() cylinder = pointcloud.extract(indices, negative=False) remaining = pointcloud.extract(indices, negative=True)

GreKro commented 4 years ago

@bimtauer Did you solve this problem ? Thanks in advance for answer.