Abstract class for projective cameras. More...
#include <models/camera/projective_cam.h>
Public Member Functions | |
ProjectiveCam (const ProjectiveCam &pc) | |
Copy Constructor. | |
virtual | ~ProjectiveCam () |
Destructor. | |
virtual ProjectiveCam & | set_location (const fawkes::HomTransform &loc) |
Sets a new location for the camera. | |
virtual ProjectiveCam & | set_location (float roll, float pitch, float yaw, float height, float x=0, float y=0) |
Sets a new location for the camera. | |
virtual fawkes::cart_coord_2d_t | get_GPA_world_coord (const center_in_roi_t &img_p) const |
Returns a point in the world under the ground plane assumption. | |
virtual center_in_roi_t | get_GPA_image_coord (const fawkes::cart_coord_2d_t &wld_p) const |
Returns an image point of a world point under the ground plane assumption. | |
virtual void | print_info (const char *name=0, const char *col_sep=0, const char *row_sep=0) const |
Prints the matrix P. | |
Protected Member Functions | |
ProjectiveCam (const Calibration &cal, const fawkes::HomTransform *loc=0) | |
Constructor. | |
ProjectiveCam (const Calibration &cal, float roll, float pitch, float yaw, float height, float x=0, float y=0) | |
Constructor. | |
Calibration | get_cal () const |
Calibration getter. | |
fawkes::Matrix | get_p () const |
P matrix getter. | |
fawkes::Matrix | get_GPA_p () const |
Returns the modified P matrix. |
Abstract class for projective cameras.
Definition at line 49 of file projective_cam.h.
firevision::ProjectiveCam::ProjectiveCam | ( | const ProjectiveCam & | pc | ) |
Copy Constructor.
pc | the ProjectiveCam to copy |
Definition at line 111 of file projective_cam.cpp.
firevision::ProjectiveCam::~ProjectiveCam | ( | ) | [virtual] |
Destructor.
Definition at line 129 of file projective_cam.cpp.
firevision::ProjectiveCam::ProjectiveCam | ( | const Calibration & | cal, | |
const fawkes::HomTransform * | loc = 0 | |||
) | [protected] |
Constructor.
cal | Calibration matrix of the camera | |
loc | Location of the camera (= translation + rotation) |
Definition at line 77 of file projective_cam.cpp.
References set_location().
firevision::ProjectiveCam::ProjectiveCam | ( | const Calibration & | cal, | |
float | roll, | |||
float | pitch, | |||
float | yaw, | |||
float | height, | |||
float | x = 0 , |
|||
float | y = 0 | |||
) | [protected] |
Constructor.
cal | Calibration matrix of the camera | |
roll | of the camera | |
pitch | of the camera | |
yaw | of the camera | |
height | of the camera | |
x | of the camera (in front if yaw is zero) | |
y | of the camera (left if yaw is zero) |
Definition at line 96 of file projective_cam.cpp.
References set_location().
Calibration firevision::ProjectiveCam::get_cal | ( | ) | const [protected] |
Calibration getter.
Definition at line 242 of file projective_cam.cpp.
center_in_roi_t firevision::ProjectiveCam::get_GPA_image_coord | ( | const fawkes::cart_coord_2d_t & | wld_p | ) | const [virtual] |
Returns an image point of a world point under the ground plane assumption.
wld_p | a point on the ground (x-meters, y-meters) |
Definition at line 219 of file projective_cam.cpp.
References fawkes::Vector::set(), firevision::center_in_roi_t::x, fawkes::cart_coord_2d_t::x, fawkes::Vector::x(), firevision::center_in_roi_t::y, fawkes::cart_coord_2d_t::y, fawkes::Vector::y(), and fawkes::Vector::z().
Matrix firevision::ProjectiveCam::get_GPA_p | ( | ) | const [protected] |
Returns the modified P matrix.
With the ground plane assumption the third column can be ignored.
Definition at line 262 of file projective_cam.cpp.
References fawkes::Matrix::get_submatrix(), and fawkes::Matrix::overlay().
fawkes::cart_coord_2d_t firevision::ProjectiveCam::get_GPA_world_coord | ( | const center_in_roi_t & | img_p | ) | const [virtual] |
Returns a point in the world under the ground plane assumption.
img_p | a point in the image (x-px, y-px) |
Definition at line 196 of file projective_cam.cpp.
References firevision::center_in_roi_t::x, fawkes::Vector::x(), firevision::center_in_roi_t::y, fawkes::Vector::y(), and fawkes::Vector::z().
Referenced by firevision::BackProjectionPositionModel::calc().
Matrix firevision::ProjectiveCam::get_p | ( | ) | const [protected] |
void firevision::ProjectiveCam::print_info | ( | const char * | name = 0 , |
|
const char * | col_sep = 0 , |
|||
const char * | row_sep = 0 | |||
) | const [virtual] |
Prints the matrix P.
name | Heading of the output | |
col_sep | a string used to separate columns (defaults to '\t') | |
row_sep | a string used to separate rows (defaults to '\n') |
Definition at line 277 of file projective_cam.cpp.
References fawkes::Matrix::print_info().
ProjectiveCam & firevision::ProjectiveCam::set_location | ( | const fawkes::HomTransform & | loc | ) | [virtual] |
Sets a new location for the camera.
loc | the new location (remember the transformation from world frame into cam frame [rot_x(-pi/2)+rot_z(-pi/2)] before the rest of the transformation) |
Definition at line 173 of file projective_cam.cpp.
References fawkes::HomTransform::get_matrix(), fawkes::Matrix::get_submatrix(), fawkes::Matrix::invert(), and fawkes::Matrix::overlay().
Referenced by firevision::BackProjectionPositionModel::calc(), ProjectiveCam(), and set_location().
ProjectiveCam & firevision::ProjectiveCam::set_location | ( | float | roll, | |
float | pitch, | |||
float | yaw, | |||
float | height, | |||
float | x = 0 , |
|||
float | y = 0 | |||
) | [virtual] |
Sets a new location for the camera.
roll | of the camera | |
pitch | of the camera | |
height | of the camera | |
yaw | of the camera | |
x | of the camera (in front if yaw is zero) | |
y | of the camera (left if yaw is zero) |
Definition at line 147 of file projective_cam.cpp.
References fawkes::HomTransform::rotate_x(), fawkes::HomTransform::rotate_y(), fawkes::HomTransform::rotate_z(), set_location(), and fawkes::HomTransform::trans().