2011-10-25 15:48:19 +00:00
|
|
|
/*
|
|
|
|
|
* Camera.h
|
|
|
|
|
*
|
|
|
|
|
* Created on: 2011-10-21
|
|
|
|
|
* Author: matlab
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef CAMERA_H_
|
|
|
|
|
#define CAMERA_H_
|
|
|
|
|
|
|
|
|
|
#include <opencv2/highgui/highgui.hpp>
|
|
|
|
|
#include <QtCore/QObject>
|
2011-11-23 16:44:14 +00:00
|
|
|
#include <QtCore/QTimer>
|
2011-10-25 15:48:19 +00:00
|
|
|
|
|
|
|
|
class Camera : public QObject {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2011-11-23 16:44:14 +00:00
|
|
|
Camera(QObject * parent = 0);
|
2011-10-25 15:48:19 +00:00
|
|
|
virtual ~Camera();
|
|
|
|
|
|
2011-11-23 16:44:14 +00:00
|
|
|
virtual bool start();
|
|
|
|
|
virtual void stop();
|
2011-10-25 15:48:19 +00:00
|
|
|
|
|
|
|
|
signals:
|
2011-11-23 16:44:14 +00:00
|
|
|
void imageReceived(const cv::Mat & image);
|
2011-10-25 15:48:19 +00:00
|
|
|
|
2011-11-23 16:44:14 +00:00
|
|
|
public slots:
|
|
|
|
|
void updateImageRate();
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void takeImage();
|
2011-10-25 15:48:19 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
CvCapture * capture_;
|
2011-11-23 16:44:14 +00:00
|
|
|
QTimer cameraTimer_;
|
2011-10-25 15:48:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* CAMERA_H_ */
|