ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange

# What does setOptimizeCoefficients do in SACSegmentation

I followed the tutorial about Segmentation in PCL and wondered what setOptimizeCoefficients does. In the tutorial the only comment is that it is optional and in the documentation I am told to set this parameter if a coefficient refinement is required. I am still not really what that is supposed to mean. Can anybody explain that to me?

Kai

edit retag close merge delete

Sort by ยป oldest newest most voted

I'll try to explain using an example from my experience.

The plane's parameters is the normal and the distance to the plane from a fixed reference frame. The model's (plane) coefficients, in this case, are the normal vector (x,y,z) and the offset.

The model's coefficients are estimated using a least-squares method inside RANSAC to find the best-fit model. Once those coefficients are found; an optimization is performed over the estimated coefficients to minimize or reduce the mean-squared-error with respect the all of the 3D points.

The optimization a bit longer and can fail if you have a large percentage of outliers.

This method is optional due to the fact that if you know you have no outliers and no noise, then the least-squares solution will be the same as the optimized (refined) solution. (Saves computational time)

However, if you know that your points are affected by noise and you had to remove outliers, then optimizing the model's coefficients will give a better solution with respect to the least-squares solution. (More time, but better solution)

Its a trade-off between time and quality of the solution.

more

thank you for this great explanation. I was hoping that this option would perform something like that.

( 2013-02-25 15:31:28 -0500 )edit

The algorithm works as follows:

1. randomly select samples from the cloud, just as many as needed to determine a model
2. compute the coefficients of the model from the samples
3. count how many points of the cloud belong to the model, given a threshold. These are called inliers
4. repeat until a good model has been found or a max number of iterations has been reached
5. return the model with the most inliers

I believe the answer to you question is related to stage 4, in which the model parameters, if setOptimizeCoefficients is true, is refined to fit all inliers, instead of using the original parameters that were fitted in stage 2 for the random samples only.

more