Fawkes API  Fawkes Development Version
circle.h
1 
2 /***************************************************************************
3  * circle.h - Header of circle shape model
4  *
5  * Created: Thu May 16 00:00:00 2005
6  * Copyright 2005 Tim Niemueller [www.niemueller.de]
7  * 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_MODELS_SHAPE_CIRCLE_H_
26 #define __FIREVISION_MODELS_SHAPE_CIRCLE_H_
27 
28 #include <vector>
29 #include <iostream>
30 
31 #include <utils/math/types.h>
32 #include <fvutils/base/types.h>
33 #include <fvutils/base/roi.h>
34 #include <fvmodels/shape/shapemodel.h>
35 
36 namespace firevision {
37 #if 0 /* just to make Emacs auto-indent happy */
38 }
39 #endif
40 
41 // constants of the limits of the detected ball
42 const unsigned int TBY_CIRCLE_RADIUS_MAX = 600;
43 const unsigned int TBY_CIRCLE_RADIUS_MIN = 2;
44 
45 class Circle : public Shape
46 {
47  public:
48  Circle();
49  Circle(const center_in_roi_t& c, float r, int n = 0);
50 
51  void printToStream(std::ostream &stream);
52 
53  void setMargin( unsigned int margin );
54  bool isClose( unsigned int in_roi_x, unsigned int in_roi_y );
55 
56  void fitCircle(std::vector< fawkes::upoint_t >& points);
57 
58  public:
59  /** Center of object in ROI */
61  /** Radius of object */
62  float radius;
63  /** Number of pixels */
64  int count;
65  /** Margin around shape */
66  unsigned int margin;
67 
68 };
69 
70 } // end namespace firevision
71 
72 #endif // __FIREVISION_MODELS_SHAPE_CIRCLE_H_
void printToStream(std::ostream &stream)
Print info.
Definition: circle.cpp:64
unsigned int margin
Margin around shape.
Definition: circle.h:66
Circle shape.
Definition: circle.h:45
Circle()
Constructor.
Definition: circle.cpp:41
void setMargin(unsigned int margin)
Set margin around shape.
Definition: circle.cpp:120
void fitCircle(std::vector< fawkes::upoint_t > &points)
Fit circle.
Definition: circle.cpp:75
int count
Number of pixels.
Definition: circle.h:64
bool isClose(unsigned int in_roi_x, unsigned int in_roi_y)
Check if the given point is close to the shape.
Definition: circle.cpp:127
Center in ROI.
Definition: types.h:39
center_in_roi_t center
Center of object in ROI.
Definition: circle.h:60
Shape interface.
Definition: shapemodel.h:39
float radius
Radius of object.
Definition: circle.h:62