Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
back_projection.h
1
/***************************************************************************
2
* back_projection.h - Projective camera back projection model
3
*
4
* Created: Mon Apr 20 21:59:00 2009
5
* Copyright 2009 Christof Rath <christof.rath@gmail.com>
6
*
7
****************************************************************************/
8
9
/* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU Library General Public License for more details.
18
*
19
* Read the full text in the LICENSE.GPL file in the doc directory.
20
*/
21
22
#ifndef __FIREVISION_MODELS_RELATIVE_POSITION_BACK_PROJECTION_H_
23
#define __FIREVISION_MODELS_RELATIVE_POSITION_BACK_PROJECTION_H_
24
25
#include <fvmodels/relative_position/relativepositionmodel.h>
26
27
#include <fvmodels/camera/projective_cam.h>
28
#include <utils/math/types.h>
29
30
namespace
firevision {
31
#if 0
/* just to make Emacs auto-indent happy */
32
}
33
#endif
34
35
class
BackProjectionPositionModel
:
public
RelativePositionModel
36
{
37
public
:
38
BackProjectionPositionModel
(
ProjectiveCam
&projective_cam,
39
float
ball_circumference = 0.f);
40
41
virtual
const
char
*
get_name
()
const
{
return
"BackProjectionPositionModel"
; }
42
virtual
void
set_radius(
float
r);
43
virtual
void
set_center(
float
x,
float
y);
44
virtual
void
set_center
(
const
center_in_roi_t
& c) {
set_center
(c.
x
, c.
y
); }
45
46
virtual
void
set_pan_tilt
(
float
pan = 0.0f,
float
tilt = 0.0f) { set_cam_rotation(pan, tilt, 0.f); }
47
virtual
void
get_pan_tilt(
float
*pan,
float
*tilt)
const
;
48
49
virtual
void
set_cam_rotation(
float
pan = 0.f,
float
tilt = 0.f,
float
roll = 0.f);
50
virtual
void
get_cam_rotation(
float
&pan,
float
&tilt,
float
&roll)
const
;
51
52
virtual
void
set_cam_translation(
float
height,
float
rel_x = 0.f,
float
rel_y = 0.f);
53
virtual
void
get_cam_translation(
float
&height,
float
&rel_x,
float
&rel_y)
const
;
54
55
virtual
float
get_distance
()
const
{
return
__distance; }
56
virtual
float
get_x
()
const
{
return
__world_x; }
57
virtual
float
get_y
()
const
{
return
__world_y; }
58
virtual
float
get_bearing
()
const
{
return
__bearing; }
59
virtual
float
get_slope
()
const
{
return
__slope; }
60
61
virtual
void
calc();
62
virtual
void
calc_unfiltered
() { calc(); }
63
virtual
void
reset();
64
65
virtual
bool
is_pos_valid
()
const
{
return
__pos_valid; }
66
67
private
:
68
ProjectiveCam
& __projective_cam;
69
70
center_in_roi_t
__cirt_center;
71
72
fawkes::point_6D_t
__cam_position;
73
74
float
__ball_circumference;
75
float
__ball_radius;
76
float
__world_x;
77
float
__world_y;
78
float
__bearing;
79
float
__slope;
80
float
__distance;
81
bool
__pos_valid;
82
};
83
84
}
// end namespace firevision
85
86
#endif
/* BACK_PROJECTION_H_ */
src
libs
fvmodels
relative_position
back_projection.h
Generated by
1.8.1.2