Motion - Feature Request 2007x 07x 03x 061451

Feature Request: motion detection on specific zones?

Description

Sorry if already discussed, but I couldnt find any reference. Many a times I dont want to check the whole area for motion, only specific zones. So support for motion analysis on specific zones shall be highly helpful.

-- SajithVk - 03 Jul 2007

Follow up

Comments

Motion does not support multiple zone like for example Zone managers does. But you can define a mask file which can have any shape or form and define which part of the image you do not included in the Motion detection.

You can also use the convertion specifiers to pass on coordinates for the detected Motion to an external script which then reacts depending on this data.

-- KennethLavrsen - 03 Jul 2007

Kenneth, we've been talking about that on IRC a while ago. I actually would like to have a simmilar feature as requested here. The problem with your suggested solution timing. To have such a feature in realtime, you would have to fire scripts with the location of motion with every frame or wait until the end of a movie or event. But then the information may be too old to the be still valid.

I'm still thinking about a simple feature that just fires a script once every event as soon as there is motion in a predefined area. The only issue with that is: How to define such an area? I could think of something really simple like dividing the picture into 9 equally sized areas and just name them 1 - 9. We could then have an option like 'area_detect 7' that fires a script 'on_area_detected' as soon as the center of motion is located somewhere inside that area. The reliability of that feature pretty much depends on the accuracy of the location algo obviously. (To be honest: I have a patch already that may be released when it is of common interrest.)

-- JoergWeber - 30 Sep 2007

How about allowing additional mask files to define the different areas? Like so:

mask_file_1 /home/username/motion/mymask1.pgm mask_file_2 /home/username/motion/mymask2.pgm mask_file_3 /home/username/motion/mymask3.pgm

Then allow different commands to be launched per mask:

on_event_start_mask_1 /home/username/motion/somecommand on_event_start_mask_2 /home/username/motion/someothercommand on_event_start_mask_3 /home/username/motion/yetanothercommand

The user could define the masks however they like, so they could be non-overlapping but that wouldn't be a requirement.

-DaveS (a new user of motion. Great job on this project by the way!)

-- DaSpears - 03 Oct 2007

Easier to read when these are on separate lines, as they should be in the config file:

mask_file_1 /home/username/motion/mymask1.pgm

mask_file_2 /home/username/motion/mymask2.pgm

mask_file_3 /home/username/motion/mymask3.pgm

on_event_start_mask_1 /home/username/motion/somecommand

on_event_start_mask_2 /home/username/motion/someothercommand

on_event_start_mask_3 /home/username/motion/yetanothercommand

-- DaSpears - 03 Oct 2007

Additional masks will definitely not be an option, because it will add a lot of additional CPU load. Motion doesn't want to imitate Zoneminder. The first goal of Motion is performance (supporting lots of cameras on a single machine) and reliability of the detection algorithms. What I am thinking of, is something really simple, but useful though.

-- JoergWeber - 03 Oct 2007

I have added the promised patch for the AreaDetect feature.

-- JoergWeber - 05 Nov 2007
Topic revision: r6 - 05 Nov 2007, JoergWeber
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.