Updated: October 28, 2024 |
Configure the focus regions on the camera
#include <camera/camera_3a.h>
camera_error_t camera_set_focus_regions(camera_handle_t handle, int numregions, camera_region_t *regions)
When focus regions are defined, the autofocus algorithm will give priority to focusing on objects in the defined areas of the scene.
Only call this function if the CAMERA_FEATURE_REGIONFOCUS feature is available. You can determine whether this feature is available by calling the camera_can_feature() function.
The maximum number of focus regions that you can configure is returned by the numsupported argument of the camera_get_focus_regions() function.
After setting the regions, you must call the camera_set_focus_mode() function to commit the changes.
CAMERA_EOK when the function successfully completes, otherwise another camera_error_t value that provides the reason that the call failed.