Main MRPT website > C++ reference
MRPT logo

CObservationImage.h

Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                   http://mrpt.sourceforge.net/                            |
00005    |                                                                           |
00006    |   Copyright (C) 2005-2011  University of Malaga                           |
00007    |                                                                           |
00008    |    This software was written by the Machine Perception and Intelligent    |
00009    |      Robotics Lab, University of Malaga (Spain).                          |
00010    |    Contact: Jose-Luis Blanco  <jlblanco@ctima.uma.es>                     |
00011    |                                                                           |
00012    |  This file is part of the MRPT project.                                   |
00013    |                                                                           |
00014    |     MRPT is free software: you can redistribute it and/or modify          |
00015    |     it under the terms of the GNU General Public License as published by  |
00016    |     the Free Software Foundation, either version 3 of the License, or     |
00017    |     (at your option) any later version.                                   |
00018    |                                                                           |
00019    |   MRPT is distributed in the hope that it will be useful,                 |
00020    |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |
00021    |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |
00022    |     GNU General Public License for more details.                          |
00023    |                                                                           |
00024    |     You should have received a copy of the GNU General Public License     |
00025    |     along with MRPT.  If not, see <http://www.gnu.org/licenses/>.         |
00026    |                                                                           |
00027    +---------------------------------------------------------------------------+ */
00028 #ifndef CObservationImage_H
00029 #define CObservationImage_H
00030 
00031 #include <mrpt/utils/CSerializable.h>
00032 #include <mrpt/utils/CImage.h>
00033 #include <mrpt/utils/TCamera.h>
00034 #include <mrpt/math/CMatrix.h>
00035 #include <mrpt/slam/CObservation.h>
00036 #include <mrpt/poses/CPose3D.h>
00037 #include <mrpt/poses/CPose2D.h>
00038 
00039 namespace mrpt
00040 {
00041 namespace slam
00042 {
00043         using namespace mrpt::utils;
00044         using namespace mrpt::math;
00045 
00046         DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CObservationImage , CObservation,OBS_IMPEXP )
00047 
00048         /** Declares a class derived from "CObservation" that encapsules an image from a camera, whose relative pose to robot is also stored.
00049              The next figure illustrate the coordinates reference systems involved in this class:<br>
00050                  <center>
00051                  <img src="CObservationImage_figRefSystem.png">
00052                  </center>
00053          *
00054          * \sa CObservation, CObservationStereoImages
00055          */
00056         class OBS_IMPEXP CObservationImage : public CObservation
00057         {
00058                 // This must be added to any CSerializable derived class:
00059                 DEFINE_SERIALIZABLE( CObservationImage )
00060 
00061          public:
00062                 /** Constructor.
00063                  * \param iplImage An OpenCV "IplImage*" object with the image to be loaded in the member "image", or NULL (default) for an empty image.
00064                  *
00065                  */
00066                 CObservationImage( void *iplImage = NULL );
00067 
00068                  /** The pose of the camera on the robot
00069                   */
00070                 CPose3D                 cameraPose;
00071 
00072                  /** Intrinsic and distortion parameters of the camera.
00073                    * See the <a href="http://www.mrpt.org/Camera_Parameters">tutorial</a> for a discussion of these parameters.
00074                    */
00075                 TCamera         cameraParams;
00076 
00077                 CImage          image; //!< The image captured by the camera, that is, the main piece of information of this observation.
00078 
00079                 /** Computes the rectified (un-distorted) image, using the embeded distortion parameters.
00080                   */
00081                 void  getRectifiedImage( CImage &out_img ) const;
00082 
00083                 /** A general method to retrieve the sensor pose on the robot.
00084                   *  Note that most sensors will return a full (6D) CPose3D, but see the derived classes for more details or special cases.
00085                   * \sa setSensorPose
00086                   */
00087                 void getSensorPose( CPose3D &out_sensorPose ) const { out_sensorPose = cameraPose; }
00088 
00089 
00090                 /** A general method to change the sensor pose on the robot.
00091                   *  Note that most sensors will use the full (6D) CPose3D, but see the derived classes for more details or special cases.
00092                   * \sa getSensorPose
00093                   */
00094                 void setSensorPose( const CPose3D &newSensorPose ) { cameraPose = newSensorPose; }
00095 
00096         }; // End of class def.
00097 
00098 
00099         } // End of namespace
00100 } // End of namespace
00101 
00102 #endif



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011