Maximum score problem

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Maximum score problem

Post by lazyleopard »

There seems to be a limit (in the Events list window) of 255 as the maximum score for a frame. However the database itself seems quite happy to have a total score for a frame that's greater than 255 (which isn't too hard to get if there are several zones and they've all managed high scores - though the score for individual zones is limited to 100 (or 50 for inclusive, or 200 for exclusive)). If the score displayed in the Events list is "255" but the actual maximum score for the frame is greater than 255 then clicking on the "255" brings up a broken image, not the image of the frame concerned. It is possible to get to the frame concerned by using "next" from an earlier frame though.

(I had no maximum alarm, filtered or blob size limits set for any of the 4 active zones, and a light came on in the dark. Just about every pixel in the frame changed suddenly....)
Rick Hewett
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Post by lazyleopard »

I think there may also be something odd going on when blobs outside the limits are eliminated.

Code: Select all

Frame 12825-12
Zone Alarm Px Filter Px Blob Px Blobs  Blob Sizes    Alarm Limits
Main     4395      1741    1512     2   1482-1482 236,225-299,286
Note how there're two blobs, but the blob size limits are both the same. It's strange, but if a little arithmetic is done, the "missing" blob's size would come out at 30, which is way below my minimum blob size of 100. Here's an even odder report:

Code: Select all

Frame 12822-10
Zone Alarm Px Filter Px Blob Px Blobs  Blob Sizes    Alarm Limits
Main    19658      2654      35     1         0-0    39,152-83,248
There's only one blob, no limits reported, and the total blob size is below the limit. I think I'll add some diagnostic output to zm_zone.cpp and see what it's doing....
Rick Hewett
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Hmm, I'll take a look at this. I can't exactly remember why the maximum score for an alarm was set to 255. I think it was for a very good reason, but what that reason was I can't recall (yet), presumably an unsigned integer somewhere I couldn't change.

The stats for events may not be as strange as they initially look. I suspect that the blob_count is not being decremented. So in your first example, there were originally two blobs but the 30 pixel one got eliminated, likewise in the second example the only blob was 35 pixels and so was eliminated also. I assume in this case that this frame is a non-alarm frame by the way. I don't know whyt he count isn't being decremented though.

Phil,
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Post by lazyleopard »

I doubt I'll be hitting those high scores again soon, as I cut back from four zones to one. (The score in zm_zone is an unsigned int, but it's capped at 100 anyway.)
Rick Hewett
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Post by lazyleopard »

There's one place in zm_zone.cpp where this loop construct is used:

Code: Select all

for ( int i = WHITE; i > 0; i-- )
and two others where this is used instead:

Code: Select all

for ( int i = 1; i < WHITE; i++ )
This could be the cause of the out-by-one problem.
Rick Hewett
Locked