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

An abstraction class wrapping hardware-specific AWB statistics. More...

Public Member Functions

virtual double computeColourError (const RGB< double > &gains) const =0
 Virtual class destructor.
 
virtual bool valid () const =0
 Retrieve if the AWB statistics are valid.
 
virtual RGB< double > rgbMeans () const =0
 Get RGB means of the statistics.
 

Detailed Description

An abstraction class wrapping hardware-specific AWB statistics.

IPA modules using libIPA AwbAlgorithm class need to provide a derived implementation of this class to give the algorithm access to the hardware-specific statistics data.

Member Function Documentation

◆ computeColourError()

libcamera::ipa::AwbStats::computeColourError ( const RGB< double > &  gains) const
pure virtual

Virtual class destructor.

AwbStat::~AwbStat

Compute an error value for when the given gains would be applied

Parameters
[in]gainsThe gains to apply

Compute an error value (non-greyness) assuming the given gains would be applied. To keep the actual implementations computationally inexpensive, the squared colour error shall be returned.

If the AWB statistics provide multiple zones, the average of the individual squared errors shall be returned. Averaging/normalizing is necessary so that the numeric dimensions are the same on all hardware platforms.

Returns
The computed error value

◆ rgbMeans()

libcamera::ipa::AwbStats::rgbMeans ( ) const
pure virtual

Get RGB means of the statistics.

Fetch the RGB means from the statistics. The values of each channel are dimensionless and only the ratios are used for further calculations. This is used by the simple grey world model to calculate the gains to apply.

Todo:
Make a requirement to return statistics in the [0, 1] range.
Returns
The RGB means

◆ valid()

libcamera::ipa::AwbStats::valid ( ) const
pure virtual

Retrieve if the AWB statistics are valid.

If the colour mean values are too small, the AwbAlgorithm class doesn't have enough information to meaningfully calculate white-balance gains. Freeze the algorithm in that case.

Returns
True if the AWB statistics are valid, false otherwise

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