-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVehicle.h
More file actions
37 lines (27 loc) · 934 Bytes
/
Vehicle.h
File metadata and controls
37 lines (27 loc) · 934 Bytes
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
#pragma once
#include <string>
#include <iostream>
#include "Blob.h"
class Vehicle
{
public:
Vehicle();
void trackVehicles();
void getFirstframe(VideoCapture &video, vector <Blob> existingBlob);
void addBlobToExistingBlobs(Blob ¤t_blob,vector<Blob> &existing_blob,int minDistIndex);
void addNewBlob(Blob ¤t_blob,vector <Blob> &existing_blob);
void drawBlobInfoOnImage(std::vector<Blob> &blobs, cv::Mat &imgFrame2Copy);
private:
vector <Blob> _existingBlob(10);
bool isFirstFrame;
int frameCount;
char _FPS[3];
VideoCapture _video;
Mat _firstFrame;
vector <vector<Point>> _contours;
vector <vector<Point>> _carBlobs;
Mat convexImg;
void _extractCars(vector < vector<Point> > &convexHulls ,Blob &_blob,vector <Blob> &_Blob);
void _matchExistingFrameBlobwWithCurrentFrameBlob(vector <Blob> &existingBlob, vector <Blob> ¤tBlob);
double distanceBetweenPoints(Point point1, Point point2);
};