|
9 | 9 | #include <opencv2/opencv.hpp> |
10 | 10 | #include <opencv2/core/ocl.hpp> |
11 | 11 |
|
12 | | -// ---------------------------------------------------------------------- |
13 | | - |
14 | | -static void Help() |
15 | | -{ |
16 | | - printf("\nExamples of the Multitarget tracking algorithm\n" |
17 | | - "Usage: \n" |
18 | | - " ./MultitargetTracker <path to movie file> [--example]=<number of example 0..7> [--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> [--async]=<async pipeline> [--res]=<csv log file> [--settings]=<ini file> [--batch_size=<number of frames>] \n\n" |
19 | | - "Press:\n" |
20 | | - "\'m\' key for change mode: play|pause. When video is paused you can press any key for get next frame. \n\n" |
21 | | - "Press Esc to exit from video \n\n" |
22 | | - ); |
23 | | -} |
24 | | - |
25 | | -const char* keys = |
26 | | -{ |
27 | | - "{ @1 |../data/atrium.avi | movie file | }" |
28 | | - "{ e example |1 | number of example 0 - MouseTracking, 1 - MotionDetector, 3 - YOLO TensorRT Detector, 4 - Cars counting | }" |
29 | | - "{ sf start_frame |0 | Start a video from this position | }" |
30 | | - "{ ef end_frame |0 | Play a video to this position (if 0 then played to the end of file) | }" |
31 | | - "{ ed end_delay |0 | Delay in milliseconds after video ending | }" |
32 | | - "{ o out | | Name of result video file | }" |
33 | | - "{ show_logs |info | Show Trackers logs: trace, debug, info, warning, error, critical, off | }" |
34 | | - "{ g gpu |0 | Use OpenCL acceleration | }" |
35 | | - "{ a async |1 | Use 2 theads for processing pipeline | }" |
36 | | - "{ r log_res | | Path to the csv file with tracking result | }" |
37 | | - "{ cvat_res | | Path to the xml file in cvat format with tracking result | }" |
38 | | - "{ s settings | | Path to the ini file with tracking settings | }" |
39 | | - "{ bs batch_size |1 | Batch size - frames count for processing | }" |
40 | | - "{ wf write_n_frame |1 | Write logs on each N frame: 1 for writing each frame | }" |
41 | | - "{ hm heat_map |0 | For CarsCounting: Draw heat map | }" |
42 | | - "{ geo_bind |geo_bind.ini | For CarsCounting: ini file with geographical binding | }" |
43 | | - "{ contrast_adjustment |0 | Use contrast adjustment for frames before detection | }" |
44 | | -}; |
45 | | - |
46 | | -// ---------------------------------------------------------------------- |
47 | | - |
| 12 | +///---------------------------------------------------------------------- |
48 | 13 | int main(int argc, char** argv) |
49 | 14 | { |
| 15 | + const char* keys = |
| 16 | + { |
| 17 | + "{ @1 |../data/atrium.avi | movie file | }" |
| 18 | + "{ e example |1 | number of example 0 - MouseTracking, 1 - MotionDetector, 3 - YOLO TensorRT Detector, 4 - Cars counting | }" |
| 19 | + "{ sf start_frame |0 | Start a video from this position | }" |
| 20 | + "{ ef end_frame |0 | Play a video to this position (if 0 then played to the end of file) | }" |
| 21 | + "{ ed end_delay |0 | Delay in milliseconds after video ending | }" |
| 22 | + "{ o out | | Name of result video file | }" |
| 23 | + "{ show_logs |info | Show Trackers logs: trace, debug, info, warning, error, critical, off | }" |
| 24 | + "{ g gpu |0 | Use OpenCL acceleration | }" |
| 25 | + "{ a async |1 | Use 2 theads for processing pipeline | }" |
| 26 | + "{ r log_res | | Path to the csv file with tracking result | }" |
| 27 | + "{ cvat_res | | Path to the xml file in cvat format with tracking result | }" |
| 28 | + "{ s settings | | Path to the ini file with tracking settings | }" |
| 29 | + "{ bs batch_size |1 | Batch size - frames count for processing | }" |
| 30 | + "{ wf write_n_frame |1 | Write logs on each N frame: 1 for writing each frame | }" |
| 31 | + "{ hm heat_map |0 | For CarsCounting: Draw heat map | }" |
| 32 | + "{ geo_bind |geo_bind.ini | For CarsCounting: ini file with geographical binding | }" |
| 33 | + "{ contrast_adjustment |0 | Use contrast adjustment for frames before detection | }" |
| 34 | + }; |
| 35 | + |
50 | 36 | cv::CommandLineParser parser(argc, argv, keys); |
51 | 37 |
|
52 | | - Help(); |
| 38 | + std::cout << "\nExamples of the Multitarget tracking algorithm\n" |
| 39 | + "Usage: \n" |
| 40 | + " ./MultitargetTracker <path to movie file> [--example]=<number of example 0..7> [--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> [--async]=<async pipeline> [--res]=<csv log file> [--settings]=<ini file> [--batch_size=<number of frames>] \n\n" |
| 41 | + "Press:\n" |
| 42 | + "\'m\' key for change mode: play|pause. When video is paused you can press any key for get next frame. \n\n" |
| 43 | + "Press Esc to exit from video \n" << std::endl; |
| 44 | + |
53 | 45 | parser.printMessage(); |
54 | 46 |
|
55 | 47 | bool useOCL = parser.get<int>("gpu") != 0; |
|
0 commit comments