fix scoring algorithim, to use max_alarm_size when specified instead of the size of the zone. (#2186)
This commit is contained in:
parent
8742388acd
commit
d97eea886a
|
@ -252,7 +252,11 @@ bool Zone::CheckAlarms(const Image *delta_image) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (max_alarm_pixels != 0)
|
||||||
|
score = (100*alarm_pixels)/max_alarm_pixels;
|
||||||
|
else
|
||||||
score = (100*alarm_pixels)/polygon.Area();
|
score = (100*alarm_pixels)/polygon.Area();
|
||||||
|
|
||||||
if ( score < 1 )
|
if ( score < 1 )
|
||||||
score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */
|
score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */
|
||||||
Debug(5, "Current score is %d", score);
|
Debug(5, "Current score is %d", score);
|
||||||
|
@ -328,7 +332,11 @@ bool Zone::CheckAlarms(const Image *delta_image) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
score = (100*alarm_filter_pixels)/(polygon.Area());
|
if (max_filter_pixels != 0)
|
||||||
|
score = (100*alarm_filter_pixels)/(max_filter_pixels);
|
||||||
|
else
|
||||||
|
score = (100*alarm_filter_pixels)/polygon.Area();
|
||||||
|
|
||||||
if ( score < 1 )
|
if ( score < 1 )
|
||||||
score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */
|
score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */
|
||||||
Debug(5, "Current score is %d", score);
|
Debug(5, "Current score is %d", score);
|
||||||
|
@ -590,7 +598,11 @@ bool Zone::CheckAlarms(const Image *delta_image) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
score = (100*alarm_blob_pixels)/(polygon.Area());
|
if (max_blob_pixels != 0)
|
||||||
|
score = (100*alarm_blob_pixels)/(max_blob_pixels);
|
||||||
|
else
|
||||||
|
score = (100*alarm_blob_pixels)/polygon.Area();
|
||||||
|
|
||||||
if ( score < 1 )
|
if ( score < 1 )
|
||||||
score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */
|
score = 1; /* Fix for score of 0 when frame meets thresholds but alarmed area is not big enough */
|
||||||
Debug(5, "Current score is %d", score);
|
Debug(5, "Current score is %d", score);
|
||||||
|
|
Loading…
Reference in New Issue