RANSAC plane fitting coefficients
Asked Answered
J

1

2

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

Janaye answered 22/5, 2014 at 18:32 Comment(1)
ask this question on crossvalidated.Longbow
L
8

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

Leyte answered 23/5, 2014 at 7:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.