2011-10-25 15:48:19 +00:00
|
|
|
/*
|
2011-12-02 18:34:08 +00:00
|
|
|
* Copyright (C) 2011, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
|
2011-10-25 15:48:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef CAMERA_H_
|
|
|
|
|
#define CAMERA_H_
|
|
|
|
|
|
2014-07-31 20:11:46 +00:00
|
|
|
#include "find_object/FindObjectExp.h" // DLL export/import defines
|
|
|
|
|
|
2011-10-25 15:48:19 +00:00
|
|
|
#include <opencv2/highgui/highgui.hpp>
|
|
|
|
|
#include <QtCore/QObject>
|
2011-11-23 16:44:14 +00:00
|
|
|
#include <QtCore/QTimer>
|
2014-05-21 21:31:42 +00:00
|
|
|
#include <QtGui/QImage>
|
2011-10-25 15:48:19 +00:00
|
|
|
|
2014-08-02 06:09:27 +00:00
|
|
|
class CameraTcpServer;
|
2014-07-31 20:11:46 +00:00
|
|
|
|
|
|
|
|
class FINDOBJECT_EXP Camera : public QObject {
|
2011-10-25 15:48:19 +00:00
|
|
|
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-11-24 00:00:37 +00:00
|
|
|
virtual bool isRunning() {return cameraTimer_.isActive();}
|
2011-10-25 15:48:19 +00:00
|
|
|
|
2012-01-30 03:16:30 +00:00
|
|
|
void pause();
|
2012-08-28 20:06:43 +00:00
|
|
|
int getTotalFrames();
|
|
|
|
|
int getCurrentFrameIndex();
|
2014-08-02 06:09:27 +00:00
|
|
|
int getPort();
|
2012-08-28 20:06:43 +00:00
|
|
|
void moveToFrame(int frame);
|
2012-01-30 03:16:30 +00:00
|
|
|
|
2014-07-08 19:55:03 +00:00
|
|
|
Q_SIGNALS:
|
2011-11-23 16:44:14 +00:00
|
|
|
void imageReceived(const cv::Mat & image);
|
2011-10-25 15:48:19 +00:00
|
|
|
|
2014-07-08 19:55:03 +00:00
|
|
|
public Q_SLOTS:
|
2011-11-24 00:00:37 +00:00
|
|
|
virtual void updateImageRate();
|
|
|
|
|
virtual void takeImage();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void startTimer();
|
|
|
|
|
void stopTimer();
|
2011-10-25 15:48:19 +00:00
|
|
|
|
|
|
|
|
private:
|
2012-05-16 01:42:10 +00:00
|
|
|
cv::VideoCapture capture_;
|
2011-11-23 16:44:14 +00:00
|
|
|
QTimer cameraTimer_;
|
2012-08-28 20:06:43 +00:00
|
|
|
QList<std::string> images_;
|
|
|
|
|
unsigned int currentImageIndex_;
|
2014-08-02 06:09:27 +00:00
|
|
|
CameraTcpServer * cameraTcpServer_;
|
2011-10-25 15:48:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* CAMERA_H_ */
|