libcamera
v0.8.0
Supporting cameras in Linux since 2019
Toggle main menu visibility
Loading...
Searching...
No Matches
awb_bayes.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2
/*
3
* Copyright (C) 2024 Ideas on Board Oy
4
*
5
* Base class for bayes AWB algorithms
6
*/
7
8
#pragma once
9
10
#include <span>
11
12
#include <
libcamera/controls.h
>
13
14
#include "
libcamera/internal/value_node.h
"
15
#include "
libcamera/internal/vector.h
"
16
17
#include "
awb.h
"
18
#include "
interpolator.h
"
19
#include "
pwl.h
"
20
21
namespace
libcamera
{
22
23
namespace
ipa
{
24
25
class
AwbBayes :
public
AwbImplementation
26
{
27
public
:
28
AwbBayes() =
default
;
29
30
int
init
(
const
ValueNode
&tuningData)
override
;
31
AwbImplementation::Result
32
calculateAwb
(
const
AwbStats
&stats,
unsigned
int
lux,
33
std::array<double, 2> range)
override
;
34
std::optional<RGB<double>>
gainsFromColourTemperature
(
double
temperatureK)
override
;
35
36
private
:
37
int
readPriors(
const
ValueNode
&tuningData);
38
39
void
fineSearch(
double
&t,
double
&r,
double
&b,
ipa::Pwl
const
&prior,
40
const
AwbStats
&stats)
const
;
41
double
coarseSearch(
const
ipa::Pwl
&prior,
const
AwbStats
&stats,
42
std::span<double> range)
const
;
43
double
interpolateQuadratic(
ipa::Pwl::Point
const
&a,
44
ipa::Pwl::Point
const
&b,
45
ipa::Pwl::Point
const
&c)
const
;
46
47
Interpolator<Pwl>
priors_;
48
Interpolator<Vector<double, 2>
> colourGainCurve_;
49
50
ipa::Pwl
ctR_;
51
ipa::Pwl
ctB_;
52
ipa::Pwl
ctRInverse_;
53
ipa::Pwl
ctBInverse_;
54
55
double
transversePos_;
56
double
transverseNeg_;
57
};
58
59
}
/* namespace ipa */
60
61
}
/* namespace libcamera */
libcamera::ValueNode
A class representing a tree structure of values.
Definition
value_node.h:27
libcamera::ipa::AwbBayes::gainsFromColourTemperature
std::optional< RGB< double > > gainsFromColourTemperature(double temperatureK) override
Compute white balance gains from a colour temperature.
Definition
awb_bayes.cpp:260
libcamera::ipa::AwbBayes::calculateAwb
AwbImplementation::Result calculateAwb(const AwbStats &stats, unsigned int lux, std::array< double, 2 > range) override
Calculate AWB data from the given statistics.
Definition
awb_bayes.cpp:272
libcamera::ipa::AwbBayes::init
int init(const ValueNode &tuningData) override
Initialize the algorithm by parsing tuningData.
Definition
awb_bayes.cpp:143
libcamera::ipa::AwbImplementation
Pure virtual base class for AWB algorithms implementations.
Definition
awb.h:54
libcamera::ipa::Interpolator
Class for storing, retrieving, and interpolating objects.
Definition
interpolator.h:28
libcamera::ipa::Pwl
Describe a univariate piecewise linear function in two-dimensional real space.
Definition
pwl.h:22
libcamera::ipa::Pwl::Point
Vector< double, 2 > Point
Describe a point in two-dimensional real space.
Definition
pwl.h:24
controls.h
Framework to manage controls related to an object.
interpolator.h
Helper class for linear interpolating a set of objects.
awb.h
libipa AWB implementation
libcamera::ipa
The IPA (Image Processing Algorithm) namespace.
Definition
af.cpp:58
libcamera
Top-level libcamera namespace.
Definition
backtrace.h:17
pwl.h
Piecewise linear functions.
libcamera::ipa::AwbImplementation::Result
The result of an AWB computation.
Definition
awb.h:56
libcamera::ipa::AwbStats
An abstraction class wrapping hardware-specific AWB statistics.
Definition
awb.h:44
value_node.h
Data structure to manage tree of values.
vector.h
Vector class.
src
ipa
libipa
awb_bayes.h
Generated by
1.17.0