Main MRPT website > C++ reference
MRPT logo
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-2014, 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/slam/CObservation.h>
17 #include <mrpt/poses/CPose3D.h>
18 #include <mrpt/poses/CPose2D.h>
19 
20 namespace mrpt
21 {
22 namespace slam
23 {
24  using namespace mrpt::utils;
25  using namespace mrpt::math;
26 
27  DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CObservationImage , CObservation,OBS_IMPEXP )
28 
29  /** Declares a class derived from "CObservation" that encapsules an image from a camera, whose relative pose to robot is also stored.
30  The next figure illustrate the coordinates reference systems involved in this class:<br>
31  <center>
32  <img src="CObservationImage_figRefSystem.png">
33  </center>
34  *
35  * \sa CObservation, CObservationStereoImages
36  * \ingroup mrpt_obs_grp
37  */
39  {
40  // This must be added to any CSerializable derived class:
42 
43  public:
44  /** Constructor.
45  * \param iplImage An OpenCV "IplImage*" object with the image to be loaded in the member "image", or NULL (default) for an empty image.
46  *
47  */
48  CObservationImage( void *iplImage = NULL );
49 
50  /** The pose of the camera on the robot
51  */
52  CPose3D cameraPose;
53 
54  /** Intrinsic and distortion parameters of the camera.
55  * See the <a href="http://www.mrpt.org/Camera_Parameters" >tutorial</a> for a discussion of these parameters.
56  */
57  TCamera cameraParams;
58 
59  CImage image; //!< The image captured by the camera, that is, the main piece of information of this observation.
60 
61  /** Computes the rectified (un-distorted) image, using the embeded distortion parameters.
62  */
63  void getRectifiedImage( CImage &out_img ) const;
64 
65  /** A general method to retrieve the sensor pose on the robot.
66  * Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases.
67  * \sa setSensorPose
68  */
69  void getSensorPose( CPose3D &out_sensorPose ) const { out_sensorPose = cameraPose; }
70 
71 
72  /** A general method to change the sensor pose on the robot.
73  * Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases.
74  * \sa getSensorPose
75  */
76  void setSensorPose( const CPose3D &newSensorPose ) { cameraPose = newSensorPose; }
77 
78  }; // End of class def.
79  DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE( CObservationImage , CObservation,OBS_IMPEXP )
80 
81 
82  } // End of namespace
83 } // End of namespace
84 
85 #endif
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
A class for storing images as grayscale or RGB bitmaps.
Definition: CImage.h:97
void setSensorPose(const CPose3D &newSensorPose)
A general method to change the sensor pose on the robot.
This base provides a set of functions for maths stuff.
Definition: CArray.h:18
#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...
Declares a class that represents any robot's observation.
Definition: CObservation.h:52
Declares a class derived from "CObservation" that encapsules an image from a camera, whose relative pose to robot is also stored.
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:69
#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



Page generated by Doxygen 1.8.8 for MRPT 1.2.2 SVN:Unversioned directory at Tue Oct 14 02:14:08 UTC 2014