22 #include <fvmodels/relative_position/back_projection.h> 43 float ball_circumference):
44 __projective_cam(projective_cam),
45 __ball_circumference(ball_circumference)
47 __ball_radius = __ball_circumference / ( 2.0 * M_PI );
49 __world_x = __world_y = __bearing = __slope = __distance = 0.f;
50 __cirt_center.
x = __cirt_center.
y = 0.0f;
73 __cam_position.
roll = roll;
74 __cam_position.
pitch = -tilt;
75 __cam_position.
yaw = pan;
86 pan = __cam_position.
yaw;
87 tilt = -__cam_position.
pitch;
88 roll = __cam_position.
roll;
93 __cam_position.
x = rel_x;
94 __cam_position.
y = rel_y;
95 __cam_position.
z = height;
100 height = __cam_position.
z;
101 rel_x = __cam_position.
x;
102 rel_y = __cam_position.
y;
111 __cam_position.
pitch,
120 __world_x = wld_pt.
x;
121 __world_y = wld_pt.
y;
132 __bearing = -atan2f(_ball_y, __world_x);
134 __bearing = atan2f(__world_y, __world_x);
137 __distance = sqrt(__world_x * __world_x + __world_y * __world_y);
138 __slope = -atan2f(__cam_position.
z, __distance);
virtual ProjectiveCam & set_location(const fawkes::HomTransform &loc)
Sets a new location for the camera.
virtual void get_pan_tilt(float *pan, float *tilt) const
Get camera pan tilt.
Cartesian coordinates (2D).
virtual void set_cam_rotation(float pan=0.f, float tilt=0.f, float roll=0.f)
Sets the camera orientation.
The point that should be calculated lies above the horizon.
virtual void get_cam_translation(float &height, float &rel_x, float &rel_y) const
Returns the current translation of the camera.
virtual void get_cam_rotation(float &pan, float &tilt, float &roll) const
Returns the camera orientation.
float x
The x-coordinate of the point.
float z
The z-coordinate of the point.
virtual void reset()
Reset all data.
Abstract class for projective cameras.
float pitch
The angle around the y-axis.
float y
The y-coordinate of the point.
virtual fawkes::cart_coord_2d_t get_GPA_world_coord(const center_in_roi_t &img_p) const
Returns a point in the world under the ground plane assumption.
BackProjectionPositionModel(ProjectiveCam &projective_cam, float ball_circumference=0.f)
Constructor.
virtual void calc()
Calculate position data.
virtual void set_radius(float r)
Set radius of a found circle.
float roll
The angle around the x-axis.
virtual void set_center(float x, float y)
Set center of a found circle.
virtual void set_cam_translation(float height, float rel_x=0.f, float rel_y=0.f)
Sets the current translation of the camera.
float yaw
The angle around the z-axis.