Fawkes API  Fawkes Development Version
firevision::ScanlineLineGrid Class Reference

Grid of scan lines. More...

#include <>>

Inheritance diagram for firevision::ScanlineLineGrid:

Public Member Functions

 ScanlineLineGrid (unsigned int width, unsigned int height, unsigned int offset_hor, unsigned int offset_ver, ROI *roi=NULL, unsigned int gap=0)
 Constructor. More...
 
virtual ~ScanlineLineGrid ()
 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...
 
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...
 
virtual void set_dimensions (unsigned int width, unsigned int height, ROI *roi=NULL)
 Sets the dimensions of the grid. More...
 
virtual void set_offset (unsigned int offset_x, unsigned int offset_y)
 Sets offset. More...
 
virtual void set_grid_params (unsigned int width, unsigned int height, unsigned int offset_hor, unsigned int offset_ver, ROI *roi=NULL)
 Set all grid parameters. More...
 
virtual void set_roi (ROI *roi=NULL)
 Sets the region-of-interest. More...
 
- Public Member Functions inherited from firevision::ScanlineModel
virtual ~ScanlineModel ()
 Virtual empty destructor. More...
 

Detailed Description

Grid of scan lines.

A grid of scan lines (i.e. horizontal and/or vertical lines) instead of only points on the grid crossings. The behavior of the ScanlineGrid (grid.h) class can be modeled if offset_hor is set to the same value as offset_x in the Grid class, offset_ver = 0 and gap is set to offset_y - 1. The advantage of doing this is a performance gain as the LineGrid is pre-calculated and getting the next point is only an iterator increment.

Definition at line 40 of file line_grid.h.

Constructor & Destructor Documentation

◆ ScanlineLineGrid()

firevision::ScanlineLineGrid::ScanlineLineGrid ( unsigned int  width,
unsigned int  height,
unsigned int  offset_hor,
unsigned int  offset_ver,
ROI roi = NULL,
unsigned int  gap = 0 
)

Constructor.

Parameters
widthWidth of grid (most likely equal to image_width)
heightHeight of grid (most likely equal to image_height)
offset_horOffset between horizontal lines (set to 0 to get only vertical lines)
offset_verOffset between vertical lines (set to 0 to get only horizontal lines)
roiThe grid will only be calculated within the roi (if NULL the grid gets calculated over the complete width/height). The provided object will be deleted by ScanlineLineGrid!
gapGap between two points on the line

Definition at line 60 of file line_grid.cpp.

References set_grid_params().

◆ ~ScanlineLineGrid()

firevision::ScanlineLineGrid::~ScanlineLineGrid ( )
virtual

Destructor.

Definition at line 73 of file line_grid.cpp.

Member Function Documentation

◆ finished()

bool firevision::ScanlineLineGrid::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 179 of file line_grid.cpp.

◆ get_margin()

unsigned int firevision::ScanlineLineGrid::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 198 of file line_grid.cpp.

◆ get_name()

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

Get name of scanline model.

Returns
name of scanline model.

Implements firevision::ScanlineModel.

Definition at line 191 of file line_grid.cpp.

◆ operator*()

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

Get the current coordinate.

Returns
current point in image that is shall be processed.

Implements firevision::ScanlineModel.

Definition at line 79 of file line_grid.cpp.

◆ operator++() [1/2]

upoint_t * firevision::ScanlineLineGrid::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 162 of file line_grid.cpp.

◆ operator++() [2/2]

upoint_t * firevision::ScanlineLineGrid::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 169 of file line_grid.cpp.

◆ operator->()

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

◆ reset()

void firevision::ScanlineLineGrid::reset ( )
virtual

Reset model.

Resets the set of processed points.

Implements firevision::ScanlineModel.

Definition at line 185 of file line_grid.cpp.

Referenced by operator->().

◆ set_dimensions()

void firevision::ScanlineLineGrid::set_dimensions ( unsigned int  width,
unsigned int  height,
ROI roi = NULL 
)
virtual

Sets the dimensions of the grid.

Set width and height of scanline grid. Implicitly resets the grid.

Parameters
widthWidth of grid (most likely equal to image_width)
heightHeight of grid (most likely equal to image_height)
roiThe grid will only be calculated within the roi (if NULL the grid gets calculated over the complete width/height). The provided object will be deleted by ScanlineLineGrid!

Definition at line 228 of file line_grid.cpp.

References set_roi().

Referenced by set_grid_params().

◆ set_grid_params()

void firevision::ScanlineLineGrid::set_grid_params ( unsigned int  width,
unsigned int  height,
unsigned int  offset_hor,
unsigned int  offset_ver,
ROI roi = NULL 
)
virtual

Set all grid parameters.

Set width, height, horizontal and vertical offset by which the pointer in the grid is advanced. Implicitly resets the grid.

Parameters
widthWidth of grid (most likely equal to image_width)
heightHeight of grid (most likely equal to image_height)
offset_horOffset between horizontal lines (set to 0 to get only vertical lines)
offset_verOffset between vertical lines (set to 0 to get only horizontal lines)
roiThe grid will only be calculated within the roi (if NULL the grid gets calculated over the complete width/height). The provided object will be deleted by ScanlineLineGrid!

Definition at line 294 of file line_grid.cpp.

References set_dimensions().

Referenced by ScanlineLineGrid().

◆ set_offset()

void firevision::ScanlineLineGrid::set_offset ( unsigned int  offset_hor,
unsigned int  offset_ver 
)
virtual

Sets offset.

Set horizontal and vertical offset by which the pointer in the grid is advanced. This function implicitly resets the grid.

Parameters
offset_horOffset between horizontal lines (set to 0 to get only vertical lines)
offset_verOffset between vertical lines (set to 0 to get only horizontal lines)

Definition at line 271 of file line_grid.cpp.

◆ set_pan_tilt()

void firevision::ScanlineLineGrid::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 212 of file line_grid.cpp.

◆ set_robot_pose()

void firevision::ScanlineLineGrid::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 205 of file line_grid.cpp.

◆ set_roi()

void firevision::ScanlineLineGrid::set_roi ( ROI roi = NULL)
virtual

Sets the region-of-interest.

Parameters
roiThe grid will only be calculated within the roi (if NULL the grid gets calculated over the complete width/height). The provided object will be deleted by ScanlineLineGrid!

Reimplemented from firevision::ScanlineModel.

Definition at line 242 of file line_grid.cpp.

References firevision::ROI::height, firevision::ROI::image_height, firevision::ROI::image_width, firevision::ROI::set_image_height(), firevision::ROI::set_image_width(), firevision::ROI::start, firevision::ROI::width, fawkes::upoint_t::x, and fawkes::upoint_t::y.

Referenced by set_dimensions().


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