{"id":11382,"url":"https://patchwork.libcamera.org/api/1.1/patches/11382/?format=json","web_url":"https://patchwork.libcamera.org/patch/11382/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210225170141.5184-3-david.plowman@raspberrypi.com>","date":"2021-02-25T17:01:41","name":"[libcamera-devel,2/2] ipa: raspberrypi: AWB: Ignore invalid statistics zones correctly","commit_ref":"cc22d2206d83d6ab76172eeadb34f6b825c1ed9a","pull_url":null,"state":"accepted","archived":false,"hash":"24e438b29b653a8c3e2add012d724a46fc71cd74","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/1.1/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11382/mbox/","series":[{"id":1728,"url":"https://patchwork.libcamera.org/api/1.1/series/1728/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1728","date":"2021-02-25T17:01:39","name":"Raspberry Pi AWB tidying","version":1,"mbox":"https://patchwork.libcamera.org/series/1728/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11382/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11382/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 29F51BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Feb 2021 17:01:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EA7A468A4E;\n\tThu, 25 Feb 2021 18:01:51 +0100 (CET)","from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com\n\t[IPv6:2a00:1450:4864:20::32c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ECD7D68A53\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Feb 2021 18:01:48 +0100 (CET)","by mail-wm1-x32c.google.com with SMTP id g11so1491342wmh.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Feb 2021 09:01:48 -0800 (PST)","from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\te3sm1526337wrt.12.2021.02.25.09.01.47\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 25 Feb 2021 09:01:47 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"i+5N5+CG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=jPus3FcP5etJB05ijHlMi7zYjv7msj437AOXSM+Y2Dw=;\n\tb=i+5N5+CGRzIHN+4MudmPpDNcggBjnsyJnc2RoSWgqDWHAt76m+WNqnNj+/80Tc8aYT\n\tj9VE0YS84mp8wV729BmC+uRSR6T2JdL3EWgr/R19fNkM18YwIP//ciOzuURRr6ORr3Me\n\t6DzrryOOb93PkYOEzefRovs8Lm1gICv74ABAT87IAB6T/v3U8WEO3QWBQo2mFIziQDDp\n\t57+lTCbZSlPSP3vP7XQpDj1HPmXynF/WEH3Fe3SCSEdkd2L8+ujEnUqZXcm0rl+r4DtJ\n\tUmHo9ycdgTBQzWFPFCiDK0kKODE7VXke7wz0ENGMwJLLfxA34012SD5kRa0j69OHMQeo\n\tsSJQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=jPus3FcP5etJB05ijHlMi7zYjv7msj437AOXSM+Y2Dw=;\n\tb=bgniO6+DMV3EQesDFTPiEvy7UxuHwu3QLPCZI/mll4/URYiKbt0wXuAmll5Z+CwXC0\n\tZ3iAfnGSQTAmi+Lpu72qJhqEZyttrQvSO1JFtBBjrbCg9J7xbY/ifl02ULFp0VGm2YU0\n\t7WWn+l57g6ihdst8ZuaXqslBNmZ8VxiUpccZySS6VjTooj0ERuN+zi3I1nryUtA5niff\n\tdZbxZczdsc8V1mjS8jxlyMExgEk9/LL/hmgKBR3oLFl7ro6mN/QLg7Ve0zuIHgxAwa4x\n\t9WkhR3kb1MyoCsi499YCAN2qX9ZbiY9A5jpxEBbG8OCmRpHunfAg9hG/bhS/HSiRriGR\n\tphtA==","X-Gm-Message-State":"AOAM532Q7CgcLuKqZq6HtMF2f/p8TF1GuP3xghEFtBCnuNeMdnPXpgGs\n\tSy4cOIlvrjpAwdafWHVbf8qdtGjifm54Q/j8","X-Google-Smtp-Source":"ABdhPJwew+emIjPcPrpWUplOiFv1z4VXdh1w15Na+xTBlOHca9NGCj16MRnsRzaLS084r2dclI+hMA==","X-Received":"by 2002:a1c:1d42:: with SMTP id d63mr4059292wmd.26.1614272508304;\n\tThu, 25 Feb 2021 09:01:48 -0800 (PST)","From":"David Plowman <david.plowman@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 25 Feb 2021 17:01:41 +0000","Message-Id":"<20210225170141.5184-3-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20210225170141.5184-1-david.plowman@raspberrypi.com>","References":"<20210225170141.5184-1-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 2/2] ipa: raspberrypi: AWB: Ignore invalid\n\tstatistics zones correctly","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Regions of the image where the statistics are not trusted should not\nbe put in the zones_ list.\n\nThis also means that the AWB may fail to run initially, so\nasync_results_ needs to be initialised to some kind of default.\n\nFinally, the RGB zone structures can be zero-initialised safely now,\nthe previous value of -1 would seem unusual.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/controller/rpi/awb.cpp | 3 ++-\n src/ipa/raspberrypi/controller/rpi/awb.hpp | 2 +-\n 2 files changed, 3 insertions(+), 2 deletions(-)","diff":"diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp\nindex 791a7039..1c917e4f 100644\n--- a/src/ipa/raspberrypi/controller/rpi/awb.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp\n@@ -169,6 +169,7 @@ void Awb::Initialise()\n \t\t\tsync_results_.gain_b = 1.0;\n \t}\n \tprev_sync_results_ = sync_results_;\n+\tasync_results_ = sync_results_;\n }\n \n unsigned int Awb::GetConvergenceFrames() const\n@@ -345,9 +346,9 @@ static void generate_stats(std::vector<Awb::RGB> &zones,\n \t\t\tif (zone.G >= min_G) {\n \t\t\t\tzone.R = stats[i].r_sum / counted;\n \t\t\t\tzone.B = stats[i].b_sum / counted;\n+\t\t\t\tzones.push_back(zone);\n \t\t\t}\n \t\t}\n-\t\tzones.push_back(zone);\n \t}\n }\n \ndiff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp\nindex 2fe59c37..8af1f27c 100644\n--- a/src/ipa/raspberrypi/controller/rpi/awb.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp\n@@ -90,7 +90,7 @@ public:\n \tvoid Prepare(Metadata *image_metadata) override;\n \tvoid Process(StatisticsPtr &stats, Metadata *image_metadata) override;\n \tstruct RGB {\n-\t\tRGB(double _R = -1.0, double _G = -1.0, double _B = -1.0)\n+\t\tRGB(double _R = 0, double _G = 0, double _B = 0)\n \t\t\t: R(_R), G(_G), B(_B)\n \t\t{\n \t\t}\n","prefixes":["libcamera-devel","2/2"]}