| Message ID | 20251024085130.995967-27-stefan.klug@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
2025. 10. 24. 10:50 keltezéssel, Stefan Klug írta: > When the AWB engine doesn't find a valid pixel because all pixels lie > outside the configured colour range it returns an AWB measurement value > of 255, 255, 255. This leaves the regulation in an unrecoverable state > noticeable by a completely green image. Fix that by skipping the AWB > calculation in case there were no valid pixels. > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> > --- > src/ipa/rkisp1/algorithms/awb.cpp | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp > index 27109478c340..81c767531c03 100644 > --- a/src/ipa/rkisp1/algorithms/awb.cpp > +++ b/src/ipa/rkisp1/algorithms/awb.cpp > @@ -313,6 +313,11 @@ void Awb::process(IPAContext &context, > return; > } > > + if (awb->awb_mean[0].cnt == 0) { > + LOG(RkISP1Awb, Warning) << "AWB statistics are empty"; > + return; > + } > + Isn't this already there? (Although with "Debug" instead of "Warning".) https://gitlab.freedesktop.org/camera/libcamera/-/commit/0069b9ceb1e03d5887ac614e35d79602b003ff27 > RGB<double> rgbMeans = calculateRgbMeans(frameContext, awb); > > /* > -- > 2.48.1 >
diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index 27109478c340..81c767531c03 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -313,6 +313,11 @@ void Awb::process(IPAContext &context, return; } + if (awb->awb_mean[0].cnt == 0) { + LOG(RkISP1Awb, Warning) << "AWB statistics are empty"; + return; + } + RGB<double> rgbMeans = calculateRgbMeans(frameContext, awb); /*
When the AWB engine doesn't find a valid pixel because all pixels lie outside the configured colour range it returns an AWB measurement value of 255, 255, 255. This leaves the regulation in an unrecoverable state noticeable by a completely green image. Fix that by skipping the AWB calculation in case there were no valid pixels. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> --- src/ipa/rkisp1/algorithms/awb.cpp | 5 +++++ 1 file changed, 5 insertions(+)