Plane fitting in a 3d point cloud

前端 未结 2 1899
南旧
南旧 2020-12-28 10:00

I am trying to find planes in a 3d point cloud, using the regression formula Z= aX + bY +C

I implemented least squares and ransac solutions, but the 3 parameters e

2条回答
  •  太阳男子
    2020-12-28 10:33

    import pcl
    cloud = pcl.PointCloud()
    cloud.from_array(points)
    seg = cloud.make_segmenter_normals(ksearch=50)
    seg.set_optimize_coefficients(True)
    seg.set_model_type(pcl.SACMODEL_PLANE)
    seg.set_normal_distance_weight(0.05)
    seg.set_method_type(pcl.SAC_RANSAC)
    seg.set_max_iterations(100)
    seg.set_distance_threshold(0.005)
    inliers, model = seg.segment()
    

    you need to install python-pcl first. Feel free to play with the parameters. points here is a nx3 numpy array with n 3d points. Model will be [a, b, c, d] such that ax + by + cz + d = 0

提交回复
热议问题