Main MRPT website > C++ reference
MRPT logo
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-2015, 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 
40  public:
41  /** Constructor.
42  * \param iplImage An OpenCV "IplImage*" object with the image to be loaded in the member "image", or NULL (default) for an empty image.
43  *
44  */
45  CObservationImage( void *iplImage = NULL );
46 
47  /** The pose of the camera on the robot
48  */
49  mrpt::poses::CPose3D cameraPose;
50 
51  /** Intrinsic and distortion parameters of the camera.
52  * See the <a href="http://www.mrpt.org/Camera_Parameters" >tutorial</a> for a discussion of these parameters.
53  */
54  mrpt::utils::TCamera cameraParams;
55 
56  mrpt::utils::CImage image; //!< The image captured by the camera, that is, the main piece of information of this observation.
57 
58  /** Computes the rectified (un-distorted) image, using the embeded distortion parameters.
59  */
60  void getRectifiedImage( mrpt::utils::CImage &out_img ) const;
61 
62  // See base class docs
63  void getSensorPose( mrpt::poses::CPose3D &out_sensorPose ) const { out_sensorPose = cameraPose; }
64  // See base class docs
65  void setSensorPose( const mrpt::poses::CPose3D &newSensorPose ) { cameraPose = newSensorPose; }
66  // See base class docs
67  virtual void getDescriptionAsText(std::ostream &o) const;
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 #endif
Declares a class derived from "CObservation" that encapsules an image from a camera, whose relative pose to robot is also stored.
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose)
A general method to change the sensor pose on the robot.
#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...
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
Declares a class that represents any robot's observation.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)



Page generated by Doxygen 1.8.9.1 for MRPT 1.3.0 SVN: at Sun Sep 13 03:55:12 UTC 2015