Page 1 of 1

Brightness Control

Posted: Wed Sep 04, 2013 4:55 pm
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