Day/night detection...

Forum for questions and support relating to the 1.30.x releases only.
Post Reply
Tantamount
Posts: 71
Joined: Wed Feb 03, 2016 7:51 am

Day/night detection...

Post by Tantamount » Thu Oct 27, 2016 6:53 am

So I've been using cron jobs to change from day to night mode in ZM. This works well up to a point -- it doesn't take into consideration things like rain, clouds, or fog and their effects on the brightness of the shot.

What I'm interested in doing instead is taking advantage of the camera's built-in ability to switch between day and night mode. In particular, I'm wondering if it is possible to detect when captured video goes from color to b/w and use that as the trigger to switch modes in ZM. Is there any place in the code that could get this information without much/any cpu cost?
2 LaView LV-PB932F4
4 ReoLink RLC-411
CentOS 7.4 - 8 Core Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz, 16 Gigs ram (Running under XenServer as a VM)
ZoneMinder Version : 1.31.1 Release : 1.320.20180206gitga177d8e9.el7.centos

Christo
Posts: 89
Joined: Wed Feb 01, 2012 9:48 pm

Re: Day/night detection...

Post by Christo » Fri Oct 28, 2016 7:29 am

Hello Tantamount,

With the use of imagemagick, it is possible to analyse the images on color within a camera stream. (identify -format %k)
Depending on the calculated color quantity, you'll know if the camera is disconnected.. bluemuted or low on IR etc.
see topic: Blue Mute detection

Furthermore ill suggest Sunwait for a more acurate switch to nighttime mode.
Because of changing weather conditions ill use a brightness calculation sequence.
see topic: Brightness Control

Success and regards,
Christo

Tantamount
Posts: 71
Joined: Wed Feb 03, 2016 7:51 am

Re: Day/night detection...

Post by Tantamount » Sat Oct 29, 2016 7:52 am

Cristo,

I think a more efficient method of detecting Blue Mute would be to get the current FPS of the monitor -- I've noticed that when a monitor is blue muted, the FPS increases tremendously. A check for FPS > 40 should work nicely. I'm just not sure how to get ZM to report the real-time FPS of the monitor -- the API doesn't seem to provide this information.

I've been using sunwait (that's how my cron jobs know when to change from day to night), however, it doesn't account for things like fog or dark clouds. If I understand what you're suggesting, I should continue to use sunwait so that I'm at least "close" to when the camera will toggle from color to b&W, and then start polling the monitors for images at some interval... then I just need to feed these images into imagemagik to tell me when the color mode has triggered.

How are you grabbing the real-time images from your monitors? Can this be done from the API?
2 LaView LV-PB932F4
4 ReoLink RLC-411
CentOS 7.4 - 8 Core Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz, 16 Gigs ram (Running under XenServer as a VM)
ZoneMinder Version : 1.31.1 Release : 1.320.20180206gitga177d8e9.el7.centos

Christo
Posts: 89
Joined: Wed Feb 01, 2012 9:48 pm

Re: Day/night detection...

Post by Christo » Tue Nov 08, 2016 11:09 am

Sorry to keep you waiting:)

This is how it's done:
wget -O $LOGDIRIMG/Monitor_$CNT.jpg "$HOST:$PORT/cgi-bin/nph-zms?mode=single&monitor=$CNT&scale=100&user=$ZMUSER&pass=$ZMPASS"

(make sure that the above user is authorized for viewing these monitors)

Or.. use the ZoneMinder Capture deamon options (zmc deamon)!!

see: http://manpages.ubuntu.com/manpages/xen ... zmc.8.html

Christo
Posts: 89
Joined: Wed Feb 01, 2012 9:48 pm

Re: Day/night detection...

Post by Christo » Tue Nov 08, 2016 11:14 am


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest