Fawkes API
Fawkes Development Version
|
24 #include <core/exceptions/software.h>
25 #include <fvmodels/scanlines/line_grid.h>
26 #include <fvutils/base/roi.h>
27 #include <fvutils/draw/drawer.h>
33 namespace firevision {
58 unsigned int offset_hor,
59 unsigned int offset_ver,
64 next_pixel_ = gap + 1;
89 ScanlineLineGrid::calc_coords()
92 bool more_to_come =
true;
99 next_px = std::min(next_pixel_, offset_ver_ ? offset_ver_ : width_);
102 + ((roi_->
height - 1) % offset_hor_) / 2;
103 point_list_.push_back(coord);
105 while (more_to_come) {
111 coord.
y += offset_hor_;
113 more_to_come =
false;
118 point_list_.push_back(coord);
125 next_px = std::min(next_pixel_, offset_hor_ ? offset_hor_ : height_);
127 + ((roi_->
width - 1) % offset_ver_) / 2;
129 point_list_.push_back(coord);
131 while (more_to_come) {
136 coord.
x += offset_ver_;
139 more_to_come =
false;
144 point_list_.push_back(coord);
154 if (cur_ != point_list_.end())
156 return cur_ != point_list_.end() ? &*cur_ : &point_list_.back();
162 if (cur_ != point_list_.end()) {
166 return &point_list_.back();
172 return cur_ == point_list_.end();
178 cur_ = point_list_.begin();
184 return "ScanlineModel::LineGrid";
190 return std::max(offset_ver_, offset_hor_);
234 roi_ =
new ROI(0, 0, width_, height_, width_, height_);
266 offset_hor_ = offset_hor;
267 offset_ver_ = offset_ver;
288 unsigned int offset_hor,
289 unsigned int offset_ver,
292 offset_hor_ = offset_hor;
293 offset_ver_ = offset_ver;
virtual ~ScanlineLineGrid()
Destructor.
void set_image_height(unsigned int image_height)
Set full image height Set the height of the image that contains this ROI.
virtual void set_roi(ROI *roi=NULL)
Sets the region-of-interest.
ScanlineLineGrid(unsigned int width, unsigned int height, unsigned int offset_hor, unsigned int offset_ver, ROI *roi=NULL, unsigned int gap=0)
Constructor.
unsigned int width
ROI width.
virtual void set_offset(unsigned int offset_x, unsigned int offset_y)
Sets offset.
unsigned int image_width
width of image that contains this ROI
virtual void set_pan_tilt(float pan, float tilt)
Set camera's pan/tilt values.
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.
unsigned int image_height
height of image that contains this ROI
Point with cartesian coordinates as unsigned integers.
unsigned int get_margin()
Get margin around points.
unsigned int height
ROI height.
void set_image_width(unsigned int image_width)
Set full image width.
fawkes::upoint_t * operator++()
Postfix ++ operator.
unsigned int y
y coordinate
virtual void set_dimensions(unsigned int width, unsigned int height, ROI *roi=NULL)
Sets the dimensions of the grid.
fawkes::upoint_t operator*()
Get the current coordinate.
const char * get_name()
Get name of scanline model.
fawkes::upoint_t start
ROI start.
virtual void set_robot_pose(float x, float y, float ori)
Set the robot's pose.
unsigned int x
x coordinate
bool finished()
Check if all desired points have been processed.
fawkes::upoint_t * operator->()
Get pointer to current point.