-
Notifications
You must be signed in to change notification settings - Fork 3
/
TFlow.hpp
36 lines (28 loc) · 1.01 KB
/
TFlow.hpp
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
#pragma once
#include <iostream>
#include <fstream>
#include <algorithm>
#include <opencv2/opencv.hpp>
#include "Car.hpp"
#define contour vector<Point>
using namespace std;
using namespace cv;
class TFlow
{
private:
VideoCapture vc;
Mat ROITransform;
Size ROISize;
void orderPointsClockwise(vector<Point2f>& pts);
Mat getTransMatrix(vector<Point2f>& src1, Size s);
Mat getROI(Mat f);
list<Car> cars;
list<Car> fgDetected;
void getCarsFG(Mat fg, Mat ROI, double time); //Fills fgDetected with the cars detected for a new instant of time
void updateCars(Mat ROI, double time); //Update cars by matching the newly detected with previous ones
public:
TFlow(){};
void genConfig(string cFile);
void loadConfig(string cFile);
void play();
};