SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Attributes | Friends | List of all members
slip::PinholeCamera< Type > Class Template Reference

Define a PinholeCamera class. More...

#include <PinholeCamera.hpp>

Inheritance diagram for slip::PinholeCamera< Type >:
Inheritance graph

Public Member Functions

Constructors & Destructors
 PinholeCamera ()
 Default constructor of PinholeCamera. More...
 
 PinholeCamera (const self &rhs)
 Constructs a copy of the PinholeCamera rhs. More...
 
 ~PinholeCamera ()
 Destructor of the PinholeCamera. More...
 
input/output methods
void read (const std::string &file)
 Read a calibration matrix from an ASCII file. More...
 
void write (const std::string &file)
 Write a calibration matrix to an ASCII file. More...
 
Assignment operators and methods
selfoperator= (const self &rhs)
 Assign a PinholeCamera. More...
 
Accessor/Mutator operators
slip::Matrix< Type > & calibration_matrix () const
 Get calibration matrix. More...
 
slip::Matrix< Type > & d_calibration_matrix () const
 Get back d_calibration matrix. More...
 
void calibration_matrix (const slip::Matrix< Type > &calibration_matrix)
 Set the calibration matrix. More...
 
void d_calibration_matrix (const slip::Matrix< Type > &d_calibration_matrix)
 Set the d_calibration matrix. More...
 
Projection methods
slip::Point2d< Type > projection (const slip::Point3d< Type > &p)
 Computes the projection of a 3d world point onto the image plane. More...
 
slip::Point3d< Type > backprojection (const slip::Point2d< Type > &p2, const Type &z)
 Computes the 3d world point corresponding to the backprojection of an image point. More...
 
Computation methods
virtual void compute (const slip::Matrix< Type > &P)
 Computes the parameters of the pinhole camera model. More...
 
Decomposition methods
virtual int decompose (slip::Matrix< Type > &K, slip::Matrix< Type > &R, slip::Vector3d< Type > &c, slip::DECOMP_TYPE flag)
 Decomposes a pinhole camera matrix. More...
 

Public Attributes

slip::Matrix< Type > * calibration_matrix_
 
slip::Matrix< Type > * d_calibration_matrix_
 

Friends

class boost::serialization::access
 
i/o operators
std::ostream & operator<< (std::ostream &out, const self &c)
 Write the PinholeCamera to the ouput stream. More...
 

Detailed Description

template<typename Type>
class slip::PinholeCamera< Type >

Define a PinholeCamera class.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Guillaume Gomit <guillaume.gomit_AT_univ-poitiers.fr>
Lionel Thomas <lionel.thomas_AT_univ-poitiers.fr>
Version
0.0.2
Date
2013/03/28
Since
1.2.0
Parameters
TypeType of the coordinates of the PinholeCamera

Definition at line 100 of file PinholeCamera.hpp.

Constructor & Destructor Documentation

template<typename Type >
slip::PinholeCamera< Type >::PinholeCamera ( )
inline

Default constructor of PinholeCamera.

Definition at line 129 of file PinholeCamera.hpp.

template<typename Type >
slip::PinholeCamera< Type >::PinholeCamera ( const self rhs)
inline

Constructs a copy of the PinholeCamera rhs.

Parameters
rhsan other PinholeCamera.

Definition at line 138 of file PinholeCamera.hpp.

template<typename Type >
slip::PinholeCamera< Type >::~PinholeCamera ( )
inline

Destructor of the PinholeCamera.

Definition at line 148 of file PinholeCamera.hpp.

Member Function Documentation

template<typename Type >
slip::Point3d<Type> slip::PinholeCamera< Type >::backprojection ( const slip::Point2d< Type > &  p2,
const Type &  z 
)
inlinevirtual

Computes the 3d world point corresponding to the backprojection of an image point.

Parameters
pPoint2d.
zDepth coordinate.
Returns
Point3d

Computes the 3d world point corresponding to the backprojection of an image point.

Parameters
pPoint2d.
zDepth coordinate.
Returns
Point3d

Implements slip::CameraModel< Type >.

Definition at line 391 of file PinholeCamera.hpp.

template<typename Type >
slip::Matrix<Type>& slip::PinholeCamera< Type >::calibration_matrix ( ) const
inline

Get calibration matrix.

Definition at line 257 of file PinholeCamera.hpp.

template<typename Type >
void slip::PinholeCamera< Type >::calibration_matrix ( const slip::Matrix< Type > &  calibration_matrix)
inline

Set the calibration matrix.

Parameters
calibration_matrixCalibration matrix.

Definition at line 274 of file PinholeCamera.hpp.

template<typename Type >
virtual void slip::PinholeCamera< Type >::compute ( const slip::Matrix< Type > &  P)
inlinevirtual

Computes the parameters of the pinhole camera model.

Parameters
PMatrix containing the input data.
Remarks
Format: $(x,y)$ are the image coordinates, $(X,Y,Z)$ are the world coordinates.

\[ \begin{array}{ccccc} \cdots & \cdots & \cdots & \cdots & \cdots \\ x_{i} & y_{i} & X_{i} & Y_{i} & Z_{i} \\ \cdots & \cdots & \cdots & \cdots & \cdots \\ \end{array} \]

Implements slip::CameraModel< Type >.

Reimplemented in slip::PinholeFaugerasCamera< Type >, and slip::PinholeDLTCamera< Type >.

Definition at line 443 of file PinholeCamera.hpp.

template<typename Type >
slip::Matrix<Type>& slip::PinholeCamera< Type >::d_calibration_matrix ( ) const
inline

Get back d_calibration matrix.

Definition at line 265 of file PinholeCamera.hpp.

template<typename Type >
void slip::PinholeCamera< Type >::d_calibration_matrix ( const slip::Matrix< Type > &  d_calibration_matrix)
inline

Set the d_calibration matrix.

Parameters
d_calibration_matrixBack-calibration matrix.

Definition at line 286 of file PinholeCamera.hpp.

template<typename Type >
virtual int slip::PinholeCamera< Type >::decompose ( slip::Matrix< Type > &  K,
slip::Matrix< Type > &  R,
slip::Vector3d< Type > &  c,
slip::DECOMP_TYPE  flag 
)
inlinevirtual

Decomposes a pinhole camera matrix.

Parameters
KMatrix containing the internal parameters
RMatrix containing the external parameters
cVector3d containing the camera centre
flagFlag of type DECOMP_TYPE, can be 'RQ' or 'direct'
Returns
1 if success an -1 if singular matrix
Precondition
K.rows()==K.cols()==3
R.rows()==R.cols()==3

Definition at line 466 of file PinholeCamera.hpp.

template<typename Type >
self& slip::PinholeCamera< Type >::operator= ( const self rhs)
inline

Assign a PinholeCamera.

Assign elements of PinholeCamera in rhs

Parameters
rhsPinholeCamera to get the values from.
Returns
self.

Definition at line 230 of file PinholeCamera.hpp.

template<typename Type >
slip::Point2d<Type> slip::PinholeCamera< Type >::projection ( const slip::Point3d< Type > &  p)
inlinevirtual

Computes the projection of a 3d world point onto the image plane.

Parameters
pPoint3d.
Returns
Point2d
Remarks
Projection: $(x,y)$ are the image coordinates, $(X,Y,Z)$ are the world coordinates.

\[ \left( \begin{array}{c} s_x x \\ s_y y \\ s \end{array} \right) = \left( \begin{array}{cccc} m_{11} & m_{12} & m_{13} & m_{14} \\ m_{21} & m_{22} & m_{23} & m_{24} \\ m_{31} & m_{32} & m_{33} & m_{34} \\ \end{array} \right) \left( \begin{array}{c} X \\ Y \\ Z \\ 1\\ \end{array} \right) \]

Implements slip::CameraModel< Type >.

Definition at line 322 of file PinholeCamera.hpp.

template<typename Type >
void slip::PinholeCamera< Type >::read ( const std::string &  file)
inlinevirtual

Read a calibration matrix from an ASCII file.

Parameters
fileFile path name.
Remarks
Format:

\[ \begin{array}{cccc} m_{11} & m_{12} & m_{13} & m_{14} \\ m_{21} & m_{22} & m_{23} & m_{24} \\ m_{31} & m_{32} & m_{33} & m_{34} \\ \end{array} \]

Implements slip::CameraModel< Type >.

Definition at line 193 of file PinholeCamera.hpp.

template<typename Type >
void slip::PinholeCamera< Type >::write ( const std::string &  file)
inlinevirtual

Write a calibration matrix to an ASCII file.

Parameters
fileFile path name.
Remarks
Format:

\[ \begin{array}{cccc} m_{11} & m_{12} & m_{13} & m_{14} \\ m_{21} & m_{22} & m_{23} & m_{24} \\ m_{31} & m_{32} & m_{33} & m_{34} \\ \end{array} \]

Implements slip::CameraModel< Type >.

Definition at line 212 of file PinholeCamera.hpp.

Friends And Related Function Documentation

template<typename Type >
friend class boost::serialization::access
friend

Definition at line 494 of file PinholeCamera.hpp.

template<typename Type >
std::ostream& operator<< ( std::ostream &  out,
const self c 
)
friend

Write the PinholeCamera to the ouput stream.

Parameters
outoutput stream.
cPinholeCamera to write to the output stream

Definition at line 544 of file PinholeCamera.hpp.

Member Data Documentation

template<typename Type >
slip::Matrix<Type>* slip::PinholeCamera< Type >::calibration_matrix_

Definition at line 490 of file PinholeCamera.hpp.

template<typename Type >
slip::Matrix<Type>* slip::PinholeCamera< Type >::d_calibration_matrix_

Definition at line 491 of file PinholeCamera.hpp.


The documentation for this class was generated from the following file: