title: Dynamic focus area for android camera
body: <p>I am building an android camera app (not using camera2 api) to take close-range pictures of some objects in the outdoor conditions. The pictures needs to be taken in burst mode i.e. once activated the camera will take say 5 pics continuously and all the pics needs to be well focussed. The user may be moving the camera while taking pics and user will not be able to manually choose the point of focus. The objects are dark in color and sometimes the camera is being over-exposed by bright objects in the camera view.<br>
  I know how to set focus area as camera parameters but the position of focus area has to be changed automatically so that its always focussed on the dark regions in the camera view. The position of dark objects is not fixed in camera view and so the app will have to look for dark pixels in every frame before setting focus area.<br>
  I am thinking of checking for dark regions in the <code>onPreviewFrame()</code> callback but I am not sure if this is the correct way to do that. Has anyone done this before who can point me in the right direction? For example is there a project which will make android camera focus on a face always using a face detector? I tried to look on internet but could not find any relevant projects.</p>