rcd_circle.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
00025
00026 #ifndef __FIREVISION_MODELS_SHAPE_RCD_CIRCLE_H_
00027 #define __FIREVISION_MODELS_SHAPE_RCD_CIRCLE_H_
00028
00029 #include <vector>
00030 #include <iostream>
00031
00032 #include <utils/math/types.h>
00033 #include <fvutils/base/types.h>
00034 #include <models/shape/circle.h>
00035
00036 namespace firevision {
00037 #if 0
00038 }
00039 #endif
00040
00041 class ROI;
00042
00043 class RcdCircleModel: public ShapeModel
00044 {
00045 private:
00046 std::vector<Circle> m_Circles;
00047 public:
00048
00049 RcdCircleModel(unsigned int max_failures = 300,
00050 unsigned int min_pixels = 20,
00051 unsigned int min_interpix_dist = 10,
00052 unsigned int max_dist_p4 = 2,
00053 unsigned int max_dist_a = 10,
00054 float hw_ratio = 0.6,
00055 float hollow_rate = 0.f,
00056 float max_time = 0.01
00057 );
00058 virtual ~RcdCircleModel(void);
00059
00060 std::string getName(void) const {return std::string("RcdCircleModel");}
00061 int parseImage(unsigned char* buffer, ROI *roi);
00062 int getShapeCount(void) const;
00063 Circle* getShape(int id) const;
00064 Circle* getMostLikelyShape(void) const;
00065
00066 private:
00067
00068
00069 void calcCircle( const fawkes::point_t& p1,
00070 const fawkes::point_t& p2,
00071 const fawkes::point_t& p3,
00072 center_in_roi_t& center,
00073 float& radius);
00074
00075
00076
00077 int diff_sec;
00078 int diff_usec;
00079 float f_diff_sec;
00080
00081 unsigned int RCD_MAX_FAILURES;
00082 unsigned int RCD_MIN_PIXELS;
00083 unsigned int RCD_MIN_INTERPIX_DIST;
00084 unsigned int RCD_MAX_DIST_P4;
00085 unsigned int RCD_MAX_DIST_A;
00086 float RCD_HW_RATIO;
00087 float RCD_MAX_TIME;
00088 float RCD_ROI_HOLLOW_RATE;
00089
00090 };
00091
00092 }
00093
00094 #endif
00095