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?
Day/night detection...
-
- Posts: 76
- Joined: Wed Feb 03, 2016 7:51 am
Day/night detection...
3 ReoLink RLC-410
2 Annke NC800
Kubernetes 1.22.6 statefulset of 5 Ubuntu 20.04 pods using iconnor's repository
ZoneMinder Version 1.36.12
2 Annke NC800
Kubernetes 1.22.6 statefulset of 5 Ubuntu 20.04 pods using iconnor's repository
ZoneMinder Version 1.36.12
Re: Day/night detection...
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
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
-
- Posts: 76
- Joined: Wed Feb 03, 2016 7:51 am
Re: Day/night detection...
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?
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?
3 ReoLink RLC-410
2 Annke NC800
Kubernetes 1.22.6 statefulset of 5 Ubuntu 20.04 pods using iconnor's repository
ZoneMinder Version 1.36.12
2 Annke NC800
Kubernetes 1.22.6 statefulset of 5 Ubuntu 20.04 pods using iconnor's repository
ZoneMinder Version 1.36.12
Re: Day/night detection...
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
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