Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Public Member Functions | Public Attributes
mrpt::utils::TStereoCamera Class Reference

Detailed Description

Structure to hold the parameters of a pinhole stereo camera model.

The parameters obtained for one camera resolution can be used for any other resolution by means of the method TStereoCamera::scaleToResolution()

See also
mrpt::vision, the application stereo-calib-gui for calibrating a stereo camera

Definition at line 25 of file TStereoCamera.h.

#include <mrpt/utils/TStereoCamera.h>

Inheritance diagram for mrpt::utils::TStereoCamera:
Inheritance graph

Public Member Functions

 TStereoCamera ()
 
void saveToConfigFile (const std::string &section, mrpt::utils::CConfigFileBase &cfg) const
 Save all params to a plain text config file in this format:
 
void loadFromConfigFile (const std::string &section, const mrpt::utils::CConfigFileBase &cfg)
 Load all the params from a config source, in the same format that used in saveToConfigFile().
 
void loadFromConfigFile (const mrpt::utils::CConfigFileBase &cfg, const std::string &section)
 
std::string dumpAsText () const
 Dumps all the parameters as a multi-line string, with the same format than saveToConfigFile.
 
void scaleToResolution (unsigned int new_ncols, unsigned int new_nrows)
 Rescale all the parameters for a new camera resolution (it raises an exception if the aspect ratio is modified, which is not permitted).
 

Public Attributes

TCamera leftCamera
 
TCamera rightCamera
 Intrinsic and distortion parameters of the left and right cameras.
 
mrpt::poses::CPose3DQuat rightCameraPose
 Pose of the right camera with respect to the coordinate origin of the left camera.
 

Protected Member Functions

CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const MRPT_OVERRIDE
 
void readFromStream (mrpt::utils::CStream &in, int version) MRPT_OVERRIDE
 

RTTI stuff <br>

typedef TStereoCameraPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_TStereoCamera
 
static mrpt::utils::TRuntimeClassId classTStereoCamera
 
static const mrpt::utils::TRuntimeClassIdclassinfo
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const MRPT_OVERRIDE
 
virtual mrpt::utils::CObjectduplicate () const MRPT_OVERRIDE
 
static mrpt::utils::CObjectCreateObject ()
 
static TStereoCameraPtr Create ()
 

Member Typedef Documentation

◆ SmartPtr

A typedef for the associated smart pointer

Definition at line 27 of file TStereoCamera.h.

Constructor & Destructor Documentation

◆ TStereoCamera()

mrpt::utils::TStereoCamera::TStereoCamera ( )

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId * mrpt::utils::TStereoCamera::_GetBaseClass ( )
staticprotected

◆ Create()

static TStereoCameraPtr mrpt::utils::TStereoCamera::Create ( )
static

◆ CreateObject()

static mrpt::utils::CObject * mrpt::utils::TStereoCamera::CreateObject ( )
static

◆ dumpAsText()

std::string mrpt::utils::TStereoCamera::dumpAsText ( ) const

Dumps all the parameters as a multi-line string, with the same format than saveToConfigFile.

See also
saveToConfigFile

◆ duplicate()

virtual mrpt::utils::CObject * mrpt::utils::TStereoCamera::duplicate ( ) const
virtual

◆ GetRuntimeClass()

virtual const mrpt::utils::TRuntimeClassId * mrpt::utils::TStereoCamera::GetRuntimeClass ( ) const
virtual

◆ loadFromConfigFile() [1/2]

void mrpt::utils::TStereoCamera::loadFromConfigFile ( const mrpt::utils::CConfigFileBase cfg,
const std::string &  section 
)
inline

Definition at line 67 of file TStereoCamera.h.

References loadFromConfigFile().

Referenced by loadFromConfigFile().

◆ loadFromConfigFile() [2/2]

void mrpt::utils::TStereoCamera::loadFromConfigFile ( const std::string &  section,
const mrpt::utils::CConfigFileBase cfg 
)

Load all the params from a config source, in the same format that used in saveToConfigFile().

Notice that 3 different sections are read, of which "section" is only the prefix.

Exceptions
std::exceptionon missing fields

◆ readFromStream()

void mrpt::utils::TStereoCamera::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protected

◆ saveToConfigFile()

void mrpt::utils::TStereoCamera::saveToConfigFile ( const std::string &  section,
mrpt::utils::CConfigFileBase cfg 
) const

Save all params to a plain text config file in this format:

[<SECTION>_LEFT]
resolution = [NCOLS NROWS]
cx = CX
cy = CY
fx = FX
fy = FY
dist = [K1 K2 T1 T2 K3]
[<SECTION>_RIGHT]
resolution = [NCOLS NROWS]
cx = CX
cy = CY
fx = FX
fy = FY
dist = [K1 K2 T1 T2 K3]
[<SECTION>_LEFT2RIGHT_POSE]
pose_quaternion = [x y z qr qx qy qz]

Notice that 3 different sections are read, of which "section" is only the prefix.

◆ scaleToResolution()

void mrpt::utils::TStereoCamera::scaleToResolution ( unsigned int  new_ncols,
unsigned int  new_nrows 
)
inline

Rescale all the parameters for a new camera resolution (it raises an exception if the aspect ratio is modified, which is not permitted).

Definition at line 74 of file TStereoCamera.h.

References mrpt::utils::TCamera::scaleToResolution().

◆ writeToStream()

void mrpt::utils::TStereoCamera::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
protected

Member Data Documentation

◆ _init_TStereoCamera

mrpt::utils::CLASSINIT mrpt::utils::TStereoCamera::_init_TStereoCamera
staticprotected

Definition at line 27 of file TStereoCamera.h.

◆ classinfo

const mrpt::utils::TRuntimeClassId* mrpt::utils::TStereoCamera::classinfo
static

Definition at line 27 of file TStereoCamera.h.

◆ classTStereoCamera

mrpt::utils::TRuntimeClassId mrpt::utils::TStereoCamera::classTStereoCamera
static

Definition at line 27 of file TStereoCamera.h.

◆ leftCamera

TCamera mrpt::utils::TStereoCamera::leftCamera

Definition at line 29 of file TStereoCamera.h.

◆ rightCamera

TCamera mrpt::utils::TStereoCamera::rightCamera

Intrinsic and distortion parameters of the left and right cameras.

Definition at line 29 of file TStereoCamera.h.

◆ rightCameraPose

mrpt::poses::CPose3DQuat mrpt::utils::TStereoCamera::rightCameraPose

Pose of the right camera with respect to the coordinate origin of the left camera.

Definition at line 30 of file TStereoCamera.h.




Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Wed Mar 22 06:31:24 UTC 2023