How can I measure the level of ambient light from an image?

后端 未结 3 1926
隐瞒了意图╮
隐瞒了意图╮ 2021-01-20 20:01

I am looking at making an app that uses a camera to measure the amount of light present when an image is taken. Some conditional behavior would take place based on how much

3条回答
  •  温柔的废话
    2021-01-20 20:59

    If it needs to be very accurate, you should consider using some regression techniques such as least squares (in particular, partial least squares). With these methods, you have a set of training data (references for several times), and it compares and interpolates to find an approximation of the time of day.

    If it doesn't need to be that accurate, you can get a good approximation by simply calculating the average pixel distance from white/black. If the camera has auto-exposure, you can factor that in too.

提交回复
热议问题