Main MRPT website > C++ reference for MRPT 1.5.9
obs/CObservationImage.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 CObservationImage_H
10 #define CObservationImage_H
11 
13 #include <mrpt/utils/CImage.h>
14 #include <mrpt/utils/TCamera.h>
15 #include <mrpt/math/CMatrix.h>
16 #include <mrpt/obs/CObservation.h>
17 #include <mrpt/poses/CPose3D.h>
18 #include <mrpt/poses/CPose2D.h>
19 
20 namespace mrpt
21 {
22 namespace obs
23 {
24  DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CObservationImage , CObservation,OBS_IMPEXP )
25 
26  /** Declares a class derived from "CObservation" that encapsules an image from a camera, whose relative pose to robot is also stored.
27  The next figure illustrate the coordinates reference systems involved in this class:<br>
28  <center>
29  <img src="CObservationImage_figRefSystem.png">
30  </center>
31  *
32  * \sa CObservation, CObservationStereoImages
33  * \ingroup mrpt_obs_grp
34  */
36  {
37  // This must be added to any CSerializable derived class:
39  // This must be added for declaration of MEX-related functions
41 
42  public:
43  /** Constructor.
44  * \param iplImage An OpenCV "IplImage*" object with the image to be loaded in the member "image", or NULL (default) for an empty image.
45  *
46  */
47  CObservationImage( void *iplImage = NULL );
48 
49  /** The pose of the camera on the robot
50  */
52 
53  /** Intrinsic and distortion parameters of the camera.
54  * See the <a href="http://www.mrpt.org/Camera_Parameters" >tutorial</a> for a discussion of these parameters.
55  */
57 
58  mrpt::utils::CImage image; //!< The image captured by the camera, that is, the main piece of information of this observation.
59 
60  /** Computes the rectified (un-distorted) image, using the embeded distortion parameters.
61  */
62  void getRectifiedImage( mrpt::utils::CImage &out_img ) const;
63 
64  // See base class docs
65  void getSensorPose( mrpt::poses::CPose3D &out_sensorPose ) const MRPT_OVERRIDE { out_sensorPose = cameraPose; }
66  void setSensorPose( const mrpt::poses::CPose3D &newSensorPose ) MRPT_OVERRIDE { cameraPose = newSensorPose; }
67  void getDescriptionAsText(std::ostream &o) const MRPT_OVERRIDE;
68 
69  }; // End of class def.
70  DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE( CObservationImage , CObservation,OBS_IMPEXP )
71 
72 
73  } // End of namespace
74 } // End of namespace
75 
76 // Add for declaration of mexplus::from template specialization
78 
79 #endif
Declares a class derived from "CObservation" that encapsules an image from a camera, whose relative pose to robot is also stored.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
mrpt::utils::TCamera cameraParams
Intrinsic and distortion parameters of the camera.
A class for storing images as grayscale or RGB bitmaps.
Definition: CImage.h:101
#define DECLARE_MEXPLUS_FROM(complete_type)
This must be inserted if a custom conversion method for MEX API is implemented in the class...
#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...
#define DECLARE_MEX_CONVERSION
This must be inserted if a custom conversion method for MEX API is implemented in the class...
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose) MRPT_OVERRIDE
A general method to change the sensor pose on the robot.
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...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
Declares a class that represents any robot&#39;s observation.
mrpt::poses::CPose3D cameraPose
The pose of the camera on the robot.
mrpt::utils::CImage image
The image captured by the camera, that is, the main piece of information of this observation.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
Structure to hold the parameters of a pinhole camera model.
Definition: TCamera.h:31
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const MRPT_OVERRIDE
A general method to retrieve the sensor pose on the robot.



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020