Fawkes API Fawkes Development Version
|
Cut of arbitrary scanline models at an artificial horizon. More...
#include <>>
Public Member Functions | |
CornerHorizon (ScanlineModel *model, float field_length, float field_width, float field_border, unsigned int image_width, unsigned int image_height, float camera_height, float camera_ori, float horizontal_angle, float vertical_angle) | |
Constructor. More... | |
virtual | ~CornerHorizon () |
Destructor. More... | |
fawkes::upoint_t | operator* () |
Get the current coordinate. More... | |
fawkes::upoint_t * | operator-> () |
Get pointer to current point. More... | |
fawkes::upoint_t * | operator++ () |
Postfix ++ operator. More... | |
fawkes::upoint_t * | operator++ (int) |
Prefix ++ operator. More... | |
bool | finished () |
Check if all desired points have been processed. More... | |
void | reset () |
Reset model. More... | |
const char * | get_name () |
Get name of scanline model. More... | |
unsigned int | get_margin () |
Get margin around points. More... | |
void | set_robot_pose (float x, float y, float ori) |
Set the robot's pose. More... | |
void | set_pan_tilt (float pan, float tilt) |
Set camera's pan/tilt values. More... | |
unsigned int | getHorizon () |
Get the horizon point. More... | |
![]() | |
virtual | ~ScanlineModel () |
Virtual empty destructor. More... | |
virtual fawkes::upoint_t | operator* ()=0 |
Get the current coordinate. More... | |
virtual fawkes::upoint_t * | operator-> ()=0 |
Get pointer to current point. More... | |
virtual fawkes::upoint_t * | operator++ ()=0 |
Postfix ++ operator. More... | |
virtual fawkes::upoint_t * | operator++ (int)=0 |
Prefix ++ operator. More... | |
virtual bool | finished ()=0 |
Check if all desired points have been processed. More... | |
virtual void | reset ()=0 |
Reset model. More... | |
virtual const char * | get_name ()=0 |
Get name of scanline model. More... | |
virtual unsigned int | get_margin ()=0 |
Get margin around points. More... | |
virtual void | set_robot_pose (float x, float y, float ori)=0 |
Set the robot's pose. More... | |
virtual void | set_pan_tilt (float pan, float tilt)=0 |
Set camera's pan/tilt values. More... | |
virtual void | set_roi (ROI *roi=NULL) |
Set the region-of-interest. More... | |
Protected Member Functions | |
void | calculate () |
Calculate horizon point. More... | |
Cut of arbitrary scanline models at an artificial horizon.
The artificial horizon is calculated by the highest corner that is visible in the image. From that the Y coordinate in the image is used and everything above that point is ignored from the scanline grid.
This class was written in a one-night hacking sensation at RoboLudens 2006 in Eindhoven. For that time it is pretty readable code and we are using it since then. Cool!
Definition at line 37 of file cornerhorizon.h.
firevision::CornerHorizon::CornerHorizon | ( | ScanlineModel * | model, |
float | field_length, | ||
float | field_width, | ||
float | field_border, | ||
unsigned int | image_width, | ||
unsigned int | image_height, | ||
float | camera_height, | ||
float | camera_ori, | ||
float | horizontal_angle, | ||
float | vertical_angle | ||
) |
Constructor.
model | Model to apply the artificial horizon on. This model is deleted on the destruction of the CornerHorizon instance so you can forget about it in the using application. |
field_length | length of soccer field |
field_width | width of soccer field |
field_border | size of border around the field (i.e. distance between the outer white line and the physical field end) |
image_width | image width in pixels |
image_height | image height in pixels |
camera_height | height of camera above ground |
camera_ori | orientation of camera on the robot in degrees |
horizontal_angle | horizontal viewing angle in degrees |
vertical_angle | vertical viewing angle in degrees |
Definition at line 68 of file cornerhorizon.cpp.
References fawkes::deg2rad(), fawkes::upoint_t::x, and fawkes::upoint_t::y.
|
virtual |
Destructor.
Not that this deletes the supplied model!
Definition at line 103 of file cornerhorizon.cpp.
|
protected |
Calculate horizon point.
Definition at line 122 of file cornerhorizon.cpp.
References fawkes::normalize_mirror_rad().
Referenced by operator++().
|
virtual |
Check if all desired points have been processed.
Implements firevision::ScanlineModel.
Definition at line 229 of file cornerhorizon.cpp.
|
virtual |
Get margin around points.
Models that do not use margins shall return zero. It shall be guaranteed that in this margin region around a point there is no other point that has been or will be returned in a full iteration.
Implements firevision::ScanlineModel.
Definition at line 249 of file cornerhorizon.cpp.
|
virtual |
Get name of scanline model.
Implements firevision::ScanlineModel.
Definition at line 243 of file cornerhorizon.cpp.
unsigned int firevision::CornerHorizon::getHorizon | ( | ) |
Get the horizon point.
Definition at line 258 of file cornerhorizon.cpp.
|
virtual |
Get the current coordinate.
Implements firevision::ScanlineModel.
Definition at line 109 of file cornerhorizon.cpp.
|
virtual |
Postfix ++ operator.
Advances to the next point and returns the new point.
Implements firevision::ScanlineModel.
Definition at line 180 of file cornerhorizon.cpp.
References calculate(), fawkes::upoint_t::x, and fawkes::upoint_t::y.
|
virtual |
Prefix ++ operator.
Advances to the next point but returns the old point.
Implements firevision::ScanlineModel.
Definition at line 207 of file cornerhorizon.cpp.
References calculate(), fawkes::upoint_t::x, and fawkes::upoint_t::y.
|
virtual |
Get pointer to current point.
Implements firevision::ScanlineModel.
Definition at line 115 of file cornerhorizon.cpp.
|
virtual |
Reset model.
Resets the set of processed points.
Implements firevision::ScanlineModel.
Definition at line 235 of file cornerhorizon.cpp.
References fawkes::upoint_t::x, and fawkes::upoint_t::y.
|
virtual |
Set camera's pan/tilt values.
pan | camera's current pan |
tilt | camera's current tilt |
Implements firevision::ScanlineModel.
Definition at line 272 of file cornerhorizon.cpp.
|
virtual |
Set the robot's pose.
x | robot's x coordinate on field in meters |
y | robot's y coordinate on field in meters |
ori | robot's orientation. Looking towards the opponent goal is zero rad, with positive values pointing to the right, negative to the left. |
Implements firevision::ScanlineModel.
Definition at line 264 of file cornerhorizon.cpp.