@@ -342,9 +342,12 @@ void Awb::process(IPAContext &context,
/* Filter the values to avoid oscillations. */
double speed = 0.2;
+ double ct = estimateCCT(rgbMeans);
+ ct = ct * speed + activeState.awb.automatic.temperatureK * (1 - speed);
awbResult.gains = awbResult.gains * speed +
activeState.awb.automatic.gains * (1 - speed);
+ activeState.awb.automatic.temperatureK = static_cast<unsigned int>(ct);
activeState.awb.automatic.gains = awbResult.gains;
LOG(RkISP1Awb, Debug)
@@ -139,10 +139,6 @@ void Ccm::prepare(IPAContext &context, const uint32_t frame,
}
uint32_t ct = frameContext.awb.temperatureK;
- /*
- * \todo The colour temperature will likely be noisy, add filtering to
- * avoid updating the CCM matrix all the time.
- */
if (frame > 0 && ct == ct_) {
frameContext.ccm.ccm = context.activeState.ccm.automatic;
return;