-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoreprocess.h
executable file
·77 lines (66 loc) · 1.98 KB
/
coreprocess.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef COREPROCESS_H
#define COREPROCESS_H
#include "mainwindow.h"
#include "saver.h"
#include "notify.h"
#include <ctime>
#include <QApplication>
#include <memory>
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/video/background_segm.hpp>
#include <stdlib.h>
#include<iostream>
#include <thread>
#include <string>
#include <counting.h>
#include <vector>
#include "blob.h"
class coreprocess:public QObject
{
Q_OBJECT
public:
int labelpos = 0;
bool bcanCapture = false;
const cv::Scalar SCALAR_BLACK = cv::Scalar(0.0, 0.0, 0.0);
const cv::Scalar SCALAR_WHITE = cv::Scalar(255.0, 255.0, 255.0);
const cv::Scalar SCALAR_YELLOW = cv::Scalar(0.0, 255.0, 255.0);
const cv::Scalar SCALAR_GREEN = cv::Scalar(0.0, 200.0, 0.0);
const cv::Scalar SCALAR_RED = cv::Scalar(0.0, 0.0, 255.0);
bool shouldsend = false;
bool channelone = false;
cv::Point detectionline[2];
int line = 0;
cv::Mat imgFrame1;
cv::Mat imgFrame2;
cv::Mat imgFrame1Copy ;
cv::Mat imgFrame2Copy ;
cv::Mat imgFrame3;
cv::Mat imgThreshCopy ;
QImage img;
cv::Mat imgDifference;
cv::Mat imgThresh;
int record;
int rec = 0;
vector<string> ips;
vector<cv::Mat> MATRIX;
cv::Mat structuringElement5x5;
public:
cv::VideoCapture vctry;
coreprocess();
void aftermain();
bool canCapture(int source,int pos);
bool canCapture(string source, int pos);
std::thread aftermainthread();
private:
void inline DrawContours(cv::Size MatSize, std::vector<std::vector<cv::Point> >& contours);
void inline DrawContours(cv::Size MatSize, std::vector<Blob>& blobs);
void inline DrawBlobInfoOnFrame(std::vector<Blob> &blobs, cv::Mat &imgFrame2Copy);
bool inline hasblobcrossed(std::vector<Blob>&blob,int& theline);
signals:
void liveupdate(QImage img,int QTlabel);
};
#endif //COREPROCESS_H