forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
49 lines (38 loc) · 1.81 KB
/
main.cpp
File metadata and controls
49 lines (38 loc) · 1.81 KB
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
#include "AsyncDetector.h"
#include <opencv2/opencv.hpp>
#include <opencv2/core/ocl.hpp>
// ----------------------------------------------------------------------
static void Help()
{
printf("\nExample of the AsyncDetector\n"
"Usage: \n"
" ./AsyncDetector <path to movie file> [--start_frame]=<start a video from this position> [--end_frame]=<play a video to this position> [--end_delay]=<delay in milliseconds after video ending> [--out]=<name of result video file> [--show_logs]=<show logs> \n\n"
"Press:\n"
"\'m\' key for change mode: play|pause. When video is paused you can press any key for get next frame. \n\n"
"Press Esc to exit from video \n\n"
);
}
const char* keys =
{
"{ @1 |../data/atrium.avi | movie file | }"
"{ sf start_frame |0 | Start a video from this position | }"
"{ ef end_frame |0 | Play a video to this position (if 0 then played to the end of file) | }"
"{ ed end_delay |0 | Delay in milliseconds after video ending | }"
"{ o out | | Name of result video file | }"
"{ sl show_logs |1 | Show Trackers logs | }"
"{ g gpu |0 | Use OpenCL acceleration | }"
};
// ----------------------------------------------------------------------
int main(int argc, char** argv)
{
Help();
cv::CommandLineParser parser(argc, argv, keys);
bool useOCL = parser.get<int>("gpu") ? 1 : 0;
cv::ocl::setUseOpenCL(useOCL);
std::cout << (cv::ocl::useOpenCL() ? "OpenCL is enabled" : "OpenCL not used") << std::endl;
AsyncDetector slow_detector(parser);
slow_detector.Process();
cv::destroyAllWindows();
std::cout << "Correct exit" << std::endl;
return 0;
}