libcamera v0.6.0 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:
[legend]
Collaboration diagram for libcamera::ipa::AwbBayes:
[legend]

## Public Member Functions
int | init (const YamlObject &tuningData) override
| Initialize the algorithm with the given tuning data.
AwbResult | calculateAwb (const AwbStats &stats, unsigned int lux) override
| Calculate AWB data from the given statistics.
std::optional< RGB< double > > | gainsFromColourTemperature (double temperatureK) override
| Compute white balance gains from a colour temperature.
void | handleControls (const ControlList &controls) override
| Handle the controls supplied in a request.
Public Member Functions inherited from libcamera::ipa::AwbAlgorithm
const ControlInfoMap::Map & | controls () const
| Get the controls info map for this algorithm.

## Additional Inherited Members
Protected Member Functions inherited from libcamera::ipa::AwbAlgorithm
int | parseModeConfigs (const YamlObject &tuningData, const ControlValue &def={})
| Parse the mode configurations from the tuning data.
Protected Attributes inherited from libcamera::ipa::AwbAlgorithm
ControlInfoMap::Map | controls_
| Controls info map for the controls provided by the algorithm.
std::map< controls::AwbModeEnum, AwbAlgorithm::ModeConfig > | modes_
| Map of all configured modes.

## 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()

AwbResult libcamera::ipa::AwbBayes::calculateAwb | ( | const AwbStats & | stats,
|  | unsigned int | lux )
| override virtual

Calculate AWB data from the given statistics.

Parameters

  [in] | stats | The statistics to use for the calculation
  [in] | lux | The lux value of the scene

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::AwbAlgorithm.

## ◆ gainsFromColourTemperature()

std::optional< RGB< double > > libcamera::ipa::AwbBayes::gainsFromColourTemperature | ( | double | colourTemperature | ) |
| override virtual

Compute white balance gains from a colour temperature.

Parameters

  [in] | colourTemperature | The colour temperature in Kelvin

Compute the white balance gains from a colourTemperature. This function does not take any statistics into account. It is used to compute the colour gains when the user manually specifies a colour temperature.

Returns
  The colour gains or std::nullopt if the conversion is not possible

Implements libcamera::ipa::AwbAlgorithm.

## ◆ handleControls()

void libcamera::ipa::AwbBayes::handleControls | ( | const ControlList & | controls | ) |
| override virtual

Handle the controls supplied in a request.

Parameters

  [in] | controls | The controls to handle

Reimplemented from libcamera::ipa::AwbAlgorithm.

## ◆ init()

int libcamera::ipa::AwbBayes::init | ( | const YamlObject & | tuningData | ) |
| override virtual

Initialize the algorithm with the given tuning data.

Parameters

  [in] | tuningData | The tuning data to use for the algorithm

Returns
  0 on success, a negative error code otherwise

Implements libcamera::ipa::AwbAlgorithm.

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

- src/ipa/libipa/awb_bayes.h
- src/ipa/libipa/awb_bayes.cpp