Brightness Control

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
Christo
Posts: 89
Joined: Wed Feb 01, 2012 9:48 pm

Brightness Control

Post by Christo »

Related to the topic of Oskin (http://www.zoneminder.com/forums/viewto ... f=9&t=3657)
I found out that with the use of ImageMagick you can achieve a more accurate brightness (lumination) calculation. The basic command to analyze a video frame is:
LUM_CURR=`convert $TMPDIR/Monitor.jpg -colorspace gray -format "%[fx:100*mean]" info:`

If you want to stick to your original (zoneMinder) Brightness settings (DEF_ZM=32768) with a lumination setting of 60 (TARGET) the calculation will look like this (in bash):
LUM_NEW=$(echo "scale=2; $TARGET/$LUM_CURR*$DEF_ZM" | bc)
echo $LUM_NEW |cut -c1-5

The rest is up to your creative minds!!
Good luck, Christo
Post Reply