Merge pull request #3180 from rabsym/rabsym_alert_to_alarm_frames

ALERT also mean warming up with alarm_frame_count value before return…
This commit is contained in:
Isaac Connor 2021-03-01 09:34:42 -05:00 committed by GitHub
commit b4c11b2fff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -332,6 +332,7 @@ Monitor::Monitor()
capture_delay(0),
alarm_capture_delay(0),
alarm_frame_count(0),
alert_to_alarm_frame_count(0),
fps_report_interval(0),
ref_blend_perc(0),
alarm_ref_blend_perc(0),
@ -2087,11 +2088,16 @@ bool Monitor::Analyse() {
shared_data->state = state = PREALARM;
}
} else if ( state == ALERT ) {
alert_to_alarm_frame_count--;
Info("%s: %03d - Alarmed frame while in alert state. Consecutive alarmed frames left to return to alarm state: %03d", name, analysis_image_count,alert_to_alarm_frame_count);
if (alert_to_alarm_frame_count == 0) {
Info("%s: %03d - Gone back into alarm state", name, analysis_image_count);
shared_data->state = state = ALARM;
}
}
last_alarm_count = analysis_image_count;
} else { // no score?
alert_to_alarm_frame_count = alarm_frame_count; // load same value configured for alarm_frame_count
if ( state == ALARM ) {
Info("%s: %03d - Gone into alert state", name, analysis_image_count);
shared_data->state = state = ALERT;

View File

@ -307,6 +307,8 @@ protected:
int capture_delay; // How long we wait between capture frames
int alarm_capture_delay; // How long we wait between capture frames when in alarm state
int alarm_frame_count; // How many alarm frames are required before an event is triggered
int alert_to_alarm_frame_count; // How many alarm frames (consecutive score frames) are required to return alarm from alert
// value for now is the same number configured in alarm_frame_count, maybe getting his own parameter some day
int fps_report_interval; // How many images should be captured/processed between reporting the current FPS
int ref_blend_perc; // Percentage of new image going into reference image.
int alarm_ref_blend_perc; // Percentage of new image going into reference image during alarm.