Project

General

Profile

BitmapToolkit Scol plugin
CameraInputOpenCV.h
Go to the documentation of this file.
1#ifndef __BTK_CAMERAINPUT_OPENCV_H__
2#define __BTK_CAMERAINPUT_OPENCV_H__
3
4#include <boost/thread/thread.hpp>
5#include <boost/bind/bind.hpp>
6
7#include <opencv2/opencv.hpp>
8#include "ICameraInput.h"
9
10#ifdef USE_RASPICAM
11 #include <raspicam/raspicam_cv.h>
12#endif
13
18{
19private:
20 cv::VideoCapture* mVI;
21 #ifdef USE_RASPICAM
23 #endif
24
25 cv::Size mBufferSize;
26 boost::thread mThread;
27 boost::shared_mutex mMutex;
28 bool mAutoUpdate;
29 bool mUpdated;
30 cv::Mat mBuffer;
31 cv::Mat mCachedFrame;
32 cv::Mat mRetrieveBuffer;
33public:
34
35 CameraInputOpenCV(int index);
37
38 virtual bool Initialize();
39 virtual void Close();
40 virtual bool IsOpened();
41 virtual cv::Mat UpdateImage();
42
43 virtual int GetWidth();
44 virtual int GetHeight();
45 virtual void SetSize(int width, int height);
46
47 virtual bool TakeSnapshot(std::string path);
48
49 void UpdateThread();
50};
51
52#endif
Concrete implementation of ICameraInput using OpenCV utility.
virtual cv::Mat UpdateImage()
virtual void SetSize(int width, int height)
virtual bool Initialize()
virtual bool TakeSnapshot(std::string path)
Interface for camera management. Concrete classes are written for Windows, Android and OpenCV native ...