| | |
| | | return -1;
|
| | | }
|
| | |
|
| | | // create nodes
|
| | | auto file_src_0 = std::make_shared<vp_nodes::vp_file_src_node>("file_src_0", 0, video_path, resize_ratio);
|
| | | // create nodes bool cycle = true, std::string gst_decoder_name = "avdec_h264", int skip_interval = 0
|
| | | auto file_src_0 = std::make_shared<vp_nodes::vp_file_src_node>("file_src_0", 0, video_path, resize_ratio, true, "avdec_h264",3);
|
| | | //auto file_src_1 = std::make_shared<vp_nodes::vp_file_src_node>("file_src_1", 1, "./vp_data/test_video/falldown.mp4", 0.5);
|
| | | //auto split = std::make_shared<vp_nodes::vp_split_node>("split", false, true); // split by deep-copy not by channel!
|
| | |
|
| | |
| | |
|
| | | auto tracker = std::make_shared<vp_nodes::vp_sort_track_node>("sort_tracker");
|
| | |
|
| | | // define a region in frame for every channel (value MUST in the scope of frame'size)
|
| | | // define a region in frame for every channel (value MUST in the scope of frame'size) (224,74),(346,64),(486,342),(9,342) vp_point(450, 100), vp_objects::vp_point(792, 80), vp_objects::vp_point(1100, 684), vp_objects::vp_point(18, 682)
|
| | | std::map<int, std::vector<vp_objects::vp_point>> regions = {
|
| | | {0, std::vector<vp_objects::vp_point>{vp_objects::vp_point(20, 30), vp_objects::vp_point(600, 40), vp_objects::vp_point(600, 300), vp_objects::vp_point(10, 300)}}, // channel0 -> region
|
| | | {1, std::vector<vp_objects::vp_point>{vp_objects::vp_point(20, 30), vp_objects::vp_point(1000, 40), vp_objects::vp_point(1000, 600), vp_objects::vp_point(10, 600)}} // channel1 -> region
|
| | | };
|
| | | {0, std::vector<vp_objects::vp_point>{vp_objects::vp_point(int(616*resize_ratio), int(13*resize_ratio)), |
| | | vp_objects::vp_point(int(670*resize_ratio), int(11*resize_ratio)), |
| | | vp_objects::vp_point(int(1100*resize_ratio), int(684*resize_ratio)), |
| | | vp_objects::vp_point(int(18*resize_ratio), int(610*resize_ratio))}}, // channel0 -> region
|
| | | };
|
| | | auto ba_jam = std::make_shared<vp_nodes::vp_ba_jam_node>("ba_jam", regions);
|
| | | auto ba_stop = std::make_shared<vp_nodes::vp_ba_stop_node>("ba_stop", regions);
|
| | |
|
| | |
| | | vp_objects::vp_point right_end(10, 10); // change to proper value
|
| | | std::map<int, std::vector<vp_objects::vp_point>> left_lines = {{0, {left_start, left_end}}}; // channel0 -> point vector
|
| | | std::map<int, std::vector<vp_objects::vp_point>> right_lines = {{0, {right_start, right_end}}}; // channel0 -> point vector
|
| | | int half_screen_width = 384;
|
| | | int half_screen_width = 640;
|
| | | auto ba_wrong_direction = std::make_shared<vp_nodes::vp_ba_wrong_direction_node>("vp_ba_wrong_direction_node", left_lines,right_lines,half_screen_width,true,true);
|
| | |
|
| | | int min_gathering_count = 2;
|
| | |
| | | auto ba_report_detect = std::make_shared<vp_nodes::vp_ba_report_detect_node>("ba_report_detect_node","fire_smoke",std::vector<int>{1000,1001,1002}, true,true);
|
| | |
|
| | |
|
| | | auto json_kafka_broker_0 = std::make_shared<vp_nodes::vp_json_kafka_broker_node>("json_kafka_broker_0", "192.168.0.85:9092", "vp_ba_vehicle", vp_nodes::vp_broke_for::BARESULT);
|
| | | auto json_kafka_broker_0 = std::make_shared<vp_nodes::vp_json_kafka_broker_node>("json_kafka_broker_0", "172.18.0.247:9092", "vp_ba_result", vp_nodes::vp_broke_for::BARESULT);
|
| | | auto osd_0 = std::make_shared<vp_nodes::vp_ba_stop_osd_node>("osd_0");
|
| | | auto recorder = std::make_shared<vp_nodes::vp_record_node>("recorder", "./record", "./record");
|
| | |
|
| | |
| | | file_src_0->start();
|
| | |
|
| | | // for debug purpose
|
| | | vp_utils::vp_analysis_board board({file_src_0});
|
| | | board.display(1, false);
|
| | | // vp_utils::vp_analysis_board board({file_src_0});
|
| | | // board.display(1, false);
|
| | |
|
| | | std::string wait;
|
| | | std::getline(std::cin, wait);
|