|
|
|
@ -900,8 +900,8 @@ void set_counter_zone() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int g_last_hour_for_counter_mail = -1; |
|
|
|
int g_last_hour_for_counter_mail = -1; |
|
|
|
void run_counter_mail(char * mail_content,int mail_content_size) { |
|
|
|
void run_counter_mail(char * mail_content,int mail_content_size, char* image_buff_base64, int image_buff_size_base64) { |
|
|
|
if (strcmp(SystemSetting.send_counter_at_specific_hour, "NULL") != 0 && strlen(SystemSetting.send_counter_at_specific_hour) >= 1) |
|
|
|
if (strcmp(SystemSetting.send_counter_at_specific_hour, "NULL") != 0 && strlen(SystemSetting.send_counter_at_specific_hour) >= 1 && mail_content_size >= 1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
time_t now_time = g_osdSysTimeStamp; |
|
|
|
time_t now_time = g_osdSysTimeStamp; |
|
|
|
if (now_time < 1000000000) { |
|
|
|
if (now_time < 1000000000) { |
|
|
|
@ -918,10 +918,18 @@ void run_counter_mail(char * mail_content,int mail_content_size) { |
|
|
|
if ((QueueSize(_POST_NOTIFICATION) < MAX_QUEUE_SIZE && QueueSize(_POST_NOTIFICATION) >= 0)) |
|
|
|
if ((QueueSize(_POST_NOTIFICATION) < MAX_QUEUE_SIZE && QueueSize(_POST_NOTIFICATION) >= 0)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QueueInfo q_info = { 0 }; |
|
|
|
QueueInfo q_info = { 0 }; |
|
|
|
q_info.image_buff_size = 0; |
|
|
|
|
|
|
|
|
|
|
|
if (image_buff_size_base64 >= 1) { |
|
|
|
|
|
|
|
memcpy(q_info.image_buff, image_buff_base64, image_buff_size_base64); |
|
|
|
|
|
|
|
q_info.image_buff_size = image_buff_size_base64; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
q_info.image_buff_size = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
memcpy(q_info.content, mail_content, mail_content_size); |
|
|
|
memcpy(q_info.content, mail_content, mail_content_size); |
|
|
|
q_info.content[mail_content_size] = '\0'; |
|
|
|
q_info.content[mail_content_size] = '\0'; |
|
|
|
|
|
|
|
//printf("\n------q_info.content:%s\n", q_info.content);
|
|
|
|
|
|
|
|
|
|
|
|
strcpy(q_info.post_url, "post_to_mail"); |
|
|
|
strcpy(q_info.post_url, "post_to_mail"); |
|
|
|
|
|
|
|
|
|
|
|
@ -9830,6 +9838,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|name|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
@ -9854,6 +9870,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|confidence|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -9884,7 +9908,15 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
}
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|left_x|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
@ -9915,6 +9947,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|top_y|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
@ -9944,7 +9984,15 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
}
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|width|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
@ -9975,6 +10023,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|height|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
@ -9999,6 +10055,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|center_x|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
@ -10023,6 +10087,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|center_y|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
char msg_center_speed[35] = { 0 }; |
|
|
|
char msg_center_speed[35] = { 0 }; |
|
|
|
@ -10060,6 +10132,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|center_speed|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
@ -10090,6 +10170,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|center_direction|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
@ -10120,6 +10208,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|center_stability|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
@ -10144,6 +10240,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|obj_tracking_id|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
@ -10168,6 +10272,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|obj_dwell_time|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL) { |
|
|
|
@ -10192,6 +10304,14 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|class_id|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifdef GY_OS_AMBA |
|
|
|
#ifdef GY_OS_AMBA |
|
|
|
@ -10250,7 +10370,15 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
}
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|color|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -10270,6 +10398,15 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
replacement_t = StrReplace(replacement, "<|plate|>", g_last_token_plate); |
|
|
|
replacement_t = StrReplace(replacement, "<|plate|>", g_last_token_plate); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|plate|>", ""); |
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
if (replacement != NULL) { |
|
|
|
free(replacement); |
|
|
|
free(replacement); |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
@ -10292,6 +10429,15 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
replacement_t = StrReplace(replacement, "<|country|>", g_last_token_country); |
|
|
|
replacement_t = StrReplace(replacement, "<|country|>", g_last_token_country); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|country|>", ""); |
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
if (replacement != NULL) { |
|
|
|
free(replacement); |
|
|
|
free(replacement); |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
@ -10314,6 +10460,15 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
replacement_t = StrReplace(replacement, "<|area|>", g_last_token_area); |
|
|
|
replacement_t = StrReplace(replacement, "<|area|>", g_last_token_area); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|area|>", ""); |
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
if (replacement != NULL) { |
|
|
|
free(replacement); |
|
|
|
free(replacement); |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
@ -10336,6 +10491,15 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
replacement_t = StrReplace(replacement, "<|plate_list|>", g_last_token_plate_list); |
|
|
|
replacement_t = StrReplace(replacement, "<|plate_list|>", g_last_token_plate_list); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|plate_list|>", ""); |
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
if (replacement != NULL) { |
|
|
|
free(replacement); |
|
|
|
free(replacement); |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
@ -10358,6 +10522,15 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
replacement_t = StrReplace(replacement, "<|logo|>", g_last_token_logo); |
|
|
|
replacement_t = StrReplace(replacement, "<|logo|>", g_last_token_logo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|logo|>", ""); |
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
if (replacement != NULL) { |
|
|
|
free(replacement); |
|
|
|
free(replacement); |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
@ -10408,6 +10581,15 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
replacement_t = StrReplace(replacement, "<|behavior_id|>", g_last_token_behavior_id); |
|
|
|
replacement_t = StrReplace(replacement, "<|behavior_id|>", g_last_token_behavior_id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|behavior_id|>", ""); |
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
if (replacement != NULL) { |
|
|
|
free(replacement); |
|
|
|
free(replacement); |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
@ -10431,6 +10613,15 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
replacement_t = StrReplace(replacement, "<|zone_id|>", g_last_token_zone_id); |
|
|
|
replacement_t = StrReplace(replacement, "<|zone_id|>", g_last_token_zone_id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|zone_id|>", ""); |
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
if (replacement != NULL) { |
|
|
|
free(replacement); |
|
|
|
free(replacement); |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
@ -10526,7 +10717,16 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
}
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|behavior_name|>", ""); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL && pNext->obj_tracking_id_idx >= 0) { |
|
|
|
if (detection_zone_idx >= 0 && trigger_idx >= 0 && pNext != NULL && pNext->obj_tracking_id_idx >= 0) { |
|
|
|
@ -10543,6 +10743,15 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
if (strcmp(SystemSetting.enable_display_OSD, "Yes") == 0 /*&& strcmp(SystemSetting.enable_cloud, "Yes") == 0*/) { |
|
|
|
replacement_t = StrReplace(replacement, "<|linked_plate|>", g_last_token_linked_plate); |
|
|
|
replacement_t = StrReplace(replacement, "<|linked_plate|>", g_last_token_linked_plate); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|linked_plate|>", ""); |
|
|
|
|
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
if (replacement != NULL) { |
|
|
|
free(replacement); |
|
|
|
free(replacement); |
|
|
|
replacement = NULL; |
|
|
|
replacement = NULL; |
|
|
|
@ -10641,7 +10850,38 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef GY_OS_V_SERIES |
|
|
|
#ifdef GY_OS_V_SERIES |
|
|
|
|
|
|
|
for (int index_counter = 0; index_counter < MAX_EVENT_COUNTERS; index_counter++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
char temp_label[30] = { 0 }; |
|
|
|
|
|
|
|
sprintf(temp_label, "<|counter%02d_count|>", index_counter + 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, temp_label, ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char temp_label_dwell[30] = { 0 }; |
|
|
|
|
|
|
|
sprintf(temp_label_dwell, "<|counter%02d_dwell|>", index_counter + 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, temp_label_dwell, ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char temp_label_dwell_unit[50] = { 0 }; |
|
|
|
|
|
|
|
sprintf(temp_label_dwell_unit, "<|counter%02d_dwell_unit|>", index_counter + 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, temp_label_dwell_unit, ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
#else |
|
|
|
#else |
|
|
|
for (int index_counter = 0; index_counter < MAX_EVENT_COUNTERS; index_counter++) |
|
|
|
for (int index_counter = 0; index_counter < MAX_EVENT_COUNTERS; index_counter++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -10873,6 +11113,92 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|space_id|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|space_zone|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|space_status|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|space_time_t|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|space_YYYY|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|space_MM|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|space_DD|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|space_GMThh|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|space_hh|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|space_mm|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|space_ss|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|difftime|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (enable_base64_image == 1) { |
|
|
|
if (enable_base64_image == 1) { |
|
|
|
|
|
|
|
|
|
|
|
@ -10911,8 +11237,68 @@ size_t ReplaceKeyWords(detection_pos* pNext, int space_zone,int space_id,char* I |
|
|
|
} |
|
|
|
} |
|
|
|
replacement = replacement_t; |
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|cropped_size|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|cropped_image|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|cropped_size|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|cropped_image|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|snap_size|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|snap_image|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|cropped_size|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replacement_t = StrReplace(replacement, "<|cropped_image|>", ""); |
|
|
|
|
|
|
|
if (replacement != NULL) { |
|
|
|
|
|
|
|
free(replacement); |
|
|
|
|
|
|
|
replacement = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
replacement = replacement_t; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
strcpy(OutputString, replacement); |
|
|
|
strcpy(OutputString, replacement); |
|
|
|
if (replacement != NULL) { |
|
|
|
if (replacement != NULL) { |
|
|
|
@ -16228,10 +16614,10 @@ void update_iou_table(detection_pos* PosInfo, int total_element_size, int tracki |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
if (!(strcmp(pNext->name, "object") == 0 && pNext->number_row == 1)) { |
|
|
|
if (!(strcmp(pNext->name, "object") == 0 && pNext->number_row == 1)) { |
|
|
|
int deltaX = abs((pNext->left_x + pNext->width / 2) - (g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].left_x + g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].width / 2)); |
|
|
|
int deltaX = abs((pNext->left_x + pNext->width / 2) - (g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].left_x + g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].width / 2)); |
|
|
|
int deltaY = abs((pNext->top_y + pNext->height / 2) - (g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].top_y + g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].height / 2)); |
|
|
|
int deltaY = abs((pNext->top_y + pNext->height / 2) - (g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].top_y + g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].height / 2)); |
|
|
|
|
|
|
|
|
|
|
|
int deltaWidth = abs(pNext->width - g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].width); |
|
|
|
int deltaWidth = abs(pNext->width - g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].width); |
|
|
|
int deltaHeight = abs(pNext->height - g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].height); |
|
|
|
int deltaHeight = abs(pNext->height - g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].height); |
|
|
|
|
|
|
|
|
|
|
|
int threshold_3 = 25; |
|
|
|
int threshold_3 = 25; |
|
|
|
@ -16255,10 +16641,10 @@ void update_iou_table(detection_pos* PosInfo, int total_element_size, int tracki |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
if (!(strcmp(pNext->name, "object") == 0 && pNext->number_row == 1)) { |
|
|
|
if (!(strcmp(pNext->name, "object") == 0 && pNext->number_row == 1)) { |
|
|
|
int deltaX = abs((pNext->left_x + pNext->width / 2) - (g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].left_x + g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].width / 2)); |
|
|
|
int deltaX = abs((pNext->left_x + pNext->width / 2) - (g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].left_x + g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].width / 2)); |
|
|
|
int deltaY = abs((pNext->top_y + pNext->height / 2) - (g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].top_y + g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].height / 2)); |
|
|
|
int deltaY = abs((pNext->top_y + pNext->height / 2) - (g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].top_y + g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].height / 2)); |
|
|
|
|
|
|
|
|
|
|
|
int deltaWidth = abs(pNext->width - g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].width); |
|
|
|
int deltaWidth = abs(pNext->width - g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].width); |
|
|
|
int deltaHeight = abs(pNext->height - g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].height); |
|
|
|
int deltaHeight = abs(pNext->height - g_TrackingRecords[tracking_channel_idx][i].prev_detections[det_count - 1].height); |
|
|
|
|
|
|
|
|
|
|
|
int threshold_3 = 25; |
|
|
|
int threshold_3 = 25; |
|
|
|
@ -16715,11 +17101,11 @@ void update_vote_table(detection_pos* PosInfo, int total_element_size, int track |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (det_count >= 1) { |
|
|
|
if (det_count >= 1) { |
|
|
|
int deltaX = abs((pNext->left_x + pNext->width / 2) - (g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].left_x + g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].width / 2)); |
|
|
|
int deltaX = abs((pNext->left_x + pNext->width / 2) - (g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].left_x + g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].width / 2)); |
|
|
|
int deltaY = abs((pNext->top_y + pNext->height / 2) - (g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].top_y + g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].height / 2)); |
|
|
|
int deltaY = abs((pNext->top_y + pNext->height / 2) - (g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].top_y + g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].height / 2)); |
|
|
|
|
|
|
|
|
|
|
|
//檢查長度和寬度是否在一定範圍內
|
|
|
|
//檢查長度和寬度是否在一定範圍內
|
|
|
|
int deltaWidth = abs(pNext->width - g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].width); |
|
|
|
int deltaWidth = abs(pNext->width - g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].width); |
|
|
|
int deltaHeight = abs(pNext->height - g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].height); |
|
|
|
int deltaHeight = abs(pNext->height - g_TrackingRecords[tracking_channel_idx][k].prev_detections[det_count - 1].height); |
|
|
|
|
|
|
|
|
|
|
|
int threshold = 5; |
|
|
|
int threshold = 5; |
|
|
|
@ -22739,28 +23125,25 @@ void move_file() { |
|
|
|
void *start_run_python_thread(void* pythonpath) {
|
|
|
|
void *start_run_python_thread(void* pythonpath) {
|
|
|
|
pthread_detach(pthread_self());
|
|
|
|
pthread_detach(pthread_self());
|
|
|
|
setPthreadName("run_python"); |
|
|
|
setPthreadName("run_python"); |
|
|
|
|
|
|
|
|
|
|
|
while (1) |
|
|
|
while (bHttpServerThreadStart) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (AI_fps >= 1)
|
|
|
|
if (AI_fps >= 1) { |
|
|
|
{ |
|
|
|
|
|
|
|
// 抓取 python 檔案
|
|
|
|
const char *prefix = "lifile_liname="; |
|
|
|
if (strstr(SystemSetting.enable_python_file, ".py") != NULL)
|
|
|
|
char pythonfile[256] = { 0 }; |
|
|
|
{ |
|
|
|
snprintf(pythonfile, sizeof(pythonfile), "%s%s", prefix, SystemSetting.enable_python_file); |
|
|
|
const char *prefix = "lifile_liname="; |
|
|
|
runPython(pythonfile); |
|
|
|
char pythonfile[256] = { 0 }; |
|
|
|
break; |
|
|
|
snprintf(pythonfile, sizeof(pythonfile), "%s%s", prefix, SystemSetting.enable_python_file); |
|
|
|
|
|
|
|
runPython(pythonfile); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
printf("Wait AI_fps..."); |
|
|
|
//printf("Wait AI_fps...");
|
|
|
|
sleep(1); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
usSleep(1000000); |
|
|
|
} |
|
|
|
} |
|
|
|
pthread_exit(NULL); |
|
|
|
|
|
|
|
|
|
|
|
pthread_exit(NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
@ -23075,17 +23458,9 @@ void run_server(int argc, char **argv) |
|
|
|
//PNS_Query_Service_Status(returned_msg);
|
|
|
|
//PNS_Query_Service_Status(returned_msg);
|
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//**半OK記憶體洩漏
|
|
|
|
//**半OK記憶體洩漏
|
|
|
|
//output.log 138,240byte ->產生330個記憶體洩漏 output.log增長幅度顯著變比較慢
|
|
|
|
//output.log 138,240byte ->產生330個記憶體洩漏 output.log增長幅度顯著變比較慢
|
|
|
|
//get_current_events_json_data 會記憶體洩漏,但是不常進去。
|
|
|
|
//get_current_events_json_data 會記憶體洩漏,但是不常進去。
|
|
|
|
g_IsPTZDevice = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
//init CGI CMD time
|
|
|
|
//init CGI CMD time
|
|
|
|
@ -25973,14 +26348,8 @@ void run_server(int argc, char **argv) |
|
|
|
} |
|
|
|
} |
|
|
|
if (enable_python_file) |
|
|
|
if (enable_python_file) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (strstr(enable_python_file->valuestring, ".py") ==
|
|
|
|
strcpy(SystemSetting.enable_python_file, enable_python_file->valuestring); |
|
|
|
enable_python_file->valuestring + strlen(enable_python_file->valuestring) - 3) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
strcpy(SystemSetting.enable_python_file, enable_python_file->valuestring); |
|
|
|
|
|
|
|
pthread_create(&runpython_thread, NULL, start_run_python_thread, (void*)configPATH); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
printf("File is not a Python file.\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
strcpy(SystemSetting.enable_python_file, "No python running."); |
|
|
|
strcpy(SystemSetting.enable_python_file, "No python running."); |
|
|
|
@ -31815,10 +32184,10 @@ void file_management() { |
|
|
|
#define COUNTER_FILE "/emmc/plugin/Aida_data/counters.dat" |
|
|
|
#define COUNTER_FILE "/emmc/plugin/Aida_data/counters.dat" |
|
|
|
int protected_counters = 0; |
|
|
|
int protected_counters = 0; |
|
|
|
int g_last_counters[MAX_EVENT_COUNTERS] = { 0 }; |
|
|
|
int g_last_counters[MAX_EVENT_COUNTERS] = { 0 }; |
|
|
|
void loadCounters() { |
|
|
|
void loadCounters() { |
|
|
|
#ifdef GY_OS_V_SERIES |
|
|
|
#ifdef GY_OS_V_SERIES |
|
|
|
|
|
|
|
|
|
|
|
#else |
|
|
|
#else |
|
|
|
if (((featureType & FEATURE_TRAF_DET) == FEATURE_TRAF_DET && (featureType2 & FEATURE_AICAP) == FEATURE_AICAP) || |
|
|
|
if (((featureType & FEATURE_TRAF_DET) == FEATURE_TRAF_DET && (featureType2 & FEATURE_AICAP) == FEATURE_AICAP) || |
|
|
|
((featureType & FEATURE_TRAF_DET) == FEATURE_TRAF_DET && (featureType2 & FEATURE_AISPORTS) == FEATURE_AISPORTS && strcmp(WeightFileModeName, "mod002") == 0) || |
|
|
|
((featureType & FEATURE_TRAF_DET) == FEATURE_TRAF_DET && (featureType2 & FEATURE_AISPORTS) == FEATURE_AISPORTS && strcmp(WeightFileModeName, "mod002") == 0) || |
|
|
|
((featureType & FEATURE_HUM_DET) == FEATURE_HUM_DET && (featureType2 & FEATURE_AIHELM) == FEATURE_AIHELM) || |
|
|
|
((featureType & FEATURE_HUM_DET) == FEATURE_HUM_DET && (featureType2 & FEATURE_AIHELM) == FEATURE_AIHELM) || |
|
|
|
@ -31827,49 +32196,49 @@ void loadCounters() { |
|
|
|
#ifdef GY_OS_NOVA |
|
|
|
#ifdef GY_OS_NOVA |
|
|
|
IsANPRCategory(featureType) || |
|
|
|
IsANPRCategory(featureType) || |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
g_IsCustomWeight == 1) |
|
|
|
g_IsCustomWeight == 1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (protected_counters == 0) { |
|
|
|
if (protected_counters == 0) { |
|
|
|
protected_counters = 1; |
|
|
|
protected_counters = 1; |
|
|
|
FILE *file = fopen(COUNTER_FILE, "r+"); // 以二進位讀取方式開啟檔案
|
|
|
|
FILE *file = fopen(COUNTER_FILE, "r+"); // 以二進位讀取方式開啟檔案
|
|
|
|
int counters[MAX_EVENT_COUNTERS] = { 0 }; |
|
|
|
int counters[MAX_EVENT_COUNTERS] = { 0 }; |
|
|
|
|
|
|
|
|
|
|
|
if (file) { |
|
|
|
if (file) { |
|
|
|
fread(counters, sizeof(int), MAX_EVENT_COUNTERS, file); // 從檔案中讀取計數器值
|
|
|
|
fread(counters, sizeof(int), MAX_EVENT_COUNTERS, file); // 從檔案中讀取計數器值
|
|
|
|
fclose(file); |
|
|
|
fclose(file); |
|
|
|
|
|
|
|
|
|
|
|
for (int index_counter = 0; index_counter < MAX_EVENT_COUNTERS; index_counter++) |
|
|
|
for (int index_counter = 0; index_counter < MAX_EVENT_COUNTERS; index_counter++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
eventCounterList[index_counter].counter_count = counters[index_counter]; |
|
|
|
eventCounterList[index_counter].counter_count = counters[index_counter]; |
|
|
|
g_last_counters[index_counter] = counters[index_counter]; |
|
|
|
g_last_counters[index_counter] = counters[index_counter]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
for (int index_counter = 0; index_counter < MAX_EVENT_COUNTERS; index_counter++) |
|
|
|
for (int index_counter = 0; index_counter < MAX_EVENT_COUNTERS; index_counter++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
counters[index_counter] = eventCounterList[index_counter].counter_count; |
|
|
|
counters[index_counter] = eventCounterList[index_counter].counter_count; |
|
|
|
g_last_counters[index_counter] = counters[index_counter]; |
|
|
|
g_last_counters[index_counter] = counters[index_counter]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
file = fopen(COUNTER_FILE, "w+"); // 以二進位寫入方式開啟檔案
|
|
|
|
file = fopen(COUNTER_FILE, "w+"); // 以二進位寫入方式開啟檔案
|
|
|
|
if (file) { |
|
|
|
if (file) { |
|
|
|
fwrite(counters, sizeof(int), MAX_EVENT_COUNTERS, file); // 將計數器值寫入檔案
|
|
|
|
fwrite(counters, sizeof(int), MAX_EVENT_COUNTERS, file); // 將計數器值寫入檔案
|
|
|
|
fclose(file); |
|
|
|
fclose(file); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
printf("\nCOUNTER FILE error.#2\n"); |
|
|
|
printf("\nCOUNTER FILE error.#2\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
protected_counters = 0; |
|
|
|
protected_counters = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void saveCounters() { |
|
|
|
void saveCounters() { |
|
|
|
#ifdef GY_OS_V_SERIES |
|
|
|
#ifdef GY_OS_V_SERIES |
|
|
|
|
|
|
|
|
|
|
|
#else |
|
|
|
#else |
|
|
|
if (((featureType & FEATURE_TRAF_DET) == FEATURE_TRAF_DET && (featureType2 & FEATURE_AICAP) == FEATURE_AICAP) || |
|
|
|
if (((featureType & FEATURE_TRAF_DET) == FEATURE_TRAF_DET && (featureType2 & FEATURE_AICAP) == FEATURE_AICAP) || |
|
|
|
((featureType & FEATURE_TRAF_DET) == FEATURE_TRAF_DET && (featureType2 & FEATURE_AISPORTS) == FEATURE_AISPORTS && strcmp(WeightFileModeName, "mod002") == 0) || |
|
|
|
((featureType & FEATURE_TRAF_DET) == FEATURE_TRAF_DET && (featureType2 & FEATURE_AISPORTS) == FEATURE_AISPORTS && strcmp(WeightFileModeName, "mod002") == 0) || |
|
|
|
((featureType & FEATURE_HUM_DET) == FEATURE_HUM_DET && (featureType2 & FEATURE_AIHELM) == FEATURE_AIHELM) || |
|
|
|
((featureType & FEATURE_HUM_DET) == FEATURE_HUM_DET && (featureType2 & FEATURE_AIHELM) == FEATURE_AIHELM) || |
|
|
|
@ -31878,36 +32247,36 @@ void saveCounters() { |
|
|
|
#ifdef GY_OS_NOVA |
|
|
|
#ifdef GY_OS_NOVA |
|
|
|
IsANPRCategory(featureType) || |
|
|
|
IsANPRCategory(featureType) || |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
g_IsCustomWeight == 1) |
|
|
|
g_IsCustomWeight == 1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (protected_counters == 0) { |
|
|
|
if (protected_counters == 0) { |
|
|
|
protected_counters = 1; |
|
|
|
protected_counters = 1; |
|
|
|
int counters[MAX_EVENT_COUNTERS] = { 0 }; |
|
|
|
int counters[MAX_EVENT_COUNTERS] = { 0 }; |
|
|
|
int check_if_difference = 0; |
|
|
|
int check_if_difference = 0; |
|
|
|
|
|
|
|
|
|
|
|
for (int index_counter = 0; index_counter < MAX_EVENT_COUNTERS; index_counter++) |
|
|
|
for (int index_counter = 0; index_counter < MAX_EVENT_COUNTERS; index_counter++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
counters[index_counter] = eventCounterList[index_counter].counter_count; |
|
|
|
counters[index_counter] = eventCounterList[index_counter].counter_count; |
|
|
|
if (counters[index_counter] != g_last_counters[index_counter]) { |
|
|
|
if (counters[index_counter] != g_last_counters[index_counter]) { |
|
|
|
check_if_difference = 1; |
|
|
|
check_if_difference = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
g_last_counters[index_counter] = counters[index_counter]; |
|
|
|
g_last_counters[index_counter] = counters[index_counter]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (check_if_difference == 1) { |
|
|
|
if (check_if_difference == 1) { |
|
|
|
FILE *file = fopen(COUNTER_FILE, "wb"); // 以二進位寫入方式開啟檔案
|
|
|
|
FILE *file = fopen(COUNTER_FILE, "wb"); // 以二進位寫入方式開啟檔案
|
|
|
|
if (file) { |
|
|
|
if (file) { |
|
|
|
fwrite(counters, sizeof(int), MAX_EVENT_COUNTERS, file); // 將計數器值寫入檔案
|
|
|
|
fwrite(counters, sizeof(int), MAX_EVENT_COUNTERS, file); // 將計數器值寫入檔案
|
|
|
|
fclose(file); |
|
|
|
fclose(file); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
printf("\nCOUNTER FILE error.\n"); |
|
|
|
printf("\nCOUNTER FILE error.\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
protected_counters = 0; |
|
|
|
protected_counters = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifdef GY_OS_NOVA |
|
|
|
#ifdef GY_OS_NOVA |
|
|
|
|