ProjectiveCam Class Reference
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. | |
Detailed Description
Abstract class for projective cameras.
Definition at line 44 of file projective_cam.h.
Constructor & Destructor Documentation
| ProjectiveCam::ProjectiveCam | ( | const ProjectiveCam & | pc | ) |
Copy Constructor.
- Parameters:
-
pc the ProjectiveCam to copy
Definition at line 108 of file projective_cam.cpp.
| ProjectiveCam::~ProjectiveCam | ( | ) | [virtual] |
| ProjectiveCam::ProjectiveCam | ( | const Calibration & | cal, | |
| const fawkes::HomTransform * | loc = 0 | |||
| ) | [protected] |
Constructor.
- Parameters:
-
cal Calibration matrix of the camera loc Location of the camera (= translation + rotation)
Definition at line 74 of file projective_cam.cpp.
References set_location().
| ProjectiveCam::ProjectiveCam | ( | const Calibration & | cal, | |
| float | roll, | |||
| float | pitch, | |||
| float | yaw, | |||
| float | height, | |||
| float | x = 0, |
|||
| float | y = 0 | |||
| ) | [protected] |
Constructor.
- Parameters:
-
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 93 of file projective_cam.cpp.
References set_location().
Member Function Documentation
| Calibration ProjectiveCam::get_cal | ( | ) | const [protected] |
Calibration getter.
- Returns:
- the calibration matrix
Definition at line 239 of file projective_cam.cpp.
| center_in_roi_t 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.
- Parameters:
-
wld_p a point on the ground (x-meters, y-meters)
- Returns:
- a point in the image (x-px, y-px)
Definition at line 216 of file projective_cam.cpp.
References fawkes::Vector::set(), center_in_roi_t::x, fawkes::cart_coord_2d_t::x, fawkes::Vector::x(), center_in_roi_t::y, fawkes::cart_coord_2d_t::y, fawkes::Vector::y(), and fawkes::Vector::z().
| Matrix 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 258 of file projective_cam.cpp.
References fawkes::Matrix::get_submatrix(), and fawkes::Matrix::overlay().
| fawkes::cart_coord_2d_t 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.
- Parameters:
-
img_p a point in the image (x-px, y-px)
- Returns:
- a point in the world (x-meters, y-meters)
Definition at line 193 of file projective_cam.cpp.
References center_in_roi_t::x, fawkes::Vector::x(), center_in_roi_t::y, fawkes::Vector::y(), and fawkes::Vector::z().
Referenced by BackProjectionPositionModel::calc().
| Matrix ProjectiveCam::get_p | ( | ) | const [protected] |
| void ProjectiveCam::print_info | ( | const char * | name = 0, |
|
| const char * | col_sep = 0, |
|||
| const char * | row_sep = 0 | |||
| ) | const [virtual] |
Prints the matrix P.
- Parameters:
-
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 273 of file projective_cam.cpp.
References fawkes::Matrix::print_info().
| ProjectiveCam & 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.
- Parameters:
-
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)
- Returns:
- a reference to the camera
Definition at line 144 of file projective_cam.cpp.
References fawkes::HomTransform::rotate_x(), fawkes::HomTransform::rotate_y(), fawkes::HomTransform::rotate_z(), set_location(), and fawkes::HomTransform::trans().
| ProjectiveCam & ProjectiveCam::set_location | ( | const fawkes::HomTransform & | loc | ) | [virtual] |
Sets a new location for the camera.
- Parameters:
-
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)
- Returns:
- a reference to the camera
Definition at line 170 of file projective_cam.cpp.
References fawkes::HomTransform::get_matrix(), fawkes::Matrix::get_submatrix(), fawkes::Matrix::invert(), and fawkes::Matrix::overlay().
Referenced by BackProjectionPositionModel::calc(), ProjectiveCam(), and set_location().
The documentation for this class was generated from the following files:
- src/firevision/models/camera/projective_cam.h
- src/firevision/models/camera/projective_cam.cpp

