Point Cloud Library (PCL) 1.12.0
sac_model_sphere.hpp
1/*
2 * Software License Agreement (BSD License)
3 *
4 * Point Cloud Library (PCL) - www.pointclouds.org
5 * Copyright (c) 2009, Willow Garage, Inc.
6 * Copyright (c) 2012-, Open Perception, Inc.
7 *
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * * Redistributions in binary form must reproduce the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer in the documentation and/or other materials provided
19 * with the distribution.
20 * * Neither the name of the copyright holder(s) nor the names of its
21 * contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 * $Id$
38 *
39 */
40
41#ifndef PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_SPHERE_H_
42#define PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_SPHERE_H_
43
44#include <unsupported/Eigen/NonLinearOptimization> // for LevenbergMarquardt
45#include <pcl/sample_consensus/sac_model_sphere.h>
46
47//////////////////////////////////////////////////////////////////////////
48template <typename PointT> bool
50{
51 if (samples.size () != sample_size_)
52 {
53 PCL_ERROR ("[pcl::SampleConsensusModelSphere::isSampleGood] Wrong number of samples (is %lu, should be %lu)!\n", samples.size (), sample_size_);
54 return (false);
55 }
56 return (true);
57}
58
59//////////////////////////////////////////////////////////////////////////
60template <typename PointT> bool
62 const Indices &samples, Eigen::VectorXf &model_coefficients) const
63{
64 // Need 4 samples
65 if (samples.size () != sample_size_)
66 {
67 PCL_ERROR ("[pcl::SampleConsensusModelSphere::computeModelCoefficients] Invalid set of samples given (%lu)!\n", samples.size ());
68 return (false);
69 }
70
71 Eigen::Matrix4f temp;
72 for (int i = 0; i < 4; i++)
73 {
74 temp (i, 0) = (*input_)[samples[i]].x;
75 temp (i, 1) = (*input_)[samples[i]].y;
76 temp (i, 2) = (*input_)[samples[i]].z;
77 temp (i, 3) = 1;
78 }
79 float m11 = temp.determinant ();
80 if (m11 == 0)
81 {
82 return (false); // the points don't define a sphere!
83 }
84
85 for (int i = 0; i < 4; ++i)
86 {
87 temp (i, 0) = ((*input_)[samples[i]].x) * ((*input_)[samples[i]].x) +
88 ((*input_)[samples[i]].y) * ((*input_)[samples[i]].y) +
89 ((*input_)[samples[i]].z) * ((*input_)[samples[i]].z);
90 }
91 float m12 = temp.determinant ();
92
93 for (int i = 0; i < 4; ++i)
94 {
95 temp (i, 1) = temp (i, 0);
96 temp (i, 0) = (*input_)[samples[i]].x;
97 }
98 float m13 = temp.determinant ();
99
100 for (int i = 0; i < 4; ++i)
101 {
102 temp (i, 2) = temp (i, 1);
103 temp (i, 1) = (*input_)[samples[i]].y;
104 }
105 float m14 = temp.determinant ();
106
107 for (int i = 0; i < 4; ++i)
108 {
109 temp (i, 0) = temp (i, 2);
110 temp (i, 1) = (*input_)[samples[i]].x;
111 temp (i, 2) = (*input_)[samples[i]].y;
112 temp (i, 3) = (*input_)[samples[i]].z;
113 }
114 float m15 = temp.determinant ();
115
116 // Center (x , y, z)
117 model_coefficients.resize (model_size_);
118 model_coefficients[0] = 0.5f * m12 / m11;
119 model_coefficients[1] = 0.5f * m13 / m11;
120 model_coefficients[2] = 0.5f * m14 / m11;
121 // Radius
122 model_coefficients[3] = std::sqrt (model_coefficients[0] * model_coefficients[0] +
123 model_coefficients[1] * model_coefficients[1] +
124 model_coefficients[2] * model_coefficients[2] - m15 / m11);
125
126 PCL_DEBUG ("[pcl::SampleConsensusModelSphere::computeModelCoefficients] Model is (%g,%g,%g,%g)\n",
127 model_coefficients[0], model_coefficients[1], model_coefficients[2], model_coefficients[3]);
128 return (true);
129}
130
131#define AT(POS) ((*input_)[(*indices_)[(POS)]])
132
133#ifdef __AVX__
134// This function computes the squared distances (i.e. the distances without the square root) of 8 points to the center of the sphere
135template <typename PointT> inline __m256 pcl::SampleConsensusModelSphere<PointT>::sqr_dist8 (const std::size_t i, const __m256 a_vec, const __m256 b_vec, const __m256 c_vec) const
136{
137 const __m256 tmp1 = _mm256_sub_ps (_mm256_set_ps (AT(i ).x, AT(i+1).x, AT(i+2).x, AT(i+3).x, AT(i+4).x, AT(i+5).x, AT(i+6).x, AT(i+7).x), a_vec);
138 const __m256 tmp2 = _mm256_sub_ps (_mm256_set_ps (AT(i ).y, AT(i+1).y, AT(i+2).y, AT(i+3).y, AT(i+4).y, AT(i+5).y, AT(i+6).y, AT(i+7).y), b_vec);
139 const __m256 tmp3 = _mm256_sub_ps (_mm256_set_ps (AT(i ).z, AT(i+1).z, AT(i+2).z, AT(i+3).z, AT(i+4).z, AT(i+5).z, AT(i+6).z, AT(i+7).z), c_vec);
140 return _mm256_add_ps (_mm256_add_ps (_mm256_mul_ps (tmp1, tmp1), _mm256_mul_ps (tmp2, tmp2)), _mm256_mul_ps(tmp3, tmp3));
142#endif // ifdef __AVX__
143
144#ifdef __SSE__
145// This function computes the squared distances (i.e. the distances without the square root) of 4 points to the center of the sphere
146template <typename PointT> inline __m128 pcl::SampleConsensusModelSphere<PointT>::sqr_dist4 (const std::size_t i, const __m128 a_vec, const __m128 b_vec, const __m128 c_vec) const
147{
148 const __m128 tmp1 = _mm_sub_ps (_mm_set_ps (AT(i ).x, AT(i+1).x, AT(i+2).x, AT(i+3).x), a_vec);
149 const __m128 tmp2 = _mm_sub_ps (_mm_set_ps (AT(i ).y, AT(i+1).y, AT(i+2).y, AT(i+3).y), b_vec);
150 const __m128 tmp3 = _mm_sub_ps (_mm_set_ps (AT(i ).z, AT(i+1).z, AT(i+2).z, AT(i+3).z), c_vec);
151 return _mm_add_ps (_mm_add_ps (_mm_mul_ps (tmp1, tmp1), _mm_mul_ps (tmp2, tmp2)), _mm_mul_ps(tmp3, tmp3));
152}
153#endif // ifdef __SSE__
154
155#undef AT
156
157//////////////////////////////////////////////////////////////////////////
158template <typename PointT> void
160 const Eigen::VectorXf &model_coefficients, std::vector<double> &distances) const
161{
162 // Check if the model is valid given the user constraints
163 if (!isModelValid (model_coefficients))
164 {
165 distances.clear ();
166 return;
167 }
168 distances.resize (indices_->size ());
170 const Eigen::Vector3f center (model_coefficients[0], model_coefficients[1], model_coefficients[2]);
171 // Iterate through the 3d points and calculate the distances from them to the sphere
172 for (std::size_t i = 0; i < indices_->size (); ++i)
173 {
174 // Calculate the distance from the point to the sphere as the difference between
175 //dist(point,sphere_origin) and sphere_radius
176 distances[i] = std::abs (((*input_)[(*indices_)[i]].getVector3fMap () - center).norm () - model_coefficients[3]);
177 }
178}
180//////////////////////////////////////////////////////////////////////////
181template <typename PointT> void
183 const Eigen::VectorXf &model_coefficients, const double threshold, Indices &inliers)
184{
185 // Check if the model is valid given the user constraints
186 if (!isModelValid (model_coefficients))
187 {
188 inliers.clear ();
189 return;
190 }
192 inliers.clear ();
193 error_sqr_dists_.clear ();
194 inliers.reserve (indices_->size ());
195 error_sqr_dists_.reserve (indices_->size ());
196
197 const float sqr_inner_radius = (model_coefficients[3] <= threshold ? 0.0f : (model_coefficients[3] - threshold) * (model_coefficients[3] - threshold));
198 const float sqr_outer_radius = (model_coefficients[3] + threshold) * (model_coefficients[3] + threshold);
199 const Eigen::Vector3f center (model_coefficients[0], model_coefficients[1], model_coefficients[2]);
200 // Iterate through the 3d points and calculate the distances from them to the sphere
201 for (std::size_t i = 0; i < indices_->size (); ++i)
203 // To avoid sqrt computation: consider one larger sphere (radius + threshold) and one smaller sphere (radius - threshold).
204 // Valid if point is in larger sphere, but not in smaller sphere.
205 const float sqr_dist = ((*input_)[(*indices_)[i]].getVector3fMap () - center).squaredNorm ();
206 if ((sqr_dist <= sqr_outer_radius) && (sqr_dist >= sqr_inner_radius))
207 {
208 // Returns the indices of the points whose distances are smaller than the threshold
209 inliers.push_back ((*indices_)[i]);
210 // Only compute exact distance if necessary (if point is inlier)
211 error_sqr_dists_.push_back (static_cast<double> (std::abs (std::sqrt (sqr_dist) - model_coefficients[3])));
212 }
213 }
214}
215
216//////////////////////////////////////////////////////////////////////////
217template <typename PointT> std::size_t
219 const Eigen::VectorXf &model_coefficients, const double threshold) const
220{
221 // Check if the model is valid given the user constraints
222 if (!isModelValid (model_coefficients))
223 return (0);
224
225#if defined (__AVX__) && defined (__AVX2__)
226 return countWithinDistanceAVX (model_coefficients, threshold);
227#elif defined (__SSE__) && defined (__SSE2__) && defined (__SSE4_1__)
228 return countWithinDistanceSSE (model_coefficients, threshold);
229#else
230 return countWithinDistanceStandard (model_coefficients, threshold);
231#endif
232}
233
234//////////////////////////////////////////////////////////////////////////
235template <typename PointT> std::size_t
237 const Eigen::VectorXf &model_coefficients, const double threshold, std::size_t i) const
238{
239 std::size_t nr_p = 0;
240 const float sqr_inner_radius = (model_coefficients[3] <= threshold ? 0.0f : (model_coefficients[3] - threshold) * (model_coefficients[3] - threshold));
241 const float sqr_outer_radius = (model_coefficients[3] + threshold) * (model_coefficients[3] + threshold);
242 const Eigen::Vector3f center (model_coefficients[0], model_coefficients[1], model_coefficients[2]);
243 // Iterate through the 3d points and calculate the distances from them to the sphere
244 for (; i < indices_->size (); ++i)
245 {
246 // To avoid sqrt computation: consider one larger sphere (radius + threshold) and one smaller sphere (radius - threshold).
247 // Valid if point is in larger sphere, but not in smaller sphere.
248 const float sqr_dist = ((*input_)[(*indices_)[i]].getVector3fMap () - center).squaredNorm ();
249 if ((sqr_dist <= sqr_outer_radius) && (sqr_dist >= sqr_inner_radius))
250 nr_p++;
251 }
252 return (nr_p);
253}
254
255//////////////////////////////////////////////////////////////////////////
256#if defined (__SSE__) && defined (__SSE2__) && defined (__SSE4_1__)
257template <typename PointT> std::size_t
259 const Eigen::VectorXf &model_coefficients, const double threshold, std::size_t i) const
260{
261 std::size_t nr_p = 0;
262 const __m128 a_vec = _mm_set1_ps (model_coefficients[0]);
263 const __m128 b_vec = _mm_set1_ps (model_coefficients[1]);
264 const __m128 c_vec = _mm_set1_ps (model_coefficients[2]);
265 // To avoid sqrt computation: consider one larger sphere (radius + threshold) and one smaller sphere (radius - threshold). Valid if point is in larger sphere, but not in smaller sphere.
266 const __m128 sqr_inner_radius = _mm_set1_ps ((model_coefficients[3] <= threshold ? 0.0 : (model_coefficients[3]-threshold)*(model_coefficients[3]-threshold)));
267 const __m128 sqr_outer_radius = _mm_set1_ps ((model_coefficients[3]+threshold)*(model_coefficients[3]+threshold));
268 __m128i res = _mm_set1_epi32(0); // This corresponds to nr_p: 4 32bit integers that, summed together, hold the number of inliers
269 for (; (i + 4) <= indices_->size (); i += 4)
270 {
271 const __m128 sqr_dist = sqr_dist4 (i, a_vec, b_vec, c_vec);
272 const __m128 mask = _mm_and_ps (_mm_cmplt_ps (sqr_inner_radius, sqr_dist), _mm_cmplt_ps (sqr_dist, sqr_outer_radius)); // The mask contains 1 bits if the corresponding points are inliers, else 0 bits
273 res = _mm_add_epi32 (res, _mm_and_si128 (_mm_set1_epi32 (1), _mm_castps_si128 (mask))); // The latter part creates a vector with ones (as 32bit integers) where the points are inliers
274 //const int res = _mm_movemask_ps (mask);
275 //if (res & 1) nr_p++;
276 //if (res & 2) nr_p++;
277 //if (res & 4) nr_p++;
278 //if (res & 8) nr_p++;
279 }
280 nr_p += _mm_extract_epi32 (res, 0);
281 nr_p += _mm_extract_epi32 (res, 1);
282 nr_p += _mm_extract_epi32 (res, 2);
283 nr_p += _mm_extract_epi32 (res, 3);
284
285 // Process the remaining points (at most 3)
286 nr_p += countWithinDistanceStandard (model_coefficients, threshold, i);
287 return (nr_p);
288}
289#endif
290
291//////////////////////////////////////////////////////////////////////////
292#if defined (__AVX__) && defined (__AVX2__)
293template <typename PointT> std::size_t
295 const Eigen::VectorXf &model_coefficients, const double threshold, std::size_t i) const
296{
297 std::size_t nr_p = 0;
298 const __m256 a_vec = _mm256_set1_ps (model_coefficients[0]);
299 const __m256 b_vec = _mm256_set1_ps (model_coefficients[1]);
300 const __m256 c_vec = _mm256_set1_ps (model_coefficients[2]);
301 // To avoid sqrt computation: consider one larger sphere (radius + threshold) and one smaller sphere (radius - threshold). Valid if point is in larger sphere, but not in smaller sphere.
302 const __m256 sqr_inner_radius = _mm256_set1_ps ((model_coefficients[3] <= threshold ? 0.0 : (model_coefficients[3]-threshold)*(model_coefficients[3]-threshold)));
303 const __m256 sqr_outer_radius = _mm256_set1_ps ((model_coefficients[3]+threshold)*(model_coefficients[3]+threshold));
304 __m256i res = _mm256_set1_epi32(0); // This corresponds to nr_p: 8 32bit integers that, summed together, hold the number of inliers
305 for (; (i + 8) <= indices_->size (); i += 8)
306 {
307 const __m256 sqr_dist = sqr_dist8 (i, a_vec, b_vec, c_vec);
308 const __m256 mask = _mm256_and_ps (_mm256_cmp_ps (sqr_inner_radius, sqr_dist, _CMP_LT_OQ), _mm256_cmp_ps (sqr_dist, sqr_outer_radius, _CMP_LT_OQ)); // The mask contains 1 bits if the corresponding points are inliers, else 0 bits
309 res = _mm256_add_epi32 (res, _mm256_and_si256 (_mm256_set1_epi32 (1), _mm256_castps_si256 (mask))); // The latter part creates a vector with ones (as 32bit integers) where the points are inliers
310 //const int res = _mm256_movemask_ps (mask);
311 //if (res & 1) nr_p++;
312 //if (res & 2) nr_p++;
313 //if (res & 4) nr_p++;
314 //if (res & 8) nr_p++;
315 //if (res & 16) nr_p++;
316 //if (res & 32) nr_p++;
317 //if (res & 64) nr_p++;
318 //if (res & 128) nr_p++;
319 }
320 nr_p += _mm256_extract_epi32 (res, 0);
321 nr_p += _mm256_extract_epi32 (res, 1);
322 nr_p += _mm256_extract_epi32 (res, 2);
323 nr_p += _mm256_extract_epi32 (res, 3);
324 nr_p += _mm256_extract_epi32 (res, 4);
325 nr_p += _mm256_extract_epi32 (res, 5);
326 nr_p += _mm256_extract_epi32 (res, 6);
327 nr_p += _mm256_extract_epi32 (res, 7);
328
329 // Process the remaining points (at most 7)
330 nr_p += countWithinDistanceStandard (model_coefficients, threshold, i);
331 return (nr_p);
332}
333#endif
334
335//////////////////////////////////////////////////////////////////////////
336template <typename PointT> void
338 const Indices &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients) const
339{
340 optimized_coefficients = model_coefficients;
341
342 // Needs a set of valid model coefficients
343 if (!isModelValid (model_coefficients))
344 {
345 PCL_ERROR ("[pcl::SampleConsensusModelSphere::optimizeModelCoefficients] Given model is invalid!\n");
346 return;
347 }
348
349 // Need more than the minimum sample size to make a difference
350 if (inliers.size () <= sample_size_)
351 {
352 PCL_ERROR ("[pcl::SampleConsensusModelSphere::optimizeModelCoefficients] Not enough inliers to refine/optimize the model's coefficients (%lu)! Returning the same coefficients.\n", inliers.size ());
353 return;
354 }
355
356 OptimizationFunctor functor (this, inliers);
357 Eigen::NumericalDiff<OptimizationFunctor> num_diff (functor);
358 Eigen::LevenbergMarquardt<Eigen::NumericalDiff<OptimizationFunctor>, float> lm (num_diff);
359 int info = lm.minimize (optimized_coefficients);
360
361 // Compute the L2 norm of the residuals
362 PCL_DEBUG ("[pcl::SampleConsensusModelSphere::optimizeModelCoefficients] LM solver finished with exit code %i, having a residual norm of %g. \nInitial solution: %g %g %g %g \nFinal solution: %g %g %g %g\n",
363 info, lm.fvec.norm (), model_coefficients[0], model_coefficients[1], model_coefficients[2], model_coefficients[3], optimized_coefficients[0], optimized_coefficients[1], optimized_coefficients[2], optimized_coefficients[3]);
364}
365
366//////////////////////////////////////////////////////////////////////////
367template <typename PointT> void
369 const Indices &, const Eigen::VectorXf &model_coefficients, PointCloud &projected_points, bool) const
370{
371 // Needs a valid model coefficients
372 if (!isModelValid (model_coefficients))
373 {
374 PCL_ERROR ("[pcl::SampleConsensusModelSphere::projectPoints] Given model is invalid!\n");
375 return;
376 }
377
378 // Allocate enough space and copy the basics
379 projected_points.resize (input_->size ());
380 projected_points.header = input_->header;
381 projected_points.width = input_->width;
382 projected_points.height = input_->height;
383 projected_points.is_dense = input_->is_dense;
384
385 PCL_WARN ("[pcl::SampleConsensusModelSphere::projectPoints] Not implemented yet.\n");
386 projected_points.points = input_->points;
387}
388
389//////////////////////////////////////////////////////////////////////////
390template <typename PointT> bool
392 const std::set<index_t> &indices, const Eigen::VectorXf &model_coefficients, const double threshold) const
393{
394 // Needs a valid model coefficients
395 if (!isModelValid (model_coefficients))
396 {
397 PCL_ERROR ("[pcl::SampleConsensusModelSphere::doSamplesVerifyModel] Given model is invalid!\n");
398 return (false);
399 }
400
401 const float sqr_inner_radius = (model_coefficients[3] <= threshold ? 0.0f : (model_coefficients[3] - threshold) * (model_coefficients[3] - threshold));
402 const float sqr_outer_radius = (model_coefficients[3] + threshold) * (model_coefficients[3] + threshold);
403 const Eigen::Vector3f center (model_coefficients[0], model_coefficients[1], model_coefficients[2]);
404 for (const auto &index : indices)
405 {
406 // To avoid sqrt computation: consider one larger sphere (radius + threshold) and one smaller sphere (radius - threshold).
407 // Valid if point is in larger sphere, but not in smaller sphere.
408 const float sqr_dist = ((*input_)[index].getVector3fMap () - center).squaredNorm ();
409 if ((sqr_dist > sqr_outer_radius) || (sqr_dist < sqr_inner_radius))
410 {
411 return (false);
412 }
413 }
414
415 return (true);
416}
417
418#define PCL_INSTANTIATE_SampleConsensusModelSphere(T) template class PCL_EXPORTS pcl::SampleConsensusModelSphere<T>;
419
420#endif // PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_SPHERE_H_
421
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: point_cloud.h:173
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:403
void resize(std::size_t count)
Resizes the container to contain count elements.
Definition: point_cloud.h:462
std::uint32_t width
The point cloud width (if organized as an image-structure).
Definition: point_cloud.h:398
pcl::PCLHeader header
The point cloud header.
Definition: point_cloud.h:392
std::uint32_t height
The point cloud height (if organized as an image-structure).
Definition: point_cloud.h:400
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
Definition: point_cloud.h:395
SampleConsensusModelSphere defines a model for 3D sphere segmentation.
bool isSampleGood(const Indices &samples) const override
Check if a sample of indices results in a good sample of points indices.
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const override
Compute all distances from the cloud data to a given sphere model.
void optimizeModelCoefficients(const Indices &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients) const override
Recompute the sphere coefficients using the given inlier set and return them to the user.
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.
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 sphere model coefficients.
std::size_t countWithinDistanceStandard(const Eigen::VectorXf &model_coefficients, const double threshold, std::size_t i=0) const
This implementation uses no SIMD instructions.
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 sphere model.
bool computeModelCoefficients(const Indices &samples, Eigen::VectorXf &model_coefficients) const override
Check whether the given index samples can form a valid sphere model, compute the model coefficients f...
void selectWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold, Indices &inliers) override
Select all the points which respect the given model coefficients as inliers.
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition: types.h:133