RANSAC plane fitting coefficients

匿名 (未验证) 提交于 2019-12-03 08:33:39

问题:

I am trying to fit a plane to a set of point cloud. I tried using Point Cloud Library (PCL) & it works well. What I need to know is that how can I obtain the coefficients a,b,c of the fitted plane (ax+by+cz+1=0). Is there any straightforward way? I got some insights from here: 3D Least Squares Plane

回答1:

See the following planar segmentation tutorial:

http://pointclouds.org/documentation/tutorials/planar_segmentation.php

Note in particular the use of the pcl::ModelCoefficients data structure.

Allocation:

pcl::ModelCoefficients::Ptr coefficients (new pcl::ModelCoefficients); 

Use:

seg.segment (*inliers, *coefficients); 

Meaning:

coefficients->values[0]/coefficients->values[3] is your a.

coefficients->values[1]/coefficients->values[3] is your b.

coefficients->values[2]/coefficients->values[3] is your c.

See also:

http://docs.pointclouds.org/1.7.0/structpcl_1_1_model_coefficients.html



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!