Fawkes API  Fawkes Development Version
firevision::ScanlineStar Class Reference

Star-like arranged scanline points. More...

#include <>>

Inheritance diagram for firevision::ScanlineStar:

Public Member Functions

 ScanlineStar (unsigned int image_width, unsigned int image_height, unsigned int center_x, unsigned int center_y, unsigned int num_rays, unsigned int radius_incr, unsigned char *yuv_mask, unsigned int dead_radius=0, unsigned int max_radius=0, unsigned int margin=0)
 Constructor. More...
 
virtual ~ScanlineStar ()
 Destructor. More...
 
fawkes::upoint_t operator* ()
 Get the current coordinate. More...
 
fawkes::upoint_toperator-> ()
 Get pointer to current point. More...
 
fawkes::upoint_toperator++ ()
 Postfix ++ operator. More...
 
fawkes::upoint_toperator++ (int)
 Prefix ++ operator. More...
 
void advance ()
 Calculates the next scanline point. 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...
 
void skip_current_ray ()
 Skips the current ray and continues with the first valid scanline point of the next ray. More...
 
unsigned int num_rays () const
 Returns the number of segments in the model. More...
 
unsigned int ray_index () const
 Return the index of the current ray. More...
 
unsigned int current_radius () const
 Returns the radius of the current scanline point. More...
 
float current_angle () const
 Returns the angle of the current scanline point. More...
 
bool first_on_ray () const
 Checks whether the current scanpoint is the first scanpoint on the current ray. More...
 
- Public Member Functions inherited from firevision::ScanlineModel
virtual ~ScanlineModel ()
 Virtual empty destructor. More...
 
virtual void set_roi (ROI *roi=NULL)
 Set the region-of-interest. More...
 

Detailed Description

Star-like arranged scanline points.

Author
Daniel Beck

Definition at line 36 of file star.h.

Constructor & Destructor Documentation

◆ ScanlineStar()

firevision::ScanlineStar::ScanlineStar ( unsigned int  image_width,
unsigned int  image_height,
unsigned int  center_x,
unsigned int  center_y,
unsigned int  num_rays,
unsigned int  radius_incr,
unsigned char *  yuv_mask,
unsigned int  dead_radius = 0,
unsigned int  max_radius = 0,
unsigned int  margin = 0 
)

Constructor.

Parameters
image_widthwidth of the image
image_heightheight of the image
center_xx-coordinate of the center point
center_yy-coordinate of the center point
num_raysnumber of rays
radius_incrnumber of pixels by which the radius is increased
yuv_maska mask allows to exclude certain regions of the image from inspection. More precisely, no scanline points are generated in those areas. The ignored regions have to be black, i.e. Y=0, U=127, V=127.
dead_radiusnumber of pixels around the center that are disregarded
max_radiusmaximal radius in number of pixels
marginmargin around every scanline point that does not contain any other scanline point (in pixels)

Definition at line 58 of file star.cpp.

References fawkes::deg2rad().

◆ ~ScanlineStar()

firevision::ScanlineStar::~ScanlineStar ( )
virtual

Destructor.

Definition at line 97 of file star.cpp.

Member Function Documentation

◆ advance()

void firevision::ScanlineStar::advance ( )

Calculates the next scanline point.

Definition at line 140 of file star.cpp.

◆ current_angle()

float firevision::ScanlineStar::current_angle ( ) const

Returns the angle of the current scanline point.

Returns
the angle of the current scanline point

Definition at line 270 of file star.cpp.

◆ current_radius()

unsigned int firevision::ScanlineStar::current_radius ( ) const

Returns the radius of the current scanline point.

Returns
the radius of the current scanline point

Definition at line 260 of file star.cpp.

◆ finished()

bool firevision::ScanlineStar::finished ( )
virtual

Check if all desired points have been processed.

Returns
true if all pixels that the model defines have been iterated.

Implements firevision::ScanlineModel.

Definition at line 167 of file star.cpp.

◆ first_on_ray()

bool firevision::ScanlineStar::first_on_ray ( ) const

Checks whether the current scanpoint is the first scanpoint on the current ray.

Returns
true, if the it is the first scanpoint on the current ray

Definition at line 280 of file star.cpp.

References fawkes::deg2rad(), firevision::YUV_t_struct::U, firevision::YUV_t_struct::V, fawkes::upoint_t::x, fawkes::upoint_t::y, and firevision::YUV_t_struct::Y.

◆ get_margin()

unsigned int firevision::ScanlineStar::get_margin ( )
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.

Returns
margin around a point.

Implements firevision::ScanlineModel.

Definition at line 194 of file star.cpp.

◆ get_name()

const char * firevision::ScanlineStar::get_name ( )
virtual

Get name of scanline model.

Returns
name of scanline model.

Implements firevision::ScanlineModel.

Definition at line 187 of file star.cpp.

◆ num_rays()

unsigned int firevision::ScanlineStar::num_rays ( ) const

Returns the number of segments in the model.

Returns
the number of segments

Definition at line 240 of file star.cpp.

◆ operator*()

upoint_t firevision::ScanlineStar::operator* ( )
virtual

Get the current coordinate.

Returns
current point in image that is shall be processed.

Implements firevision::ScanlineModel.

Definition at line 107 of file star.cpp.

◆ operator++() [1/2]

upoint_t * firevision::ScanlineStar::operator++ ( )
virtual

Postfix ++ operator.

Advances to the next point and returns the new point.

Returns
pointer to new point

Implements firevision::ScanlineModel.

Definition at line 121 of file star.cpp.

◆ operator++() [2/2]

upoint_t * firevision::ScanlineStar::operator++ ( int  )
virtual

Prefix ++ operator.

Advances to the next point but returns the old point.

Returns
pointer to next point

Implements firevision::ScanlineModel.

Definition at line 129 of file star.cpp.

◆ operator->()

upoint_t * firevision::ScanlineStar::operator-> ( )
virtual

Get pointer to current point.

Returns
pointer to current point
See also
operator*()

Implements firevision::ScanlineModel.

Definition at line 114 of file star.cpp.

◆ ray_index()

unsigned int firevision::ScanlineStar::ray_index ( ) const

Return the index of the current ray.

Returns
the index of the current ray

Definition at line 250 of file star.cpp.

◆ reset()

void firevision::ScanlineStar::reset ( )
virtual

Reset model.

Resets the set of processed points.

Implements firevision::ScanlineModel.

Definition at line 174 of file star.cpp.

◆ set_pan_tilt()

void firevision::ScanlineStar::set_pan_tilt ( float  pan,
float  tilt 
)
virtual

Set camera's pan/tilt values.

Parameters
pancamera's current pan
tiltcamera's current tilt

Implements firevision::ScanlineModel.

Definition at line 208 of file star.cpp.

◆ set_robot_pose()

void firevision::ScanlineStar::set_robot_pose ( float  x,
float  y,
float  ori 
)
virtual

Set the robot's pose.

Parameters
xrobot's x coordinate on field in meters
yrobot's y coordinate on field in meters
orirobot'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 201 of file star.cpp.

◆ skip_current_ray()

void firevision::ScanlineStar::skip_current_ray ( )

Skips the current ray and continues with the first valid scanline point of the next ray.

Definition at line 217 of file star.cpp.


The documentation for this class was generated from the following files: