Light sensor sensitivity for use in camera application

556 Views Asked by At

I am working on an application to record video automatically at remote, outdoor locations using MJPEG format. I would like to stop video recording at night when light levels are below the required threshold. To do this I've used the following to set a flag that starts and stops recording.

boolean bTooDarkFlag;
float fLightLevel;

if(event.sensor.getType() == Sensor.TYPE_LIGHT){
        fLightLevel = event.values[0];
        if (fLightLevel > 0.1){
            bTooDarkFlag = false;    
        }else{
            bTooDarkFlag = true;
        }
}

Unfortunately, the sensor reaches 0.0 while there is still just enough light to record with. What other solutions might be worth exploring? Can I crank up the sensitivity of the light sensor? Part of this problem is that the sensor on the device that I may deploy to (Samsung S4 Active) is on the opposite side as the camera, therefore potentially in the shadow. Thoughts on using camera input to set/reset the boolean flag? Thanks in advance...

0

There are 0 best solutions below