-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComputerVision.h
executable file
·54 lines (41 loc) · 1.36 KB
/
ComputerVision.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
/*
* File: ComputerVision.h
* Author: alex
*
* Created on June 17, 2014, 10:44 AM
*/
#ifndef COMPUTERVISION_H
#define COMPUTERVISION_H
#include "opencv2/opencv.hpp"
#include "BalloonLocation.h"
class ComputerVision {
public:
ComputerVision();
ComputerVision(const ComputerVision& orig);
virtual ~ComputerVision();
static void *RunCV(void *tid);
private:
double avgCaptureTime;
double avgConversionTime,
avgSplitTime,
avgProcessingTime,
avgDisplayTime;
long captureTime,
conversionTime,
splitTime,
processingTime,
displayTime;
int nFrames;
balloonLocation_t tempLocation;
constexpr static double areaRatio = 0.65;
void InitGUI();
void RecordTime(long delta, double *avgTime);
long GetTimeDelta(struct timeval timea, struct timeval timeb);
void Log(const char* msg, ...);
void CaptureFrame(cv::VideoCapture &camera, cv::Mat &frame_host, cv::gpu::GpuMat &frame, cv::Mat &debugOverlay);
void ConvertToHSV(cv::gpu::GpuMat &frame, cv::gpu::GpuMat &hue, cv::gpu::GpuMat &sat, cv::gpu::GpuMat &val);
void ProcessFrame(cv::gpu::GpuMat &hue, cv::gpu::GpuMat &sat, cv::gpu::GpuMat &balloonyness, cv::Mat &debugOverlay);
void DisplayOutput(cv::Mat frame, cv::gpu::GpuMat hue, cv::gpu::GpuMat sat, cv::gpu::GpuMat val, cv::gpu::GpuMat balloonyness, cv::Mat debugOverlay);
void CvMain();
};
#endif /* COMPUTERVISION_H */