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 class ROI;
00037
00038 class RcdCircleModel: public ShapeModel
00039 {
00040 private:
00041 std::vector<Circle> m_Circles;
00042 public:
00043
00044 RcdCircleModel(unsigned int max_failures = 300,
00045 unsigned int min_pixels = 20,
00046 unsigned int min_interpix_dist = 10,
00047 unsigned int max_dist_p4 = 2,
00048 unsigned int max_dist_a = 10,
00049 float hw_ratio = 0.6,
00050 float hollow_rate = 0.f,
00051 float max_time = 0.01
00052 );
00053 virtual ~RcdCircleModel(void);
00054
00055 std::string getName(void) const {return std::string("RcdCircleModel");}
00056 int parseImage(unsigned char* buffer, ROI *roi);
00057 int getShapeCount(void) const;
00058 Circle* getShape(int id) const;
00059 Circle* getMostLikelyShape(void) const;
00060
00061 private:
00062
00063
00064 void calcCircle( const fawkes::point_t& p1,
00065 const fawkes::point_t& p2,
00066 const fawkes::point_t& p3,
00067 center_in_roi_t& center,
00068 float& radius);
00069
00070
00071
00072 int diff_sec;
00073 int diff_usec;
00074 float f_diff_sec;
00075
00076 unsigned int RCD_MAX_FAILURES;
00077 unsigned int RCD_MIN_PIXELS;
00078 unsigned int RCD_MIN_INTERPIX_DIST;
00079 unsigned int RCD_MAX_DIST_P4;
00080 unsigned int RCD_MAX_DIST_A;
00081 float RCD_HW_RATIO;
00082 float RCD_MAX_TIME;
00083 float RCD_ROI_HOLLOW_RATE;
00084
00085 };
00086
00087 #endif
00088