libipa: lux: Normalize referenceY to 1

By normalizing the referenceY value to 1 (which is the usual range for
Y) in the tuning file, the bins_ value is no longer needed. Remove it.

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>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
This commit is contained in:
Stefan Klug 2025-01-23 12:41:04 +01:00
parent 92bb16b68e
commit ce9d547aff
3 changed files with 7 additions and 20 deletions

View file

@ -43,11 +43,6 @@ namespace ipa {
* that depend on the estimated lux value.
*/
/**
* \var Lux::binSize_
* \brief The maximum count of each bin
*/
/**
* \var Lux::referenceExposureTime_
* \brief The exposure time of the reference image, in microseconds
@ -65,9 +60,8 @@ namespace ipa {
/**
* \var Lux::referenceY_
* \brief The measured luminance of the reference image, out of the bin size
* \brief The measured luminance of the reference image, normalized to 1
*
* \sa binSize_
*/
/**
@ -76,11 +70,9 @@ namespace ipa {
*/
/**
* \brief Construct the Lux helper module
* \param[in] binSize The maximum count of each bin
*/
Lux::Lux(unsigned int binSize)
: binSize_(binSize)
* \brief Construct the Lux helper module
*/
Lux::Lux()
{
}
@ -97,7 +89,7 @@ Lux::Lux(unsigned int binSize)
* referenceExposureTime: 10000
* referenceAnalogueGain: 4.0
* referenceDigitalGain: 1.0
* referenceY: 12000
* referenceY: 0.1831
* referenceLux: 1000
* \endcode
*
@ -167,7 +159,7 @@ double Lux::estimateLux(utils::Duration exposureTime,
double exposureTimeRatio = referenceExposureTime_ / exposureTime;
double aGainRatio = referenceAnalogueGain_ / aGain;
double dGainRatio = referenceDigitalGain_ / dGain;
double yRatio = currentY * (binSize_ / yHist.bins()) / referenceY_;
double yRatio = (currentY / yHist.bins()) / referenceY_;
double estimatedLux = exposureTimeRatio * aGainRatio * dGainRatio *
yRatio * referenceLux_;

View file

@ -21,7 +21,7 @@ class Histogram;
class Lux
{
public:
Lux(unsigned int binSize);
Lux();
int parseTuningData(const YamlObject &tuningData);
double estimateLux(utils::Duration exposureTime,
@ -29,7 +29,6 @@ public:
const Histogram &yHist) const;
private:
unsigned int binSize_;
utils::Duration referenceExposureTime_;
double referenceAnalogueGain_;
double referenceDigitalGain_;

View file

@ -33,12 +33,8 @@ namespace ipa::rkisp1::algorithms {
/**
* \brief Construct an rkisp1 Lux algo module
*
* The Lux helper is initialized to 65535 as that is the max bin count on the
* rkisp1.
*/
Lux::Lux()
: lux_(65535)
{
}