How to detect average pixel intensity from live camera preview?
<p>I am building a scanner app, and trying to determine the "preview quality" from the preview callback of the camera. I want to customize the camera's <code>AUTO_FLASH_MODE</code> where it will be turned on if the environment is too dark.</p>

<p>How can I detect if there is a high average of dark pixels? This means (in preview) I am getting darkness and therefore need to turn on the camera's flash light.</p>