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

parameters for a camera More...

#include <parameter_stereo_camera.h>

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

Public Member Functions

 ParameterStereoCamera ()
 
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...
 
void setBaseline (double baseline_)
 
double baseline () const
 
- Public Member Functions inherited from g2o::ParameterCamera
 ParameterCamera ()
 
void setKcam (double fx, double fy, double cx, double cy)
 
void setOffset (const Isometry3D &offset_=Isometry3D::Identity())
 
const Matrix3DKcam () const
 
const Matrix3DinvKcam () const
 
const Matrix3DKcam_inverseOffsetR () const
 
- Public Member Functions inherited from g2o::ParameterSE3Offset
 ParameterSE3Offset ()
 
void setOffset (const Isometry3D &offset_=Isometry3D::Identity())
 
const Isometry3Doffset () const
 rotation of the offset as 3x3 rotation matrix More...
 
const Isometry3DinverseOffset () const
 rotation of the inverse offset as 3x3 rotation matrix 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
 
- Public Attributes inherited from g2o::ParameterCamera
 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 
- Public Attributes inherited from g2o::ParameterSE3Offset
 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 

Protected Attributes

double _baseline
 
- Protected Attributes inherited from g2o::ParameterCamera
Matrix3D _Kcam
 
Matrix3D _invKcam
 
Matrix3D _Kcam_inverseOffsetR
 
- Protected Attributes inherited from g2o::ParameterSE3Offset
Isometry3D _offset
 
Isometry3D _inverseOffset
 
- Protected Attributes inherited from g2o::Parameter
int _id
 

Detailed Description

parameters for a camera

Definition at line 38 of file parameter_stereo_camera.h.

Constructor & Destructor Documentation

g2o::ParameterStereoCamera::ParameterStereoCamera ( )

Definition at line 39 of file parameter_stereo_camera.cpp.

39  {
40  setBaseline(0.075);
41  }
void setBaseline(double baseline_)

Member Function Documentation

double g2o::ParameterStereoCamera::baseline ( ) const
inline

Definition at line 47 of file parameter_stereo_camera.h.

bool g2o::ParameterStereoCamera::read ( std::istream &  is)
virtual

read the data from a stream

Reimplemented from g2o::ParameterCamera.

Definition at line 43 of file parameter_stereo_camera.cpp.

References g2o::internal::fromVectorQT(), and g2o::internal::normalize().

43  {
44  Vector7d off;
45  for (int i=0; i<7; i++)
46  is >> off[i];
47  // normalize the quaternion to recover numerical precision lost by storing as human readable text
48  Vector4D::MapType(off.data()+3).normalize();
50  double fx,fy,cx,cy;
51  is >> fx >> fy >> cx >> cy;
52  setKcam(fx,fy,cx,cy);
53  double baseline_;
54  is >> baseline_;
55  setBaseline(baseline_);
56  return is.good();
57  }
Isometry3D fromVectorQT(const Vector7d &v)
void setBaseline(double baseline_)
Eigen::Matrix< double, 7, 1 > Vector7d
Definition: sim3.h:35
void setOffset(const Isometry3D &offset_=Isometry3D::Identity())
Eigen::Quaterniond & normalize(Eigen::Quaterniond &q)
void setKcam(double fx, double fy, double cx, double cy)
void g2o::ParameterStereoCamera::setBaseline ( double  baseline_)
inline

Definition at line 46 of file parameter_stereo_camera.h.

46 { _baseline = baseline_;}
bool g2o::ParameterStereoCamera::write ( std::ostream &  os) const
virtual

write the data to a stream

Reimplemented from g2o::ParameterCamera.

Definition at line 59 of file parameter_stereo_camera.cpp.

References g2o::internal::toVectorQT().

59  {
61  for (int i=0; i<7; i++)
62  os << off[i] << " ";
63  os << _Kcam(0,0) << " ";
64  os << _Kcam(1,1) << " ";
65  os << _Kcam(0,2) << " ";
66  os << _Kcam(1,2) << " ";
67  os << baseline() << " ";
68  return os.good();
69  }
Eigen::Matrix< double, 7, 1 > Vector7d
Definition: sim3.h:35
Vector7d toVectorQT(const Isometry3D &t)

Member Data Documentation

double g2o::ParameterStereoCamera::_baseline
protected

Definition at line 49 of file parameter_stereo_camera.h.

g2o::ParameterStereoCamera::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

Definition at line 40 of file parameter_stereo_camera.h.


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