ipa rkisp1: Remove temperatureK from FrameContext

The frame context is used to store data used for processing that frame.
It is later used to either act as input for other algorithms or to fill
the metadata.  For the colour temperature this is not needed, as the
meatadata shall not contain the value that was active when the image was
processed, but the value that was calculated based on the statistics for
that image. This is no functional change.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Stefan Klug 2024-07-12 16:32:03 +02:00 committed by Kieran Bingham
parent 7b8094d6fc
commit e9aea086b5
2 changed files with 2 additions and 6 deletions

View file

@ -277,7 +277,6 @@ void Awb::process(IPAContext &context,
*/
if (redMean < kMeanMinThreshold && greenMean < kMeanMinThreshold &&
blueMean < kMeanMinThreshold) {
frameContext.awb.temperatureK = activeState.awb.temperatureK;
return;
}
@ -309,21 +308,19 @@ void Awb::process(IPAContext &context,
activeState.awb.gains.automatic.blue = blueGain;
activeState.awb.gains.automatic.green = 1.0;
frameContext.awb.temperatureK = activeState.awb.temperatureK;
metadata.set(controls::AwbEnable, frameContext.awb.autoEnabled);
metadata.set(controls::ColourGains, {
static_cast<float>(frameContext.awb.gains.red),
static_cast<float>(frameContext.awb.gains.blue)
});
metadata.set(controls::ColourTemperature, frameContext.awb.temperatureK);
metadata.set(controls::ColourTemperature, activeState.awb.temperatureK);
LOG(RkISP1Awb, Debug) << std::showpoint
<< "Means [" << redMean << ", " << greenMean << ", " << blueMean
<< "], gains [" << activeState.awb.gains.automatic.red << ", "
<< activeState.awb.gains.automatic.green << ", "
<< activeState.awb.gains.automatic.blue << "], temp "
<< frameContext.awb.temperatureK << "K";
<< activeState.awb.temperatureK << "K";
}
REGISTER_IPA_ALGORITHM(Awb, "Awb")