ipa: rkisp1: awb: Avoid division by zero
As the gains can also be specified manually, the regulation can run into numeric instabilities by dividing by near zero. Mitigate that by applying a small minium value. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
parent
7991293cec
commit
969df3db31
1 changed files with 2 additions and 2 deletions
|
@ -413,9 +413,9 @@ RGB<double> Awb::calculateRgbMeans(const IPAFrameContext &frameContext, const rk
|
|||
/*
|
||||
* The ISP computes the AWB means after applying the colour gains,
|
||||
* divide by the gains that were used to get the raw means from the
|
||||
* sensor.
|
||||
* sensor. Apply a minimum value to avoid divisions by near-zero.
|
||||
*/
|
||||
rgbMeans /= frameContext.awb.gains;
|
||||
rgbMeans /= frameContext.awb.gains.max(0.01);
|
||||
|
||||
return rgbMeans;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue