00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2009 University of Malaga | 00007 | | 00008 | This software was written by the Perception and Robotics | 00009 | research group, 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 00029 #ifndef CCameraSensor_H 00030 #define CCameraSensor_H 00031 00032 #include <mrpt/poses/CPose3D.h> 00033 #include <mrpt/utils/CDebugOutputCapable.h> 00034 #include <mrpt/hwdrivers/CGenericSensor.h> 00035 #include <mrpt/vision/CImageGrabber_OpenCV.h> 00036 #include <mrpt/vision/CImageGrabber_dc1394.h> 00037 00038 #include <mrpt/gui/CDisplayWindow.h> 00039 00040 namespace mrpt 00041 { 00042 namespace hwdrivers 00043 { 00098 class HWDLLIMPEXP CCameraSensor : public utils::CDebugOutputCapable, public CGenericSensor 00099 { 00100 DEFINE_GENERIC_SENSOR(CCameraSensor) 00101 00102 public: 00106 CCameraSensor(); 00107 00110 virtual ~CCameraSensor(); 00111 00117 void doProcess(); 00118 00122 void loadConfig( 00123 const mrpt::utils::CConfigFileBase &configSource, 00124 const std::string &iniSection ); 00125 00129 virtual void initialize(); 00130 00131 00135 void close(); 00136 00137 00141 void setPathForExternalImages( const std::string &directory ); 00142 00147 void setExternalImageFormat( const std::string &ext ) 00148 { 00149 m_external_images_format = ext; 00150 } 00151 00152 protected: 00153 poses::CPose3D m_sensorPose; 00154 std::string m_sensorLabel; 00155 00156 std::string m_grabber_type; 00157 int m_cv_camera_index; 00158 std::string m_cv_camera_type; 00159 mrpt::vision::TCaptureCVOptions m_cv_options; 00160 00161 uint64_t m_dc1394_camera_guid; 00162 int m_dc1394_camera_unit; 00163 mrpt::vision::TCaptureOptions_dc1394 m_dc1394_options; 00164 int m_preview_decimation; 00165 00166 00167 std::string m_path_for_external_images; 00168 std::string m_external_images_format; 00169 00170 private: 00171 /* The OpenCV capture object. */ 00172 mrpt::vision::CImageGrabber_OpenCV *m_cap_cv; 00173 00174 /* The dc1394 capture object. */ 00175 mrpt::vision::CImageGrabber_dc1394 *m_cap_dc1394; 00176 00177 int m_preview_counter; 00178 mrpt::gui::CDisplayWindow *m_preview_win; 00179 00180 }; // end class 00181 00182 } // end namespace 00183 } // end namespace 00184 00185 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Thu Feb 26 02:07:47 EST 2009 |