rcd_circle.h

00001
00002 /***************************************************************************
00003  *  rcd_circle.h - Header of circle shape model
00004  *                 using Random Circle Detection Algorithm
00005  *
00006  *  Generated: Thu May 16 2005
00007  *  Copyright  2005  Tim Niemueller [www.niemueller.de]
00008  *                   Hu Yuxiao      <Yuxiao.Hu@rwth-aachen.de>
00009  *
00010  ****************************************************************************/
00011
00012 /*  This program is free software; you can redistribute it and/or modify
00013  *  it under the terms of the GNU General Public License as published by
00014  *  the Free Software Foundation; either version 2 of the License, or
00015  *  (at your option) any later version. A runtime exception applies to
00016  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00017  *
00018  *  This program is distributed in the hope that it will be useful,
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *  GNU Library General Public License for more details.
00022  *
00023  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
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   /** Calculate circle from three points
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