| | |
| | | // for vp_frame_target only
|
| | | std::vector<int> hit_traget_ids;
|
| | | for (auto& target : meta->targets) {
|
| | | auto len = target->tracks.size();
|
| | | auto loc = target->get_rect().track_point();
|
| | | if (target->primary_label == target->class_label_of_car)
|
| | | {
|
| | | auto len = target->tracks.size();
|
| | | auto loc = target->get_rect().track_point();
|
| | |
|
| | | // target has been tracked AND tracked enough frames
|
| | | if (len < check_interval_frames || target->track_id < 0) {
|
| | | continue;
|
| | | }
|
| | | // if target inside of stop region or not
|
| | | if (!point_in_poly(loc, stop_region)) {
|
| | | continue;
|
| | | }
|
| | | // target has been tracked AND tracked enough frames
|
| | | if (len < check_interval_frames || target->track_id < 0) {
|
| | | continue;
|
| | | }
|
| | | // if target inside of stop region or not
|
| | | if (!point_in_poly(loc, stop_region)) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | auto pre_loc = target->tracks[len - check_interval_frames].track_point();
|
| | | if (pre_loc.distance_with(loc) <= check_max_distance) {
|
| | | stop_checking_status[target->track_id]++;
|
| | | hit_traget_ids.push_back(target->track_id);
|
| | | auto pre_loc = target->tracks[len - check_interval_frames].track_point();
|
| | | if (pre_loc.distance_with(loc) <= check_max_distance) {
|
| | | stop_checking_status[target->track_id]++;
|
| | | hit_traget_ids.push_back(target->track_id);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|