Fawkes API  Fawkes Development Version
firevision::ScanlineRadial Class Reference

Radial scanlines. More...

#include <>>

Inheritance diagram for firevision::ScanlineRadial:

Public Member Functions

 ScanlineRadial (unsigned int width, unsigned int height, unsigned int center_x, unsigned int center_y, unsigned int radius_increment, unsigned int step, unsigned int max_radius=0, unsigned int dead_radius=0)
 Constructor. 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...
 
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...
 
virtual void set_robot_pose (float x, float y, float ori)
 Set the robot's pose. More...
 
virtual void set_pan_tilt (float pan, float tilt)
 Set camera's pan/tilt values. More...
 
void set_center (unsigned int center_x, unsigned int center_y)
 Set new center point. More...
 
void set_radius (unsigned int dead_radius, unsigned int max_radius)
 Set new radius. 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

Radial scanlines.

Uses circles to generate scanline points. A dead radius is ignored in the center of the image (for example for the camera itself in an omni-vision system). From there circles are used in radius_increment distances. On each circle points are generated in a distance of about step pixels. This is done up to a given maximum radius. If no maximum radius is supplied (max_radius=0) it is automatically calculated depending on the image size.

Definition at line 35 of file radial.h.

Constructor & Destructor Documentation

◆ ScanlineRadial()

firevision::ScanlineRadial::ScanlineRadial ( unsigned int  width,
unsigned int  height,
unsigned int  center_x,
unsigned int  center_y,
unsigned int  radius_increment,
unsigned int  step,
unsigned int  max_radius = 0,
unsigned int  dead_radius = 0 
)

Constructor.

Parameters
widthimage width
heightimage height
center_xradial center center x
center_yradial center center y
radius_incrementradius increment
stepstep
max_radiusmaximum radius, if set to 0 will be calculated automatically depending on the image dimensions.
dead_radiusinner radius to ignore

Definition at line 59 of file radial.cpp.

References reset().

Member Function Documentation

◆ finished()

bool firevision::ScanlineRadial::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 213 of file radial.cpp.

◆ get_margin()

unsigned int firevision::ScanlineRadial::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 294 of file radial.cpp.

◆ get_name()

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

Get name of scanline model.

Returns
name of scanline model.

Implements firevision::ScanlineModel.

Definition at line 287 of file radial.cpp.

◆ operator*()

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

Get the current coordinate.

Returns
current point in image that is shall be processed.

Implements firevision::ScanlineModel.

Definition at line 80 of file radial.cpp.

◆ operator++() [1/2]

upoint_t * firevision::ScanlineRadial::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 92 of file radial.cpp.

References fawkes::upoint_t::x, and fawkes::upoint_t::y.

◆ operator++() [2/2]

upoint_t * firevision::ScanlineRadial::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 206 of file radial.cpp.

◆ operator->()

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

Get pointer to current point.

Returns
pointer to current point
See also
operator*()

Implements firevision::ScanlineModel.

Definition at line 86 of file radial.cpp.

◆ reset()

void firevision::ScanlineRadial::reset ( )
virtual

Reset model.

Resets the set of processed points.

Implements firevision::ScanlineModel.

Definition at line 245 of file radial.cpp.

References fawkes::upoint_t::x, and fawkes::upoint_t::y.

Referenced by ScanlineRadial(), set_center(), and set_radius().

◆ set_center()

void firevision::ScanlineRadial::set_center ( unsigned int  center_x,
unsigned int  center_y 
)

Set new center point.

Sets new center point to move around the scanlines in the image. Does an implicit reset().

Parameters
center_xx coordinate of the new center
center_yy coordinate of the new center

Definition at line 307 of file radial.cpp.

References reset().

Referenced by set_pan_tilt().

◆ set_pan_tilt()

virtual void firevision::ScanlineRadial::set_pan_tilt ( float  pan,
float  tilt 
)
inlinevirtual

Set camera's pan/tilt values.

Parameters
pancamera's current pan
tiltcamera's current tilt

Implements firevision::ScanlineModel.

Definition at line 57 of file radial.h.

References set_center(), and set_radius().

◆ set_radius()

void firevision::ScanlineRadial::set_radius ( unsigned int  dead_radius,
unsigned int  max_radius 
)

Set new radius.

Sets the new maximum and dead radius. Does an implicit reset().

Parameters
dead_radiusnew dead radius
max_radiusnew maximum radius, if set to 0 this is automatically calculated depending on the image size.

Definition at line 322 of file radial.cpp.

References reset().

Referenced by set_pan_tilt().

◆ set_robot_pose()

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

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 56 of file radial.h.


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