summaryrefslogtreecommitdiff
path: root/src/ipa/libipa/awb.cpp
AgeCommit message (Collapse)Author
3 dayslibipa: awb: Rename AwbStats::getRGBMeans() to rgbMeans()Laurent Pinchart
The convention in libcamera is not to prefix getters with a 'get' prefix. Rename the AwbStats::getRGBMeans() function accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
3 dayslibipa: awb: Replace reference to pipeline handle with IPA moduleLaurent Pinchart
The AwbStats documentation incorrectly references pipeline handlers when it means IPA modules. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
3 dayslibipa: awb: Standardize spelling on 'grey' worldLaurent Pinchart
All locations but one spell 'grey' instead of 'gray'. Fix the outlier. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
3 dayslibipa: awb: Follow function names with '()' in doxygen documentationLaurent Pinchart
Function names are followed by parentheses in doxygen documentation blocks as convention in libcamera. Add missing parentheses in the AwbAlgorithm documentation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
3 dayslibipa: awb: Capitalize AWBLaurent Pinchart
AWB is an abbreviation, capitalize it in comments and log messages for consistency. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
3 dayslibipa: awb: Sort class member documentation according to header orderLaurent Pinchart
Sort the documentation of the class members in the same order as the member declaration in the class definition, as is customary in libcamera. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
6 dayslibipa: awb_bayes: Change the probabilities from log space to linear spaceStefan Klug
The original code used to specify the probabilities in log space and scaled for the RaspberryPi hardware with 192 AWB measurement points. This is reasonable as the whole algorithm makes use of unitless numbers to prefer some colour temperatures based on a lux level. These numbers are then hand tuned with the specific device in mind. This has two shortcomings: 1. The linear interpolation of PWLs in log space is mathematically incorrect. The outcome might still be ok, as both spaces (log and linear) are monotonic, but it is still not "right". 2. Having unitless numbers gets more error prone when we try to harmonize the behavior over multiple platforms. Change the algorithm to interpret the numbers as being in linear space. This makes the interpolation mathematically correct at the expense of a few log operations. To account for that change, update the numbers in the tuning example file with the linear counterparts scaled to one AWB zone measurement. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
6 dayslibipa: awb: Add helper functions for AWB mode supportStefan Klug
The AWB modes are specified in the libcamera core controls. It is therefore quite likely that every AWB algorithm will implement them. Add helper functions for parsing and storing the configured modes in the AwbAlgorithm base class. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
6 dayslibipa: Add AWB algorithm base classStefan Klug
Add a class to provide a generic interface for auto white balance algorithms. Concrete AWB algorithms are expected to subclass the AwbAlgorithm class to implement their functionality. IPAs are expected to subclass the AwbStats class and implement the necessary functions to give the algorithm access to the hardware specific statistics data. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>