Go to the documentation of this file.
32 rightCameraPose = rCPose;
33 cameraPoseOnRobot = cPORobot;
39 std::ofstream file(filename);
43 for (it = theFeatures.begin(); it != theFeatures.end(); ++it)
45 "%u %.2f %.2f %.2f %.2f\n", it->ID, it->pixels.first.x,
46 it->pixels.first.y, it->pixels.second.x, it->pixels.second.y);
59 out << rightCameraPose << cameraPoseOnRobot;
62 for (
unsigned int i = 0; i < theFeatures.size(); ++i)
64 out << theFeatures[i].pixels.first.x << theFeatures[i].pixels.first.y;
65 out << theFeatures[i].pixels.second.x << theFeatures[i].pixels.second.y;
68 out << sensorLabel << timestamp;
81 in >> rightCameraPose >> cameraPoseOnRobot;
83 theFeatures.resize(nL);
84 for (
unsigned int i = 0; i < theFeatures.size(); ++i)
86 in >> theFeatures[i].pixels.first.x >>
87 theFeatures[i].pixels.first.y;
88 in >> theFeatures[i].pixels.second.x >>
89 theFeatures[i].pixels.second.y;
91 theFeatures[i].ID = (
unsigned int)nR;
93 in >> sensorLabel >> timestamp;
102 std::ostream& o)
const
106 o <<
"Homogeneous matrix for the sensor's 3D pose, relative to robot "
109 << cameraPoseOnRobot << endl;
111 o <<
"Homogeneous matrix for the RIGHT camera's 3D pose, relative to LEFT "
112 "camera reference system:\n";
114 << rightCameraPose << endl;
116 o <<
"Intrinsic parameters matrix for the LEFT camera:" << endl;
118 o << aux.inMatlabFormat() << endl << aux << endl;
120 o <<
"Distortion parameters vector for the LEFT camera:" << endl <<
"[ ";
121 for (
unsigned int i = 0; i < 5; ++i) o << cameraLeft.dist[i] <<
" ";
124 o <<
"Intrinsic parameters matrix for the RIGHT camera:" << endl;
125 aux = cameraRight.intrinsicParams;
126 o << aux.inMatlabFormat() << endl << aux << endl;
128 o <<
"Distortion parameters vector for the RIGHT camera:" << endl <<
"[ ";
129 for (
unsigned int i = 0; i < 5; ++i) o << cameraRight.dist[i] <<
" ";
134 " Image size: %ux%u pixels\n", (
unsigned int)cameraLeft.ncols,
135 (
unsigned int)cameraLeft.nrows);
138 " Number of features in images: %u\n",
139 (
unsigned int)theFeatures.size());
CObservationStereoImagesFeatures()=default
GLenum GLsizei GLenum format
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,...
#define ASSERT_(f)
Defines an assertion mechanism.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
This namespace contains representation of robot actions and observations.
Virtual base class for "archives": classes abstracting I/O streams.
virtual void getDescriptionAsText(std::ostream &o) const
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Declares a class derived from "CObservation" that encapsules a pair of cameras and a set of matched i...
Structure to hold the parameters of a pinhole camera model.
A numeric matrix of compile-time fixed size.
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
Declares a class that represents any robot's observation.
This base provides a set of functions for maths stuff.
IMPLEMENTS_SERIALIZABLE(CObservationStereoImagesFeatures, CObservation, mrpt::obs) CObservationStereoImagesFeatures
GLsizei const GLchar ** string
void saveFeaturesToTextFile(const std::string &filename)
A method for storing the set of observed features in a text file in the format: ID ul vl ur vr be...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
unsigned __int32 uint32_t
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |