ConePrimitiveShape.cpp
Go to the documentation of this file.
2
3#include <algorithm>
4#include <iostream>
5#include <limits>
6
7#include "Bitmap.h"
11#include "ScoreComputer.h"
13#include "TorusPrimitiveShape.h"
14#include <GfxTL/MathHelper.h>
15#include <GfxTL/NullClass.h>
16#include <MiscLib/Performance.h>
17
19#undef max
20#undef min
21
23{
24}
25
26size_t
28{
29 return 3;
30}
31
34{
35 return new ConePrimitiveShape(*this);
36}
37
38float
40{
41 return m_cone.Distance(p);
42}
43
44float
46{
47 return m_cone.SignedDistance(p);
48}
49
50float
52{
53 Vec3f normal;
54 m_cone.Normal(p, &normal);
55 return n.dot(normal);
56}
57
58void
60 const Vec3f& n,
61 std::pair<float, float>* dn) const
62{
63 Vec3f normal;
64 dn->first = m_cone.DistanceAndNormal(p, &normal);
65 dn->second = n.dot(normal);
66}
67
68void
70{
71 m_cone.Project(p, pp);
72}
73
74void
76{
77 m_cone.Normal(p, n);
78}
79
80unsigned int
82 float epsilon,
83 float normalThresh,
84 float rms,
85 const PointCloud& pc,
86 const MiscLib::Vector<size_t>& indices) const
87{
89 numTests, epsilon, normalThresh, rms, pc, indices);
90}
91
92void
94{
95 *s = "Cone";
96}
97
98bool
100 float epsilon,
101 float normalThresh,
104{
105 Cone fit = m_cone;
106 if (fit.LeastSquaresFit(pc, begin, end))
107 {
108 m_cone = fit;
109 return true;
110 }
111 return false;
112}
113
116 float epsilon,
117 float normalThresh,
120 std::pair<size_t, float>* score) const
121{
122 Cone fit = m_cone;
123 if (fit.LeastSquaresFit(pc, begin, end))
124 {
125 score->first = -1;
126 return new ConePrimitiveShape(fit);
127 }
128 score->first = 0;
129 return NULL;
130}
131
134{
135 return new ConeLevMarFunc(m_cone);
136}
137
138void
139ConePrimitiveShape::Serialize(std::ostream* o, bool binary) const
140{
141 if (binary)
142 {
143 const char id = 3;
144 (*o) << id;
145 }
146 else
147 {
148 (*o) << "3"
149 << " ";
150 }
151 m_cone.Serialize(binary, o);
152 if (!binary)
153 {
154 (*o) << std::endl;
155 }
156}
157
158size_t
160{
161 return m_cone.SerializedSize() + 1;
162}
163
164void
165ConePrimitiveShape::Parameters(const Vec3f& p, std::pair<float, float>* param) const
166{
167 m_cone.Parameters(p, param); // this gives us length and angle
168 // select parametrization with smaller stretch
169 if (m_cone.Angle() < float(M_PI / 4)) // angle of cone less than 45 degrees
170 {
171 // parameterize in the following way:
172 // u = length
173 // v = arc length
174 float r = m_cone.RadiusAtLength(param->first);
175 param->second = (param->second - float(M_PI)) * r; // convert to arc length and centralize
176 }
177 else
178 {
179 float l = param->first;
180 param->first = std::sin(param->second) * l;
181 param->second = std::cos(param->second) * l;
182 }
183}
184
185void
193
194void
198 MiscLib::Vector<std::pair<float, float>>* bmpParams) const
199{
200 ParametersImpl(begin, end, bmpParams);
201}
202
203void
204ConePrimitiveShape::Transform(float scale, const Vec3f& translate)
205{
206 m_cone.Transform(scale, translate);
207}
208
209void
211 const GfxTL::Vector3Df& trans)
212{
213 m_cone.Transform(rot, trans);
214}
215
216void
218{
219 visitor->Visit(*this);
220}
221
222void
224 const PointCloud& pc,
227 float distThresh,
229{
230 // sample the bounding box in parameter space at 25 locations
231 // these points are used to estimate the other shapes
232 // if the shapes succeed the suggestion is returned
233 MiscLib::Vector<Vec3f> samples(2 * 25);
234 float uStep = (m_extBbox.Max()[0] - m_extBbox.Min()[0]) / 4;
235 float vStep = (m_extBbox.Max()[1] - m_extBbox.Min()[1]) / 4;
236 float u = m_extBbox.Min()[0];
237 for (unsigned int i = 0; i < 5; ++i, u += uStep)
238 {
239 float v = m_extBbox.Min()[1];
240 for (unsigned int j = 0; j < 5; ++j, v += vStep)
241 {
242 float bmpu, bmpv;
243 if (m_cone.Angle() >= M_PI / 4)
244 {
245 bmpu = std::sin(v) * u;
246 bmpv = std::cos(v) * u;
247 }
248 else
249 {
250 bmpu = u;
251 float r = m_cone.RadiusAtLength(u);
252 bmpv = (v - float(M_PI)) * r;
253 }
254 InSpace(bmpu, bmpv, &samples[i * 5 + j], &samples[i * 5 + j + 25]);
255 }
256 }
257 size_t c = samples.size() / 2;
258 // now check all the shape types
259 Cylinder cylinder;
260 if (cylinder.InitAverage(samples))
261 {
262 cylinder.LeastSquaresFit(samples.begin(), samples.begin() + c);
263 bool failed = false;
264 for (size_t i = 0; i < c; ++i)
265 if (cylinder.Distance(samples[i]) > distThresh)
266 {
267 failed = true;
268 break;
269 }
270 if (!failed)
271 {
272 suggestions->push_back(new CylinderPrimitiveShape(cylinder));
273 suggestions->back()->Release();
274 }
275 }
276 Sphere sphere;
277 if (sphere.Init(samples))
278 {
279 sphere.LeastSquaresFit(samples.begin(), samples.begin() + c);
280 bool failed = false;
281 for (size_t i = 0; i < c; ++i)
282 if (sphere.Distance(samples[i]) > distThresh)
283 {
284 failed = true;
285 break;
286 }
287 if (!failed)
288 {
289 suggestions->push_back(new SpherePrimitiveShape(sphere));
290 suggestions->back()->Release();
291 }
292 }
293 Plane plane;
294 if (plane.LeastSquaresFit(samples.begin(), samples.begin() + c))
295 {
296 bool failed = false;
297 for (size_t i = 0; i < c; ++i)
298 if (plane.Distance(samples[i]) > distThresh)
299 {
300 failed = true;
301 break;
302 }
303 if (!failed)
304 {
305 suggestions->push_back(new PlanePrimitiveShape(plane));
306 suggestions->back()->Release();
307 }
308 }
309
310 /*// simpler shapes are suggested if the maximal curvature of the cone
311 // is small compared to the extend in relation to the distThresh
312
313 float meanRadius, length, meanLength, radialExtent;
314 // the cone is parameterized as length and angle
315 // in this case the cone is parametrized as length and arclength
316 meanRadius = (m_cone.RadiusAtLength(m_extBbox.Min()[0])
317 + m_cone.RadiusAtLength(m_extBbox.Max()[0])) / 2;
318 length = m_extBbox.Max()[0] - m_extBbox.Min()[0];
319 meanLength = (m_extBbox.Max()[0] + m_extBbox.Min()[0]) / 2;
320 // the radial extent
321 radialExtent = m_extBbox.Max()[1] - m_extBbox.Min()[1];
322 // We suggest a cylinder if the opening angle of the cone is so small
323 // that over the whole height the difference is less than distThresh
324 if(std::sin(m_cone.Angle()) * length / 2 < distThresh)
325 {
326 // construct the cylinder
327 // it has the same axis as the cone
328 // and we use the average radius of the cone
329 Cylinder cylinder(m_cone.AxisDirection(), m_cone.Center(),
330 meanRadius);
331 suggestions->push_back(new CylinderPrimitiveShape(cylinder));
332 suggestions->back()->Release();
333 }
334
335 // We suggest a sphere if a curvature of mean radius along the height
336 // does not introduce too large an error
337 float sphereRadius = std::tan(m_cone.Angle()) * meanLength;
338 float radiusDiff = (std::sqrt(sphereRadius * sphereRadius + length * length / 4)
339 - sphereRadius) / 2;
340 if(radiusDiff < distThresh)
341 {
342 // the center of the sphere is given as the point on the axis
343 // with the height of the mean length
344 Vec3f center = (meanLength / std::cos(m_cone.Angle()))
345 * m_cone.AxisDirection() + m_cone.Center();
346 Sphere sphere(center, sphereRadius + radiusDiff);
347 suggestions->push_back(new SpherePrimitiveShape(sphere));
348 suggestions->back()->Release();
349 }
350
351 // We suggest a plane if the mean radius causes only a small error
352 // for this we need the angular extent in the curved direction of the cone
353 radiusDiff = meanRadius - std::sin(radialExtent) * meanRadius;
354 if(radiusDiff < distThresh)
355 {
356 GfxTL::Vector2Df bboxCenter;
357 m_extBbox.Center(&bboxCenter);
358 Vec3f pos, normal;
359 InSpace(bboxCenter[0], bboxCenter[1] * m_cone.RadiusAtLength(bboxCenter[0]),
360 &pos, &normal);
361 Plane plane(pos, normal);
362 suggestions->push_back(new PlanePrimitiveShape(plane));
363 suggestions->back()->Release();
364 }*/
365}
366
367bool
368ConePrimitiveShape::Similar(float tolerance, const ConePrimitiveShape& shape) const
369{
370 return m_cone.Angle() <= (1.f + tolerance) * shape.m_cone.Angle() &&
371 (1.f + tolerance) * m_cone.Angle() >= shape.m_cone.Angle();
372}
373
374void
377 MiscLib::Vector<std::pair<float, float>>* params,
378 size_t* uextent,
379 size_t* vextent)
380{
381 *uextent =
382 std::ceil((bbox->Max()[0] - bbox->Min()[0]) / epsilon); // no wrappig along u direction
383 *vextent = std::ceil((bbox->Max()[1] - bbox->Min()[1]) / epsilon) + 1; // add one for wrapping
384 if ((*vextent) * (*uextent) > 1e6 && m_cone.Angle() < float(M_PI / 4))
385 {
386 // try to reparameterize
387 // try to find cut in the outer regions
388 MiscLib::Vector<float> angularParams; //(params->size());
389 angularParams.reserve(params->size());
390 float outer = 3.f * std::max(abs(bbox->Min()[0]), abs(bbox->Max()[0])) / 4.f;
391 for (size_t i = 0; i < params->size(); ++i)
392 if ((*params)[i].first > outer)
393 angularParams.push_back(
394 ((*params)[i].second / m_cone.RadiusAtLength((*params)[i].first)) +
395 float(M_PI));
396 std::sort(angularParams.begin(), angularParams.end());
397 // try to find a large gap
398 float maxGap = 0;
399 float lower, upper;
400 for (size_t i = 1; i < angularParams.size(); ++i)
401 {
402 float gap = angularParams[i] - angularParams[i - 1];
403 if (gap > maxGap)
404 {
405 maxGap = gap;
406 lower = angularParams[i - 1];
407 upper = angularParams[i];
408 }
409 }
410 // reparameterize with new angular cut
411 float newCut = (lower + upper) / 2.f;
412 m_cone.RotateAngularDirection(newCut);
413 bbox->Min()[1] = std::numeric_limits<float>::infinity();
414 bbox->Max()[1] = -std::numeric_limits<float>::infinity();
415 for (size_t i = 0; i < params->size(); ++i)
416 {
417 float r = m_cone.RadiusAtLength((*params)[i].first);
418 (*params)[i].second = ((*params)[i].second / r) + float(M_PI) - newCut;
419 if ((*params)[i].second < 0)
420 {
421 (*params)[i].second = 2 * float(M_PI) + (*params)[i].second;
422 }
423 (*params)[i].second = ((*params)[i].second - float(M_PI)) * r;
424 if ((*params)[i].second < bbox->Min()[1])
425 {
426 bbox->Min()[1] = (*params)[i].second;
427 }
428 if ((*params)[i].second > bbox->Max()[1])
429 {
430 bbox->Max()[1] = (*params)[i].second;
431 }
432 }
433 *vextent = std::floor((bbox->Max()[1] - bbox->Min()[1]) / epsilon) + 1;
434 }
435}
436
437void
438ConePrimitiveShape::InBitmap(const std::pair<float, float>& param,
439 float epsilon,
441 size_t uextent,
442 size_t vextent,
443 std::pair<int, int>* inBmp) const
444{
445 // convert u = length and v = arc length into bitmap coordinates
446 inBmp->first = std::floor((param.first - bbox.Min()[0]) / epsilon);
447 inBmp->second = std::floor((param.second - bbox.Min()[1]) / epsilon);
448}
449
450void
452 float epsilon,
453 size_t uextent,
454 size_t vextent,
455 MiscLib::Vector<char>* bmp) const
456{
457 if (m_cone.Angle() >= float(M_PI / 4))
458 {
459 return;
460 }
461 // for wrapping we copy the first pixel to the last one in each v column
462 for (size_t u = 0; u < uextent; ++u)
463 {
464 // determine the coordinates of the last pixel in the column
465 // get the radius of the column
466 float r = m_cone.RadiusAtLength(u * epsilon + bbox.Min()[0]);
467 size_t v = std::floor((2 * float(M_PI) * r - bbox.Min()[1]) / epsilon) + 1;
468 if (v >= vextent)
469 {
470 continue;
471 }
472 if ((*bmp)[u])
473 {
474 (*bmp)[v * uextent + u] = (*bmp)[u]; // do the wrap
475 }
476 // if(!(*bmp)[u * vextent + v])
477 // (*bmp)[u * vextent + v] = (*bmp)[u * vextent]; // do the wrap
478 }
479}
480
481void
483 float epsilon,
484 bool* uwrap,
485 bool* vwrap) const
486{
487 *uwrap = *vwrap = false;
488}
489
490void
492 float epsilon,
493 size_t uextent,
494 size_t vextent,
495 MiscLib::Vector<int>* componentImg,
496 MiscLib::Vector<std::pair<int, size_t>>* labels) const
497{
498 if (m_cone.Angle() >= float(M_PI / 4))
499 {
500 return;
501 }
502 // for wrapping we copy the first pixel to the last one in each v column
503 for (size_t u = 0; u < uextent; ++u)
504 {
505 // determine the coordinates of the last pixel in the column
506 // get the radius of the column
507 float r = m_cone.RadiusAtLength(u * epsilon + bbox.Min()[0]);
508 size_t v = std::floor((2 * float(M_PI) * r - bbox.Min()[1]) / epsilon) + 1;
509 if (v >= vextent)
510 {
511 continue;
512 }
513 if ((*componentImg)[u])
514 {
515 (*componentImg)[v * uextent + u] = (*componentImg)[u]; // do the wrap
516 }
517 }
518 // relabel the components
519 MiscLib::Vector<std::pair<int, size_t>> tempLabels(*labels);
520 int curLabel = tempLabels.size() - 1;
521 for (size_t u = 0; u < uextent; ++u)
522 {
523 float r = m_cone.RadiusAtLength(u * epsilon + bbox.Min()[0]);
524 size_t v = std::floor((2 * float(M_PI) * r - bbox.Min()[1]) / epsilon) + 1;
525 if (v >= vextent)
526 {
527 continue;
528 }
529 if (!(*componentImg)[v * uextent + u])
530 {
531 continue;
532 }
533 // get the neighbors
534 int n[8];
535 size_t i = 0;
536 if (v >= 1)
537 {
538 size_t prevRow = (v - 1) * uextent;
539 if (u >= 1)
540 {
541 n[i++] = (*componentImg)[prevRow + u - 1];
542 }
543 n[i++] = (*componentImg)[prevRow + u];
544 if (u < uextent - 1)
545 {
546 n[i++] = (*componentImg)[prevRow + u + 1];
547 }
548 }
549 size_t row = v * uextent;
550 if (u >= 1)
551 {
552 n[i++] = (*componentImg)[row + u - 1];
553 }
554 if (u < uextent - 1)
555 {
556 n[i++] = (*componentImg)[row + u + 1];
557 }
558 if (v < vextent - 1)
559 {
560 size_t nextRow = (v + 1) * uextent;
561 if (u >= 1)
562 {
563 n[i++] = (*componentImg)[nextRow + u - 1];
564 }
565 n[i++] = (*componentImg)[nextRow + u];
566 if (u < uextent - 1)
567 {
568 n[i++] = (*componentImg)[nextRow + u + 1];
569 }
570 }
571 // associate labels
572 int l = (*componentImg)[v * uextent + u];
573 for (size_t j = 0; j < i; ++j)
574 if (n[j])
575 {
576 AssociateLabel(l, n[j], &tempLabels);
577 }
578 }
579 // condense labels
580 for (size_t i = tempLabels.size() - 1; i > 0; --i)
581 {
582 tempLabels[i].first = ReduceLabel(i, tempLabels);
583 }
584 MiscLib::Vector<int> condensed(tempLabels.size());
585 labels->clear();
586 labels->reserve(condensed.size());
587 int count = 0;
588 for (size_t i = 0; i < tempLabels.size(); ++i)
589 if (i == tempLabels[i].first)
590 {
591 labels->push_back(std::make_pair(count, tempLabels[i].second));
592 condensed[i] = count;
593 ++count;
594 }
595 else
596 (*labels)[condensed[tempLabels[i].first]].second += tempLabels[i].second;
597 // set new component ids
598 for (size_t i = 0; i < componentImg->size(); ++i)
599 (*componentImg)[i] = condensed[tempLabels[(*componentImg)[i]].first];
600}
601
602void
604 const MiscLib::Vector<int>& componentsImg,
605 size_t uextent,
606 size_t vextent,
607 float epsilon,
608 int label)
609{
610}
611
612bool
613ConePrimitiveShape::InSpace(float length, float arcLength, Vec3f* p, Vec3f* n) const
614{
615 float angle;
616 if (m_cone.Angle() >= float(M_PI / 4))
617 {
618 //angle = std::atan2(arcLength, length);
619 angle = std::atan2(length, arcLength);
620 length = std::sqrt(length * length + arcLength * arcLength);
621 // angle = std::acos(GfxTL::Math< float >::Clamp(arcLength / length, -1.f, 1.f));
622 }
623 else
624 {
625 angle = (arcLength / m_cone.RadiusAtLength(length)) + float(M_PI);
626 }
628 q.RotationRad(
629 angle, m_cone.AxisDirection()[0], m_cone.AxisDirection()[1], m_cone.AxisDirection()[2]);
630 Vec3f vvec;
631 q.Rotate(m_cone.AngularDirection(), &vvec);
632 *p = std::sin(m_cone.Angle()) * abs(length) * vvec +
633 std::cos(m_cone.Angle()) * length * m_cone.AxisDirection() + m_cone.Center();
634 m_cone.Normal(*p, n);
635 return true;
636}
637
638bool
640 size_t v,
641 float epsilon,
643 size_t uextent,
644 size_t vextent,
645 Vec3f* p,
646 Vec3f* n) const
647{
648 float length, angle;
649 if (m_cone.Angle() >= float(M_PI / 4))
650 {
651 float uf = ((float(u) + .5f) * epsilon) + bbox.Min()[0];
652 float vf = ((float(v) + .5f) * epsilon) + bbox.Min()[1];
653 length = std::sqrt(uf * uf + vf * vf);
654 //angle = std::atan2(vf, uf);
655 angle = std::atan2(uf, vf);
656 //angle = std::acos(GfxTL::Math< float >::Clamp(vf / length, -1.f, 1.f));
657 }
658 else
659 {
660 length = ((float(u) + .5f) * epsilon) + bbox.Min()[0];
661 float arcLength = ((float(v) + .5f) * epsilon) + bbox.Min()[1];
662 angle = (arcLength / m_cone.RadiusAtLength(length)) + float(M_PI);
663 }
664 if (angle > 2 * float(M_PI))
665 {
666 return false;
667 }
668 //float angle = ((v * epsilon) / m_cone.RadiusAtLength(std::max(abs(bbox.Min()[0]), abs(bbox.Max()[0])))
669 // + bbox.Min()[1]);
671 q.RotationRad(
672 angle, m_cone.AxisDirection()[0], m_cone.AxisDirection()[1], m_cone.AxisDirection()[2]);
673 Vec3f vvec;
674 q.Rotate(m_cone.AngularDirection(), &vvec);
675 *p = std::sin(m_cone.Angle()) * abs(length) * vvec +
676 std::cos(m_cone.Angle()) * length * m_cone.AxisDirection() + m_cone.Center();
677 // TODO: this is very lazy and should be optimized!
678 m_cone.Normal(*p, n);
679 return true;
680}
#define float
Definition 16_Level.h:22
int ReduceLabel(int a, const MiscLib::Vector< std::pair< int, size_t > > &labels)
Definition Bitmap.cpp:866
void AssociateLabel(int a, int b, MiscLib::Vector< std::pair< int, size_t > > *labels)
Definition Bitmap.cpp:840
MiscLib::performance_t totalTime_coneConnected
#define M_PI
Definition MathTools.h:17
class DLL_LINKAGE CylinderPrimitiveShape
class DLL_LINKAGE SpherePrimitiveShape
class DLL_LINKAGE ConePrimitiveShape
class DLL_LINKAGE PlanePrimitiveShape
constexpr T c
unsigned int ConfidenceTests(unsigned int numTests, float epsilon, float normalThresh, float rms, const PointCloud &pc, const MiscLib::Vector< size_t > &indices) const
GfxTL::AABox< GfxTL::Vector2Df > m_extBbox
void WrapComponents(const GfxTL::AABox< GfxTL::Vector2Df > &bbox, float epsilon, size_t uextent, size_t vextent, MiscLib::Vector< int > *componentImg, MiscLib::Vector< std::pair< int, size_t > > *labels) const
void DistanceAndNormalDeviation(const Vec3f &p, const Vec3f &n, std::pair< float, float > *dn) const
unsigned int ConfidenceTests(unsigned int numTests, float epsilon, float normalThresh, float rms, const PointCloud &pc, const MiscLib::Vector< size_t > &indices) const
ConePrimitiveShape(const Cone &cone)
size_t SerializedSize() const
float SignedDistance(const Vec3f &p) const
float NormalDeviation(const Vec3f &p, const Vec3f &n) const
void PreWrapBitmap(const GfxTL::AABox< GfxTL::Vector2Df > &bbox, float epsilon, size_t uextent, size_t vextent, MiscLib::Vector< char > *bmp) const
PrimitiveShape * Clone() const
void Normal(const Vec3f &p, Vec3f *n) const
void SuggestSimplifications(const PointCloud &pc, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end, float distThresh, MiscLib::Vector< MiscLib::RefCountPtr< PrimitiveShape > > *suggestions) const
void InBitmap(const std::pair< float, float > &param, float epsilon, const GfxTL::AABox< GfxTL::Vector2Df > &bbox, size_t uextent, size_t vextent, std::pair< int, int > *inBmp) const
void Transform(float scale, const Vec3f &translate)
PrimitiveShape * LSFit(const PointCloud &pc, float epsilon, float normalThresh, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end, std::pair< size_t, float > *score) const
void Visit(PrimitiveShapeVisitor *visitor) const
void Project(const Vec3f &p, Vec3f *pp) const
LevMarFunc< float > * SignedDistanceFunc() const
bool Fit(const PointCloud &pc, float epsilon, float normalThresh, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end)
void SetExtent(const GfxTL::AABox< GfxTL::Vector2Df > &bbox, const MiscLib::Vector< int > &componentsImg, size_t uextent, size_t vextent, float epsilon, int label)
void WrapBitmap(const GfxTL::AABox< GfxTL::Vector2Df > &bbox, float epsilon, bool *uwrap, bool *vwrap) const
float Distance(const Vec3f &p) const
void Serialize(std::ostream *o, bool binary=true) const
This is the one and only serialization function It stores all the parameters of the shape as well as ...
void BitmapExtent(float epsilon, GfxTL::AABox< GfxTL::Vector2Df > *bbox, MiscLib::Vector< std::pair< float, float > > *params, size_t *uextent, size_t *vextent)
bool Similar(float tolerance, const ConePrimitiveShape &shape) const
void Description(std::string *s) const
void Parameters(const Vec3f &p, std::pair< float, float > *param) const
bool InSpace(float u, float v, Vec3f *p, Vec3f *n) const
Definition Cone.h:25
bool LeastSquaresFit(const PointCloud &pc, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end)
Definition Cone.cpp:699
float Angle() const
Definition Cone.h:389
bool LeastSquaresFit(const PointCloud &pc, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end)
Definition Cylinder.cpp:439
float Distance(const Vec3f &p) const
Definition Cylinder.h:197
bool InitAverage(const MiscLib::Vector< Vec3f > &samples)
Definition Cylinder.cpp:97
Point & Min()
Definition AABox.hpp:68
Point & Max()
Definition AABox.hpp:82
const Point * const_iterator
Definition Vector.h:25
size_type size() const
Definition Vector.h:215
void push_back(const T &v)
Definition Vector.h:354
void reserve(size_type s)
Definition Vector.h:189
Definition Plane.h:19
bool LeastSquaresFit(const PointCloud &pc, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end)
Definition Plane.cpp:200
float Distance(const Vec3f &pos) const
Definition Plane.h:47
virtual void Visit(const PlanePrimitiveShape &plane)=0
PrimtiveShape is a shape primitive in conjunction with a parametrization.
bool LeastSquaresFit(const PointCloud &pc, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end)
Definition Sphere.cpp:399
float Distance(const Vec3f &p) const
Definition Sphere.h:260
bool Init(const MiscLib::Vector< Vec3f > &samples)
Definition Sphere.cpp:172
Definition basic.h:18
#define q
VectorXD< 3, float > Vector3Df
Definition VectorXD.h:718
clock_t performance_t
Definition Performance.h:31
double angle(const Point &a, const Point &b, const Point &c)
Definition point.hpp:109