mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 15:29:45 +03:00
ipa: rkisp1: Introduce AWB
The RkISP1 ISP calculates a mean value for Y, Cr and Cb at each frame. There is a RGB mode which could theoretically give us the values for R, G and B directly, but it seems to be failing right now. Convert those values into R, G and B and estimate the gain to apply in a grey world. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Tested-by: Peter Griffin <peter.griffin@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
8917c9e7ba
commit
4b2251509f
6 changed files with 258 additions and 0 deletions
33
src/ipa/rkisp1/algorithms/awb.h
Normal file
33
src/ipa/rkisp1/algorithms/awb.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
/*
|
||||
* Copyright (C) 2021-2022, Ideas On Board
|
||||
*
|
||||
* awb.h - AWB control algorithm
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <linux/rkisp1-config.h>
|
||||
|
||||
#include "algorithm.h"
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
namespace ipa::rkisp1::algorithms {
|
||||
|
||||
class Awb : public Algorithm
|
||||
{
|
||||
public:
|
||||
Awb() = default;
|
||||
~Awb() = default;
|
||||
|
||||
int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;
|
||||
void prepare(IPAContext &context, rkisp1_params_cfg *params) override;
|
||||
void process(IPAContext &context, const rkisp1_stat_buffer *stats) override;
|
||||
|
||||
private:
|
||||
uint32_t estimateCCT(double red, double green, double blue);
|
||||
};
|
||||
|
||||
} /* namespace ipa::rkisp1::algorithms */
|
||||
} /* namespace libcamera */
|
Loading…
Add table
Add a link
Reference in a new issue