Fawkes API  Fawkes Development Version
rht_circle.h
1 
2 /***************************************************************************
3  * rht_circle.h - Header of circle shape model
4  * using Randomized Hough Transform
5  *
6  * Created: Tue Jun 28 00:00:00 2005
7  * Copyright 2005 Hu Yuxiao <Yuxiao.Hu@rwth-aachen.de>
8  *
9  ****************************************************************************/
10 
11 /* This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version. A runtime exception applies to
15  * this software (see LICENSE.GPL_WRE file mentioned below for details).
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Library General Public License for more details.
21  *
22  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
23  */
24 
25 #ifndef __FIREVISION_RHT_CIRCLE_H_
26 #define __FIREVISION_RHT_CIRCLE_H_
27 
28 #include <vector>
29 #include <iostream>
30 
31 #include <utils/math/types.h>
32 #include <fvutils/base/types.h>
33 #include <fvmodels/shape/circle.h>
34 #include <fvmodels/shape/accumulators/ht_accum.h>
35 
36 namespace firevision {
37 #if 0 /* just to make Emacs auto-indent happy */
38 }
39 #endif
40 
41 class ROI;
42 
44 {
45  private:
46  std::vector<Circle> m_Circles;
47  RhtAccumulator accumulator;
48  static const float RHT_MIN_RADIUS;
49  static const float RHT_MAX_RADIUS;
50 
51  public:
52  RhtCircleModel(void);
53  virtual ~RhtCircleModel(void);
54 
55  std::string getName(void) const {return std::string("RhtCircleModel");}
56  int parseImage(unsigned char* buffer, ROI *roi);
57  int getShapeCount(void) const;
58  Circle* getShape(int id) const;
59  Circle* getMostLikelyShape(void) const;
60 
61  private:
62  void calcCircle( // for calculating circles from 3 points
63  const fawkes::upoint_t& p1,
64  const fawkes::upoint_t& p2,
65  const fawkes::upoint_t& p3,
66  center_in_roi_t& center,
67  float& radius);
68 };
69 
70 } // end namespace firevision
71 
72 #endif // __FIREVISION_RHT_CIRCLE_H_
73 
int getShapeCount(void) const
Get number of shapes.
Definition: rht_circle.cpp:256
RhtCircleModel(void)
Constructor.
Definition: rht_circle.cpp:55
Hough-Transform accumulator.
Definition: ht_accum.h:125
int parseImage(unsigned char *buffer, ROI *roi)
Parse image for given ROI.
Definition: rht_circle.cpp:72
std::string getName(void) const
Get name of shape model.
Definition: rht_circle.h:55
Circle * getShape(int id) const
Get specific shape.
Definition: rht_circle.cpp:262
Circle * getMostLikelyShape(void) const
Get best candidate.
Definition: rht_circle.cpp:273
Region of interest.
Definition: roi.h:58
Circle shape.
Definition: circle.h:45
virtual ~RhtCircleModel(void)
Destructor.
Definition: rht_circle.cpp:61
Point with cartesian coordinates as unsigned integers.
Definition: types.h:34
Center in ROI.
Definition: types.h:39
Shape model interface.
Definition: shapemodel.h:49
Randomized Hough-Transform circle model.
Definition: rht_circle.h:43