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. | |
CartesianImage (const StepResult &res, PolarAngle phi, const unsigned char *mask=0) | |
Constructor. | |
CartesianImage (const unsigned char *buf, int width, int height, PolarAngle phi, const PixelPoint ¢er) | |
Constructor. | |
CartesianImage (unsigned char *buf, int width, int height, PolarAngle phi, const PixelPoint ¢er) | |
Constructor. | |
CartesianImage (const unsigned char *buf, int width, int height, PolarAngle phi) | |
Constructor. | |
CartesianImage (unsigned char *buf, int width, int height, PolarAngle phi) | |
Constructor. | |
unsigned char * | buf () |
Get Buffer. | |
const unsigned char * | mask () const |
Mask. | |
const unsigned char * | buf () const |
Buffer. | |
const PixelPoint & | center () const |
Center of buffer. | |
const int | width () const |
Width of buffer. | |
const int | height () const |
Height of buffer. | |
const PolarAngle | phi () const |
Phi angle. | |
PixelPoint | to_pixel (const CartesianPoint &p) const |
Converts a cartesian point to a pixel point. | |
CartesianPoint | to_cartesian (const PixelPoint &p) const |
Converts a pixel point to a cartesian point. | |
bool | contains (const PixelPoint &p) const |
Indicates whether the image contains a pixel point. | |
bool | contains (const CartesianPoint &p) const |
Indicates whether the image contains a cartesian point. | |
unsigned char | get (const CartesianPoint &p) const |
Get luminance at a given point. | |
int | max_x () const |
Get Maximum cartesian X coordinate of the image. | |
int | max_y () const |
Get Maximum cartesian Y coordinate of the image. | |
PolarRadius | max_radius () const |
Maximum polar radius of the image. | |
void | set_color (const PixelPoint &p, unsigned char luma, unsigned char chrominance) |
Sets the luminance Y and chrominance U at a given pixel point. | |
void | set_color (const CartesianPoint &p, unsigned char luma, unsigned char chrominance) |
Sets the luminance Y and chrominance U at a given cartesian point. | |
float | bright_fraction (const CartesianPoint &from, const CartesianPoint &to) const |
Get relative amount of bright pixels. | |
bool | is_line (const CartesianPoint &p, int length) const |
Indicates whether at pixel point p there is a highlighted line. | |
void | highlight_line (const CartesianPoint &p, int length) |
Highlightes a line at pixel point p. | |
void | draw_line (const PixelPoint &p, const PixelPoint &q) |
Draws a line from p to q. | |
void | draw_line (const CartesianPoint &p, const CartesianPoint &q) |
Draws a line from p to q. | |
void | highlight_pixel (const PixelPoint &p) |
Highlights a pixel, i.e. | |
void | highlight_point (const CartesianPoint &p) |
Highlights a point, i.e. |
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.
firevision::MirrorCalibTool::CartesianImage::CartesianImage | ( | const StepResult & | res, |
PolarAngle | phi, | ||
PixelPoint | center, | ||
const unsigned char * | mask = 0 |
||
) | [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.
firevision::MirrorCalibTool::CartesianImage::CartesianImage | ( | const StepResult & | res, |
PolarAngle | phi, | ||
const unsigned char * | mask = 0 |
||
) | [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.
firevision::MirrorCalibTool::CartesianImage::CartesianImage | ( | const unsigned char * | buf, |
int | width, | ||
int | height, | ||
PolarAngle | phi, | ||
const PixelPoint & | center | ||
) | [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.
firevision::MirrorCalibTool::CartesianImage::CartesianImage | ( | unsigned char * | buf, |
int | width, | ||
int | height, | ||
PolarAngle | phi, | ||
const PixelPoint & | center | ||
) | [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.
firevision::MirrorCalibTool::CartesianImage::CartesianImage | ( | const unsigned char * | buf, |
int | width, | ||
int | height, | ||
PolarAngle | phi | ||
) | [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.
firevision::MirrorCalibTool::CartesianImage::CartesianImage | ( | unsigned char * | buf, |
int | width, | ||
int | height, | ||
PolarAngle | phi | ||
) | [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.
float firevision::MirrorCalibTool::CartesianImage::bright_fraction | ( | const CartesianPoint & | from, |
const CartesianPoint & | to | ||
) | const [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 firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
unsigned char* firevision::MirrorCalibTool::CartesianImage::buf | ( | ) | [inline] |
const unsigned char* firevision::MirrorCalibTool::CartesianImage::buf | ( | ) | const [inline] |
const PixelPoint& firevision::MirrorCalibTool::CartesianImage::center | ( | ) | const [inline] |
bool firevision::MirrorCalibTool::CartesianImage::contains | ( | const PixelPoint & | p | ) | const [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_line(), and firevision::MirrorCalibTool::draw_crosshair().
bool firevision::MirrorCalibTool::CartesianImage::contains | ( | const CartesianPoint & | p | ) | const [inline] |
Indicates whether the image contains a cartesian point.
p | The point. |
Definition at line 509 of file mirror_calib.cpp.
void firevision::MirrorCalibTool::CartesianImage::draw_line | ( | const PixelPoint & | p, |
const PixelPoint & | q | ||
) | [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.
void firevision::MirrorCalibTool::CartesianImage::draw_line | ( | const CartesianPoint & | p, |
const CartesianPoint & | q | ||
) | [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::x, firevision::MirrorCalibTool::Point::y, firevision::MirrorCalibTool::Point::length(), firevision::MirrorCalibTool::Point::atan(), and fawkes::set_color().
unsigned char firevision::MirrorCalibTool::CartesianImage::get | ( | const CartesianPoint & | p | ) | const [inline] |
Get luminance at a given point.
p | The point. |
Definition at line 519 of file mirror_calib.cpp.
References firevision::MirrorCalibTool::Point::x, firevision::MirrorCalibTool::Point::y, firevision::YUV_t_struct::Y, firevision::YUV_t_struct::U, and firevision::YUV_t_struct::V.
const int firevision::MirrorCalibTool::CartesianImage::height | ( | ) | const [inline] |
void firevision::MirrorCalibTool::CartesianImage::highlight_line | ( | const CartesianPoint & | p, |
int | length | ||
) | [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.
void firevision::MirrorCalibTool::CartesianImage::highlight_pixel | ( | const PixelPoint & | p | ) | [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 firevision::MirrorCalibTool::Point::x, firevision::MirrorCalibTool::Point::y, and fawkes::set_color().
Referenced by firevision::MirrorCalibTool::next_step().
void firevision::MirrorCalibTool::CartesianImage::highlight_point | ( | const CartesianPoint & | p | ) | [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 firevision::MirrorCalibTool::Point::x, firevision::MirrorCalibTool::Point::y, and fawkes::set_color().
Referenced by firevision::MirrorCalibTool::next_step().
bool firevision::MirrorCalibTool::CartesianImage::is_line | ( | const CartesianPoint & | p, |
int | length | ||
) | const [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.
const unsigned char* firevision::MirrorCalibTool::CartesianImage::mask | ( | ) | const [inline] |
PolarRadius firevision::MirrorCalibTool::CartesianImage::max_radius | ( | ) | const [inline] |
Maximum polar radius of the image.
Definition at line 550 of file mirror_calib.cpp.
Referenced by firevision::MirrorCalibTool::draw_line(), and firevision::MirrorCalibTool::draw_crosshair().
int firevision::MirrorCalibTool::CartesianImage::max_x | ( | ) | const [inline] |
Get Maximum cartesian X coordinate of the image.
Definition at line 542 of file mirror_calib.cpp.
int firevision::MirrorCalibTool::CartesianImage::max_y | ( | ) | const [inline] |
Get Maximum cartesian Y coordinate of the image.
Definition at line 546 of file mirror_calib.cpp.
const PolarAngle firevision::MirrorCalibTool::CartesianImage::phi | ( | ) | const [inline] |
void firevision::MirrorCalibTool::CartesianImage::set_color | ( | const PixelPoint & | p, |
unsigned char | luma, | ||
unsigned char | chrominance | ||
) | [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 firevision::MirrorCalibTool::Point::x, and firevision::MirrorCalibTool::Point::y.
Referenced by firevision::MirrorCalibTool::draw_line(), and firevision::MirrorCalibTool::draw_crosshair().
void firevision::MirrorCalibTool::CartesianImage::set_color | ( | const CartesianPoint & | p, |
unsigned char | luma, | ||
unsigned char | chrominance | ||
) | [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.
References fawkes::set_color().
CartesianPoint firevision::MirrorCalibTool::CartesianImage::to_cartesian | ( | const PixelPoint & | p | ) | const [inline] |
Converts a pixel point to a cartesian point.
p | The point. |
Definition at line 488 of file mirror_calib.cpp.
References firevision::MirrorCalibTool::Point::x, firevision::MirrorCalibTool::Point::y, and firevision::MirrorCalibTool::CartesianPoint::rotate().
PixelPoint firevision::MirrorCalibTool::CartesianImage::to_pixel | ( | const CartesianPoint & | p | ) | const [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 firevision::MirrorCalibTool::ConvexPolygon::contains(), and firevision::MirrorCalibTool::next_step().
const int firevision::MirrorCalibTool::CartesianImage::width | ( | ) | const [inline] |