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 <fvmodels/shape/accumulators/ht_accum.h>
29 #include <fvmodels/shape/circle.h>
30 #include <fvutils/base/types.h>
31 #include <utils/math/types.h>
32 
33 #include <iostream>
34 #include <vector>
35 
36 namespace firevision {
37 
38 class ROI;
39 
40 class RhtCircleModel : public ShapeModel
41 {
42 private:
43  std::vector<Circle> m_Circles;
44  RhtAccumulator accumulator;
45  static const float RHT_MIN_RADIUS;
46  static const float RHT_MAX_RADIUS;
47 
48 public:
49  RhtCircleModel(void);
50  virtual ~RhtCircleModel(void);
51 
52  std::string
53  getName(void) const
54  {
55  return std::string("RhtCircleModel");
56  }
57  int parseImage(unsigned char *buffer, ROI *roi);
58  int getShapeCount(void) const;
59  Circle *getShape(int id) const;
60  Circle *getMostLikelyShape(void) const;
61 
62 private:
63  void calcCircle( // for calculating circles from 3 points
64  const fawkes::upoint_t &p1,
65  const fawkes::upoint_t &p2,
66  const fawkes::upoint_t &p3,
67  center_in_roi_t & center,
68  float & radius);
69 };
70 
71 } // end namespace firevision
72 
73 #endif // FIREVISION_RHT_CIRCLE_H__
int getShapeCount(void) const
Get number of shapes.
Definition: rht_circle.cpp:241
RhtCircleModel(void)
Constructor.
Definition: rht_circle.cpp:51
Hough-Transform accumulator.
Definition: ht_accum.h:124
int parseImage(unsigned char *buffer, ROI *roi)
Parse image for given ROI.
Definition: rht_circle.cpp:67
std::string getName(void) const
Get name of shape model.
Definition: rht_circle.h:53
Circle * getShape(int id) const
Get specific shape.
Definition: rht_circle.cpp:247
Circle * getMostLikelyShape(void) const
Get best candidate.
Definition: rht_circle.cpp:257
Region of interest.
Definition: roi.h:54
Circle shape.
Definition: circle.h:42
virtual ~RhtCircleModel(void)
Destructor.
Definition: rht_circle.cpp:56
Point with cartesian coordinates as unsigned integers.
Definition: types.h:34
Center in ROI.
Definition: types.h:37
Shape model interface.
Definition: shapemodel.h:45
Randomized Hough-Transform circle model.
Definition: rht_circle.h:40