<div dir="ltr"><div dir="ltr">Hi David,<div><br></div><div>Thank you for your patch.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 25 Feb 2021 at 17:01, David Plowman <<a href="mailto:david.plowman@raspberrypi.com">david.plowman@raspberrypi.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Regions of the image where the statistics are not trusted should not<br>
be put in the zones_ list.<br>
<br>
This also means that the AWB may fail to run initially, so<br>
async_results_ needs to be initialised to some kind of default.<br>
<br>
Finally, the RGB zone structures can be zero-initialised safely now,<br>
the previous value of -1 would seem unusual.<br>
<br>
Signed-off-by: David Plowman <<a href="mailto:david.plowman@raspberrypi.com" target="_blank">david.plowman@raspberrypi.com</a>><br></blockquote><div><br></div><div>Reviewed-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 src/ipa/raspberrypi/controller/rpi/awb.cpp | 3 ++-<br>
 src/ipa/raspberrypi/controller/rpi/awb.hpp | 2 +-<br>
 2 files changed, 3 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp<br>
index 791a7039..1c917e4f 100644<br>
--- a/src/ipa/raspberrypi/controller/rpi/awb.cpp<br>
+++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp<br>
@@ -169,6 +169,7 @@ void Awb::Initialise()<br>
                        sync_results_.gain_b = 1.0;<br>
        }<br>
        prev_sync_results_ = sync_results_;<br>
+       async_results_ = sync_results_;<br>
 }<br>
<br>
 unsigned int Awb::GetConvergenceFrames() const<br>
@@ -345,9 +346,9 @@ static void generate_stats(std::vector<Awb::RGB> &zones,<br>
                        if (zone.G >= min_G) {<br>
                                zone.R = stats[i].r_sum / counted;<br>
                                zone.B = stats[i].b_sum / counted;<br>
+                               zones.push_back(zone);<br>
                        }<br>
                }<br>
-               zones.push_back(zone);<br>
        }<br>
 }<br>
<br>
diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp<br>
index 2fe59c37..8af1f27c 100644<br>
--- a/src/ipa/raspberrypi/controller/rpi/awb.hpp<br>
+++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp<br>
@@ -90,7 +90,7 @@ public:<br>
        void Prepare(Metadata *image_metadata) override;<br>
        void Process(StatisticsPtr &stats, Metadata *image_metadata) override;<br>
        struct RGB {<br>
-               RGB(double _R = -1.0, double _G = -1.0, double _B = -1.0)<br>
+               RGB(double _R = 0, double _G = 0, double _B = 0)<br>
                        : R(_R), G(_G), B(_B)<br>
                {<br>
                }<br>
-- <br>
2.20.1<br>
<br>
_______________________________________________<br>
libcamera-devel mailing list<br>
<a href="mailto:libcamera-devel@lists.libcamera.org" target="_blank">libcamera-devel@lists.libcamera.org</a><br>
<a href="https://lists.libcamera.org/listinfo/libcamera-devel" rel="noreferrer" target="_blank">https://lists.libcamera.org/listinfo/libcamera-devel</a><br>
</blockquote></div></div>