Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * rht_circle.h - Header of circle shape model 00004 * using Randomized Hough Transform 00005 * 00006 * Created: Tue Jun 28 00:00:00 2005 00007 * Copyright 2005 Hu Yuxiao <Yuxiao.Hu@rwth-aachen.de> 00008 * 00009 ****************************************************************************/ 00010 00011 /* This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. A runtime exception applies to 00015 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Library General Public License for more details. 00021 * 00022 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00023 */ 00024 00025 #ifndef __FIREVISION_RHT_CIRCLE_H_ 00026 #define __FIREVISION_RHT_CIRCLE_H_ 00027 00028 #include <vector> 00029 #include <iostream> 00030 00031 #include <utils/math/types.h> 00032 #include <fvutils/base/types.h> 00033 #include <models/shape/circle.h> 00034 #include <models/shape/accumulators/ht_accum.h> 00035 00036 namespace firevision { 00037 #if 0 /* just to make Emacs auto-indent happy */ 00038 } 00039 #endif 00040 00041 class ROI; 00042 00043 class RhtCircleModel: public ShapeModel 00044 { 00045 private: 00046 std::vector<Circle> m_Circles; 00047 RhtAccumulator accumulator; 00048 static const float RHT_MIN_RADIUS; 00049 static const float RHT_MAX_RADIUS; 00050 00051 public: 00052 RhtCircleModel(void); 00053 virtual ~RhtCircleModel(void); 00054 00055 std::string getName(void) const {return std::string("RhtCircleModel");} 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 void calcCircle( // for calculating circles from 3 points 00063 const fawkes::point_t& p1, 00064 const fawkes::point_t& p2, 00065 const fawkes::point_t& p3, 00066 center_in_roi_t& center, 00067 float& radius); 00068 }; 00069 00070 } // end namespace firevision 00071 00072 #endif // __FIREVISION_RHT_CIRCLE_H_ 00073