Feature Request: Virtual light sensor from the image
Description
It would be great, if motion will have conversion specifier which implies a value of current light. For example ,my picture is 528x432 pix, on php I has this code:
#--------------------------------------------------------------
$image = imagecreatefromjpeg("last.jpg");
for($y=0; $y<432; $y++)
{
for($x=0; $x < 528; $x++)
{
$rgb = imagecolorat($image, $x, $y);
$total += $rgb;
}
}
$result = round($total / 228096, 0);
$current_light = round($result / 1000000, 2);
#-------------------------------------------------------------
If now the day in my room light , $current_light is about 3 .. 6 , if now evening , twilight, $current_light is about 1.5 ... 3 , if night < 1.5
--
StPavel - 02 Nov 2010
Follow up
Unfortunately cameras usually have agc (automatic gain control). This will multiply the detected values by 2x,4x,etc. This would introduce sudden current_light changes. You can only guess the agc current value e.g. if all lower bit is 0, then it must be at least agc x2...
--
LaszloVarga - 25 Jan 2011