Main MRPT website > C++ reference for MRPT 1.4.0
obs/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-2016, 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>
16#include <mrpt/poses/CPose3D.h>
18#include <mrpt/poses/CPose2D.h>
19
20namespace mrpt
21{
22namespace obs
23{
25 {
26 std::pair<mrpt::utils::TPixelCoordf,mrpt::utils::TPixelCoordf> pixels;
27 unsigned int ID;
28 };
29
31 /** Declares a class derived from "CObservation" that encapsules a pair of 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 UNDISTORTED, but the TCamera members must provide their distortion params.
34 A zero-vector of distortion params means a set of UNDISTORTED pixels.<br>
35 * \sa CObservation
36 * \ingroup mrpt_obs_grp
37 */
39 {
40 // This must be added to any CSerializable derived class:
42
43 public:
44 /** Default Constructor.
45 */
47
48 /** Other constructor providing members initialization.
49 */
51 const mrpt::math::CMatrixDouble33 &iPLeft /*left intrinsic params*/, const mrpt::math::CMatrixDouble33 &iPRight /*right intrinsic params*/,
52 const mrpt::math::CArrayDouble<5> &dPLeft /*left distortion params*/, const mrpt::math::CArrayDouble<5> &dPRight /*right distortion params*/,
53 const mrpt::poses::CPose3DQuat &rCPose /*rightCameraPose*/, const mrpt::poses::CPose3DQuat &cPORobot /*cameraPoseOnRobot*/ );
54
55 /** Other constructor providing members initialization.
56 */
58 const mrpt::utils::TCamera &cLeft /*left camera*/, const mrpt::utils::TCamera &cRight /*right camera*/,
59 const mrpt::poses::CPose3DQuat &rCPose /*rightCameraPose*/, const mrpt::poses::CPose3DQuat &cPORobot /*cameraPoseOnRobot*/ );
60
61 /** Destructor
62 */
64
65 /** A method for storing the set of observed features in a text file in the format: <br>
66 * ID ul vl ur vr <br>
67 * being (ul,vl) and (ur,vr) the "x" and "y" coordinates for the left and right feature, respectively.
68 */
69 void saveFeaturesToTextFile( const std::string &filename );
70
71 // ------------------
72 // Class Members
73 // ------------------
75
76 /** The pose of the right camera, relative to the left one:
77 * Note that for the Bumblebee stereo camera and using the conventional reference coordinates for the left
78 * camera ("x" points to the right, "y" down), the "right" camera is situated
79 * at position (BL, 0, 0) with q = [1 0 0 0], where BL is the BASELINE.
80 */
82
83 /** The pose of the LEFT camera, relative to the robot.
84 */
86
87 /** Vectors of image feature pairs (with ID).
88 */
89 std::vector<TStereoImageFeatures> theFeatures;
90
91 // See base class docs
92 void getSensorPose( mrpt::poses::CPose3D &out_sensorPose ) const MRPT_OVERRIDE { out_sensorPose = mrpt::poses::CPose3D(cameraPoseOnRobot); }
93 // See base class docs
94 void getSensorPose( mrpt::poses::CPose3DQuat &out_sensorPose ) const { out_sensorPose = cameraPoseOnRobot; }
95 // See base class docs
96 void getDescriptionAsText(std::ostream &o) const MRPT_OVERRIDE;
97
98 /** A general method to change the sensor pose on the robot in a mrpt::poses::CPose3D form.
99 * Note that most sensors will use the full (6D) CPose3DQuat, but see the derived classes for more details or special cases.
100 * \sa getSensorPose
101 */
102 inline void setSensorPose( const mrpt::poses::CPose3D &newSensorPose ) MRPT_OVERRIDE { cameraPoseOnRobot = mrpt::poses::CPose3DQuat(newSensorPose); }
103
104 /** A general method to change the sensor pose on the robot in a CPose3DQuat form.
105 * Note that most sensors will use the full (6D) CPose3DQuat, but see the derived classes for more details or special cases.
106 * \sa getSensorPose
107 */
108 inline void setSensorPose( const mrpt::poses::CPose3DQuat &newSensorPose ) { cameraPoseOnRobot = newSensorPose; }
109 }; // End of class def.
110 DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE( CObservationStereoImagesFeatures , CObservation, OBS_IMPEXP )
111
112 } // End of namespace
113} // End of namespace
114
115#endif
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
A partial specialization of CArrayNumeric for double numbers.
Definition: CArrayNumeric.h:75
A numeric matrix of compile-time fixed size.
Declares a class that represents any robot's observation.
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).
mrpt::poses::CPose3DQuat cameraPoseOnRobot
The pose of the LEFT camera, relative to the robot.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) MRPT_OVERRIDE
A general method to change the sensor pose on the robot in a mrpt::poses::CPose3D form.
void getDescriptionAsText(std::ostream &o) const MRPT_OVERRIDE
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
mrpt::poses::CPose3DQuat rightCameraPose
The pose of the right camera, relative to the left one: Note that for the Bumblebee stereo camera and...
CObservationStereoImagesFeatures(const mrpt::utils::TCamera &cLeft, const mrpt::utils::TCamera &cRight, const mrpt::poses::CPose3DQuat &rCPose, const mrpt::poses::CPose3DQuat &cPORobot)
Other constructor providing members initialization.
void setSensorPose(const mrpt::poses::CPose3DQuat &newSensorPose)
A general method to change the sensor pose on the robot in a CPose3DQuat form.
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...
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const MRPT_OVERRIDE
A general method to retrieve the sensor pose on the robot.
void getSensorPose(mrpt::poses::CPose3DQuat &out_sensorPose) const
CObservationStereoImagesFeatures(const mrpt::math::CMatrixDouble33 &iPLeft, const mrpt::math::CMatrixDouble33 &iPRight, const mrpt::math::CArrayDouble< 5 > &dPLeft, const mrpt::math::CArrayDouble< 5 > &dPRight, const mrpt::poses::CPose3DQuat &rCPose, const mrpt::poses::CPose3DQuat &cPORobot)
Other constructor providing members initialization.
CObservationStereoImagesFeatures()
Default Constructor.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:73
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,...
Definition: CPose3DQuat.h:42
Structure to hold the parameters of a pinhole camera model.
Definition: TCamera.h:32
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Definition: mrpt_macros.h:28
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::pair< mrpt::utils::TPixelCoordf, mrpt::utils::TPixelCoordf > pixels



Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Wed Feb 15 01:46:32 UTC 2023