forked from HuskyRye/FightingVision2020
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFightingVision2020.cpp
More file actions
45 lines (40 loc) · 1021 Bytes
/
FightingVision2020.cpp
File metadata and controls
45 lines (40 loc) · 1021 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
38
39
40
41
42
43
44
45
#include "FightingVision2020.h"
int FightingVision2020()
{
FightingCapture* capture;
//如果使用大恒相机测试
capture = new FightingDahengCapture();
//如果选择使用视频来测试
char* filename = "D:\\red-ev-0.MOV";
//capture = new FightingVideoCapture(filename);
if (capture && !capture->init()) {
printf("Video source initialization failed.\n");
delete capture;
return 1;
}
/* ArmorDetector */
ArmorDetector armor_detector;
cv::Mat src;
cv::Point3f target;
while (true) {
if (capture->read(src)) {
if (!(armor_detector.DetectArmor(src, target)))
target = { 0, 0, -1 };
;
//cv::imshow("src", src);
cv::waitKey(1);
} else
break;
}
delete capture;
return 0;
}
int main(int argc, char* argv[])
{
while (true) {
FightingVision2020();
printf("### Error, start again! ###\n\n");
cv::waitKey(2000);
}
return 0;
}