Fawkes API
Fawkes Development Version
|
Wraps an image so that access to (0, 0) is mapped to the middle of the image and so on. More...
Public Member Functions | |
CartesianImage (const StepResult &res, PolarAngle phi, PixelPoint center, const unsigned char *mask=0) | |
Constructor. More... | |
CartesianImage (const StepResult &res, PolarAngle phi, const unsigned char *mask=0) | |
Constructor. More... | |
CartesianImage (const unsigned char *buf, int width, int height, PolarAngle phi, const PixelPoint ¢er) | |
Constructor. More... | |
CartesianImage (unsigned char *buf, int width, int height, PolarAngle phi, const PixelPoint ¢er) | |
Constructor. More... | |
CartesianImage (const unsigned char *buf, int width, int height, PolarAngle phi) | |
Constructor. More... | |
CartesianImage (unsigned char *buf, int width, int height, PolarAngle phi) | |
Constructor. More... | |
unsigned char * | buf () |
Get Buffer. More... | |
const unsigned char * | mask () const |
Mask. More... | |
const unsigned char * | buf () const |
Buffer. More... | |
const PixelPoint & | center () const |
Center of buffer. More... | |
const int | width () const |
Width of buffer. More... | |
const int | height () const |
Height of buffer. More... | |
const PolarAngle | phi () const |
Phi angle. More... | |
PixelPoint | to_pixel (const CartesianPoint &p) const |
Converts a cartesian point to a pixel point. More... | |
CartesianPoint | to_cartesian (const PixelPoint &p) const |
Converts a pixel point to a cartesian point. More... | |
bool | contains (const PixelPoint &p) const |
Indicates whether the image contains a pixel point. More... | |
bool | contains (const CartesianPoint &p) const |
Indicates whether the image contains a cartesian point. More... | |
unsigned char | get (const CartesianPoint &p) const |
Get luminance at a given point. More... | |
int | max_x () const |
Get Maximum cartesian X coordinate of the image. More... | |
int | max_y () const |
Get Maximum cartesian Y coordinate of the image. More... | |
PolarRadius | max_radius () const |
Maximum polar radius of the image. More... | |
void | set_color (const PixelPoint &p, unsigned char luma, unsigned char chrominance) |
Sets the luminance Y and chrominance U at a given pixel point. More... | |
void | set_color (const CartesianPoint &p, unsigned char luma, unsigned char chrominance) |
Sets the luminance Y and chrominance U at a given cartesian point. More... | |
float | bright_fraction (const CartesianPoint &from, const CartesianPoint &to) const |
Get relative amount of bright pixels. More... | |
bool | is_line (const CartesianPoint &p, int length) const |
Indicates whether at pixel point p there is a highlighted line. More... | |
void | highlight_line (const CartesianPoint &p, int length) |
Highlightes a line at pixel point p. More... | |
void | draw_line (const PixelPoint &p, const PixelPoint &q) |
Draws a line from p to q. More... | |
void | draw_line (const CartesianPoint &p, const CartesianPoint &q) |
Draws a line from p to q. More... | |
void | highlight_pixel (const PixelPoint &p) |
Highlights a pixel, i.e. More... | |
void | highlight_point (const CartesianPoint &p) |
Highlights a point, i.e. More... | |
Wraps an image so that access to (0, 0) is mapped to the middle of the image and so on.
The result is a cartesian coordinate system with X and Y axis.
Definition at line 319 of file mirror_calib.cpp.
|
inline |
Constructor.
res | The step result that contains the base image. |
phi | The angle by which the image is rotated counter-clockwise. |
center | The center of the image from the robot's point of view; i.e. the center of the cone mirror. |
mask | The mask that indicates which pixels should be ignored. |
Definition at line 336 of file mirror_calib.cpp.
|
inline |
Constructor.
res | The step result that contains the base image. |
phi | The angle by which the image is rotated counter-clockwise. |
mask | The mask that indicates which pixels should be ignored. |
Definition at line 353 of file mirror_calib.cpp.
|
inline |
Constructor.
buf | The base YUV buffer. |
width | Image width. |
height | Image height. |
phi | The angle by which the image is rotated counter-clockwise. |
center | The center of the image from the robot's point of view; i.e. the center of the cone mirror. |
Definition at line 372 of file mirror_calib.cpp.
|
inline |
Constructor.
buf | The base YUV buffer. |
width | Image width. |
height | Image height. |
phi | The angle by which the image is rotated counter-clockwise. |
center | The center of the image from the robot's point of view; i.e. the center of the cone mirror. |
Definition at line 393 of file mirror_calib.cpp.
|
inline |
Constructor.
buf | The base YUV buffer. |
width | Image width. |
height | Image height. |
phi | The angle by which the image is rotated counter-clockwise. |
Definition at line 412 of file mirror_calib.cpp.
|
inline |
Constructor.
buf | The base YUV buffer. |
width | Image width. |
height | Image height. |
phi | The angle by which the image is rotated counter-clockwise. |
Definition at line 430 of file mirror_calib.cpp.
|
inline |
Get relative amount of bright pixels.
from | One point of the rectangle. |
to | Opposite point of the rectangle. |
Definition at line 588 of file mirror_calib.cpp.
References fawkes::contains(), firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
|
inline |
|
inline |
|
inline |
|
inline |
Indicates whether the image contains a pixel point.
p | The point. |
Definition at line 499 of file mirror_calib.cpp.
References firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
Referenced by firevision::MirrorCalibTool::draw_crosshair(), firevision::MirrorCalibTool::draw_line(), and firevision::MirrorCalibTool::draw_mark_lines().
|
inline |
Indicates whether the image contains a cartesian point.
p | The point. |
Definition at line 509 of file mirror_calib.cpp.
References fawkes::contains().
|
inline |
Draws a line from p to q.
p | First point of the line. |
q | First point of the line. |
Definition at line 649 of file mirror_calib.cpp.
|
inline |
Draws a line from p to q.
p | First point of the line. |
q | First point of the line. |
Definition at line 659 of file mirror_calib.cpp.
References firevision::MirrorCalibTool::Point::atan(), fawkes::contains(), firevision::MirrorCalibTool::Point::length(), firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
|
inline |
Get luminance at a given point.
p | The point. |
Definition at line 519 of file mirror_calib.cpp.
References fawkes::contains(), firevision::YUV_t_struct::U, firevision::YUV_t_struct::V, firevision::MirrorCalibTool::Point::x, firevision::YUV_t_struct::Y, and firevision::MirrorCalibTool::Point::y.
|
inline |
|
inline |
Highlightes a line at pixel point p.
p | The center point of the line. |
length | The length of the line. |
Definition at line 636 of file mirror_calib.cpp.
References firevision::MirrorCalibTool::Point::atan(), fawkes::deg2rad(), firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
Referenced by firevision::MirrorCalibTool::get_state_description().
|
inline |
Highlights a pixel, i.e.
sets the luminance and chrominance to MARK_LUMA and MARK_CHROMINANCE.
p | The pixel. |
Definition at line 676 of file mirror_calib.cpp.
References fawkes::contains(), firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
Referenced by firevision::MirrorCalibTool::next_step().
|
inline |
Highlights a point, i.e.
sets the luminance and chrominance to MARK_LUMA and MARK_CHROMINANCE.
p | The point. |
Definition at line 693 of file mirror_calib.cpp.
References fawkes::contains(), to_pixel(), firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
Referenced by firevision::MirrorCalibTool::get_state_description(), and firevision::MirrorCalibTool::next_step().
|
inline |
Indicates whether at pixel point p there is a highlighted line.
p | The assumed center point of the line. |
length | The length of the line |
Definition at line 618 of file mirror_calib.cpp.
References firevision::MirrorCalibTool::Point::atan(), fawkes::deg2rad(), firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
Referenced by firevision::MirrorCalibTool::get_state_description().
|
inline |
|
inline |
Maximum polar radius of the image.
Definition at line 550 of file mirror_calib.cpp.
Referenced by firevision::MirrorCalibTool::draw_crosshair(), firevision::MirrorCalibTool::draw_line(), firevision::MirrorCalibTool::draw_mark_lines(), and firevision::MirrorCalibTool::get_state_description().
|
inline |
Get Maximum cartesian X coordinate of the image.
Definition at line 542 of file mirror_calib.cpp.
|
inline |
Get Maximum cartesian Y coordinate of the image.
Definition at line 546 of file mirror_calib.cpp.
|
inline |
|
inline |
Sets the luminance Y and chrominance U at a given pixel point.
p | The point whose luminance Y and chrominance U is changed. |
luma | The luminance Y. |
chrominance | The chrominance U. |
Definition at line 559 of file mirror_calib.cpp.
References fawkes::contains(), firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
Referenced by firevision::MirrorCalibTool::draw_crosshair(), firevision::MirrorCalibTool::draw_line(), and firevision::MirrorCalibTool::draw_mark_lines().
|
inline |
Sets the luminance Y and chrominance U at a given cartesian point.
p | The point whose luminance Y and chrominance U is changed. |
luma | The luminance Y. |
chrominance | The chrominance U. |
Definition at line 575 of file mirror_calib.cpp.
|
inline |
Converts a pixel point to a cartesian point.
p | The point. |
Definition at line 488 of file mirror_calib.cpp.
References firevision::MirrorCalibTool::CartesianPoint::rotate(), firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
Referenced by firevision::MirrorCalibTool::next_step().
|
inline |
Converts a cartesian point to a pixel point.
p | The point. |
Definition at line 477 of file mirror_calib.cpp.
References firevision::MirrorCalibTool::CartesianPoint::rotate(), firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
Referenced by highlight_point(), and firevision::MirrorCalibTool::next_step().
|
inline |