00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef CImageGrabber_OpenCV_H
00029 #define CImageGrabber_OpenCV_H
00030
00031 #include <mrpt/config.h>
00032
00033 #include <mrpt/slam/CObservationImage.h>
00034
00035
00036 namespace mrpt
00037 {
00038 namespace vision
00039 {
00041 enum TCameraType
00042 {
00043 CAMERA_CV_AUTODETECT = 0,
00044 CAMERA_CV_DC1394,
00045 CAMERA_CV_VFL,
00046 CAMERA_CV_VFW,
00047 CAMERA_CV_MIL
00048 };
00049
00054 struct TCaptureCVOptions
00055 {
00056 TCaptureCVOptions() :
00057 frame_width(0), frame_height(0),
00058 gain(0),
00059 ieee1394_fps(0)
00060 {}
00061
00062 int frame_width,frame_height;
00063 double gain;
00064 double ieee1394_fps;
00065 };
00066
00077 class MRPTDLLIMPEXP CImageGrabber_OpenCV
00078 {
00079 protected:
00082 bool m_bInitialized;
00083
00086 void *m_capture;
00087
00088 public:
00094 CImageGrabber_OpenCV(
00095 int cameraIndex = -1,
00096 TCameraType cameraType = CAMERA_CV_AUTODETECT,
00097 const TCaptureCVOptions &options = TCaptureCVOptions()
00098 );
00099
00102 CImageGrabber_OpenCV( const std::string &AVI_fileName );
00103
00106 virtual ~CImageGrabber_OpenCV( );
00107
00109 bool isOpen() const
00110 {
00111 return m_bInitialized;
00112 }
00113
00119 bool getObservation( mrpt::slam::CObservationImage &out_observation);
00120
00121
00122 };
00123
00124 }
00125 }
00126
00127
00128 #endif