MRPT  2.0.1
CObservationImage.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/img/CImage.h>
12 #include <mrpt/img/TCamera.h>
13 #include <mrpt/math/CMatrixF.h>
14 #include <mrpt/obs/CObservation.h>
15 #include <mrpt/poses/CPose2D.h>
16 #include <mrpt/poses/CPose3D.h>
18 
19 namespace mrpt::obs
20 {
21 /** Declares a class derived from "CObservation" that encapsules an image from a
22  camera, whose relative pose to robot is also stored.
23  The next figure illustrate the coordinates reference systems involved in
24  this class:<br>
25  <center>
26  <img src="CObservationImage_figRefSystem.png">
27  </center>
28  *
29  * \sa CObservation, CObservationStereoImages
30  * \ingroup mrpt_obs_grp
31  */
33 {
35  // This must be added for declaration of MEX-related functions
37 
38  public:
39  /** Constructor.
40  * \param iplImage An OpenCV "IplImage*" object with the image to be loaded
41  * in the member "image", or nullptr (default) for an empty image.
42  *
43  */
44  CObservationImage() = default;
45  /** The pose of the camera on the robot
46  */
48 
49  /** Intrinsic and distortion parameters of the camera.
50  * See the <a href="http://www.mrpt.org/Camera_Parameters" >tutorial</a>
51  * for a discussion of these parameters.
52  */
54 
55  /** The image captured by the camera, that is, the main piece of information
56  * of this observation. */
58 
59  /** Computes the un-distorted image, using the embeded camera
60  * intrinsic & distortion parameters.
61  */
62  void getUndistortedImage(mrpt::img::CImage& out_img) const;
63 
64  // See base class docs
65  void getSensorPose(mrpt::poses::CPose3D& out_sensorPose) const override
66  {
67  out_sensorPose = cameraPose;
68  }
69  void setSensorPose(const mrpt::poses::CPose3D& newSensorPose) override
70  {
71  cameraPose = newSensorPose;
72  }
73  void getDescriptionAsText(std::ostream& o) const override;
74 
75  void load() const override;
76 
77 }; // End of class def.
78 
79 } // namespace mrpt::obs
80 // Add for declaration of mexplus::from template specialization
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) override
A general method to change the sensor pose on the robot.
void getDescriptionAsText(std::ostream &o) const override
Build a detailed, multi-line textual description of the observation contents and dump it to the outpu...
mrpt::img::CImage image
The image captured by the camera, that is, the main piece of information of this observation.
#define DECLARE_MEX_CONVERSION
This must be inserted if a custom conversion method for MEX API is implemented in the class...
DECLARE_MEXPLUS_FROM(mrpt::img::TCamera) namespace std
Definition: TCamera.h:227
void getUndistortedImage(mrpt::img::CImage &out_img) const
Computes the un-distorted image, using the embeded camera intrinsic & distortion parameters.
This namespace contains representation of robot actions and observations.
Parameters for the Brown-Conrady camera lens distortion model.
Definition: TCamera.h:26
mrpt::img::TCamera cameraParams
Intrinsic and distortion parameters of the camera.
void load() const override
Makes sure all images and other fields which may be externally stored are loaded in memory...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
Declares a class that represents any robot&#39;s observation.
Definition: CObservation.h:43
mrpt::poses::CPose3D cameraPose
The pose of the camera on the robot.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const override
A general method to retrieve the sensor pose on the robot.
A class for storing images as grayscale or RGB bitmaps.
Definition: img/CImage.h:148
CObservationImage()=default
Constructor.



Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020