Main MRPT website > C++ reference
MRPT logo
CStereoGrabber_SVS.h
Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                       http://www.mrpt.org/                                |
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 CStereoGrabber_SVS_H
00029 #define CStereoGrabber_SVS_H
00030 
00031 #include <mrpt/slam/CObservationStereoImages.h>
00032 #include <mrpt/hwdrivers/link_pragmas.h>
00033 
00034 
00035 namespace mrpt
00036 {
00037         namespace hwdrivers
00038         {
00039 
00040 
00041                 /** Options used when creating a STOC Videre Design camera capture object
00042                   * \ingroup mrpt_hwdrivers_grp
00043                   */
00044                 struct HWDRIVERS_IMPEXP TCaptureOptions_SVS
00045                 {
00046                         TCaptureOptions_SVS(int _frame_width=640, int _frame_height=480 , double _framerate = 30, int _NDisp= 64,
00047                                                                 int _Corrsize=15, int _LR = false, int _Thresh = 10, int _Unique = 13, int _Horopter = 0,int _SpeckleSize = 100,bool _procesOnChip = true,bool _calDisparity = true);
00048 
00049                         int     frame_width, frame_height;      //!< Capture resolution (Default: 640x480)
00050 
00051                         bool getRectified;                              //!< Indicates if the STOC camera must capture rectified images (Default: true -> rectified)
00052                         double framerate;                               //!< STOC camera frame rate (Default: 30 fps)
00053                         int                                 m_NDisp;    //!< number of STOC's disparities (Default: 64 )
00054                         int                                 m_Corrsize; // correlation window size
00055                         int                                 m_LR;       // no left-right check, not available
00056                         int                                 m_Thresh;   // texture filter
00057                         int                                 m_Unique;   // uniqueness filter
00058                         int                                 m_Horopter;
00059                         int                                 m_SpeckleSize;
00060                         bool                                m_procesOnChip;
00061                         bool                                m_calDisparity;
00062 
00063                 };
00064 
00065                 /** A class for grabing stereo images from a STOC camera of Videre Design
00066                   * NOTE:
00067                   *             - Windows:
00068                   *                     - This class is not available.
00069                   *
00070                   *             - Linux:
00071                   *                     - This class is only available when compiling MRPT with "MRPT_HAS_SVS".
00072                   *                     - You must have the videre design's library.
00073                   *                     - Capture will be made in grayscale.
00074                   *                     - The grabber must be launch in root.
00075                   *
00076                   * Once connected to a camera, you can call "getStereoObservation" to retrieve the Disparity images.
00077                   *
00078                   * \sa You'll probably want to use instead the most generic camera grabber in MRPT: mrpt::hwdrivers::CCameraSensor
00079                   * \ingroup mrpt_hwdrivers_grp
00080                   */
00081         class HWDRIVERS_IMPEXP  CStereoGrabber_SVS : public mrpt::utils::CUncopiable
00082                 {
00083                 protected:
00084                         bool                    m_bInitialized;                                 //!< If this has been correctly initiated
00085 
00086                         void                     *m_videoObject;        // svsVideoImages*
00087                         void                     *m_stereoImage;        // svsStereoImage*
00088                         void                 *m_disparityParams;        // svsDisparityParams*
00089                         void                   *m_processObject;        // svsStereoProcess
00090                         unsigned int                        m_resolutionX;
00091                         unsigned int                        m_resolutionY;
00092 
00093                         unsigned char                      *m_ptrMat;
00094 
00095                         bool                                m_status;
00096                         bool                                m_initialized;
00097                         bool                                m_procesOnChip;
00098                         bool                                m_calDisparity;
00099 
00100 
00101                 private:
00102 
00103                 public:
00104 
00105                         TCaptureOptions_SVS     m_options;
00106 
00107                         /** Constructor: */
00108                         CStereoGrabber_SVS( int cameraIndex = 0, const TCaptureOptions_SVS &options = TCaptureOptions_SVS() );
00109 
00110                         /** Destructor */
00111                         virtual ~CStereoGrabber_SVS(void);
00112 
00113                         /** Grab stereo images, and return the pair of rectified images.
00114                          * \param out_observation The object to be filled with sensed data.
00115                          *
00116                          *  NOTICE: (1) That the member "CObservationStereoImages::refCameraPose" must be
00117                          *                set on the return of this method, since we don't know here the robot physical structure.
00118                          *          (2) The images are already rectified.
00119                          *
00120                          * \return false on any error, true if all go fine.
00121                         */
00122                         bool  getStereoObservation( mrpt::slam::CObservationStereoImages &out_observation );
00123 
00124                 };      // End of class
00125 
00126         } // End of NS
00127 } // End of NS
00128 
00129 
00130 #endif



Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011