libcamera: ipa: raspberrypi: Populate focus FoM from the ISP statistics
Switch FocusStatus::num to unsigned int for convenience. Fill in libcamera::controls::FocusFoM with the average of the middle two regions (across a 4x3 grid) FoM statistics from the ISP. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
64652e26d7
commit
e0c583871d
2 changed files with 13 additions and 1 deletions
|
@ -42,6 +42,7 @@
|
|||
#include "contrast_status.h"
|
||||
#include "controller.hpp"
|
||||
#include "dpc_status.h"
|
||||
#include "focus_status.h"
|
||||
#include "geq_status.h"
|
||||
#include "lux_status.h"
|
||||
#include "metadata.hpp"
|
||||
|
@ -405,6 +406,17 @@ void IPARPi::reportMetadata()
|
|||
static_cast<int32_t>(blackLevelStatus->black_level_g),
|
||||
static_cast<int32_t>(blackLevelStatus->black_level_g),
|
||||
static_cast<int32_t>(blackLevelStatus->black_level_b) });
|
||||
|
||||
FocusStatus *focusStatus = rpiMetadata_.GetLocked<FocusStatus>("focus.status");
|
||||
if (focusStatus && focusStatus->num == 12) {
|
||||
/*
|
||||
* We get a 4x3 grid of regions by default. Calculate the average
|
||||
* FoM over the central two positions to give an overall scene FoM.
|
||||
* This can change later if it is not deemed suitable.
|
||||
*/
|
||||
int32_t focusFoM = (focusStatus->focus_measures[5] + focusStatus->focus_measures[6]) / 2;
|
||||
libcameraMetadata_.set(controls::FocusFoM, focusFoM);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue