From 8437893900c78703e49a01ed2b1167bcbaf89ecb Mon Sep 17 00:00:00 2001 From: Jean-Michel Hautbois Date: Mon, 23 Aug 2021 14:05:42 +0200 Subject: ipa: ipu3: awb: Introduce Black Level Correction The pixels output by the camera normally include a black level, because sensors do not always report a signal level of '0' for black. Pixels at or below this level should be considered black and to achieve that, we need to substract an offset to all the pixels. This can be taken into account by reading the lowest value of a special region on sensors which is not exposed to light. This provides a substracting factor to be able to adjust the expected black levels in the resulting images. For a camera outputting 10-bit pixel values (in the range 0 to 1023) a typical black level might be 64. It is a fixed value, obtained by capturing a raw frame with minimum exposure and gain fixed to 1.0 while covering the sensor (the darker the better). We consider it good enough as a very first approximation, until we measure it during a tuning process and include it in a configuration file Signed-off-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/ipa/ipu3/algorithms/blc.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/ipa/ipu3/algorithms/blc.h (limited to 'src/ipa/ipu3/algorithms/blc.h') diff --git a/src/ipa/ipu3/algorithms/blc.h b/src/ipa/ipu3/algorithms/blc.h new file mode 100644 index 00000000..4b7cb483 --- /dev/null +++ b/src/ipa/ipu3/algorithms/blc.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2021, Google inc. + * + * black_correction.h - IPU3 Black Level Correction control + */ +#ifndef __LIBCAMERA_IPU3_ALGORITHMS_BLC_H__ +#define __LIBCAMERA_IPU3_ALGORITHMS_BLC_H__ + +#include "algorithm.h" + +namespace libcamera { + +namespace ipa::ipu3::algorithms { + +class BlackLevelCorrection : public Algorithm +{ +public: + BlackLevelCorrection(); + + void prepare(IPAContext &context, ipu3_uapi_params *params) override; +}; + +} /* namespace ipa::ipu3::algorithms */ + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_IPU3_ALGORITHMS_BLC_H__ */ -- cgit v1.2.1