Fine Tune Zone

Support and queries relating to all previous versions of ZoneMinder
Post Reply
jamescollings
Posts: 59
Joined: Wed Nov 22, 2006 11:26 am
Location: Bucks, UK

Fine Tune Zone

Post by jamescollings » Mon Nov 27, 2006 1:58 pm

I have zone stats on, but I just wonder "how" to fine tune my zones. I could use "trial and error", but since my zones are very sensative I have at least 200 events to help me work out the right settings.

I can see that a zone might be defined thus:
Alarm Check Method [Blobs]
Min/Max Pixel Threshold (0-255) [20] [ ]
Filter Width/Height (pixels) [3] [3]

Min/Max Alarmed Area [8] [ ]
Min/Max Filtered Area [6] [ ] Min/Max Blob Area [5] [ ]

Min/Max Blobs [1] [ ]


And that the stats for an alarmed frame might show this:
Zone [Zone1]
Pixel Diff [26]
Alarm Px [5954 (34%)]
Filter Px [4906 (28%)]
Blob Px [4858 (27%)]
Blobs [1]
Blob Sizes [3797 (21%)]
Alarm Limits [178,141-319,186 ]
Score [28]
I can drag out each alarm frame statistic by typing:
mysql> use zm;
mysql> select * from Stats;


So surely I should be able to identify:
Which areas on the image are causing the most false alarms
The correct threshold (assuming I know which are falsies and which are true events)

But only if I knew how to link the stats to the Zone definition... is this in a FAQ somewhere that I haven't found yet?

User avatar
zoneminder
Site Admin
Posts: 5220
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder » Mon Nov 27, 2006 2:42 pm

Zone [Zone1]

This is the zone that the stats relate to

Pixel Diff [26]

This is the average difference between the pixel values in the image and the reference image. This relates to Min/Max Pixel Threshold and can be useful to help tune those values.

Alarm Px [5954 (34%)]

The number of pixels in the zone whose difference were between your defined min/max pixel thresholds. If this is between your defined min/max alarmed pixels then go to next step.

Filter Px [4906 (28%)]

The same value after filtering with your defined filter. If this is between your defined min/max filtered pixels then go to next step. In this case you have had 1048 pixels filtered out because they were in groups less than 3x3 in size.

Blob Px [4858 (27%)]

The number of pixels that have been aggragated into blobs that are at least your min blob size and less than your max. In your case 48 pixels have been eliminated. You probably had one 48 pixel blob, but it may have been 1 x 18 + 2 x 15 etc.

Blobs [1]

The actual number of blobs that fit the blob size criterion.

Blob Sizes [3797 (21%)]

This gives the minimum and maximum blobs sizes. As you only have one it is both.

Alarm Limits [178,141-319,186 ]

This is the extent of the alarmed area (the blob above in your case) in image co-ordinate terms, x1,y1 - x2,y2

Score [28]


This is an arbitrary score that is intended only to have a way to quantitatively compare events to see which is more significant.

Hopefully that will help you understand the stats a bit more. If you have several zones then you may gets stats generated for each zone. It may be helpful to also switch on diagnostic images for a short period which will dump images at each stage of the process as it's often easier to understand visually. One day I'll find the time to write an article about all this with illustrations :?
Phil

jamescollings
Posts: 59
Joined: Wed Nov 22, 2006 11:26 am
Location: Bucks, UK

Post by jamescollings » Mon Nov 27, 2006 7:52 pm

:shock: gulp :shock:

I'll see if I can improve ANYTHING about my zones :?

jamescollings
Posts: 59
Joined: Wed Nov 22, 2006 11:26 am
Location: Bucks, UK

Post by jamescollings » Wed Nov 29, 2006 9:29 am

Just to close off my own thread..

I extracted everything from the Stats and Events tables, and loaded them into Excel.

Then I noted the Event-Ids of all of the "true" events (10) and "falsies" (200), and set about "Tuning".

First the PixelDiff Threshold, at least half of the "falsies" were cleared by upping the Minimum Pixel threshold count.

Then the AlarmPixels threshold did for all but a handfull of "falsies".

I couldn't tune the "filter" since I had no way of reprocessing the images with the "new" filter.

But by amending the BlobPixels threshold I stripped out the last "falsies".

In all it took 10 minutes.

Brilliant stuff!

User avatar
zoneminder
Site Admin
Posts: 5220
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder » Wed Nov 29, 2006 12:33 pm

Good. Bear in mind though that the pixel diff in the stats is just an average so it can be skewed by particularly 'different' areas which might not be typical. Thus you may want to revisit your settings after a short while to check.
Phil

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests