MRPT  1.9.9
List of all members | Public Member Functions | Public Attributes
mrpt::img::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 23 of file TStereoCamera.h.

#include <mrpt/img/TStereoCamera.h>

Inheritance diagram for mrpt::img::TStereoCamera:

Public Member Functions

void saveToConfigFile (const std::string &section, mrpt::config::CConfigFileBase &cfg) const
 Save all params to a plain text config file in this format: More...
 
void loadFromConfigFile (const std::string &section, const mrpt::config::CConfigFileBase &cfg)
 Load all the params from a config source, in the same format that used in saveToConfigFile(). More...
 
void loadFromConfigFile (const mrpt::config::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...
 
RTTI classes and functions for polymorphic hierarchies
mrpt::rtti::CObject::Ptr duplicateGetSmartPtr () const
 Makes a deep copy of the object and returns a smart pointer to it. More...
 

Public Attributes

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

Protected Member Functions

CSerializable virtual methods
uint8_t serializeGetVersion () const override
 Must return the current versioning number of the object. More...
 
void serializeTo (mrpt::serialization::CArchive &out) const override
 Pure virtual method for writing (serializing) to an abstract archive. More...
 
void serializeFrom (mrpt::serialization::CArchive &in, uint8_t serial_version) override
 Pure virtual method for reading (deserializing) from an abstract archive. More...
 
CSerializable virtual methods
virtual void serializeTo (CSchemeArchiveBase &out) const
 Virtual method for writing (serializing) to an abstract schema based archive. More...
 
virtual void serializeFrom (CSchemeArchiveBase &in)
 Virtual method for reading (deserializing) from an abstract schema based archive. More...
 

RTTI stuff

using Ptr = std::shared_ptr< mrpt::img ::TStereoCamera >
 
using ConstPtr = std::shared_ptr< const mrpt::img ::TStereoCamera >
 
using UniquePtr = std::unique_ptr< mrpt::img ::TStereoCamera >
 
using ConstUniquePtr = std::unique_ptr< const mrpt::img ::TStereoCamera >
 
static const mrpt::rtti::TRuntimeClassId runtimeClassId
 
static constexpr const char * className = "mrpt::img" "::" "TStereoCamera"
 
static const mrpt::rtti::TRuntimeClassId_GetBaseClass ()
 
static constexpr auto getClassName ()
 
static const mrpt::rtti::TRuntimeClassIdGetRuntimeClassIdStatic ()
 
static std::shared_ptr< CObjectCreateObject ()
 
template<typename... Args>
static Ptr Create (Args &&... args)
 
template<typename Alloc , typename... Args>
static Ptr CreateAlloc (const Alloc &alloc, Args &&... args)
 
template<typename... Args>
static UniquePtr CreateUnique (Args &&... args)
 
virtual const mrpt::rtti::TRuntimeClassIdGetRuntimeClass () const override
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::rtti::CObjectclone () const override
 Returns a deep copy (clone) of the object, indepently of its class. More...
 

Member Typedef Documentation

◆ ConstPtr

Definition at line 25 of file TStereoCamera.h.

◆ ConstUniquePtr

using mrpt::img::TStereoCamera::ConstUniquePtr = std::unique_ptr<const mrpt::img :: TStereoCamera >

Definition at line 25 of file TStereoCamera.h.

◆ Ptr

A type for the associated smart pointer

Definition at line 25 of file TStereoCamera.h.

◆ UniquePtr

using mrpt::img::TStereoCamera::UniquePtr = std::unique_ptr< mrpt::img :: TStereoCamera >

Definition at line 25 of file TStereoCamera.h.

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::rtti::TRuntimeClassId* mrpt::img::TStereoCamera::_GetBaseClass ( )
staticprotected

◆ clone()

virtual mrpt::rtti::CObject* mrpt::img::TStereoCamera::clone ( ) const
overridevirtual

Returns a deep copy (clone) of the object, indepently of its class.

Implements mrpt::rtti::CObject.

◆ Create()

template<typename... Args>
static Ptr mrpt::img::TStereoCamera::Create ( Args &&...  args)
inlinestatic

Definition at line 25 of file TStereoCamera.h.

◆ CreateAlloc()

template<typename Alloc , typename... Args>
static Ptr mrpt::img::TStereoCamera::CreateAlloc ( const Alloc &  alloc,
Args &&...  args 
)
inlinestatic

Definition at line 25 of file TStereoCamera.h.

◆ CreateObject()

static std::shared_ptr<CObject> mrpt::img::TStereoCamera::CreateObject ( )
static

◆ CreateUnique()

template<typename... Args>
static UniquePtr mrpt::img::TStereoCamera::CreateUnique ( Args &&...  args)
inlinestatic

Definition at line 25 of file TStereoCamera.h.

◆ dumpAsText()

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 97 of file TStereoCamera.cpp.

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ duplicateGetSmartPtr()

mrpt::rtti::CObject::Ptr CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Makes a deep copy of the object and returns a smart pointer to it.

Definition at line 204 of file CObject.h.

References mrpt::rtti::CObject::clone().

Referenced by mrpt::obs::CRawlog::insert().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getClassName()

static constexpr auto mrpt::img::TStereoCamera::getClassName ( )
inlinestatic

Definition at line 25 of file TStereoCamera.h.

◆ GetRuntimeClass()

virtual const mrpt::rtti::TRuntimeClassId* mrpt::img::TStereoCamera::GetRuntimeClass ( ) const
overridevirtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::serialization::CSerializable.

◆ GetRuntimeClassIdStatic()

static const mrpt::rtti::TRuntimeClassId& mrpt::img::TStereoCamera::GetRuntimeClassIdStatic ( )
static

◆ loadFromConfigFile() [1/2]

void TStereoCamera::loadFromConfigFile ( const std::string &  section,
const mrpt::config::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 45 of file TStereoCamera.cpp.

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

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFromConfigFile() [2/2]

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

overload This signature is consistent with the rest of MRPT APIs

Definition at line 70 of file TStereoCamera.h.

References loadFromConfigFile().

Here is the call graph for this function:

◆ saveToConfigFile()

void TStereoCamera::saveToConfigFile ( const std::string &  section,
mrpt::config::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 24 of file TStereoCamera.cpp.

References saveToConfigFile().

Referenced by saveToConfigFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scaleToResolution()

void mrpt::img::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 83 of file TStereoCamera.h.

References leftCamera, rightCamera, and mrpt::img::TCamera::scaleToResolution().

Here is the call graph for this function:

◆ serializeFrom() [1/2]

void TStereoCamera::serializeFrom ( mrpt::serialization::CArchive in,
uint8_t  serial_version 
)
overrideprotectedvirtual

Pure virtual method for reading (deserializing) from an abstract archive.

Users don't call this method directly. Instead, use stream >> object;.

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 I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 68 of file TStereoCamera.cpp.

References MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, and THROW_EXCEPTION.

◆ serializeFrom() [2/2]

virtual void mrpt::serialization::CSerializable::serializeFrom ( CSchemeArchiveBase in)
inlineprotectedvirtualinherited

Virtual method for reading (deserializing) from an abstract schema based archive.

Definition at line 74 of file CSerializable.h.

References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ serializeGetVersion()

uint8_t TStereoCamera::serializeGetVersion ( ) const
overrideprotectedvirtual

Must return the current versioning number of the object.

Start in zero for new classes, and increments each time there is a change in the stored format.

Implements mrpt::serialization::CSerializable.

Definition at line 61 of file TStereoCamera.cpp.

◆ serializeTo() [1/2]

void TStereoCamera::serializeTo ( mrpt::serialization::CArchive out) const
overrideprotectedvirtual

Pure virtual method for writing (serializing) to an abstract archive.

Users don't call this method directly. Instead, use stream << object;.

Exceptions
std::exceptionOn any I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 62 of file TStereoCamera.cpp.

References out.

◆ serializeTo() [2/2]

virtual void mrpt::serialization::CSerializable::serializeTo ( CSchemeArchiveBase out) const
inlineprotectedvirtualinherited

Virtual method for writing (serializing) to an abstract schema based archive.

Definition at line 64 of file CSerializable.h.

References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ writeToMatlab()

virtual mxArray* mrpt::serialization::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 nullptr is class does not support conversion to MATLAB.

Definition at line 90 of file CSerializable.h.

Member Data Documentation

◆ className

constexpr const char* mrpt::img::TStereoCamera::className = "mrpt::img" "::" "TStereoCamera"
static

Definition at line 25 of file TStereoCamera.h.

◆ leftCamera

TCamera mrpt::img::TStereoCamera::leftCamera

◆ rightCamera

TCamera mrpt::img::TStereoCamera::rightCamera

◆ rightCameraPose

mrpt::math::TPose3DQuat mrpt::img::TStereoCamera::rightCameraPose

◆ runtimeClassId

const mrpt::rtti::TRuntimeClassId mrpt::img::TStereoCamera::runtimeClassId
staticprotected

Definition at line 25 of file TStereoCamera.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020