48 lines
749 B
C++
48 lines
749 B
C++
#pragma once
|
|
#ifndef RGBCAMERAOPERATION_H
|
|
#define RGBCAMERAOPERATION_H
|
|
|
|
#include <QObject>
|
|
#include <QTimer>
|
|
#include <opencv2/opencv.hpp>
|
|
#include <QImage>
|
|
|
|
#include <functional>
|
|
|
|
#include "imageProcessor.h"
|
|
|
|
typedef void(*func)();
|
|
|
|
class RgbCameraOperation:public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
RgbCameraOperation();
|
|
~RgbCameraOperation();
|
|
|
|
QImage m_qImage;
|
|
void setCallback(void(*func)());
|
|
|
|
private:
|
|
cv::Mat frame;
|
|
cv::VideoCapture *cam;
|
|
|
|
func m_func;
|
|
|
|
ImageProcessor* m_ImageProcessor;
|
|
|
|
bool record;
|
|
|
|
public slots:
|
|
void OpenCamera();
|
|
void OpenCamera_callback();//不使用信号而使用回调函数来通知界面刷新视频
|
|
void CloseCamera();
|
|
|
|
signals:
|
|
void PlotSignal();
|
|
|
|
void CamClosed();
|
|
};
|
|
#endif // !RGBCAMERAOPERATION_H
|