[{"id":20902,"web_url":"https://patchwork.libcamera.org/comment/20902/","msgid":"<051acc49-2bcb-db8f-0049-5ce3a9375adc@ideasonboard.com>","date":"2021-11-12T09:42:33","subject":"Re: [libcamera-devel] [PATCH v4 10/14] ipa: ipu3: awb: Add support\n\tfor color temperature","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi JM\n\nThank you for the patch\n\nOn 11/11/21 7:39 PM, Jean-Michel Hautbois wrote:\n> The AWB estimates the color temperature, but it is not used at all. It\n> can be useful for debug purpose at least, but also for lux estimation\n> later, to be able to know the temperature estimated for a given frame.\n>\n> Add a new member to the IPAFrameContext::awb for this purpose, and\n> update the value in AWB.\n>\n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   src/ipa/ipu3/algorithms/awb.cpp | 1 +\n>   src/ipa/ipu3/ipa_context.cpp    | 3 +++\n>   src/ipa/ipu3/ipa_context.h      | 2 ++\n>   3 files changed, 6 insertions(+)\n>\n> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n> index a4114659..c7bcb20e 100644\n> --- a/src/ipa/ipu3/algorithms/awb.cpp\n> +++ b/src/ipa/ipu3/algorithms/awb.cpp\n> @@ -385,6 +385,7 @@ void Awb::process(IPAContext &context, const ipu3_uapi_stats_3a *stats)\n>   \tcontext.frameContext.awb.gains.blue = asyncResults_.blueGain;\n>   \tcontext.frameContext.awb.gains.green = asyncResults_.greenGain;\n>   \tcontext.frameContext.awb.gains.red = asyncResults_.redGain;\n> +\tcontext.frameContext.awb.temperatureK = asyncResults_.temperatureK;\n>   }\n>   \n>   constexpr uint16_t Awb::threshold(float value)\n> diff --git a/src/ipa/ipu3/ipa_context.cpp b/src/ipa/ipu3/ipa_context.cpp\n> index a7ff957d..99caf9ad 100644\n> --- a/src/ipa/ipu3/ipa_context.cpp\n> +++ b/src/ipa/ipu3/ipa_context.cpp\n> @@ -117,6 +117,9 @@ namespace libcamera::ipa::ipu3 {\n>    *\n>    * \\var IPAFrameContext::awb.gains.blue\n>    * \\brief White balance gain for B channel\n> + *\n> + * \\var IPAFrameContext::awb.temperatureK\n> + * \\brief Estimated color temperature\n>    */\n>   \n>   /**\n> diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h\n> index a5a19800..fd97e240 100644\n> --- a/src/ipa/ipu3/ipa_context.h\n> +++ b/src/ipa/ipu3/ipa_context.h\n> @@ -45,6 +45,8 @@ struct IPAFrameContext {\n>   \t\t\tdouble green;\n>   \t\t\tdouble blue;\n>   \t\t} gains;\n> +\n> +\t\tdouble temperatureK;\n>   \t} awb;\n>   \n>   \tstruct {","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 36975BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Nov 2021 09:42:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 608BD6034D;\n\tFri, 12 Nov 2021 10:42:38 +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 AAEA860234\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Nov 2021 10:42:37 +0100 (CET)","from [192.168.1.106] (unknown [103.251.226.254])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B67E174C;\n\tFri, 12 Nov 2021 10:42:36 +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=\"oRQVT2oE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1636710157;\n\tbh=EQ3BkLYsyZmClGRMZefgTFFGN1+8aQGlCQ5RIx73ACw=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=oRQVT2oE4MGxCuD2KJZ2IMoTgdYCdaEfhlrI8VTrzXce+p1Xkqq2kXWpbMK9+B4KU\n\trsRdIQWxlv697wCExy5VHQ/NWgit4dnKL2rxb9hG2juYRTpBLm9TvD+qluU2dGBm0h\n\txOuAXhVLsEshu+KsLJV5bhbJar/V6U6PpBaUmbKE=","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20211111140928.136111-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20211111140928.136111-11-jeanmichel.hautbois@ideasonboard.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<051acc49-2bcb-db8f-0049-5ce3a9375adc@ideasonboard.com>","Date":"Fri, 12 Nov 2021 15:12:33 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<20211111140928.136111-11-jeanmichel.hautbois@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH v4 10/14] ipa: ipu3: awb: Add support\n\tfor color temperature","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":20938,"web_url":"https://patchwork.libcamera.org/comment/20938/","msgid":"<20211112231943.GH8453@jade.amanokami.net>","date":"2021-11-12T23:19:43","subject":"Re: [libcamera-devel] [PATCH v4 10/14] ipa: ipu3: awb: Add support\n\tfor color temperature","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Jean-Michel,\n\nOn Thu, Nov 11, 2021 at 03:09:24PM +0100, Jean-Michel Hautbois wrote:\n> The AWB estimates the color temperature, but it is not used at all. It\n> can be useful for debug purpose at least, but also for lux estimation\n> later, to be able to know the temperature estimated for a given frame.\n> \n> Add a new member to the IPAFrameContext::awb for this purpose, and\n> update the value in AWB.\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/ipa/ipu3/algorithms/awb.cpp | 1 +\n>  src/ipa/ipu3/ipa_context.cpp    | 3 +++\n>  src/ipa/ipu3/ipa_context.h      | 2 ++\n>  3 files changed, 6 insertions(+)\n> \n> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n> index a4114659..c7bcb20e 100644\n> --- a/src/ipa/ipu3/algorithms/awb.cpp\n> +++ b/src/ipa/ipu3/algorithms/awb.cpp\n> @@ -385,6 +385,7 @@ void Awb::process(IPAContext &context, const ipu3_uapi_stats_3a *stats)\n>  \tcontext.frameContext.awb.gains.blue = asyncResults_.blueGain;\n>  \tcontext.frameContext.awb.gains.green = asyncResults_.greenGain;\n>  \tcontext.frameContext.awb.gains.red = asyncResults_.redGain;\n> +\tcontext.frameContext.awb.temperatureK = asyncResults_.temperatureK;\n>  }\n>  \n>  constexpr uint16_t Awb::threshold(float value)\n> diff --git a/src/ipa/ipu3/ipa_context.cpp b/src/ipa/ipu3/ipa_context.cpp\n> index a7ff957d..99caf9ad 100644\n> --- a/src/ipa/ipu3/ipa_context.cpp\n> +++ b/src/ipa/ipu3/ipa_context.cpp\n> @@ -117,6 +117,9 @@ namespace libcamera::ipa::ipu3 {\n>   *\n>   * \\var IPAFrameContext::awb.gains.blue\n>   * \\brief White balance gain for B channel\n> + *\n> + * \\var IPAFrameContext::awb.temperatureK\n> + * \\brief Estimated color temperature\n>   */\n>  \n>  /**\n> diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h\n> index a5a19800..fd97e240 100644\n> --- a/src/ipa/ipu3/ipa_context.h\n> +++ b/src/ipa/ipu3/ipa_context.h\n> @@ -45,6 +45,8 @@ struct IPAFrameContext {\n>  \t\t\tdouble green;\n>  \t\t\tdouble blue;\n>  \t\t} gains;\n> +\n> +\t\tdouble temperatureK;\n>  \t} awb;\n>  \n>  \tstruct {\n> -- \n> 2.32.0\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 94D74BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Nov 2021 23:19:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4A61E6036B;\n\tSat, 13 Nov 2021 00:19:55 +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 627D6600B5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Nov 2021 00:19:54 +0100 (CET)","from jade.amanokami.net (KD027085206038.au-net.ne.jp\n\t[27.85.206.38])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 901709CA;\n\tSat, 13 Nov 2021 00:19:52 +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=\"sDO8zQqt\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1636759194;\n\tbh=DNWwO+eqUoqc6rK7c4XqmU9xYNXSMF3sTAim7MP7Ke0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=sDO8zQqtEs/fEOa6HSLXTRUvA6Is0l/XFB33n3C0KMtWuoPK15js7fNeV3dT0rV6f\n\tJvYobNKe/ayBDo0Al4NWlyYTgZ6uPF/O/B+i4aku4/BXSzYMqEqvbD0KinknHKpsc6\n\t0NVLrYtkhSjaeEUxME415escaF3diC4AUOLK52A0=","Date":"Sat, 13 Nov 2021 08:19:43 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<20211112231943.GH8453@jade.amanokami.net>","References":"<20211111140928.136111-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20211111140928.136111-11-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20211111140928.136111-11-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 10/14] ipa: ipu3: awb: Add support\n\tfor color temperature","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]