Motion Detection Not Working

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
ldp
Posts: 4
Joined: Thu May 13, 2021 9:04 pm

Motion Detection Not Working

Post by ldp »

Hi Everyone,

I've been trying to build a simple set up with ZoneMinder and an IP camera for a basic CCTV system at home. I have managed to get the camera properly configured and can record/stream video (Mocord at 2fps) from ZoneMinder but then motion detection doesn't seem to do anything. It's not that it's not sensitive enough or too sensitive, it seems to not react to anything, no matter how far I move the dials in the Zone configuration. I have been debugging this and looking for answers here and all over the web but nothing seems to be applicable.

Here is what I have tried:
1. Maxing out the zone sensitivity: Alarm Check Method=AlarmedPixels / Min Pixel Threshold=1 / Min Alarmed Area=1%. Still no alarms.
2. Enabled Debug logging. Nothing out of the ordinary comes up.
3. Enabled RECORD_DIAG_IMAGES both w/ and w/o RECORD_DIAG_IMAGES_FIFO. When I look at either the delta or the reference feeds, both look exactly like the live camera feed.
4. Looking at the timeline, the activity plot at the bottom is completely flat.
5. I'm not sure, but I don't think even the "FORCE ALARM" button is doing anything.

No matter what I try, I always have 0 alarm frames. Without alarm frames, I can't even use RECORD_EVENT_STATS to review the detection algorithm outputs. I still get the "Continuous" events, which give me a basic always running recording, but no alerts when something relevant happens.

I'm running ZM v1.34.26 on Ubuntu 18.04. Does anyone have any ideas for me to try out? Is there some option that needs to be enabled or some package to install that I'm missing?

Thanks!
alabamatoy
Posts: 349
Joined: Sun Jun 05, 2016 2:53 pm

Re: Motion Detection Not Working

Post by alabamatoy »

Is the monitor set for modect?
User avatar
Andyrh
Posts: 238
Joined: Sat Oct 28, 2017 3:55 am

Re: Motion Detection Not Working

Post by Andyrh »

The percent to make an alarm can be small. I have an 8mp camera, 1 of the zones is 81% of the frame, the alarm percent is 0.73%. That works out to be roughly adult sized. At 1% a person would never trip the alarm. I find it useful on hi-res cameras to change from percent to pixels.
It took time for me to get the setting correct, so I understand it can be frustrating.

What is the source type for the camera? I think I remember correctly that modect does not work on web site.

This works for an 8mp camera 15 feet off the ground:
Alarm Check Method
Blobs
Min/Max Pixel Threshold (0-255)
17
255
Filter Width/Height (pixels)
3
3
Zone Area
6739305
Min/Max Alarmed Area
49000
5058329
Min/Max Filtered Area
45000
5058329
Min/Max Blob Area
45000
Min/Max Blobs
1
Overload Frame Ignore Count
0
Extend Alarm Frame Count
0
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
ldp
Posts: 4
Joined: Thu May 13, 2021 9:04 pm

Re: Motion Detection Not Working

Post by ldp »

Hi alabamatoy, Andyrh,

Thank you for getting back to me!

To respond:
alabamatoy wrote: Fri May 14, 2021 5:29 pm Is the monitor set for modect?
I have been using mocord mode instead. As I understand it, this should basically just be modetect and record combined. What I want is to have "modetect" to notify me when something might be going on and to have "record" with the full video log in case I need it. I did also try with modetect and still no alarms.
Andyrh wrote: Fri May 14, 2021 6:15 pm The percent to make an alarm can be small. I have an 8mp camera, 1 of the zones is 81% of the frame, the alarm percent is 0.73%. That works out to be roughly adult sized. At 1% a person would never trip the alarm.
In my case its a 5mp camera, with 1 zone using 18.57% of the frame.
Andyrh wrote: Fri May 14, 2021 6:15 pm I find it useful on hi-res cameras to change from percent to pixels.
I hadn't thought of that. I tried maxing out the settings again: Alarm Check Method=AlarmedPixels / Min Pixel Threshold=1 / Min Alarmed Area=1. Still no alarms. What makes this difficult to debug is the total absence of alarm frames. If this were just too sensitive, I could look at some analysis data and re-calibrate after some trial and error, but as it stands I have nothing to analyze in the first place.
Andyrh wrote: Fri May 14, 2021 6:15 pm What is the source type for the camera? I think I remember correctly that modect does not work on web site.
Ffmpeg. I get an MP4 stream from the camera via RTSP. Could that be a problem?

Thank you both!
User avatar
Andyrh
Posts: 238
Joined: Sat Oct 28, 2017 3:55 am

Re: Motion Detection Not Working

Post by Andyrh »

I happen to have something similar, 5mp camera and 1 of the zones is about 12% of the frame. This will detect an adult at about 60 feet from 15 feet off the ground. I hope it gets you in the right direction.

And you may have guessed I have not figured out how to make the picture smaller...
Attachments
5mp.JPG
5mp.JPG (82.92 KiB) Viewed 3183 times
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
ldp
Posts: 4
Joined: Thu May 13, 2021 9:04 pm

Re: Motion Detection Not Working

Post by ldp »

Andyrh wrote: Sat May 15, 2021 3:08 am This will detect an adult at about 60 feet from 15 feet off the ground.
That would definitely be useful for me as well. I tried your configuration exactly. Given the similarity of the scenarios, the numbers were within allowable range. That said, I still get no alarm frames.

Is there a way to tell if the motion detection algorithm is running at all? I feel like whatever is wrong with my setup is something basic, like a missing package or some unfortunate option that disables the whole thing silently. Any thoughts?
ldp
Posts: 4
Joined: Thu May 13, 2021 9:04 pm

Re: Motion Detection Not Working

Post by ldp »

OK, I think I figured it out.

When I first configured the camera, it came with a default zone called "All" which covered everything. Rather than deleting that zone or editing it to select the region of interest, I marked it as "Inactive" (in case I needed it later for something) and then created a new "Active" one with the region I had in mind.

I just went over the documentation all over again and realized that "Inactive" does not mean disabled or ignored, it specifically prevents alarms from within that regions, which, being "all", disabled alarms for the entire camera.

I deleted the region and voilà, alarm frames are working. I might have some calibration ahead, but Andy's settings should be an excellent starting point. Hopefully this post will help the next clueless noob that comes around searching for this.

Thanks!
User avatar
Andyrh
Posts: 238
Joined: Sat Oct 28, 2017 3:55 am

Re: Motion Detection Not Working

Post by Andyrh »

That is the bad part of remote "support". Something you overlook (we all do it) would have been immediately spotted by someone else. Glad you found it.
Andy
o||||o

Ubuntu 22.04
ZM 1.36.33
E5-1650-v4 Xeon
16 GB RAM
6 cameras -> 54 FPS modect
Post Reply