libcamera v0.7.2+rpt20260817
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
libcamera::ipa::AwbBayes Class Reference

Implementation of a bayesian auto white balance algorithm. More...

Inheritance diagram for libcamera::ipa::AwbBayes:
Collaboration diagram for libcamera::ipa::AwbBayes:

Public Member Functions

int init (const ValueNode &tuningData) override
 Initialize the algorithm by parsing tuningData.
 
AwbImplementation::Result calculateAwb (const AwbStats &stats, unsigned int lux, std::array< double, 2 > range) override
 Calculate AWB data from the given statistics.
 
std::optional< RGB< double > > gainsFromColourTemperature (double temperatureK) override
 Compute white balance gains from a colour temperature.
 
- Public Member Functions inherited from libcamera::ipa::AwbImplementation
virtual ~AwbImplementation ()=default
 Virtual class destructor.
 

Detailed Description

Implementation of a bayesian auto white balance algorithm.

In a bayesian AWB algorithm the auto white balance estimation is improved by taking the likelihood of a given lightsource based on the estimated lux level into account. E.g. If it is very bright we can assume that we are outside and that colour temperatures around 6500 are preferred.

The second part of this algorithm is the search for the most likely colour temperature. It is implemented in AwbBayes::coarseSearch() and in AwbBayes::fineSearch(). The search works very well without prior likelihoods and therefore the algorithm itself provides very good results even without prior likelihoods.

Member Function Documentation

◆ calculateAwb()

AwbImplementation::Result libcamera::ipa::AwbBayes::calculateAwb ( const AwbStats stats,
unsigned int  lux,
std::array< double, 2 >  range 
)
overridevirtual

Calculate AWB data from the given statistics.

Parameters
[in]statsThe statistics to use for the calculation
[in]luxThe lux value of the scene
[in]rangeThe colour temperature search limits

Calculate an AwbResult object from the given statistics and lux value. A lux value of 0 means it is unknown or invalid and the algorithm shall ignore it.

Returns
The AWB result

Implements libcamera::ipa::AwbImplementation.

◆ gainsFromColourTemperature()

std::optional< RGB< double > > libcamera::ipa::AwbBayes::gainsFromColourTemperature ( double  colourTemperature)
overridevirtual

Compute white balance gains from a colour temperature.

Parameters
[in]colourTemperatureThe colour temperature in Kelvin

Compute the white balance gains from a colourTemperature. This function does not take any statistics into account. It simply interpolates the colour gains curve on a new colour temperature.

Returns
The RGB gain values adjusted to temperatureK

Implements libcamera::ipa::AwbImplementation.

◆ init()

int libcamera::ipa::AwbBayes::init ( const ValueNode tuningData)
overridevirtual

Initialize the algorithm by parsing tuningData.

Parameters
[in]tuningData

Implements libcamera::ipa::AwbImplementation.


The documentation for this class was generated from the following files: