fc_accum.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __FIREVISION_FC_ACCUM_H_
00025 #define __FIREVISION_FC_ACCUM_H_
00026
00027 #include <utils/math/types.h>
00028 #include <fvutils/base/types.h>
00029 #include <models/shape/circle.h>
00030
00031 class FittedCircle
00032 {
00033 private:
00034 static const float TOO_SMALL_DELTA;
00035
00036 private:
00037 int count;
00038 struct circle_matrix
00039 {
00040 float A00, A01, A02;
00041 float A10, A11, A12;
00042 float A20, A21, A22;
00043
00044 float b0, b1, b2;
00045 } circle_matrices[2];
00046 int current_circle;
00047 bool point_added;
00048
00049 public:
00050 FittedCircle(void);
00051 ~FittedCircle(void);
00052
00053 void reset(void);
00054 float addPoint(const fawkes::point_t&);
00055
00056 void removePoint(const fawkes::point_t&);
00057
00058 float distanceTo(const fawkes::point_t&, bool current = true);
00059
00060 void commit(void);
00061 int getCount(void) const;
00062 Circle* getCircle(void) const;
00063
00064 private:
00065 Circle* fitCircle(circle_matrix* p) const;
00066 };
00067
00068 #endif // __FIREVISION_FC_ACCUM_H_