24 #include <fvmodels/scanlines/grid.h> 25 #include <core/exceptions/software.h> 52 unsigned int offset_x,
unsigned int offset_y,
53 ROI* roi,
bool horizontal_grid)
58 roi, horizontal_grid);
82 ScanlineGrid::calc_next_coord()
89 if (static_cast<int>(coord.
x) < static_cast<int>(roi->
image_width - offset_x))
95 if (static_cast<int>(coord.
y) < static_cast<int>(roi->
image_height - offset_y))
102 more_to_come =
false;
108 if (static_cast<int>(coord.
y) < static_cast<int>(roi->
image_height - offset_y))
114 if (static_cast<int>(coord.
x) < static_cast<int>(roi->
image_width - offset_x))
121 more_to_come =
false;
137 memcpy(&tmp_coord, &coord,
sizeof(
upoint_t));
145 return !more_to_come;
160 return "ScanlineModel::Grid";
167 return (offset_x > offset_y) ? offset_x : offset_y;
187 if (!roi) this->roi =
new ROI(0, 0, this->width, this->height, this->width, this->height);
191 this->roi =
new ROI(roi);
220 this->height = height;
234 this->offset_x = offset_x;
235 this->offset_y = offset_y;
255 unsigned int offset_x,
unsigned int offset_y,
256 ROI* roi,
bool horizontal_grid)
258 this->horizontal_grid = horizontal_grid;
virtual void set_pan_tilt(float pan, float tilt)
Set camera's pan/tilt values.
virtual ~ScanlineGrid()
Destructor.
fawkes::upoint_t * operator++()
Postfix ++ operator.
fawkes::upoint_t start
ROI start.
unsigned int y
y coordinate
unsigned int x
x coordinate
unsigned int width
ROI width.
virtual void set_roi(ROI *roi=NULL)
Set the region-of-interest.
virtual void set_robot_pose(float x, float y, float ori)
Set the robot's pose.
const char * get_name()
Get name of scanline model.
unsigned int image_width
width of image that contains this ROI
unsigned int get_margin()
Get margin around points.
unsigned int image_height
height of image that contains this ROI
void setOffset(unsigned int offset_x, unsigned int offset_y)
Set offset.
Point with cartesian coordinates as unsigned integers.
bool finished()
Check if all desired points have been processed.
fawkes::upoint_t operator*()
Get the current coordinate.
ScanlineGrid(unsigned int width, unsigned int height, unsigned int offset_x, unsigned int offset_y, ROI *roi=NULL, bool horizontal_grid=true)
Constructor.
unsigned int height
ROI height.
void setDimensions(unsigned int width, unsigned int height, ROI *roi=NULL)
Set dimensions.
fawkes::upoint_t * operator->()
Get pointer to current point.
void setGridParams(unsigned int width, unsigned int height, unsigned int offset_x, unsigned int offset_y, ROI *roi=NULL, bool horizontal_grid=true)
Set all grid parameters.