alarms and zones

Forum for questions and support relating to the 1.29.x releases only.
Locked
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

alarms and zones

Post by alabamatoy »

Very, very frustrated. After a month or so of working with ZM, I am of the opinion that the motion detection is worthless. I get alarms for every bug that flies by, every lightning bug (if you aren't from SE US, google it), every flash of summer lightning, and every time the camera flips from day to IR or back again, but people and cars can wander across the FOV and no alarms. I can stand in the FOV and jump up and down and wave my arms and nothing, but if the wind blows and tree leaves move, I get an alarm.

I need some help. Is there a guide to setting up and tuning the alarm zones?
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

Re: alarms and zones

Post by alabamatoy »

So nobody is willing to help the newb, I'll try to answer my own question in hopes that perhaps it helps someone else or improves Zoneminder a bit.

Part of what is so confusing to me is in the zone configuration (click on the zone, configure the outline, then set all the parameters) has settings that appear untraceable to the statistics for an alarmed frame. I see settings in the config page for

Code: Select all

Min/Max Pixel Threshold (0-255) 		
Filter Width/Height (pixels) 		
Zone Area 	
Min/Max Alarmed Area 		
Min/Max Filtered Area 		
Min/Max Blob Area 		
Min/Max Blobs 		
Overload Frame Ignore Count 	
Extend Alarm Frame Count
but in the statistics for an alarm frame page (click on an alarm, choose frames, pick an alarm frame, the click on statistics), what I see is:

Code: Select all

Pixel Diff
Alarm Px
Filter Px
Blob Px
Blobs
Blob Sizes
Alarm Limits
Score
Why aren't these exactly the same? IOW, how does "min/max alarmed area" relate to "alarm px"? How does "blob area" relate to "blob size"? Perhaps my confusion stems from these not being traceable in my simple mind from what I can configure to what I see being the result of the test for alarm condition?

I would expect to able to tune the thresholds for the very things that are displayed in the alarm frame. Why not? Am I way off base here?

PS - I am reading these two guides:
http://zoneminder.readthedocs.io/en/sta ... ezone.html
https://wiki.zoneminder.com/Understandi ... or_Dummies.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: alarms and zones

Post by bbunge »

Until someone with more "zone" knowledge chimes in... I usually leave the zone settings to default and adjust the zone area to capture specific motion as in a walkway to a door or to omit motion as cars on a street. Outdoor cameras do best for me in mocord. Indoor are running modect (mostly). Some critical areas, such as a camera watching a safe, are mocord. Set you frame rate down to 5 FPS and lower the resolution (640x480) to see if you get better results. You really do not need high frame rates and resolution to get good captures. We've caught crooks with 320x240 @ 3 FPS.

bb
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: alarms and zones

Post by SteveGilvarry »

In the interest of full disclosure I normally run 24x7 Record and not motion detection. So I didn't jump in to assist you but I have run in the past.
Please feel free to turn on motion detection in cheap IP camera for true definition of worthless. Motion detection is based purely around change in a picture, so light changes result in the entire image changing. That is a big change, and you need to use the max areas to filter them out, or you can use a very small area of the frame that would never receive motion as an preclusion zone to stop the alarm.

Bugs and spiders are a bitch to deal with, camera cannot tell difference between bug flying 2 inches away and a car driving up the driveway. They are both large changes in pixels in the image.

The statistics are pure data for the specific alarm, so they don't match. That could do with being fixed to report on % area when that is the zone definition I don't disagree.
For your example min/max alarmed area, it a percentage of the total pixels.
Example 720p image = 921600 pixels
Alarm Px = 20000
Means 20000/921600 x 100 = 2.17 Alarmed Area
But the easy way to think about it is for 720p 100,000 pixels is close enough to 10 percent of image. 1080p = 200000 pixels = 10%.

I will have to look up blob sizes to see what that is doing on the alarm frame stats
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

Re: alarms and zones

Post by alabamatoy »

SteveGilvarry wrote:In the interest of full disclosure I normally run 24x7 Record and not motion detection.
I understand, and that's where I have been with iSpy, and part of why I am working on xtion to Zoneminder.
SteveGilvarry wrote:Please feel free to turn on motion detection in cheap IP camera for true definition of worthless.
Yes, BTDT. Again, part of the reason I am here....because I wanted the ability to tune the detection.
SteveGilvarry wrote:The statistics are pure data for the specific alarm, so they don't match. That could do with being fixed to report on % area when that is the zone definition I don't disagree.
OK, so I am not *totally* lost in this. Thank you. So maybe I need to "put up" and offer some changes to address my own criticism....that's how this open source thing is supposed to work, right? :-)

Perhaps I can understand the PL enough to build an alternative output page for index.php?view=stats&eid=eventnumber&fid=framenumber that would be more traceable to the parameters one can tune/adjust in the zone configuration. This means I have to reverse engineer what the code is doing, and I dont know perl....should be a fun intellectual challenge for a rainy day, if ever we get one.

I want to see statistics that fall into line with the adjustments I can make, so if the adjustments are:

Code: Select all

Min/Max Pixel Threshold (0-255)       
Filter Width/Height (pixels)       
Zone Area    
Min/Max Alarmed Area       
Min/Max Filtered Area       
Min/Max Blob Area       
Min/Max Blobs       
Overload Frame Ignore Count    
Extend Alarm Frame Count
I would want to see a stats page which displays something like

Code: Select all

Pixel Threshold            
Alarmed Area       
Filtered Area       
Blob Area       
Blobs       
Overload Frame Ignore Count and Extend Alarm Frame Count dont make sense in the context of a single frame, right? So those should be displayed on the event frames page, not on the individual frame stats page, right?

Also, based on the user guide, there are some things being displayed which I think shouldnt be. For example, if one selects blob as the method, then filtered pixels and filtered area shouldn't event be shown on either the config page or the stats page since (according to the guide) they are effectively disabled. Am I right on that or wrong? If Im right, same thinking should be applied to the other two methods. Maybe instead of not displaying them, simply display "not used" so its clear to the newb like me.

This form of a stats page would allow the user to look at the stats and make substantive, effective adjustments to the zone config.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: alarms and zones

Post by rockedge »

I use external wireless X10 motion detectors that connect with a CM19a X10 transceiver connected via USB to a machine which triggers recording events with the correct camera(s) using zmTrigger.pl. Using the MS16A ActiveEye Motion Sensors has eliminated most of the motion detection problems and work equally well during the night or day light changes. Moths at night really a challenge with night vision cameras using ZoneMinder's built in motion detection and this is mostly fixed by using the dedicated external sensors. The CM19a communicates with a Python driver that is polled via scripts that send the proper event signals to ZoneMinder through zmTrigger.pl. This setup runs very reliably for me and hugely decreases the CPU loads on the server which runs ZM on a Puppy Linux OS.

This type of approach could of course be accomplished with other similar hardware and using the zmTrigger.pl script.
Fressikus
Posts: 13
Joined: Fri Jul 29, 2016 7:51 pm

Re: alarms and zones

Post by Fressikus »

I'm having similar problems with getting the motion detection to work 100%. I'm sure that it's just me not understanding the zone configuration correctly, so maybe somebody can offer some advice.

This is the image I am working with right now: Image

I've been continuously lowering the settings for Min Alarmed Area, Filtered Area etc. in hopes of getting the motion detection to be more sensitive. The image is usually very static like that. People walking by the path trigger okay, but I've just seen a black bird (good contrast) running straight across the image live and no alarm was triggered. Any ideas what might help with that?
loxodograph
Posts: 3
Joined: Sat Aug 06, 2016 9:59 am
Location: France

Re: alarms and zones

Post by loxodograph »

Hello,

Long-time lurker, now registered. :-)

@Fressikus: It is not easy to guess the size of targets in the zone. For example, in your screenshot, the paving blocks, as a percentage of the zone size are:
- right-hand side of zone: 0,29%
- bottom of zone: 0,69%

A 'blackbird-sized' area, around the centre of the large grass area is about 0,4% of the zone. Clearly, the blackbird should not have triggered an alarm set to minimum size 1%. ;-)

Once I realised that my targets were _much_ smaller than I imagined, I was able to improve my detection greatly. I used a free Java progam ImageJ[0] to import a frame, measure the size of my zone and the size of the intended target. This is easy – just draw polygons to represent each part and measure the area directly in pixels, then it's a simple calculation.

[0] http://imagej.net
Nick.
Fressikus
Posts: 13
Joined: Fri Jul 29, 2016 7:51 pm

Re: alarms and zones

Post by Fressikus »

loxodograph wrote:A 'blackbird-sized' area, around the centre of the large grass area is about 0,4% of the zone. Clearly, the blackbird should not have triggered an alarm set to minimum size 1%. ;-)
If you put it like that, that sounds very logical. However, can you even go in between 0% and 1%? Because as I've understood it, 0% would trigger on the slightest changes in the image, which is impractical when you're recording outdoors.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: alarms and zones

Post by knight-of-ni »

Fressikus wrote:
loxodograph wrote:A 'blackbird-sized' area, around the centre of the large grass area is about 0,4% of the zone. Clearly, the blackbird should not have triggered an alarm set to minimum size 1%. ;-)
If you put it like that, that sounds very logical. However, can you even go in between 0% and 1%? Because as I've understood it, 0% would trigger on the slightest changes in the image, which is impractical when you're recording outdoors.
This is exactly why I change units from percent to pixels in almost every case. Percent might be easier, but the amount of precision sucks.

I haven't read all the posts in this forum, but a key tuning step seems to be missing in the discussion. Set your motion parameters to be very sensitive, so it picks up a lot more than what you want.

The next thing you should do is look at the statistics for you events. ZoneMinder will tell you exactly how many pixels it counted as motion. Turn on blob detection and ZoneMinder will even circle, in red, what it saw as motion. That will give you hard data so you aren't just guessing. For example, say you want to record on people, not squirrels. Find an event triggered by a squirrel, and look at how many pixels were triggered. Let's say it was 500. Now go back to your motion settings and change the minimum threshold to be a little greater than that. Then sit back and observe.

The tuning parameters are entirely dependant on the camera and the view, so there is no way for anyone to precisely tell someone else how to tune their cameras without seeing sample screenshots of the view and the motion statistics of relevant events.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Locked