greenhouse/src/Camera.h
matlabbe 680b1740b1 Moved all non-gui stuff outside the GUI
Added FindObject and ObjSignature classes
Added ULogger from utilite for pretty log

git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@356 620bd6b2-0a58-f614-fd9a-1bd335dccda9
2014-07-31 19:02:31 +00:00

49 lines
938 B
C++

/*
* Copyright (C) 2011, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
*/
#ifndef CAMERA_H_
#define CAMERA_H_
#include <opencv2/highgui/highgui.hpp>
#include <QtCore/QObject>
#include <QtCore/QTimer>
#include <QtGui/QImage>
#include "CameraTcpClient.h"
class Camera : public QObject {
Q_OBJECT
public:
Camera(QObject * parent = 0);
virtual ~Camera();
virtual bool start();
virtual void stop();
virtual bool isRunning() {return cameraTimer_.isActive();}
void pause();
int getTotalFrames();
int getCurrentFrameIndex();
void moveToFrame(int frame);
Q_SIGNALS:
void imageReceived(const cv::Mat & image);
public Q_SLOTS:
virtual void updateImageRate();
virtual void takeImage();
protected:
void startTimer();
void stopTimer();
private:
cv::VideoCapture capture_;
QTimer cameraTimer_;
QList<std::string> images_;
unsigned int currentImageIndex_;
CameraTcpClient cameraTcpClient_;
};
#endif /* CAMERA_H_ */