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-2017, 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/utils/CImage.h>
14 #include <mrpt/utils/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::utils::TPixelCoordf, mrpt::utils::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:
44  /** Default Constructor.
45  */
47 
48  /** Other constructor providing members initialization.
49  */
51  const mrpt::math::CMatrixDouble33& iPLeft /*left intrinsic params*/,
52  const mrpt::math::CMatrixDouble33& iPRight /*right intrinsic params*/,
53  const mrpt::math::CArrayDouble<5>& dPLeft /*left distortion params*/,
54  const mrpt::math::CArrayDouble<5>& dPRight /*right distortion params*/,
55  const mrpt::poses::CPose3DQuat& rCPose /*rightCameraPose*/,
56  const mrpt::poses::CPose3DQuat& cPORobot /*cameraPoseOnRobot*/);
57 
58  /** Other constructor providing members initialization.
59  */
61  const mrpt::utils::TCamera& cLeft /*left camera*/,
62  const mrpt::utils::TCamera& cRight /*right camera*/,
63  const mrpt::poses::CPose3DQuat& rCPose /*rightCameraPose*/,
64  const mrpt::poses::CPose3DQuat& cPORobot /*cameraPoseOnRobot*/);
65 
66  /** Destructor
67  */
69 
70  /** A method for storing the set of observed features in a text file in the
71  * format: <br>
72  * ID ul vl ur vr <br>
73  * being (ul,vl) and (ur,vr) the "x" and "y" coordinates for the left and
74  * right feature, respectively.
75  */
76  void saveFeaturesToTextFile(const std::string& filename);
77 
78  // ------------------
79  // Class Members
80  // ------------------
82 
83  /** The pose of the right camera, relative to the left one:
84  * Note that for the Bumblebee stereo camera and using the conventional
85  * reference coordinates for the left
86  * camera ("x" points to the right, "y" down), the "right" camera is
87  * situated
88  * at position (BL, 0, 0) with q = [1 0 0 0], where BL is the BASELINE.
89  */
91 
92  /** The pose of the LEFT camera, relative to the robot.
93  */
95 
96  /** Vectors of image feature pairs (with ID).
97  */
98  std::vector<TStereoImageFeatures> theFeatures;
99 
100  // See base class docs
101  void getSensorPose(mrpt::poses::CPose3D& out_sensorPose) const override
102  {
103  out_sensorPose = mrpt::poses::CPose3D(cameraPoseOnRobot);
104  }
105  // See base class docs
106  void getSensorPose(mrpt::poses::CPose3DQuat& out_sensorPose) const
107  {
108  out_sensorPose = cameraPoseOnRobot;
109  }
110  // See base class docs
111  void getDescriptionAsText(std::ostream& o) const override;
112 
113  /** A general method to change the sensor pose on the robot in a
114  * mrpt::poses::CPose3D form.
115  * Note that most sensors will use the full (6D) CPose3DQuat, but see the
116  * derived classes for more details or special cases.
117  * \sa getSensorPose
118  */
119  inline void setSensorPose(
120  const mrpt::poses::CPose3D& newSensorPose) override
121  {
123  }
124 
125  /** A general method to change the sensor pose on the robot in a CPose3DQuat
126  * form.
127  * Note that most sensors will use the full (6D) CPose3DQuat, but see the
128  * derived classes for more details or special cases.
129  * \sa getSensorPose
130  */
131  inline void setSensorPose(const mrpt::poses::CPose3DQuat& newSensorPose)
132  {
133  cameraPoseOnRobot = newSensorPose;
134  }
135 }; // End of class def.
136 
137 } // End of namespace
138 } // End of namespace
139 
140 #endif
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...
Declares a class derived from "CObservation" that encapsules a pair of cameras and a set of matched i...
std::vector< TStereoImageFeatures > theFeatures
Vectors of image feature pairs (with ID).
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
void getSensorPose(mrpt::poses::CPose3DQuat &out_sensorPose) const
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
Definition: CPose3DQuat.h:48
GLsizei const GLchar ** string
Definition: glext.h:4101
CObservationStereoImagesFeatures()
Default Constructor.
mrpt::poses::CPose3DQuat cameraPoseOnRobot
The pose of the LEFT camera, relative to the robot.
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...
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
mrpt::poses::CPose3DQuat rightCameraPose
The pose of the right camera, relative to the left one: Note that for the Bumblebee stereo camera and...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
Declares a class that represents any robot&#39;s observation.
Definition: CObservation.h:41
void setSensorPose(const mrpt::poses::CPose3DQuat &newSensorPose)
A general method to change the sensor pose on the robot in a CPose3DQuat form.
std::pair< mrpt::utils::TPixelCoordf, mrpt::utils::TPixelCoordf > pixels
Structure to hold the parameters of a pinhole camera model.
Definition: TCamera.h:32



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019