Class TStereoCamera

Inheritance Relationships

Base Type

  • public mrpt::serialization::CSerializable

Class Documentation

class TStereoCamera : public mrpt::serialization::CSerializable

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

Public Functions

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

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(). Notice that 3 different sections are read, of which “section” is only the prefix.

Throws:

std::exception – on missing fields

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

overload This signature is consistent with the rest of MRPT APIs

std::string dumpAsText() const

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

See also

saveToConfigFile

inline 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 Members

TCamera leftCamera

Intrinsic and distortion parameters of the left and right cameras

TCamera rightCamera
mrpt::math::TPose3DQuat rightCameraPose

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