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);
81 ScanlineGrid::calc_next_coord()
88 if (static_cast<int>(coord.
x) < static_cast<int>(roi->
image_width - offset_x))
94 if (static_cast<int>(coord.
y) < static_cast<int>(roi->
image_height - offset_y))
101 more_to_come =
false;
107 if (static_cast<int>(coord.
y) < static_cast<int>(roi->
image_height - offset_y))
113 if (static_cast<int>(coord.
x) < static_cast<int>(roi->
image_width - offset_x))
120 more_to_come =
false;
136 memcpy(&tmp_coord, &coord,
sizeof(
point_t));
144 return !more_to_come;
159 return "ScanlineModel::Grid";
166 return (offset_x > offset_y) ? offset_x : offset_y;
186 if (!roi) this->roi =
new ROI(0, 0, this->width, this->height, this->width, this->height);
215 this->height = height;
229 this->offset_x = offset_x;
230 this->offset_y = offset_y;
250 unsigned int offset_x,
unsigned int offset_y,
251 ROI* roi,
bool horizontal_grid)
253 this->horizontal_grid = horizontal_grid;
virtual void set_pan_tilt(float pan, float tilt)
Set camera's pan/tilt values.
virtual ~ScanlineGrid()
Destructor.
fawkes::point_t start
ROI start.
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.
Point with cartesian coordinates as unsigned integers.
unsigned int image_height
height of image that contains this ROI
fawkes::point_t operator*()
Get the current coordinate.
void setOffset(unsigned int offset_x, unsigned int offset_y)
Set offset.
unsigned int y
y coordinate
bool finished()
Check if all desired points have been processed.
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::point_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.
fawkes::point_t * operator++()
Postfix ++ operator.