Main MRPT website > C++ reference for MRPT 1.9.9
CObservationStereoImagesFeatures.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef CObservationStereoImagesFeatures_H
10 #define CObservationStereoImagesFeatures_H
11 
13 #include <mrpt/img/CImage.h>
14 #include <mrpt/img/TCamera.h>
15 #include <mrpt/obs/CObservation.h>
16 #include <mrpt/poses/CPose3D.h>
17 #include <mrpt/poses/CPose3DQuat.h>
18 #include <mrpt/poses/CPose2D.h>
19 
20 namespace mrpt
21 {
22 namespace obs
23 {
25 {
26  std::pair<mrpt::img::TPixelCoordf, mrpt::img::TPixelCoordf> pixels;
27  unsigned int ID;
28 };
29 
30 /** Declares a class derived from "CObservation" that encapsules a pair of
31  cameras and a set of matched image features extracted from them.
32  *
33  <b>NOTE:</b> The image features stored in this class are NOT supposed to be
34  UNDISTORTED, but the TCamera members must provide their distortion params.
35  A zero-vector of distortion params means a set of UNDISTORTED pixels.<br>
36  * \sa CObservation
37  * \ingroup mrpt_obs_grp
38  */
40 {
42 
43  public:
45  /** Other constructor providing members initialization.
46  */
48  const mrpt::img::TCamera& cLeft /*left camera*/,
49  const mrpt::img::TCamera& cRight /*right camera*/,
50  const mrpt::poses::CPose3DQuat& rCPose /*rightCameraPose*/,
51  const mrpt::poses::CPose3DQuat& cPORobot /*cameraPoseOnRobot*/);
52 
53  /** A method for storing the set of observed features in a text file in the
54  * format: <br>
55  * ID ul vl ur vr <br>
56  * being (ul,vl) and (ur,vr) the "x" and "y" coordinates for the left and
57  * right feature, respectively.
58  */
59  void saveFeaturesToTextFile(const std::string& filename);
60 
61  // ------------------
62  // Class Members
63  // ------------------
65 
66  /** The pose of the right camera, relative to the left one:
67  * Note that for the Bumblebee stereo camera and using the conventional
68  * reference coordinates for the left
69  * camera ("x" points to the right, "y" down), the "right" camera is
70  * situated
71  * at position (BL, 0, 0) with q = [1 0 0 0], where BL is the BASELINE.
72  */
74 
75  /** The pose of the LEFT camera, relative to the robot.
76  */
78 
79  /** Vectors of image feature pairs (with ID).
80  */
81  std::vector<TStereoImageFeatures> theFeatures;
82 
83  // See base class docs
84  void getSensorPose(mrpt::poses::CPose3D& out_sensorPose) const override
85  {
86  out_sensorPose = mrpt::poses::CPose3D(cameraPoseOnRobot);
87  }
88  // See base class docs
89  void getSensorPose(mrpt::poses::CPose3DQuat& out_sensorPose) const
90  {
91  out_sensorPose = cameraPoseOnRobot;
92  }
93  // See base class docs
94  void getDescriptionAsText(std::ostream& o) const override;
95 
96  /** A general method to change the sensor pose on the robot in a
97  * mrpt::poses::CPose3D form.
98  * Note that most sensors will use the full (6D) CPose3DQuat, but see the
99  * derived classes for more details or special cases.
100  * \sa getSensorPose
101  */
102  inline void setSensorPose(
103  const mrpt::poses::CPose3D& newSensorPose) override
104  {
106  }
107 
108  /** A general method to change the sensor pose on the robot in a CPose3DQuat
109  * form.
110  * Note that most sensors will use the full (6D) CPose3DQuat, but see the
111  * derived classes for more details or special cases.
112  * \sa getSensorPose
113  */
114  inline void setSensorPose(const mrpt::poses::CPose3DQuat& newSensorPose)
115  {
116  cameraPoseOnRobot = newSensorPose;
117  }
118 }; // End of class def.
119 
120 } // namespace obs
121 } // namespace mrpt
122 
123 #endif
mrpt::obs::CObservationStereoImagesFeatures::CObservationStereoImagesFeatures
CObservationStereoImagesFeatures()=default
mrpt::obs::CObservationStereoImagesFeatures::rightCameraPose
mrpt::poses::CPose3DQuat rightCameraPose
The pose of the right camera, relative to the left one: Note that for the Bumblebee stereo camera and...
Definition: CObservationStereoImagesFeatures.h:73
mrpt::obs::CObservationStereoImagesFeatures::cameraLeft
mrpt::img::TCamera cameraLeft
Definition: CObservationStereoImagesFeatures.h:64
mrpt::obs::CObservationStereoImagesFeatures::getSensorPose
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
Definition: CObservationStereoImagesFeatures.h:84
mrpt::obs::TStereoImageFeatures
Definition: CObservationStereoImagesFeatures.h:24
mrpt::obs::CObservationStereoImagesFeatures::theFeatures
std::vector< TStereoImageFeatures > theFeatures
Vectors of image feature pairs (with ID).
Definition: CObservationStereoImagesFeatures.h:81
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::poses::CPose3DQuat
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,...
Definition: CPose3DQuat.h:48
mrpt::obs::CObservationStereoImagesFeatures::setSensorPose
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) override
A general method to change the sensor pose on the robot in a mrpt::poses::CPose3D form.
Definition: CObservationStereoImagesFeatures.h:102
CPose2D.h
TCamera.h
mrpt::obs::TStereoImageFeatures::ID
unsigned int ID
Definition: CObservationStereoImagesFeatures.h:27
mrpt::obs::CObservationStereoImagesFeatures::setSensorPose
void setSensorPose(const mrpt::poses::CPose3DQuat &newSensorPose)
A general method to change the sensor pose on the robot in a CPose3DQuat form.
Definition: CObservationStereoImagesFeatures.h:114
mrpt::obs::CObservationStereoImagesFeatures::cameraRight
mrpt::img::TCamera cameraRight
Definition: CObservationStereoImagesFeatures.h:64
mrpt::obs::CObservationStereoImagesFeatures::cameraPoseOnRobot
mrpt::poses::CPose3DQuat cameraPoseOnRobot
The pose of the LEFT camera, relative to the robot.
Definition: CObservationStereoImagesFeatures.h:77
mrpt::obs::CObservationStereoImagesFeatures
Declares a class derived from "CObservation" that encapsules a pair of cameras and a set of matched i...
Definition: CObservationStereoImagesFeatures.h:39
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
CPose3DQuat.h
mrpt::img::TCamera
Structure to hold the parameters of a pinhole camera model.
Definition: TCamera.h:29
mrpt::obs::CObservationStereoImagesFeatures::getDescriptionAsText
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
Definition: CObservationStereoImagesFeatures.cpp:101
CPose3D.h
mrpt::obs::CObservationStereoImagesFeatures::getSensorPose
void getSensorPose(mrpt::poses::CPose3DQuat &out_sensorPose) const
Definition: CObservationStereoImagesFeatures.h:89
CObservation.h
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:102
mrpt::obs::TStereoImageFeatures::pixels
std::pair< mrpt::img::TPixelCoordf, mrpt::img::TPixelCoordf > pixels
Definition: CObservationStereoImagesFeatures.h:26
mrpt::obs::CObservation
Declares a class that represents any robot's observation.
Definition: CObservation.h:43
string
GLsizei const GLchar ** string
Definition: glext.h:4101
CImage.h
mrpt::obs::CObservationStereoImagesFeatures::saveFeaturesToTextFile
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...
Definition: CObservationStereoImagesFeatures.cpp:36
CSerializable.h



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