g2o
Public Member Functions | Public Attributes | List of all members
g2o::CameraParameters Class Reference

#include <types_six_dof_expmap.h>

Inheritance diagram for g2o::CameraParameters:
Inheritance graph
[legend]
Collaboration diagram for g2o::CameraParameters:
Collaboration graph
[legend]

Public Member Functions

 CameraParameters ()
 
 CameraParameters (double focal_length, const Vector2D &principle_point, double baseline)
 
Vector2D cam_map (const Vector3D &trans_xyz) const
 
Vector3D stereocam_uvu_map (const Vector3D &trans_xyz) const
 
virtual bool read (std::istream &is)
 read the data from a stream More...
 
virtual bool write (std::ostream &os) const
 write the data to a stream More...
 
- Public Member Functions inherited from g2o::Parameter
 Parameter ()
 
virtual ~Parameter ()
 
int id () const
 
void setId (int id_)
 
virtual HyperGraph::HyperGraphElementType elementType () const
 
- Public Member Functions inherited from g2o::HyperGraph::HyperGraphElement
virtual ~HyperGraphElement ()
 
HyperGraphElementclone () const
 

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 
double focal_length
 
Vector2D principle_point
 
double baseline
 

Additional Inherited Members

- Protected Attributes inherited from g2o::Parameter
int _id
 

Detailed Description

Definition at line 43 of file types_six_dof_expmap.h.

Constructor & Destructor Documentation

g2o::CameraParameters::CameraParameters ( )

Definition at line 45 of file types_six_dof_expmap.cpp.

46  : focal_length(1.),
47  principle_point(Vector2D(0., 0.)),
48  baseline(0.5) {
49 }
Eigen::Matrix< double, 2, 1, Eigen::ColMajor > Vector2D
Definition: eigen_types.h:45
g2o::CameraParameters::CameraParameters ( double  focal_length,
const Vector2D principle_point,
double  baseline 
)
inline

Member Function Documentation

Vector2D g2o::CameraParameters::cam_map ( const Vector3D trans_xyz) const

Definition at line 70 of file types_six_dof_expmap.cpp.

References g2o::project2d().

Referenced by g2o::EdgeProjectXYZ2UV::computeError(), g2o::EdgeProjectPSI2UV::computeError(), and main().

70  {
71  Vector2D proj = project2d(trans_xyz);
72  Vector2D res;
73  res[0] = proj[0]*focal_length + principle_point[0];
74  res[1] = proj[1]*focal_length + principle_point[1];
75  return res;
76 }
Eigen::Matrix< double, 2, 1, Eigen::ColMajor > Vector2D
Definition: eigen_types.h:45
Vector2D project2d(const Vector3D &v)
virtual bool g2o::CameraParameters::read ( std::istream &  is)
inlinevirtual

read the data from a stream

Implements g2o::Parameter.

Definition at line 60 of file types_six_dof_expmap.h.

60  {
61  is >> focal_length;
62  is >> principle_point[0];
63  is >> principle_point[1];
64  is >> baseline;
65  return true;
66  }
Vector3D g2o::CameraParameters::stereocam_uvu_map ( const Vector3D trans_xyz) const

Definition at line 78 of file types_six_dof_expmap.cpp.

Referenced by g2o::EdgeProjectXYZ2UVU::computeError().

78  {
79  Vector2D uv_left = cam_map(trans_xyz);
80  double proj_x_right = (trans_xyz[0]-baseline)/trans_xyz[2];
81  double u_right = proj_x_right*focal_length + principle_point[0];
82  return Vector3D(uv_left[0],uv_left[1],u_right);
83 }
Eigen::Matrix< double, 2, 1, Eigen::ColMajor > Vector2D
Definition: eigen_types.h:45
Vector2D cam_map(const Vector3D &trans_xyz) const
Eigen::Matrix< double, 3, 1, Eigen::ColMajor > Vector3D
Definition: eigen_types.h:46
virtual bool g2o::CameraParameters::write ( std::ostream &  os) const
inlinevirtual

write the data to a stream

Implements g2o::Parameter.

Definition at line 68 of file types_six_dof_expmap.h.

68  {
69  os << focal_length << " ";
70  os << principle_point.x() << " ";
71  os << principle_point.y() << " ";
72  os << baseline << " ";
73  return true;
74  }

Member Data Documentation

double g2o::CameraParameters::baseline

Definition at line 78 of file types_six_dof_expmap.h.

g2o::CameraParameters::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 46 of file types_six_dof_expmap.h.

double g2o::CameraParameters::focal_length
Vector2D g2o::CameraParameters::principle_point

Definition at line 77 of file types_six_dof_expmap.h.


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