[{"id":25476,"web_url":"https://patchwork.libcamera.org/comment/25476/","msgid":"<Y1AhMMg0emS/0zk8@pendragon.ideasonboard.com>","date":"2022-10-19T16:09:20","subject":"Re: [libcamera-devel] [PATCH] utils: raspberrypi: ctt: Fix alsc\n\tgreen averaging","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\n(CC'ing Naush and David)\n\nThank you for the patch.\n\nOn Wed, Oct 19, 2022 at 08:41:43PM +0900, Paul Elder via libcamera-devel wrote:\n> The alsc component of ctt meant to average the two green channels into\n> one, but used incorrect indexing resulting in only the first green\n> channel being used. Fix this.\n\nWell spotted.\n\n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nI'd like to have an ack from David or Naush too.\n\nThis makes me wonder how different the two green channels can be if this\nhas never been noticed before.\n\n> ---\n>  utils/raspberrypi/ctt/ctt_alsc.py | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/utils/raspberrypi/ctt/ctt_alsc.py b/utils/raspberrypi/ctt/ctt_alsc.py\n> index c0ba7b63..e51d6931 100644\n> --- a/utils/raspberrypi/ctt/ctt_alsc.py\n> +++ b/utils/raspberrypi/ctt/ctt_alsc.py\n> @@ -132,7 +132,7 @@ def alsc(Cam, Img, do_alsc_colour, plot=False):\n>      \"\"\"\n>      average the green channels into one\n>      \"\"\"\n> -    av_ch_g = np.mean((channels[1:2]), axis=0)\n> +    av_ch_g = np.mean((channels[1:3]), axis=0)\n>      if do_alsc_colour:\n>          \"\"\"\n>          obtain 16x12 grid of intensities for each channel and subtract black level","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 A1F62C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 19 Oct 2022 16:09:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EDD6C62E5F;\n\tWed, 19 Oct 2022 18:09:45 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6390962DFA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Oct 2022 18:09:45 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9EBF15A4;\n\tWed, 19 Oct 2022 18:09:44 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666195786;\n\tbh=p39fjKLRryTrVZ5QQyMDoBDisfd2qTngb6sZF/XPjLE=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=kpcEpreLtNXhpYfWJHi6jdRTwg4R+QdKzyirc72SU4RrSY2FFBfpwC06I23WSa6NI\n\tJkvq+eaW3AQR1J+XlJe+sfikXJVTSUqofuDEqLitCRdGOwfZTTowAGG4ZYOlvIzc+j\n\tUqHVspPYtiEfm/cz5CNTf/RmJvatFNqDH4aPlS0AxDuoMNp1GrxcV1s6tp9bPD39QE\n\tVvJLXVGhJAqOEvNFf+rlaZFt4bydfo/7HzKhBeXU5T9+CSosXBkYVJtIU8X1u9B7yy\n\t0pRUns22OXICpaCgOXHgS33n/DThXMu/Z1l+KSv6hboI6uICxV5jatWQnqnTR/uBHY\n\tnRG7S78MHpOxA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1666195784;\n\tbh=p39fjKLRryTrVZ5QQyMDoBDisfd2qTngb6sZF/XPjLE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=CB4b5xHMRhr2woDLNZ52OUdFWMpcnbKAolJ5TeM0Ob5IiqbiQASxMLHA0yPU49VOF\n\teSLIRK4fdjd4LWybQ3CzWeEmgWrDdFAgKEAsi/9rlKDkXcgRmlzlTx9w4WKxxFpjZT\n\t38OcTFR+aOC8SLlj1NNe/PQr/3EKJrQx1kTA7DM4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"CB4b5xHM\"; dkim-atps=neutral","Date":"Wed, 19 Oct 2022 19:09:20 +0300","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<Y1AhMMg0emS/0zk8@pendragon.ideasonboard.com>","References":"<20221019114143.479093-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221019114143.479093-1-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] utils: raspberrypi: ctt: Fix alsc\n\tgreen averaging","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25477,"web_url":"https://patchwork.libcamera.org/comment/25477/","msgid":"<CAHW6GY+M0Lx7jdfkN9w7N0_W36347XvMrN0k8XRhKo28gEZQ8Q@mail.gmail.com>","date":"2022-10-19T17:07:45","subject":"Re: [libcamera-devel] [PATCH] utils: raspberrypi: ctt: Fix alsc\n\tgreen averaging","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Paul\n\nThanks for spotting this, indeed I assume it was probably the\nintention to do it this way.\n\nOn Wed, 19 Oct 2022 at 17:09, Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hi Paul,\n>\n> (CC'ing Naush and David)\n>\n> Thank you for the patch.\n>\n> On Wed, Oct 19, 2022 at 08:41:43PM +0900, Paul Elder via libcamera-devel wrote:\n> > The alsc component of ctt meant to average the two green channels into\n> > one, but used incorrect indexing resulting in only the first green\n> > channel being used. Fix this.\n>\n> Well spotted.\n>\n> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\n>\n> I'd like to have an ack from David or Naush too.\n>\n> This makes me wonder how different the two green channels can be if this\n> has never been noticed before.\n\nHmm, I'm not sure that you could ever notice. If the red or blue\nchannels are made flat compared to the Gr channel (for example),\nthey're probably also flat compared to the Gb. So you might find that\nthe red values are (again, as an example) 50% of the Gr values\neverywhere but maybe 53% of the Gb. But that should be irrelevant\nbecause we always scale the lens shading gains so that the smallest\none is exactly 1 before applying them. (The AWB then worries about the\nrelative magnitudes of the reds and greens.)\n\nSo I'm somewhat suspecting it makes no real difference, though the\nchange is probably worthwhile just to stop discussions like this!!\n\nThanks again\nDavid\n\n>\n> > ---\n> >  utils/raspberrypi/ctt/ctt_alsc.py | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/utils/raspberrypi/ctt/ctt_alsc.py b/utils/raspberrypi/ctt/ctt_alsc.py\n> > index c0ba7b63..e51d6931 100644\n> > --- a/utils/raspberrypi/ctt/ctt_alsc.py\n> > +++ b/utils/raspberrypi/ctt/ctt_alsc.py\n> > @@ -132,7 +132,7 @@ def alsc(Cam, Img, do_alsc_colour, plot=False):\n> >      \"\"\"\n> >      average the green channels into one\n> >      \"\"\"\n> > -    av_ch_g = np.mean((channels[1:2]), axis=0)\n> > +    av_ch_g = np.mean((channels[1:3]), axis=0)\n> >      if do_alsc_colour:\n> >          \"\"\"\n> >          obtain 16x12 grid of intensities for each channel and subtract black level\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 8230ABD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 19 Oct 2022 17:08:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D3FC362E5F;\n\tWed, 19 Oct 2022 19:08:00 +0200 (CEST)","from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com\n\t[IPv6:2607:f8b0:4864:20::102e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 409B362DFA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Oct 2022 19:07:58 +0200 (CEST)","by mail-pj1-x102e.google.com with SMTP id h14so918080pjv.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Oct 2022 10:07:58 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666199280;\n\tbh=A8fb+CxR+SRFRT+EGcm18nb1yDtsjRHGVzHXwEn2brI=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=1gndlwZKHDQvEG9EpUoqQdoIR2CzroppkSHs6Pb26cAQdeHnazlM3jAym+4Ts3PLL\n\tAIwTzzYvGS4znbR6d+W3NprefMgWmmNDjLzQcHfSyMQTZWw1jW4JBt0A1a0wpagl5o\n\t+YVdoRmPmR0h0RVZx0MgEfkDzlUWzAg3n7cVhtSo3Cor6V3brsRgroGjvPwIyt+frh\n\t/1RZwfGl5MPAgP4RexmB3LzWqQHsuGmQzRBvszVPzBNKPWRJvwW7oyKFV065pw0ohC\n\t/JejB4VzJNin5L0HNYLpS9AN2CB5PHNx93nOkbZE4jgvOBOoPB1bvZ11Nrnf2q8pJ/\n\ttCy25OeSHXr8Q==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\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=1vc0M+qJyDsoXa2laDYLkTxvGX6fADXZruqntn3OWbQ=;\n\tb=JnT9u7jooa/bix5e7j5S6yFY1NcJZQaQBd9+8BESM18WB3FtbqHDd+C5Q0dgUQ1Qbg\n\tcLOqEB8Gf5fLBlx8aVXsXgZt8Q2hp2j3WVObe1xBhOnGz/RDCpXUjvQvdPwS4OfHiFtS\n\t23ovEDmjlMPZvE4Wp59ahOlDrZ7r5SIhvfMROywMHaFK3kJwSoy6bNNEWlUpl74Ls7To\n\tNYumgcfcpiThiwYF4Bpkdtwuco2i6ao6yQXSq2viN2xnPOrDDDj0vUJxPd8cnsLN4vwQ\n\tkU796EBbNXU3IHoHxEf6prTSEH/dOlgk17F9O/u6/VqLEUSw5gYCcQdaxiuK3rmdF5yr\n\tckWg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"JnT9u7jo\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\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=1vc0M+qJyDsoXa2laDYLkTxvGX6fADXZruqntn3OWbQ=;\n\tb=MGutUCeXg3NEiqSR+h1YFZ0zorVJZuZsunpBGoehg2CxMptgMsIcBTVjpRMwzCGsd3\n\tmvMFciCsMdRHOuHcB9yBMJ2jfDzkFmymPN6nUK01BxJAz1NqftijlQW+XunfVbKNbA/8\n\tICi24tRzk8N5NMjexLM+eKI3Vb/awUDKuVLUCBqQzeTcJsT9XhwwpI7ZjO+EjPVBZN0+\n\tMilv7IvUTXlg1ln/gCsBMkkWvLPLl3CsN2YkDqpaW1cMoG3+9AXtmx8z+XTWKp1fZLjF\n\tiI33HUPf2I0XwkngB7pLqVbkTlhAN9BkVkEHDOeDeMZ4jA8heDJAn2IRyT5sICjxoeq+\n\tnLxw==","X-Gm-Message-State":"ACrzQf3+JiXsoTJ4rsSdl05EDqypjOGIIEX7jupzQOagMyF2KRx5gngB\n\twjo33N7xans1q+tQTTbfklsz7Y3o4HPEhBlr+6xi4w==","X-Google-Smtp-Source":"AMsMyM6d7OwC2czDzc8ntFQTQnCC2r1FiZEJATJRTvQgaw6iKwBjOVf6XjZQyRgC96qgZWdmbUnlVEkTYe7Xx55qzyk=","X-Received":"by 2002:a17:90a:6405:b0:203:6eaa:4999 with SMTP id\n\tg5-20020a17090a640500b002036eaa4999mr46602638pjj.8.1666199276472;\n\tWed, 19 Oct 2022 10:07:56 -0700 (PDT)","MIME-Version":"1.0","References":"<20221019114143.479093-1-paul.elder@ideasonboard.com>\n\t<Y1AhMMg0emS/0zk8@pendragon.ideasonboard.com>","In-Reply-To":"<Y1AhMMg0emS/0zk8@pendragon.ideasonboard.com>","Date":"Wed, 19 Oct 2022 18:07:45 +0100","Message-ID":"<CAHW6GY+M0Lx7jdfkN9w7N0_W36347XvMrN0k8XRhKo28gEZQ8Q@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH] utils: raspberrypi: ctt: Fix alsc\n\tgreen averaging","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>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]