Fawkes API  Fawkes Development Version
line.h
1 
2 /***************************************************************************
3  * line.h - Header of circle shape model
4  *
5  * Created: Tue Sep 27 11:25:35 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_LINE_H_
26 #define __FIREVISION_MODELS_SHAPE_LINE_H_
27 
28 #include <vector>
29 #include <iostream>
30 
31 #include <fvutils/base/types.h>
32 #include <fvutils/base/roi.h>
33 #include <fvmodels/shape/shapemodel.h>
34 
35 namespace firevision {
36 #if 0 /* just to make Emacs auto-indent happy */
37 }
38 #endif
39 
40 class LineShape : public Shape
41 {
42  friend class HtLinesModel;
43  friend class RhtLinesModel;
44  public:
45  LineShape(unsigned int roi_width, unsigned int roi_height);
46  ~LineShape();
47 
48  void printToStream(std::ostream &stream);
49  void setMargin( unsigned int margin );
50  bool isClose(unsigned int in_roi_x, unsigned int in_roi_y);
51 
52  void calcPoints();
53  void getPoints(int *x1, int *y1, int *x2, int *y2);
54 
55  private:
56  float r;
57  float phi;
58  int count;
59  unsigned int margin;
60  int max_length;
61 
62  unsigned int roi_width;
63  unsigned int roi_height;
64 
65  float last_calc_r;
66  float last_calc_phi;
67 
68  int x1;
69  int y1;
70  int x2;
71  int y2;
72 
73 
74 };
75 
76 } // end namespace firevision
77 
78 #endif // __FIREVISION_MODELS_SHAPE_LINE_H_
Randomized Hough-Transform line model.
Definition: rht_lines.h:43
Hough-Transform line matcher.
Definition: ht_lines.h:43
void printToStream(std::ostream &stream)
Print line.
Definition: line.cpp:69
void getPoints(int *x1, int *y1, int *x2, int *y2)
Get two points that define the line.
Definition: line.cpp:202
void setMargin(unsigned int margin)
Set margin around shape.
Definition: line.cpp:76
bool isClose(unsigned int in_roi_x, unsigned int in_roi_y)
Check if the given point is close to the shape.
Definition: line.cpp:83
void calcPoints()
Calc points for line.
Definition: line.cpp:104
Line shape.
Definition: line.h:40
LineShape(unsigned int roi_width, unsigned int roi_height)
Constructor.
Definition: line.cpp:44
Shape interface.
Definition: shapemodel.h:39
~LineShape()
Destructor.
Definition: line.cpp:60