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



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011