[{"id":32256,"web_url":"https://patchwork.libcamera.org/comment/32256/","msgid":"<CAHW6GY+k=b64C=Y1Eb=dO-wLqC7UJGdm16BsTOALJtLCuB7phA@mail.gmail.com>","date":"2024-11-19T09:11:08","subject":"Re: [PATCH] ipa: rpi: awb: Disable CT search bias for Grey World AWB","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch. Yes, we should probably have spotted this\nearlier. But I'll add a test for grey world AWB so that we don't get\ncaught out like this again!\n\nOn Tue, 19 Nov 2024 at 08:55, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n> If grey world AWB is setup in the tuning file, the CT curve will either\n> be missing or invalid. Disable biasing the statistics for the search in\n> such cases.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/ipa/rpi/controller/rpi/awb.cpp | 7 +++++--\n>  1 file changed, 5 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/ipa/rpi/controller/rpi/awb.cpp b/src/ipa/rpi/controller/rpi/awb.cpp\n> index 9d8e170d1bfe..87b1b077ffb8 100644\n> --- a/src/ipa/rpi/controller/rpi/awb.cpp\n> +++ b/src/ipa/rpi/controller/rpi/awb.cpp\n> @@ -459,10 +459,13 @@ void Awb::prepareStats()\n>          * LSC has already been applied to the stats in this pipeline, so stop\n>          * any LSC compensation.  We also ignore config_.fast in this version.\n>          */\n> +       const double biasCtR = config_.bayes && config_.ctR.size() ?\n> +                              config_.ctR.eval(config_.biasCT) : 0;\n> +       const double biasCtB = config_.bayes && config_.ctB.size() ?\n> +                              config_.ctB.eval(config_.biasCT) : 0;\n\nI'm OK with this, though perhaps \"empty()\" is microscopically better\nthan \"size()\" here? Actually, I think the read function ensures that\nthe PWLs are set if bayes is, so we could leave it out completely. But\neither way I'm not overly bothered:\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nDavid\n\n>         generateStats(zones_, statistics_, config_.minPixels,\n>                       config_.minG, getGlobalMetadata(),\n> -                     config_.biasProportion, config_.ctR.eval(config_.biasCT),\n> -                     config_.ctB.eval(config_.biasCT));\n> +                     config_.biasProportion, biasCtR, biasCtB);\n>         /*\n>          * apply sensitivities, so values appear to come from our \"canonical\"\n>          * sensor.\n> --\n> 2.34.1\n>","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 06448C326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Nov 2024 09:11:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 389DA65EDE;\n\tTue, 19 Nov 2024 10:11:22 +0100 (CET)","from mail-qk1-x730.google.com (mail-qk1-x730.google.com\n\t[IPv6:2607:f8b0:4864:20::730])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5CFB165898\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Nov 2024 10:11:20 +0100 (CET)","by mail-qk1-x730.google.com with SMTP id\n\taf79cd13be357-7b147a2ff04so220971585a.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Nov 2024 01:11:20 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"iyLOcahA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1732007479; x=1732612279;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=0OaCGhx0EFIrlN/M3+aCr3jkXHPG03vdLdyq/JSuY7k=;\n\tb=iyLOcahA0wvIyQN3UsgKtoBKlkGphlhbmJV6fnCJcpBviwpw6+nRGEITK8TjNgQ3XZ\n\tLd/jlLOIm5Mz55xL506NE9Z/JyVC1Nne3axrHvj2Nrx1oAClqCcHYP1Ony9iNDvYEctv\n\try4vimFUNUnXyqt6dKIhWXdUI9LrMQtyvfWtIevkk1o89BjTsqnWVmBcfA8eqVzYoBRR\n\tiqeA7Rawe0zoP7PYCQaNdno26HKs4gpb6bXX8nWMrZJqJqsrYBJWrWBDG+ERNYfxVgCl\n\tp95nfZa8i8GIlaTRTISOSSE5YX5CpoAsmdJzX0LHI8G6xf2jBchJlNstMzypxzbbp97Z\n\txxkw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1732007479; x=1732612279;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=0OaCGhx0EFIrlN/M3+aCr3jkXHPG03vdLdyq/JSuY7k=;\n\tb=VYMi2+zKq5rUV+gVL4GSOJ3qsch1PobmqD+wTlriY9kxevT4cZHXhP27kreOurVcxv\n\t2GvUhoBmN3nSwuSb7bnLTG/JPL+0GMN72XvMjMMIM4ABVlbfgv9gaS72czCBpSPZ0GCE\n\t0S0DMZY5bc95tp5Nnqdnjz8dPSvrTqfw/tHBqr9HF28cChFFzVWm45GvFa3vbnivjyF9\n\tH+k9rC7LOKKZxx/vCL4grvCEQRo/zfNeS0lYZqXe9QuS6NPF5gYR53MoqIuXUq3RN6gU\n\tQDnIJLggJHFX8Mm9/dYn/cMGksu3q+ZV/Otk4Fb0HAM8sB4q2P5yyGxbE0+iHm+jChb5\n\tfpEA==","X-Gm-Message-State":"AOJu0YwZMWYD9X5Mcjscwv9k+t6egYRVsjzfpCUN7nmD3x+lLrWrBK2Y\n\tEcx+07DdtLE+MN1BkDCihyWqgsKfR4coT/9o+xp8T6odOEAv/dj1z7bJb8KvL2QSu/2pkZCIhYg\n\ttcY3DE1lS3M0E+CiBusQUaeoallNphv2E//ktUQG36FIqPVD4","X-Google-Smtp-Source":"AGHT+IFqvxaXkpuG4Jx3/Mb+N6qxotv6GwEEu8THyVNEX8deVkYxBdeynQFZNLtguqPiK9lbne/3tKoMUOQV1ws4ykU=","X-Received":"by 2002:a05:6214:5411:b0:6d3:f6c6:2aaa with SMTP id\n\t6a1803df08f44-6d3fb768c8bmr221276166d6.14.1732007479346;\n\tTue, 19 Nov 2024 01:11:19 -0800 (PST)","MIME-Version":"1.0","References":"<20241119084525.22589-1-naush@raspberrypi.com>","In-Reply-To":"<20241119084525.22589-1-naush@raspberrypi.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Tue, 19 Nov 2024 09:11:08 +0000","Message-ID":"<CAHW6GY+k=b64C=Y1Eb=dO-wLqC7UJGdm16BsTOALJtLCuB7phA@mail.gmail.com>","Subject":"Re: [PATCH] ipa: rpi: awb: Disable CT search bias for Grey World AWB","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32258,"web_url":"https://patchwork.libcamera.org/comment/32258/","msgid":"<173200828949.576258.17707298982118168132@ping.linuxembedded.co.uk>","date":"2024-11-19T09:24:49","subject":"Re: [PATCH] ipa: rpi: awb: Disable CT search bias for Grey World AWB","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck (2024-11-19 08:45:25)\n> If grey world AWB is setup in the tuning file, the CT curve will either\n> be missing or invalid. Disable biasing the statistics for the search in\n> such cases.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nWhat's the fixes tag for this (mostly so I can report this as a fix in\nthe next release?)\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/ipa/rpi/controller/rpi/awb.cpp | 7 +++++--\n>  1 file changed, 5 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/ipa/rpi/controller/rpi/awb.cpp b/src/ipa/rpi/controller/rpi/awb.cpp\n> index 9d8e170d1bfe..87b1b077ffb8 100644\n> --- a/src/ipa/rpi/controller/rpi/awb.cpp\n> +++ b/src/ipa/rpi/controller/rpi/awb.cpp\n> @@ -459,10 +459,13 @@ void Awb::prepareStats()\n>          * LSC has already been applied to the stats in this pipeline, so stop\n>          * any LSC compensation.  We also ignore config_.fast in this version.\n>          */\n> +       const double biasCtR = config_.bayes && config_.ctR.size() ?\n> +                              config_.ctR.eval(config_.biasCT) : 0;\n> +       const double biasCtB = config_.bayes && config_.ctB.size() ?\n> +                              config_.ctB.eval(config_.biasCT) : 0;\n>         generateStats(zones_, statistics_, config_.minPixels,\n>                       config_.minG, getGlobalMetadata(),\n> -                     config_.biasProportion, config_.ctR.eval(config_.biasCT),\n> -                     config_.ctB.eval(config_.biasCT));\n> +                     config_.biasProportion, biasCtR, biasCtB);\n>         /*\n>          * apply sensitivities, so values appear to come from our \"canonical\"\n>          * sensor.\n> -- \n> 2.34.1\n>","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 8F1D0C326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Nov 2024 09:24:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8C5EE65EE0;\n\tTue, 19 Nov 2024 10:24:54 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E0C9665898\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Nov 2024 10:24:52 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8ED57B3;\n\tTue, 19 Nov 2024 10:24:35 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"h8+xxbcd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732008275;\n\tbh=cmEsrC5eim5Zxig5gGp7XzDTRcgDyYn64LfGocNqSLo=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=h8+xxbcdo9Cej56Gp38BFsAX/m4Z93gVUjvJC/dmnyw2fcIoeWh2HmIYOw17U8zdf\n\tMnJEvaWeiBQvxRPO5eI1PiBwupbg7/URWom/aTqJx/60iAe+UdCENaZqEiJVW8pnXm\n\tWwSMqeQ/kueTNB+Tx3lAjY4ZAbCBEE3FR0ErHlV0=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241119084525.22589-1-naush@raspberrypi.com>","References":"<20241119084525.22589-1-naush@raspberrypi.com>","Subject":"Re: [PATCH] ipa: rpi: awb: Disable CT search bias for Grey World AWB","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"david.plowman@raspberrypi.com, Naushir Patuck <naush@raspberrypi.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 19 Nov 2024 09:24:49 +0000","Message-ID":"<173200828949.576258.17707298982118168132@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32259,"web_url":"https://patchwork.libcamera.org/comment/32259/","msgid":"<CAEmqJPppZwOkY4xGyhjdBhPHXk-xHtoff2VNfitp40nR_+cEOg@mail.gmail.com>","date":"2024-11-19T09:27:14","subject":"Re: [PATCH] ipa: rpi: awb: Disable CT search bias for Grey World AWB","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"On Tue, 19 Nov 2024 at 09:24, Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Quoting Naushir Patuck (2024-11-19 08:45:25)\n> > If grey world AWB is setup in the tuning file, the CT curve will either\n> > be missing or invalid. Disable biasing the statistics for the search in\n> > such cases.\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n>\n> What's the fixes tag for this (mostly so I can report this as a fix in\n> the next release?)\n>\n\nGood point, please add if possible:\n\nFixes: ea8fd63d936f (\"ipa: rpi: awb: Add a bias to the AWB search\")\n\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n> > ---\n> >  src/ipa/rpi/controller/rpi/awb.cpp | 7 +++++--\n> >  1 file changed, 5 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/src/ipa/rpi/controller/rpi/awb.cpp b/src/ipa/rpi/controller/rpi/awb.cpp\n> > index 9d8e170d1bfe..87b1b077ffb8 100644\n> > --- a/src/ipa/rpi/controller/rpi/awb.cpp\n> > +++ b/src/ipa/rpi/controller/rpi/awb.cpp\n> > @@ -459,10 +459,13 @@ void Awb::prepareStats()\n> >          * LSC has already been applied to the stats in this pipeline, so stop\n> >          * any LSC compensation.  We also ignore config_.fast in this version.\n> >          */\n> > +       const double biasCtR = config_.bayes && config_.ctR.size() ?\n> > +                              config_.ctR.eval(config_.biasCT) : 0;\n> > +       const double biasCtB = config_.bayes && config_.ctB.size() ?\n> > +                              config_.ctB.eval(config_.biasCT) : 0;\n> >         generateStats(zones_, statistics_, config_.minPixels,\n> >                       config_.minG, getGlobalMetadata(),\n> > -                     config_.biasProportion, config_.ctR.eval(config_.biasCT),\n> > -                     config_.ctB.eval(config_.biasCT));\n> > +                     config_.biasProportion, biasCtR, biasCtB);\n> >         /*\n> >          * apply sensitivities, so values appear to come from our \"canonical\"\n> >          * sensor.\n> > --\n> > 2.34.1\n> >","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 00946C32F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Nov 2024 09:27:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 12F8665EE4;\n\tTue, 19 Nov 2024 10:27:54 +0100 (CET)","from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com\n\t[IPv6:2607:f8b0:4864:20::b31])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 432E665898\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Nov 2024 10:27:52 +0100 (CET)","by mail-yb1-xb31.google.com with SMTP id\n\t3f1490d57ef6-e3337b09c9dso619173276.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Nov 2024 01:27:52 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"tVTEkLDi\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1732008471; x=1732613271;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=GyRvuZ9Uw5YA8rxl8cDXbzYxK0FU1eUHrPYQa3sHw4E=;\n\tb=tVTEkLDiTrjs1i2LVc0r6KMtZ5VcaDVPF5R2Cp30eW0c0Xrj17kpqcmf7dFRv+CNHm\n\tmhA6trkHjFSJw9mZYcYEH1ruRlmLh+WZwP9Tryt80Bq+HgPKKNRvkeyj1qXldYzuQ66L\n\tzSXsldxpACWYZA957jzJ8n5jBhghARJ2tGcU07Bom5aka6I99diNUF8OaQBWnHGzt6/e\n\tzQ55xUg9baxY0sV3V91NSXAhlSFdTp//E/L0wtQqY5ZR3vgnc2FS7PlfUljSvGvIHnZ1\n\t2991rHjAenZ79NAisMOODesAobDgjK68wXU5T8Q6Ft1ygip+0QeQORPHq0J9oqxQzXxs\n\ttprQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1732008471; x=1732613271;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=GyRvuZ9Uw5YA8rxl8cDXbzYxK0FU1eUHrPYQa3sHw4E=;\n\tb=wUwCeWGVHnO9/BQ0aDouGXtODjh6eu25Xi2iY3AfyPZ6Jd1Qwy+zf9vqhK2Bh3u6v+\n\teQPhu7ukWonhqwpaF6FMCqtw1hHIE6wVTtH9dtEp9lBu2CEZ7MJZhTZqg/gV4/H6VDsu\n\tnzQ+hjuaHnOIkIDUAhTqcRTa91WGvpLoljzh1UbiYTbseUMLt4IKfu3CakGIC/NA2ayC\n\t9Ls2KdwcLAM0RjxfNvIynaEqYSsTo4EpfsWMD7WcHX/f8eeyG3vt6dIU9fJ2a1e7hUzw\n\tt7Eun7vq/L6+9/TRqj7/QqvpItW7DIJnm5AY94sQbfQtyOWDVa1wOn0skGAFsJJjKi5p\n\tmsEQ==","X-Gm-Message-State":"AOJu0Yw4AwfUgM6UUrvgWZOOXgQrMkqGInO3vofW5IIqSVhJQDXiWhua\n\t10JmdRi2C93LUB3pFiOWlOeiE9M1beWz4KCzfi5pA3c4KzO/HMykxqaDmDeaJl2PXSNH9WvUFCc\n\ttVzTvjGYtnZ4jcWVDjYQHyGHAD3F+mP9EX2xzsg==","X-Google-Smtp-Source":"AGHT+IErumPiUwmjnQBzCAu5aPD/nupQg9pZwax1QK1Tx/06mCK+gTCrehYcMSU3dh/nHh6VwtCrtVR1W6/PcZoT//c=","X-Received":"by 2002:a05:690c:6703:b0:6d3:c7d:5eaa with SMTP id\n\t00721157ae682-6ee55cf6328mr59867877b3.8.1732008470828;\n\tTue, 19 Nov 2024 01:27:50 -0800 (PST)","MIME-Version":"1.0","References":"<20241119084525.22589-1-naush@raspberrypi.com>\n\t<173200828949.576258.17707298982118168132@ping.linuxembedded.co.uk>","In-Reply-To":"<173200828949.576258.17707298982118168132@ping.linuxembedded.co.uk>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Tue, 19 Nov 2024 09:27:14 +0000","Message-ID":"<CAEmqJPppZwOkY4xGyhjdBhPHXk-xHtoff2VNfitp40nR_+cEOg@mail.gmail.com>","Subject":"Re: [PATCH] ipa: rpi: awb: Disable CT search bias for Grey World AWB","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, david.plowman@raspberrypi.com","Content-Type":"text/plain; charset=\"UTF-8\"","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32262,"web_url":"https://patchwork.libcamera.org/comment/32262/","msgid":"<20241119100426.GF31681@pendragon.ideasonboard.com>","date":"2024-11-19T10:04:26","subject":"Re: [PATCH] ipa: rpi: awb: Disable CT search bias for Grey World AWB","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Nov 19, 2024 at 09:11:08AM +0000, David Plowman wrote:\n> Hi Naush\n> \n> Thanks for the patch. Yes, we should probably have spotted this\n> earlier. But I'll add a test for grey world AWB so that we don't get\n> caught out like this again!\n> \n> On Tue, 19 Nov 2024 at 08:55, Naushir Patuck <naush@raspberrypi.com> wrote:\n> >\n> > If grey world AWB is setup in the tuning file, the CT curve will either\n> > be missing or invalid. Disable biasing the statistics for the search in\n> > such cases.\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > ---\n> >  src/ipa/rpi/controller/rpi/awb.cpp | 7 +++++--\n> >  1 file changed, 5 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/src/ipa/rpi/controller/rpi/awb.cpp b/src/ipa/rpi/controller/rpi/awb.cpp\n> > index 9d8e170d1bfe..87b1b077ffb8 100644\n> > --- a/src/ipa/rpi/controller/rpi/awb.cpp\n> > +++ b/src/ipa/rpi/controller/rpi/awb.cpp\n> > @@ -459,10 +459,13 @@ void Awb::prepareStats()\n> >          * LSC has already been applied to the stats in this pipeline, so stop\n> >          * any LSC compensation.  We also ignore config_.fast in this version.\n> >          */\n> > +       const double biasCtR = config_.bayes && config_.ctR.size() ?\n> > +                              config_.ctR.eval(config_.biasCT) : 0;\n> > +       const double biasCtB = config_.bayes && config_.ctB.size() ?\n> > +                              config_.ctB.eval(config_.biasCT) : 0;\n> \n> I'm OK with this, though perhaps \"empty()\" is microscopically better\n> than \"size()\" here? Actually, I think the read function ensures that\n> the PWLs are set if bayes is, so we could leave it out completely. But\n> either way I'm not overly bothered:\n\nYes, I think we can write\n\n\tconst double biasCtR = config_.bayes ? config_.ctR.eval(config_.biasCT) : 0;\n\tconst double biasCtB = config_.bayes ? config_.ctB.eval(config_.biasCT) : 0;\n\n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> \n> >         generateStats(zones_, statistics_, config_.minPixels,\n> >                       config_.minG, getGlobalMetadata(),\n> > -                     config_.biasProportion, config_.ctR.eval(config_.biasCT),\n> > -                     config_.ctB.eval(config_.biasCT));\n> > +                     config_.biasProportion, biasCtR, biasCtB);\n> >         /*\n> >          * apply sensitivities, so values appear to come from our \"canonical\"\n> >          * sensor.","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 7C519C326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Nov 2024 10:04:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ABAA365EE9;\n\tTue, 19 Nov 2024 11:04:40 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5B41E6589D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Nov 2024 11:04:38 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2ECAED52;\n\tTue, 19 Nov 2024 11:04:19 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"wSlwhWg0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732010659;\n\tbh=qqakLdjG9R6+mHoY0b+lCDD4nAYfaDafBuDjm1Spn1k=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=wSlwhWg0DPKKGnMRPPJB6h8IbjkCfgzB2k0wrrwvACefwuSvnUyG4oEEb6iBM2qTc\n\tQlVT5uO8arzui+SDpsUQ8SZhyIL+j/x6kbGYIn4xbUnv28MunflCKHzapwAxInvVsE\n\tnG/uByBEjIKsBznRtRR9TG9mzFstfulupmkBcHKM=","Date":"Tue, 19 Nov 2024 12:04:26 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] ipa: rpi: awb: Disable CT search bias for Grey World AWB","Message-ID":"<20241119100426.GF31681@pendragon.ideasonboard.com>","References":"<20241119084525.22589-1-naush@raspberrypi.com>\n\t<CAHW6GY+k=b64C=Y1Eb=dO-wLqC7UJGdm16BsTOALJtLCuB7phA@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAHW6GY+k=b64C=Y1Eb=dO-wLqC7UJGdm16BsTOALJtLCuB7phA@mail.gmail.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]