libcamera  v0.3.2+116-83c5ad0f
Supporting cameras in Linux since 2019
Public Member Functions | List of all members
libcamera::ipa::ipu3::algorithms::Agc Class Reference

A mean-based auto-exposure algorithm. More...

Inheritance diagram for libcamera::ipa::ipu3::algorithms::Agc:
Inheritance graph
[legend]
Collaboration diagram for libcamera::ipa::ipu3::algorithms::Agc:
Collaboration graph
[legend]

Public Member Functions

int init (IPAContext &context, const YamlObject &tuningData) override
 Initialise the AGC algorithm from tuning files. More...
 
int configure (IPAContext &context, const IPAConfigInfo &configInfo) override
 Configure the AGC given a configInfo. More...
 
void process (IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, const ipu3_uapi_stats_3a *stats, ControlList &metadata) override
 Process IPU3 statistics, and run AGC operations. More...
 
- Public Member Functions inherited from libcamera::ipa::Algorithm< _Module >
virtual int init ([[maybe_unused]] typename Module::Context &context, [[maybe_unused]] const YamlObject &tuningData)
 Initialize the Algorithm with tuning data. More...
 
virtual int configure ([[maybe_unused]] typename Module::Context &context, [[maybe_unused]] const typename Module::Config &configInfo)
 Configure the Algorithm given an IPAConfigInfo. More...
 
virtual void queueRequest ([[maybe_unused]] typename Module::Context &context, [[maybe_unused]] const uint32_t frame, [[maybe_unused]] typename Module::FrameContext &frameContext, [[maybe_unused]] const ControlList &controls)
 Provide control values to the algorithm. More...
 
virtual void prepare ([[maybe_unused]] typename Module::Context &context, [[maybe_unused]] const uint32_t frame, [[maybe_unused]] typename Module::FrameContext &frameContext, [[maybe_unused]] typename Module::Params *params)
 Fill the params buffer with ISP processing parameters for a frame. More...
 
virtual void process ([[maybe_unused]] typename Module::Context &context, [[maybe_unused]] const uint32_t frame, [[maybe_unused]] typename Module::FrameContext &frameContext, [[maybe_unused]] const typename Module::Stats *stats, [[maybe_unused]] ControlList &metadata)
 Process ISP statistics, and run algorithm operations. More...
 
- Public Member Functions inherited from libcamera::ipa::AgcMeanLuminance
int parseTuningData (const YamlObject &tuningData)
 Parse tuning data for AeConstraintMode and AeExposureMode controls. More...
 
void setLimits (utils::Duration minShutter, utils::Duration maxShutter, double minGain, double maxGain)
 Set the ExposureModeHelper limits for this class. More...
 
std::map< int32_t, std::vector< AgcConstraint > > constraintModes ()
 Get the constraint modes that have been parsed from tuning data.
 
std::map< int32_t, std::shared_ptr< ExposureModeHelper > > exposureModeHelpers ()
 Get the ExposureModeHelpers that have been parsed from tuning data.
 
ControlInfoMap::Map controls ()
 Get the controls that have been generated after parsing tuning data.
 
std::tuple< utils::Duration, double, double > calculateNewEv (uint32_t constraintModeIndex, uint32_t exposureModeIndex, const Histogram &yHist, utils::Duration effectiveExposureValue)
 Calculate the new exposure value and splut it between shutter time and gain. More...
 
void resetFrameCount ()
 Reset the frame counter. More...
 

Additional Inherited Members

- Public Types inherited from libcamera::ipa::Algorithm< _Module >
using Module = _Module
 The IPA module type for this class of algorithms.
 

Detailed Description

A mean-based auto-exposure algorithm.

This algorithm calculates a shutter time and an analogue gain so that the average value of the green channel of the brightest 2% of pixels approaches 0.5. The AWB gains are not used here, and all cells in the grid have the same weight, like an average-metering case. In this metering mode, the camera uses light information from the entire scene and creates an average for the final exposure setting, giving no weighting to any particular portion of the metered area.

Reference: Battiato, Messina & Castorina. (2008). Exposure Correction for Imaging Devices: An Overview. 10.1201/9781420054538.ch12.

Member Function Documentation

◆ configure()

int libcamera::ipa::ipu3::algorithms::Agc::configure ( IPAContext context,
const IPAConfigInfo &  configInfo 
)
override

Configure the AGC given a configInfo.

Parameters
[in]contextThe shared IPA context
[in]configInfoThe IPA configuration data
Returns
0

◆ init()

int libcamera::ipa::ipu3::algorithms::Agc::init ( IPAContext context,
const YamlObject tuningData 
)
override

Initialise the AGC algorithm from tuning files.

Parameters
[in]contextThe shared IPA context
[in]tuningDataThe YamlObject containing Agc tuning data

This function calls the base class' tuningData parsers to discover which control values are supported.

Returns
0 on success or errors from the base class

◆ process()

void libcamera::ipa::ipu3::algorithms::Agc::process ( IPAContext context,
const uint32_t  frame,
IPAFrameContext frameContext,
const ipu3_uapi_stats_3a *  stats,
ControlList metadata 
)
override

Process IPU3 statistics, and run AGC operations.

Parameters
[in]contextThe shared IPA context
[in]frameThe current frame sequence number
[in]frameContextThe current frame context
[in]statsThe IPU3 statistics and ISP results
[out]metadataMetadata for the frame, to be filled by the algorithm

Identify the current image brightness, and use that to estimate the optimal new exposure and gain for the scene.


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