mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-21 15:53:54 +03:00
ipa: rpi: agc: Allow AGC channels to avoid using "fast desaturation"
"Fast desaturation" is a technique that can help the AGC algorithm to desaturate images more quickly when they are very over-exposed. However, it uses digital gain to do this which can confuse our HDR techniques. Therefore make it optional. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
0923d50b15
commit
edb48a1337
2 changed files with 7 additions and 2 deletions
|
@ -253,6 +253,8 @@ int AgcConfig::read(const libcamera::YamlObject ¶ms)
|
|||
|
||||
stableRegion = params["stable_region"].get<double>(0.02);
|
||||
|
||||
desaturate = params["desaturate"].get<int>(1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -860,8 +862,10 @@ bool AgcChannel::applyDigitalGain(double gain, double targetY, bool channelBound
|
|||
* quickly (and we then approach the correct value more quickly from
|
||||
* below).
|
||||
*/
|
||||
bool desaturate = !channelBound &&
|
||||
targetY > config_.fastReduceThreshold && gain < sqrt(targetY);
|
||||
bool desaturate = false;
|
||||
if (config_.desaturate)
|
||||
desaturate = !channelBound &&
|
||||
targetY > config_.fastReduceThreshold && gain < sqrt(targetY);
|
||||
if (desaturate)
|
||||
dg /= config_.fastReduceThreshold;
|
||||
LOG(RPiAgc, Debug) << "Digital gain " << dg << " desaturate? " << desaturate;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue