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 <fvmodels/shape/shapemodel.h>
29#include <fvutils/base/roi.h>
30#include <fvutils/base/types.h>
31
32#include <iostream>
33#include <vector>
34
35namespace firevision {
36
37class HtLinesModel;
38class RhtLinesModel;
39
40class LineShape : public Shape
41{
42 friend HtLinesModel;
43 friend RhtLinesModel;
44
45public:
46 LineShape(unsigned int roi_width, unsigned int roi_height);
47 ~LineShape();
48
49 void printToStream(std::ostream &stream);
50 void setMargin(unsigned int margin);
51 bool isClose(unsigned int in_roi_x, unsigned int in_roi_y);
52
53 void calcPoints();
54 void getPoints(int *x1, int *y1, int *x2, int *y2);
55
56private:
57 float r;
58 float phi;
59 int count;
60 unsigned int margin;
61 int max_length;
62
63 unsigned int roi_width;
64 unsigned int roi_height;
65
66 float last_calc_r;
67 float last_calc_phi;
68
69 int x1;
70 int y1;
71 int x2;
72 int y2;
73};
74
75} // end namespace firevision
76
77#endif // FIREVISION_MODELS_SHAPE_LINE_H__
Hough-Transform line matcher.
Definition: ht_lines.h:41
Line shape.
Definition: line.h:41
void printToStream(std::ostream &stream)
Print line.
Definition: line.cpp:63
void setMargin(unsigned int margin)
Set margin around shape.
Definition: line.cpp:69
LineShape(unsigned int roi_width, unsigned int roi_height)
Constructor.
Definition: line.cpp:41
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:75
~LineShape()
Destructor.
Definition: line.cpp:55
void calcPoints()
Calc points for line.
Definition: line.cpp:96
void getPoints(int *x1, int *y1, int *x2, int *y2)
Get two points that define the line.
Definition: line.cpp:192
Randomized Hough-Transform line model.
Definition: rht_lines.h:41
Shape interface.
Definition: shapemodel.h:37