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 <fvmodels/shape/shapemodel.h>
29#include <fvutils/base/roi.h>
30#include <fvutils/base/types.h>
31#include <utils/math/types.h>
32
33#include <iostream>
34#include <vector>
35
36namespace firevision {
37
38// constants of the limits of the detected ball
39const unsigned int TBY_CIRCLE_RADIUS_MAX = 600;
40const unsigned int TBY_CIRCLE_RADIUS_MIN = 2;
41
42class Circle : public Shape
43{
44public:
45 Circle();
46 Circle(const center_in_roi_t &c, float r, int n = 0);
47
48 void printToStream(std::ostream &stream);
49
50 void setMargin(unsigned int margin);
51 bool isClose(unsigned int in_roi_x, unsigned int in_roi_y);
52
53 void fitCircle(std::vector<fawkes::upoint_t> &points);
54
55public:
56 /** Center of object in ROI */
58 /** Radius of object */
59 float radius;
60 /** Number of pixels */
61 int count;
62 /** Margin around shape */
63 unsigned int margin;
64};
65
66} // end namespace firevision
67
68#endif // FIREVISION_MODELS_SHAPE_CIRCLE_H__
Circle shape.
Definition: circle.h:43
Circle()
Constructor.
Definition: circle.cpp:39
void setMargin(unsigned int margin)
Set margin around shape.
Definition: circle.cpp:119
void fitCircle(std::vector< fawkes::upoint_t > &points)
Fit circle.
Definition: circle.cpp:73
float radius
Radius of object.
Definition: circle.h:59
center_in_roi_t center
Center of object in ROI.
Definition: circle.h:57
void printToStream(std::ostream &stream)
Print info.
Definition: circle.cpp:62
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:125
int count
Number of pixels.
Definition: circle.h:61
unsigned int margin
Margin around shape.
Definition: circle.h:63
Shape interface.
Definition: shapemodel.h:37
Center in ROI.
Definition: types.h:38