Main MRPT website > C++ reference for MRPT 1.5.7
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Static 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

voidoperator new (size_t size)
 
voidoperator new[] (size_t size)
 
void operator delete (void *ptr) throw ()
 
void operator delete[] (void *ptr) throw ()
 
void operator delete (void *memory, void *ptr) throw ()
 
voidoperator new (size_t size, const std::nothrow_t &) throw ()
 
void operator delete (void *ptr, const std::nothrow_t &) throw ()
 
 TStereoCamera ()
 
void saveToConfigFile (const std::string &section, mrpt::utils::CConfigFileBase &cfg) const
 Save all params to a plain text config file in this format: More...
 
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(). More...
 
void loadFromConfigFile (const mrpt::utils::CConfigFileBase &cfg, const std::string &section)
 overload This signature is consistent with the rest of MRPT APIs More...
 
std::string dumpAsText () const
 Dumps all the parameters as a multi-line string, with the same format than saveToConfigFile. More...
 
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). More...
 
virtual mxArraywriteToMatlab () const
 Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More...
 
mrpt::utils::CObjectPtr duplicateGetSmartPtr () const
 Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More...
 
CObjectclone () const
 Cloning interface for smart pointers. More...
 

Static Public Member Functions

static voidoperator new (size_t size, void *ptr)
 

Public Attributes

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

Static Public Attributes

static const mrpt::utils::TRuntimeClassId classCObject
 
RTTI stuff
static const mrpt::utils::TRuntimeClassId classCSerializable
 

Protected Member Functions

CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const
 Introduces a pure virtual method responsible for writing to a CStream. More...
 
void readFromStream (mrpt::utils::CStream &in, int version)
 Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More...
 

RTTI stuff

typedef TStereoCameraPtr Ptr
 
typedef TStereoCameraPtr ConstPtr
 
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
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class. More...
 
static mrpt::utils::CObjectCreateObject ()
 
static TStereoCameraPtr Create ()
 

Member Typedef Documentation

typedef TStereoCameraPtr mrpt::utils::TStereoCamera::ConstPtr

Definition at line 27 of file TStereoCamera.h.

typedef TStereoCameraPtr mrpt::utils::TStereoCamera::Ptr

A typedef for the associated smart pointer

Definition at line 27 of file TStereoCamera.h.

Constructor & Destructor Documentation

TStereoCamera::TStereoCamera ( )

Definition at line 23 of file TStereoCamera.cpp.

Member Function Documentation

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

Cloning interface for smart pointers.

Definition at line 143 of file CObject.h.

static TStereoCameraPtr mrpt::utils::TStereoCamera::Create ( )
static
static mrpt::utils::CObject* mrpt::utils::TStereoCamera::CreateObject ( )
static
std::string TStereoCamera::dumpAsText ( ) const

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

See also
saveToConfigFile

Definition at line 98 of file TStereoCamera.cpp.

References mrpt::utils::CConfigFileMemory::getContent().

Referenced by mrpt::obs::CObservationStereoImages::getDescriptionAsText().

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

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 140 of file CObject.h.

Referenced by mrpt::obs::CRawlog::addActions(), mrpt::slam::CIncrementalMapPartitioner::addMapFrame(), and mrpt::obs::CRawlog::addObservations().

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

Returns information about the class of an object in runtime.

Reimplemented from mrpt::utils::CSerializable.

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

Load all the params from a config source, in the format described in saveToConfigFile()

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

Exceptions
std::exceptionon missing fields

Definition at line 48 of file TStereoCamera.cpp.

References mrpt::utils::CConfigFileBase::read_string().

Referenced by mrpt::hwdrivers::COpenNI2Sensor::loadConfig_sensorSpecific(), mrpt::hwdrivers::CKinect::loadConfig_sensorSpecific(), and mrpt::hwdrivers::TCaptureOptions_DUO3D::loadOptionsFrom().

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

overload This signature is consistent with the rest of MRPT APIs

Definition at line 67 of file TStereoCamera.h.

References loadFromConfigFile().

Referenced by loadFromConfigFile().

void mrpt::utils::TStereoCamera::operator delete ( void ptr)
throw (
)
inline

Definition at line 27 of file TStereoCamera.h.

void mrpt::utils::TStereoCamera::operator delete ( void memory,
void ptr 
)
throw (
)
inline

Definition at line 27 of file TStereoCamera.h.

void mrpt::utils::TStereoCamera::operator delete ( void ptr,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 27 of file TStereoCamera.h.

void mrpt::utils::TStereoCamera::operator delete[] ( void ptr)
throw (
)
inline

Definition at line 27 of file TStereoCamera.h.

void* mrpt::utils::TStereoCamera::operator new ( size_t  size)
inline

Definition at line 27 of file TStereoCamera.h.

static void* mrpt::utils::TStereoCamera::operator new ( size_t  size,
void ptr 
)
inlinestatic

Definition at line 27 of file TStereoCamera.h.

void* mrpt::utils::TStereoCamera::operator new ( size_t  size,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 27 of file TStereoCamera.h.

void* mrpt::utils::TStereoCamera::operator new[] ( size_t  size)
inline

Definition at line 27 of file TStereoCamera.h.

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

Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any error, see CStream::ReadBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

Definition at line 76 of file TStereoCamera.cpp.

References MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.

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

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

Save as a config block:

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

Definition at line 30 of file TStereoCamera.cpp.

References mrpt::poses::CPose3DQuat::asString(), and mrpt::utils::CConfigFileBase::write().

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

virtual mxArray* mrpt::utils::CSerializable::writeToMatlab ( ) const
inlinevirtualinherited

Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class.

Returns
A new mxArray (caller is responsible of memory freeing) or NULL is class does not support conversion to MATLAB.

Definition at line 79 of file CSerializable.h.

References BASE_IMPEXP, DEFINE_MRPT_OBJECT_POST, mrpt::utils::ObjectToOctetVector(), mrpt::utils::ObjectToRawString(), mrpt::utils::ObjectToString(), mrpt::utils::OctetVectorToObject(), mrpt::utils::RawStringToObject(), and mrpt::utils::StringToObject().

Referenced by mrpt::poses::operator<<(), mrpt::utils::TCamera::readFromStream(), mrpt::obs::CObservationImage::readFromStream(), mrpt::obs::CObservationStereoImages::readFromStream(), mrpt::obs::CObservation2DRangeScan::readFromStream(), and mrpt::utils::CImage::readFromStream().

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

Introduces a pure virtual method responsible for writing to a CStream.

This can not be used directly be users, instead use "stream << object;" for writing it to a stream.

Parameters
outThe output binary stream where object must be dumped.
getVersionIf NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data.
Exceptions
std::exceptionOn any error, see CStream::WriteBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

Definition at line 63 of file TStereoCamera.cpp.

Member Data Documentation

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

Definition at line 27 of file TStereoCamera.h.

const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject
staticinherited

Definition at line 128 of file CObject.h.

const mrpt::utils::TRuntimeClassId mrpt::utils::CSerializable::classCSerializable
staticinherited

Definition at line 42 of file CSerializable.h.

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

Definition at line 27 of file TStereoCamera.h.

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

Definition at line 27 of file TStereoCamera.h.

TCamera mrpt::utils::TStereoCamera::leftCamera
TCamera mrpt::utils::TStereoCamera::rightCamera
mrpt::poses::CPose3DQuat mrpt::utils::TStereoCamera::rightCameraPose



Page generated by Doxygen 1.8.11 for MRPT 1.5.7 Git: 2190203 Tue May 15 02:01:15 2018 +0200 at miƩ may 16 12:40:16 CEST 2018