firevision::ProjectiveCam Class Reference

Abstract class for projective cameras. More...

#include <models/camera/projective_cam.h>

Inheritance diagram for firevision::ProjectiveCam:

[legend]
List of all members.

Public Member Functions

 ProjectiveCam (const ProjectiveCam &pc)
 Copy Constructor.
virtual ~ProjectiveCam ()
 Destructor.
virtual ProjectiveCamset_location (const fawkes::HomTransform &loc)
 Sets a new location for the camera.
virtual ProjectiveCamset_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.

Author:
Christof Rath

Definition at line 49 of file projective_cam.h.


Constructor & Destructor Documentation

firevision::ProjectiveCam::ProjectiveCam ( const ProjectiveCam pc  ) 

Copy Constructor.

Parameters:
pc the ProjectiveCam to copy

Definition at line 111 of file projective_cam.cpp.

References __gpa_inv, __gpa_inv_data, and __p.

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.

Parameters:
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.

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 96 of file projective_cam.cpp.

References set_location().


Member Function Documentation

Calibration firevision::ProjectiveCam::get_cal (  )  const [protected]

Calibration getter.

Returns:
the calibration matrix

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.

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 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.

Returns:
modified P matrix

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.

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 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]

P matrix getter.

Returns:
the P matrix

Definition at line 252 of file projective_cam.cpp.

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.

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 277 of file projective_cam.cpp.

References fawkes::Matrix::print_info().

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.

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 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().

ProjectiveCam & firevision::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 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().


The documentation for this class was generated from the following files:
Generated on Tue Feb 22 13:33:02 2011 for Fawkes API by  doxygen 1.4.7