Point Cloud Library (PCL)  1.11.1-dev
sac_model_circle3d.hpp
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2012-, Open Perception, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of the copyright holder(s) nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  *
37  */
38 
39 #ifndef PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_CIRCLE_3D_HPP_
40 #define PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_CIRCLE_3D_HPP_
41 
42 #include <cfloat> // for DBL_MAX
43 
44 #include <pcl/sample_consensus/eigen.h>
45 #include <pcl/sample_consensus/sac_model_circle3d.h>
46 #include <pcl/common/concatenate.h>
47 
48 //////////////////////////////////////////////////////////////////////////
49 template <typename PointT> bool
51  const Indices &samples) const
52 {
53  if (samples.size () != sample_size_)
54  {
55  PCL_ERROR ("[pcl::SampleConsensusModelCircle3D::isSampleGood] Wrong number of samples (is %lu, should be %lu)!\n", samples.size (), sample_size_);
56  return (false);
57  }
58  // Get the values at the three points
59  Eigen::Vector3d p0 ((*input_)[samples[0]].x, (*input_)[samples[0]].y, (*input_)[samples[0]].z);
60  Eigen::Vector3d p1 ((*input_)[samples[1]].x, (*input_)[samples[1]].y, (*input_)[samples[1]].z);
61  Eigen::Vector3d p2 ((*input_)[samples[2]].x, (*input_)[samples[2]].y, (*input_)[samples[2]].z);
62 
63  // calculate vectors between points
64  p1 -= p0;
65  p2 -= p0;
66 
67  return (p1.dot (p2) < 0.000001);
68 }
69 
70 //////////////////////////////////////////////////////////////////////////
71 template <typename PointT> bool
72 pcl::SampleConsensusModelCircle3D<PointT>::computeModelCoefficients (const Indices &samples, Eigen::VectorXf &model_coefficients) const
73 {
74  // Need 3 samples
75  if (samples.size () != sample_size_)
76  {
77  PCL_ERROR ("[pcl::SampleConsensusModelCircle3D::computeModelCoefficients] Invalid set of samples given (%lu)!\n", samples.size ());
78  return (false);
79  }
80 
81  model_coefficients.resize (model_size_); //needing 7 coefficients: centerX, centerY, centerZ, radius, normalX, normalY, normalZ
82 
83  Eigen::Vector3d p0 ((*input_)[samples[0]].x, (*input_)[samples[0]].y, (*input_)[samples[0]].z);
84  Eigen::Vector3d p1 ((*input_)[samples[1]].x, (*input_)[samples[1]].y, (*input_)[samples[1]].z);
85  Eigen::Vector3d p2 ((*input_)[samples[2]].x, (*input_)[samples[2]].y, (*input_)[samples[2]].z);
86 
87 
88  Eigen::Vector3d helper_vec01 = p0 - p1;
89  Eigen::Vector3d helper_vec02 = p0 - p2;
90  Eigen::Vector3d helper_vec10 = p1 - p0;
91  Eigen::Vector3d helper_vec12 = p1 - p2;
92  Eigen::Vector3d helper_vec20 = p2 - p0;
93  Eigen::Vector3d helper_vec21 = p2 - p1;
94 
95  Eigen::Vector3d common_helper_vec = helper_vec01.cross (helper_vec12);
96 
97  double commonDividend = 2.0 * common_helper_vec.squaredNorm ();
98 
99  double alpha = (helper_vec12.squaredNorm () * helper_vec01.dot (helper_vec02)) / commonDividend;
100  double beta = (helper_vec02.squaredNorm () * helper_vec10.dot (helper_vec12)) / commonDividend;
101  double gamma = (helper_vec01.squaredNorm () * helper_vec20.dot (helper_vec21)) / commonDividend;
102 
103  Eigen::Vector3d circle_center = alpha * p0 + beta * p1 + gamma * p2;
104 
105  Eigen::Vector3d circle_radiusVector = circle_center - p0;
106  double circle_radius = circle_radiusVector.norm ();
107  Eigen::Vector3d circle_normal = common_helper_vec.normalized ();
108 
109  model_coefficients[0] = static_cast<float> (circle_center[0]);
110  model_coefficients[1] = static_cast<float> (circle_center[1]);
111  model_coefficients[2] = static_cast<float> (circle_center[2]);
112  model_coefficients[3] = static_cast<float> (circle_radius);
113  model_coefficients[4] = static_cast<float> (circle_normal[0]);
114  model_coefficients[5] = static_cast<float> (circle_normal[1]);
115  model_coefficients[6] = static_cast<float> (circle_normal[2]);
116 
117  return (true);
118 }
119 
120 //////////////////////////////////////////////////////////////////////////
121 template <typename PointT> void
122 pcl::SampleConsensusModelCircle3D<PointT>::getDistancesToModel (const Eigen::VectorXf &model_coefficients, std::vector<double> &distances) const
123 {
124  // Check if the model is valid given the user constraints
125  if (!isModelValid (model_coefficients))
126  {
127  distances.clear ();
128  return;
129  }
130  distances.resize (indices_->size ());
131 
132  // Iterate through the 3d points and calculate the distances from them to the sphere
133  for (std::size_t i = 0; i < indices_->size (); ++i)
134  // Calculate the distance from the point to the circle:
135  // 1. calculate intersection point of the plane in which the circle lies and the
136  // line from the sample point with the direction of the plane normal (projected point)
137  // 2. calculate the intersection point of the line from the circle center to the projected point
138  // with the circle
139  // 3. calculate distance from corresponding point on the circle to the sample point
140  {
141  // what i have:
142  // P : Sample Point
143  Eigen::Vector3d P ((*input_)[(*indices_)[i]].x, (*input_)[(*indices_)[i]].y, (*input_)[(*indices_)[i]].z);
144  // C : Circle Center
145  Eigen::Vector3d C (model_coefficients[0], model_coefficients[1], model_coefficients[2]);
146  // N : Circle (Plane) Normal
147  Eigen::Vector3d N (model_coefficients[4], model_coefficients[5], model_coefficients[6]);
148  // r : Radius
149  double r = model_coefficients[3];
150 
151  Eigen::Vector3d helper_vectorPC = P - C;
152  // 1.1. get line parameter
153  double lambda = (helper_vectorPC.dot (N)) / N.squaredNorm ();
154 
155  // Projected Point on plane
156  Eigen::Vector3d P_proj = P + lambda * N;
157  Eigen::Vector3d helper_vectorP_projC = P_proj - C;
158 
159  // K : Point on Circle
160  Eigen::Vector3d K = C + r * helper_vectorP_projC.normalized ();
161  Eigen::Vector3d distanceVector = P - K;
162 
163  distances[i] = distanceVector.norm ();
164  }
165 }
166 
167 //////////////////////////////////////////////////////////////////////////
168 template <typename PointT> void
170  const Eigen::VectorXf &model_coefficients, const double threshold,
171  Indices &inliers)
172 {
173  // Check if the model is valid given the user constraints
174  if (!isModelValid (model_coefficients))
175  {
176  inliers.clear ();
177  return;
178  }
179  inliers.clear ();
180  inliers.reserve (indices_->size ());
181 
182  const auto squared_threshold = threshold * threshold;
183  // Iterate through the 3d points and calculate the distances from them to the sphere
184  for (std::size_t i = 0; i < indices_->size (); ++i)
185  {
186  // what i have:
187  // P : Sample Point
188  Eigen::Vector3d P ((*input_)[(*indices_)[i]].x, (*input_)[(*indices_)[i]].y, (*input_)[(*indices_)[i]].z);
189  // C : Circle Center
190  Eigen::Vector3d C (model_coefficients[0], model_coefficients[1], model_coefficients[2]);
191  // N : Circle (Plane) Normal
192  Eigen::Vector3d N (model_coefficients[4], model_coefficients[5], model_coefficients[6]);
193  // r : Radius
194  double r = model_coefficients[3];
195 
196  Eigen::Vector3d helper_vectorPC = P - C;
197  // 1.1. get line parameter
198  double lambda = (-(helper_vectorPC.dot (N))) / N.dot (N);
199  // Projected Point on plane
200  Eigen::Vector3d P_proj = P + lambda * N;
201  Eigen::Vector3d helper_vectorP_projC = P_proj - C;
202 
203  // K : Point on Circle
204  Eigen::Vector3d K = C + r * helper_vectorP_projC.normalized ();
205  Eigen::Vector3d distanceVector = P - K;
206 
207  if (distanceVector.squaredNorm () < squared_threshold)
208  {
209  // Returns the indices of the points whose distances are smaller than the threshold
210  inliers.push_back ((*indices_)[i]);
211  }
212  }
213 }
214 
215 //////////////////////////////////////////////////////////////////////////
216 template <typename PointT> std::size_t
218  const Eigen::VectorXf &model_coefficients, const double threshold) const
219 {
220  // Check if the model is valid given the user constraints
221  if (!isModelValid (model_coefficients))
222  return (0);
223  std::size_t nr_p = 0;
224 
225  const auto squared_threshold = threshold * threshold;
226  // Iterate through the 3d points and calculate the distances from them to the sphere
227  for (std::size_t i = 0; i < indices_->size (); ++i)
228  {
229  // what i have:
230  // P : Sample Point
231  Eigen::Vector3d P ((*input_)[(*indices_)[i]].x, (*input_)[(*indices_)[i]].y, (*input_)[(*indices_)[i]].z);
232  // C : Circle Center
233  Eigen::Vector3d C (model_coefficients[0], model_coefficients[1], model_coefficients[2]);
234  // N : Circle (Plane) Normal
235  Eigen::Vector3d N (model_coefficients[4], model_coefficients[5], model_coefficients[6]);
236  // r : Radius
237  double r = model_coefficients[3];
238 
239  Eigen::Vector3d helper_vectorPC = P - C;
240  // 1.1. get line parameter
241  double lambda = (-(helper_vectorPC.dot (N))) / N.dot (N);
242 
243  // Projected Point on plane
244  Eigen::Vector3d P_proj = P + lambda * N;
245  Eigen::Vector3d helper_vectorP_projC = P_proj - C;
246 
247  // K : Point on Circle
248  Eigen::Vector3d K = C + r * helper_vectorP_projC.normalized ();
249  Eigen::Vector3d distanceVector = P - K;
250 
251  if (distanceVector.squaredNorm () < squared_threshold)
252  nr_p++;
253  }
254  return (nr_p);
255 }
256 
257 //////////////////////////////////////////////////////////////////////////
258 template <typename PointT> void
260  const Indices &inliers,
261  const Eigen::VectorXf &model_coefficients,
262  Eigen::VectorXf &optimized_coefficients) const
263 {
264  optimized_coefficients = model_coefficients;
265 
266  // Needs a set of valid model coefficients
267  if (!isModelValid (model_coefficients))
268  {
269  PCL_ERROR ("[pcl::SampleConsensusModelCircle3D::optimizeModelCoefficients] Given model is invalid!\n");
270  return;
271  }
272 
273  // Need more than the minimum sample size to make a difference
274  if (inliers.size () <= sample_size_)
275  {
276  PCL_ERROR ("[pcl::SampleConsensusModelCircle3D::optimizeModelCoefficients] Not enough inliers to refine/optimize the model's coefficients (%lu)! Returning the same coefficients.\n", inliers.size ());
277  return;
278  }
279 
280  OptimizationFunctor functor (this, inliers);
281  Eigen::NumericalDiff<OptimizationFunctor> num_diff (functor);
282  Eigen::LevenbergMarquardt<Eigen::NumericalDiff<OptimizationFunctor>, double> lm (num_diff);
283  Eigen::VectorXd coeff;
284  int info = lm.minimize (coeff);
285  for (Eigen::Index i = 0; i < coeff.size (); ++i)
286  optimized_coefficients[i] = static_cast<float> (coeff[i]);
287 
288  // Compute the L2 norm of the residuals
289  PCL_DEBUG ("[pcl::SampleConsensusModelCircle3D::optimizeModelCoefficients] LM solver finished with exit code %i, having a residual norm of %g. \nInitial solution: %g %g %g %g %g %g %g \nFinal solution: %g %g %g %g %g %g %g\n",
290  info, lm.fvec.norm (), model_coefficients[0], model_coefficients[1], model_coefficients[2], model_coefficients[3], model_coefficients[4], model_coefficients[5], model_coefficients[6], optimized_coefficients[0], optimized_coefficients[1], optimized_coefficients[2], optimized_coefficients[3], optimized_coefficients[4], optimized_coefficients[5], optimized_coefficients[6]);
291 }
292 
293 //////////////////////////////////////////////////////////////////////////
294 template <typename PointT> void
296  const Indices &inliers, const Eigen::VectorXf &model_coefficients,
297  PointCloud &projected_points, bool copy_data_fields) const
298 {
299  // Needs a valid set of model coefficients
300  if (!isModelValid (model_coefficients))
301  {
302  PCL_ERROR ("[pcl::SampleConsensusModelCircle3D::projectPoints] Given model is invalid!\n");
303  return;
304  }
305 
306  projected_points.header = input_->header;
307  projected_points.is_dense = input_->is_dense;
308 
309  // Copy all the data fields from the input cloud to the projected one?
310  if (copy_data_fields)
311  {
312  // Allocate enough space and copy the basics
313  projected_points.resize (input_->size ());
314  projected_points.width = input_->width;
315  projected_points.height = input_->height;
316 
317  using FieldList = typename pcl::traits::fieldList<PointT>::type;
318  // Iterate over each point
319  for (std::size_t i = 0; i < projected_points.size (); ++i)
320  // Iterate over each dimension
321  pcl::for_each_type <FieldList> (NdConcatenateFunctor <PointT, PointT> ((*input_)[i], projected_points[i]));
322 
323  // Iterate through the 3d points and calculate the distances from them to the plane
324  for (std::size_t i = 0; i < inliers.size (); ++i)
325  {
326  // what i have:
327  // P : Sample Point
328  Eigen::Vector3d P ((*input_)[inliers[i]].x, (*input_)[inliers[i]].y, (*input_)[inliers[i]].z);
329  // C : Circle Center
330  Eigen::Vector3d C (model_coefficients[0], model_coefficients[1], model_coefficients[2]);
331  // N : Circle (Plane) Normal
332  Eigen::Vector3d N (model_coefficients[4], model_coefficients[5], model_coefficients[6]);
333  // r : Radius
334  double r = model_coefficients[3];
335 
336  Eigen::Vector3d helper_vectorPC = P - C;
337  // 1.1. get line parameter
338  //float lambda = (helper_vectorPC.dot(N)) / N.squaredNorm() ;
339  double lambda = (-(helper_vectorPC.dot (N))) / N.dot (N);
340  // Projected Point on plane
341  Eigen::Vector3d P_proj = P + lambda * N;
342  Eigen::Vector3d helper_vectorP_projC = P_proj - C;
343 
344  // K : Point on Circle
345  Eigen::Vector3d K = C + r * helper_vectorP_projC.normalized ();
346 
347  projected_points[i].x = static_cast<float> (K[0]);
348  projected_points[i].y = static_cast<float> (K[1]);
349  projected_points[i].z = static_cast<float> (K[2]);
350  }
351  }
352  else
353  {
354  // Allocate enough space and copy the basics
355  projected_points.resize (inliers.size ());
356  projected_points.width = inliers.size ();
357  projected_points.height = 1;
358 
359  using FieldList = typename pcl::traits::fieldList<PointT>::type;
360  // Iterate over each point
361  for (std::size_t i = 0; i < inliers.size (); ++i)
362  // Iterate over each dimension
363  pcl::for_each_type <FieldList> (NdConcatenateFunctor <PointT, PointT> ((*input_)[inliers[i]], projected_points[i]));
364 
365  // Iterate through the 3d points and calculate the distances from them to the plane
366  for (std::size_t i = 0; i < inliers.size (); ++i)
367  {
368  // what i have:
369  // P : Sample Point
370  Eigen::Vector3d P ((*input_)[inliers[i]].x, (*input_)[inliers[i]].y, (*input_)[inliers[i]].z);
371  // C : Circle Center
372  Eigen::Vector3d C (model_coefficients[0], model_coefficients[1], model_coefficients[2]);
373  // N : Circle (Plane) Normal
374  Eigen::Vector3d N (model_coefficients[4], model_coefficients[5], model_coefficients[6]);
375  // r : Radius
376  double r = model_coefficients[3];
377 
378  Eigen::Vector3d helper_vectorPC = P - C;
379  // 1.1. get line parameter
380  double lambda = (-(helper_vectorPC.dot (N))) / N.dot (N);
381  // Projected Point on plane
382  Eigen::Vector3d P_proj = P + lambda * N;
383  Eigen::Vector3d helper_vectorP_projC = P_proj - C;
384 
385  // K : Point on Circle
386  Eigen::Vector3d K = C + r * helper_vectorP_projC.normalized ();
387 
388  projected_points[i].x = static_cast<float> (K[0]);
389  projected_points[i].y = static_cast<float> (K[1]);
390  projected_points[i].z = static_cast<float> (K[2]);
391  }
392  }
393 }
394 
395 //////////////////////////////////////////////////////////////////////////
396 template <typename PointT> bool
398  const std::set<index_t> &indices,
399  const Eigen::VectorXf &model_coefficients,
400  const double threshold) const
401 {
402  // Needs a valid model coefficients
403  if (!isModelValid (model_coefficients))
404  {
405  PCL_ERROR ("[pcl::SampleConsensusModelCircle3D::doSamplesVerifyModel] Given model is invalid!\n");
406  return (false);
407  }
408 
409  const auto squared_threshold = threshold * threshold;
410  for (const auto &index : indices)
411  {
412  // Calculate the distance from the point to the sphere as the difference between
413  //dist(point,sphere_origin) and sphere_radius
414 
415  // what i have:
416  // P : Sample Point
417  Eigen::Vector3d P ((*input_)[index].x, (*input_)[index].y, (*input_)[index].z);
418  // C : Circle Center
419  Eigen::Vector3d C (model_coefficients[0], model_coefficients[1], model_coefficients[2]);
420  // N : Circle (Plane) Normal
421  Eigen::Vector3d N (model_coefficients[4], model_coefficients[5], model_coefficients[6]);
422  // r : Radius
423  double r = model_coefficients[3];
424  Eigen::Vector3d helper_vectorPC = P - C;
425  // 1.1. get line parameter
426  double lambda = (-(helper_vectorPC.dot (N))) / N.dot (N);
427  // Projected Point on plane
428  Eigen::Vector3d P_proj = P + lambda * N;
429  Eigen::Vector3d helper_vectorP_projC = P_proj - C;
430 
431  // K : Point on Circle
432  Eigen::Vector3d K = C + r * helper_vectorP_projC.normalized ();
433  Eigen::Vector3d distanceVector = P - K;
434 
435  if (distanceVector.squaredNorm () > squared_threshold)
436  return (false);
437  }
438  return (true);
439 }
440 
441 //////////////////////////////////////////////////////////////////////////
442 template <typename PointT> bool
443 pcl::SampleConsensusModelCircle3D<PointT>::isModelValid (const Eigen::VectorXf &model_coefficients) const
444 {
445  if (!SampleConsensusModel<PointT>::isModelValid (model_coefficients))
446  return (false);
447 
448  if (radius_min_ != -DBL_MAX && model_coefficients[3] < radius_min_)
449  return (false);
450  if (radius_max_ != DBL_MAX && model_coefficients[3] > radius_max_)
451  return (false);
452 
453  return (true);
454 }
455 
456 #define PCL_INSTANTIATE_SampleConsensusModelCircle3D(T) template class PCL_EXPORTS pcl::SampleConsensusModelCircle3D<T>;
457 
458 #endif // PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_CIRCLE3D_HPP_
459 
pcl::K
@ K
Definition: norms.h:54
pcl::SampleConsensusModelCircle3D::isSampleGood
bool isSampleGood(const Indices &samples) const override
Check if a sample of indices results in a good sample of points indices.
Definition: sac_model_circle3d.hpp:50
pcl::PointCloud::height
std::uint32_t height
The point cloud height (if organized as an image-structure).
Definition: point_cloud.h:394
pcl::SampleConsensusModelCircle3D::projectPoints
void projectPoints(const Indices &inliers, const Eigen::VectorXf &model_coefficients, PointCloud &projected_points, bool copy_data_fields=true) const override
Create a new point cloud with inliers projected onto the 3d circle model.
Definition: sac_model_circle3d.hpp:295
pcl::SampleConsensusModelCircle3D::computeModelCoefficients
bool computeModelCoefficients(const Indices &samples, Eigen::VectorXf &model_coefficients) const override
Check whether the given index samples can form a valid 2D circle model, compute the model coefficient...
Definition: sac_model_circle3d.hpp:72
pcl::NdConcatenateFunctor
Helper functor structure for concatenate.
Definition: concatenate.h:49
pcl::PointCloud< pcl::PointXYZRGB >
pcl::PointCloud::width
std::uint32_t width
The point cloud width (if organized as an image-structure).
Definition: point_cloud.h:392
pcl::SampleConsensusModelCircle3D::countWithinDistance
std::size_t countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold) const override
Count all the points which respect the given model coefficients as inliers.
Definition: sac_model_circle3d.hpp:217
pcl::PointCloud::is_dense
bool is_dense
True if no points are invalid (e.g., have NaN or Inf values in any of their floating point fields).
Definition: point_cloud.h:397
pcl::PointCloud::resize
void resize(std::size_t count)
Resizes the container to contain count elements.
Definition: point_cloud.h:456
pcl::PointCloud::header
pcl::PCLHeader header
The point cloud header.
Definition: point_cloud.h:386
pcl::Indices
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition: types.h:131
pcl::PointCloud::size
std::size_t size() const
Definition: point_cloud.h:437
pcl::SampleConsensusModelCircle3D::isModelValid
bool isModelValid(const Eigen::VectorXf &model_coefficients) const override
Check whether a model is valid given the user constraints.
Definition: sac_model_circle3d.hpp:443
pcl::SampleConsensusModelCircle3D::doSamplesVerifyModel
bool doSamplesVerifyModel(const std::set< index_t > &indices, const Eigen::VectorXf &model_coefficients, const double threshold) const override
Verify whether a subset of indices verifies the given 3d circle model coefficients.
Definition: sac_model_circle3d.hpp:397
pcl::SampleConsensusModelCircle3D::selectWithinDistance
void selectWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold, Indices &inliers) override
Compute all distances from the cloud data to a given 3D circle model.
Definition: sac_model_circle3d.hpp:169
pcl::SampleConsensusModel
SampleConsensusModel represents the base model class.
Definition: sac_model.h:69
pcl::SampleConsensusModelCircle3D::optimizeModelCoefficients
void optimizeModelCoefficients(const Indices &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients) const override
Recompute the 3d circle coefficients using the given inlier set and return them to the user.
Definition: sac_model_circle3d.hpp:259
pcl::SampleConsensusModelCircle3D::getDistancesToModel
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const override
Compute all distances from the cloud data to a given 3D circle model.
Definition: sac_model_circle3d.hpp:122