[{"id":30933,"web_url":"https://patchwork.libcamera.org/comment/30933/","msgid":"<Zs7Oz_YJNhQuZepY@pyrite.rasen.tech>","date":"2024-08-28T07:16:31","subject":"Re: [PATCH v4 4/6] libtuning: Modify ctt_awb.awb() so that it can\n\trun in our context","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"On Tue, Aug 13, 2024 at 10:44:21AM +0200, Stefan Klug wrote:\n> Modify the awb function that was copied from the Raspberry Pi tuning\n> scripts in a way that it can easily be called from the libtuning code.\n> In essence the logging was replaced by calls to a python logger and the\n> need for the Cam object was removed by providing a list of images to the\n> function.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  utils/tuning/libtuning/ctt_awb.py | 55 ++++++++++++++++---------------\n>  1 file changed, 28 insertions(+), 27 deletions(-)\n> \n> diff --git a/utils/tuning/libtuning/ctt_awb.py b/utils/tuning/libtuning/ctt_awb.py\n> index abf22321a0ea..73a1bc1a840c 100644\n> --- a/utils/tuning/libtuning/ctt_awb.py\n> +++ b/utils/tuning/libtuning/ctt_awb.py\n> @@ -4,6 +4,8 @@\n>  #\n>  # camera tuning tool for AWB\n>  \n> +import logging\n> +\n>  import matplotlib.pyplot as plt\n>  from bisect import bisect_left\n>  from scipy.optimize import fmin\n> @@ -11,12 +13,12 @@ import numpy as np\n>  \n>  from .image import Image\n>  \n> +logger = logging.getLogger(__name__)\n>  \n>  \"\"\"\n>  obtain piecewise linear approximation for colour curve\n>  \"\"\"\n> -def awb(Cam, cal_cr_list, cal_cb_list, plot):\n> -    imgs = Cam.imgs\n> +def awb(imgs, cal_cr_list, cal_cb_list, plot):\n>      \"\"\"\n>      condense alsc calibration tables into one dictionary\n>      \"\"\"\n> @@ -39,7 +41,7 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>      rb_raw = []\n>      rbs_hat = []\n>      for Img in imgs:\n> -        Cam.log += '\\nProcessing '+Img.name\n> +        logger.info(f'Processing {Img.name}')\n>          \"\"\"\n>          get greyscale patches with alsc applied if alsc enabled.\n>          Note: if alsc is disabled then colour_cals will be set to None and the\n> @@ -51,7 +53,7 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>          \"\"\"\n>          r_g = np.mean(r_patchs/g_patchs)\n>          b_g = np.mean(b_patchs/g_patchs)\n> -        Cam.log += '\\n       r : {:.4f}       b : {:.4f}'.format(r_g, b_g)\n> +        logger.info('       r : {:.4f}       b : {:.4f}'.format(r_g, b_g))\n>          \"\"\"\n>          The curve tends to be better behaved in so-called hatspace.\n>          R, B, G represent the individual channels. The colour curve is plotted in\n> @@ -74,12 +76,11 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>          \"\"\"\n>          r_g_hat = r_g/(1+r_g+b_g)\n>          b_g_hat = b_g/(1+r_g+b_g)\n> -        Cam.log += '\\n   r_hat : {:.4f}   b_hat : {:.4f}'.format(r_g_hat, b_g_hat)\n> -        rbs_hat.append((r_g_hat, b_g_hat, Img.col))\n> +        logger.info('\\n   r_hat : {:.4f}   b_hat : {:.4f}'.format(r_g_hat, b_g_hat))\n> +        rbs_hat.append((r_g_hat, b_g_hat, Img.color))\n>          rb_raw.append((r_g, b_g))\n> -        Cam.log += '\\n'\n>  \n> -    Cam.log += '\\nFinished processing images'\n> +    logger.info('Finished processing images')\n>      \"\"\"\n>      sort all lits simultaneously by r_hat\n>      \"\"\"\n> @@ -95,7 +96,7 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>      fit quadratic fit to r_g hat and b_g_hat\n>      \"\"\"\n>      a, b, c = np.polyfit(rbs_hat[0], rbs_hat[1], 2)\n> -    Cam.log += '\\nFit quadratic curve in hatspace'\n> +    logger.info('Fit quadratic curve in hatspace')\n>      \"\"\"\n>      the algorithm now approximates the shortest distance from each point to the\n>      curve in dehatspace. Since the fit is done in hatspace, it is easier to\n> @@ -151,14 +152,14 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>          if (x+y) > (rr+bb):\n>              dist *= -1\n>          dists.append(dist)\n> -    Cam.log += '\\nFound closest point on fit line to each point in dehatspace'\n> +    logger.info('Found closest point on fit line to each point in dehatspace')\n>      \"\"\"\n>      calculate wiggle factors in awb. 10% added since this is an upper bound\n>      \"\"\"\n>      transverse_neg = - np.min(dists) * 1.1\n>      transverse_pos = np.max(dists) * 1.1\n> -    Cam.log += '\\nTransverse pos : {:.5f}'.format(transverse_pos)\n> -    Cam.log += '\\nTransverse neg : {:.5f}'.format(transverse_neg)\n> +    logger.info('Transverse pos : {:.5f}'.format(transverse_pos))\n> +    logger.info('Transverse neg : {:.5f}'.format(transverse_neg))\n>      \"\"\"\n>      set minimum transverse wiggles to 0.1 .\n>      Wiggle factors dictate how far off of the curve the algorithm searches. 0.1\n> @@ -167,10 +168,10 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>      \"\"\"\n>      if transverse_pos < 0.01:\n>          transverse_pos = 0.01\n> -        Cam.log += '\\nForced transverse pos to 0.01'\n> +        logger.info('Forced transverse pos to 0.01')\n>      if transverse_neg < 0.01:\n>          transverse_neg = 0.01\n> -        Cam.log += '\\nForced transverse neg to 0.01'\n> +        logger.info('Forced transverse neg to 0.01')\n>  \n>      \"\"\"\n>      generate new b_hat values at each r_hat according to fit\n> @@ -202,25 +203,25 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>      i = len(c_fit) - 1\n>      while i > 0:\n>          if c_fit[i] > c_fit[i-1]:\n> -            Cam.log += '\\nColour temperature increase found\\n'\n> -            Cam.log += '{} K at r = {} to '.format(c_fit[i-1], r_fit[i-1])\n> -            Cam.log += '{} K at r = {}'.format(c_fit[i], r_fit[i])\n> +            logger.info('Colour temperature increase found')\n> +            logger.info('{} K at r = {} to '.format(c_fit[i-1], r_fit[i-1]))\n> +            logger.info('{} K at r = {}'.format(c_fit[i], r_fit[i]))\n>              \"\"\"\n>              if colour temperature increases then discard point furthest from\n>              the transformed fit (dehatspace)\n>              \"\"\"\n>              error_1 = abs(dists[i-1])\n>              error_2 = abs(dists[i])\n> -            Cam.log += '\\nDistances from fit:\\n'\n> -            Cam.log += '{} K : {:.5f} , '.format(c_fit[i], error_1)\n> -            Cam.log += '{} K : {:.5f}'.format(c_fit[i-1], error_2)\n> +            logger.info('Distances from fit:')\n> +            logger.info('{} K : {:.5f} , '.format(c_fit[i], error_1))\n> +            logger.info('{} K : {:.5f}'.format(c_fit[i-1], error_2))\n>              \"\"\"\n>              find bad index\n>              note that in python false = 0 and true = 1\n>              \"\"\"\n>              bad = i - (error_1 < error_2)\n> -            Cam.log += '\\nPoint at {} K deleted as '.format(c_fit[bad])\n> -            Cam.log += 'it is furthest from fit'\n> +            logger.info('Point at {} K deleted as '.format(c_fit[bad]))\n> +            logger.info('it is furthest from fit')\n>              \"\"\"\n>              delete bad point\n>              \"\"\"\n> @@ -239,12 +240,12 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>      return formatted ct curve, ordered by increasing colour temperature\n>      \"\"\"\n>      ct_curve = list(np.array(list(zip(b_fit, r_fit, c_fit))).flatten())[::-1]\n> -    Cam.log += '\\nFinal CT curve:'\n> +    logger.info('Final CT curve:')\n>      for i in range(len(ct_curve)//3):\n>          j = 3*i\n> -        Cam.log += '\\n  ct: {}  '.format(ct_curve[j])\n> -        Cam.log += '  r: {}  '.format(ct_curve[j+1])\n> -        Cam.log += '  b: {}  '.format(ct_curve[j+2])\n> +        logger.info('  ct: {}  '.format(ct_curve[j]))\n> +        logger.info('  r: {}  '.format(ct_curve[j+1]))\n> +        logger.info('  b: {}  '.format(ct_curve[j+2]))\n>  \n>      \"\"\"\n>      plotting code for debug\n> @@ -303,7 +304,7 @@ def get_alsc_patches(Img, colour_cals, grey=True):\n>      \"\"\"\n>      if grey:\n>          cen_coords = Img.cen_coords[3::4]\n> -        col = Img.col\n> +        col = Img.color\n>          patches = [np.array(Img.patches[i]) for i in Img.order]\n>          r_patchs = patches[0][3::4] - Img.blacklevel_16\n>          b_patchs = patches[3][3::4] - Img.blacklevel_16\n> -- \n> 2.43.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 3E328C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Aug 2024 07:16:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C1C0263460;\n\tWed, 28 Aug 2024 09:16:39 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0476061903\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Aug 2024 09:16:38 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:632b:90c4:b4b9:9e22])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6F1AF7E4;\n\tWed, 28 Aug 2024 09:15:29 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"UKcaIuW0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1724829330;\n\tbh=Ij50kO3zJRFRVvrHvI4reLe5asfoR5WhTaJlnNDowfY=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=UKcaIuW0cWwTXqmu84WY8cOTK+/a60XolUyRbaS4BNnF1bQL9FU9YslVjnVUBG42M\n\trlvnD1GlduZ3CIUlnor0+5a45Gu05FAxumAGNWr2hss1Uta9WLEKRZaXx90AJ01+88\n\t5Fj/9wHWlc6wZ9PoZNcHTQM3/qrwmfbw3ikCKi8k=","Date":"Wed, 28 Aug 2024 16:16:31 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v4 4/6] libtuning: Modify ctt_awb.awb() so that it can\n\trun in our context","Message-ID":"<Zs7Oz_YJNhQuZepY@pyrite.rasen.tech>","References":"<20240813084451.44099-1-stefan.klug@ideasonboard.com>\n\t<20240813084451.44099-5-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20240813084451.44099-5-stefan.klug@ideasonboard.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>"}},{"id":30972,"web_url":"https://patchwork.libcamera.org/comment/30972/","msgid":"<20240829231640.GA26181@pendragon.ideasonboard.com>","date":"2024-08-29T23:16:40","subject":"Re: [PATCH v4 4/6] libtuning: Modify ctt_awb.awb() so that it can\n\trun in our context","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Stefan,\n\nThank you for the patch.\n\nOn Tue, Aug 13, 2024 at 10:44:21AM +0200, Stefan Klug wrote:\n> Modify the awb function that was copied from the Raspberry Pi tuning\n> scripts in a way that it can easily be called from the libtuning code.\n> In essence the logging was replaced by calls to a python logger and the\n\ns/was/is/\n\n> need for the Cam object was removed by providing a list of images to the\n\ns/was/is/\n\nThe commit message should use the imperative mood though.\n\n> function.\n\nThat sounds like two changes, calling for two patches.\n\n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  utils/tuning/libtuning/ctt_awb.py | 55 ++++++++++++++++---------------\n>  1 file changed, 28 insertions(+), 27 deletions(-)\n> \n> diff --git a/utils/tuning/libtuning/ctt_awb.py b/utils/tuning/libtuning/ctt_awb.py\n> index abf22321a0ea..73a1bc1a840c 100644\n> --- a/utils/tuning/libtuning/ctt_awb.py\n> +++ b/utils/tuning/libtuning/ctt_awb.py\n> @@ -4,6 +4,8 @@\n>  #\n>  # camera tuning tool for AWB\n>  \n> +import logging\n> +\n>  import matplotlib.pyplot as plt\n>  from bisect import bisect_left\n>  from scipy.optimize import fmin\n> @@ -11,12 +13,12 @@ import numpy as np\n>  \n>  from .image import Image\n>  \n> +logger = logging.getLogger(__name__)\n>  \n>  \"\"\"\n>  obtain piecewise linear approximation for colour curve\n>  \"\"\"\n> -def awb(Cam, cal_cr_list, cal_cb_list, plot):\n> -    imgs = Cam.imgs\n> +def awb(imgs, cal_cr_list, cal_cb_list, plot):\n>      \"\"\"\n>      condense alsc calibration tables into one dictionary\n>      \"\"\"\n> @@ -39,7 +41,7 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>      rb_raw = []\n>      rbs_hat = []\n>      for Img in imgs:\n> -        Cam.log += '\\nProcessing '+Img.name\n> +        logger.info(f'Processing {Img.name}')\n>          \"\"\"\n>          get greyscale patches with alsc applied if alsc enabled.\n>          Note: if alsc is disabled then colour_cals will be set to None and the\n> @@ -51,7 +53,7 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>          \"\"\"\n>          r_g = np.mean(r_patchs/g_patchs)\n>          b_g = np.mean(b_patchs/g_patchs)\n> -        Cam.log += '\\n       r : {:.4f}       b : {:.4f}'.format(r_g, b_g)\n> +        logger.info('       r : {:.4f}       b : {:.4f}'.format(r_g, b_g))\n\nAs you use an f-string above, I think you can write this\n\n        logger.info(f'       r : {r_g:.4f}       b : {b_g:.4f}'\n\nSame below.\n\n>          \"\"\"\n>          The curve tends to be better behaved in so-called hatspace.\n>          R, B, G represent the individual channels. The colour curve is plotted in\n> @@ -74,12 +76,11 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>          \"\"\"\n>          r_g_hat = r_g/(1+r_g+b_g)\n>          b_g_hat = b_g/(1+r_g+b_g)\n> -        Cam.log += '\\n   r_hat : {:.4f}   b_hat : {:.4f}'.format(r_g_hat, b_g_hat)\n> -        rbs_hat.append((r_g_hat, b_g_hat, Img.col))\n> +        logger.info('\\n   r_hat : {:.4f}   b_hat : {:.4f}'.format(r_g_hat, b_g_hat))\n> +        rbs_hat.append((r_g_hat, b_g_hat, Img.color))\n>          rb_raw.append((r_g, b_g))\n> -        Cam.log += '\\n'\n>  \n> -    Cam.log += '\\nFinished processing images'\n> +    logger.info('Finished processing images')\n>      \"\"\"\n>      sort all lits simultaneously by r_hat\n>      \"\"\"\n> @@ -95,7 +96,7 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>      fit quadratic fit to r_g hat and b_g_hat\n>      \"\"\"\n>      a, b, c = np.polyfit(rbs_hat[0], rbs_hat[1], 2)\n> -    Cam.log += '\\nFit quadratic curve in hatspace'\n> +    logger.info('Fit quadratic curve in hatspace')\n>      \"\"\"\n>      the algorithm now approximates the shortest distance from each point to the\n>      curve in dehatspace. Since the fit is done in hatspace, it is easier to\n> @@ -151,14 +152,14 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>          if (x+y) > (rr+bb):\n>              dist *= -1\n>          dists.append(dist)\n> -    Cam.log += '\\nFound closest point on fit line to each point in dehatspace'\n> +    logger.info('Found closest point on fit line to each point in dehatspace')\n>      \"\"\"\n>      calculate wiggle factors in awb. 10% added since this is an upper bound\n>      \"\"\"\n>      transverse_neg = - np.min(dists) * 1.1\n>      transverse_pos = np.max(dists) * 1.1\n> -    Cam.log += '\\nTransverse pos : {:.5f}'.format(transverse_pos)\n> -    Cam.log += '\\nTransverse neg : {:.5f}'.format(transverse_neg)\n> +    logger.info('Transverse pos : {:.5f}'.format(transverse_pos))\n> +    logger.info('Transverse neg : {:.5f}'.format(transverse_neg))\n>      \"\"\"\n>      set minimum transverse wiggles to 0.1 .\n>      Wiggle factors dictate how far off of the curve the algorithm searches. 0.1\n> @@ -167,10 +168,10 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>      \"\"\"\n>      if transverse_pos < 0.01:\n>          transverse_pos = 0.01\n> -        Cam.log += '\\nForced transverse pos to 0.01'\n> +        logger.info('Forced transverse pos to 0.01')\n>      if transverse_neg < 0.01:\n>          transverse_neg = 0.01\n> -        Cam.log += '\\nForced transverse neg to 0.01'\n> +        logger.info('Forced transverse neg to 0.01')\n>  \n>      \"\"\"\n>      generate new b_hat values at each r_hat according to fit\n> @@ -202,25 +203,25 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>      i = len(c_fit) - 1\n>      while i > 0:\n>          if c_fit[i] > c_fit[i-1]:\n> -            Cam.log += '\\nColour temperature increase found\\n'\n> -            Cam.log += '{} K at r = {} to '.format(c_fit[i-1], r_fit[i-1])\n> -            Cam.log += '{} K at r = {}'.format(c_fit[i], r_fit[i])\n> +            logger.info('Colour temperature increase found')\n> +            logger.info('{} K at r = {} to '.format(c_fit[i-1], r_fit[i-1]))\n> +            logger.info('{} K at r = {}'.format(c_fit[i], r_fit[i]))\n>              \"\"\"\n>              if colour temperature increases then discard point furthest from\n>              the transformed fit (dehatspace)\n>              \"\"\"\n>              error_1 = abs(dists[i-1])\n>              error_2 = abs(dists[i])\n> -            Cam.log += '\\nDistances from fit:\\n'\n> -            Cam.log += '{} K : {:.5f} , '.format(c_fit[i], error_1)\n> -            Cam.log += '{} K : {:.5f}'.format(c_fit[i-1], error_2)\n> +            logger.info('Distances from fit:')\n> +            logger.info('{} K : {:.5f} , '.format(c_fit[i], error_1))\n> +            logger.info('{} K : {:.5f}'.format(c_fit[i-1], error_2))\n>              \"\"\"\n>              find bad index\n>              note that in python false = 0 and true = 1\n>              \"\"\"\n>              bad = i - (error_1 < error_2)\n> -            Cam.log += '\\nPoint at {} K deleted as '.format(c_fit[bad])\n> -            Cam.log += 'it is furthest from fit'\n> +            logger.info('Point at {} K deleted as '.format(c_fit[bad]))\n> +            logger.info('it is furthest from fit')\n>              \"\"\"\n>              delete bad point\n>              \"\"\"\n> @@ -239,12 +240,12 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n>      return formatted ct curve, ordered by increasing colour temperature\n>      \"\"\"\n>      ct_curve = list(np.array(list(zip(b_fit, r_fit, c_fit))).flatten())[::-1]\n> -    Cam.log += '\\nFinal CT curve:'\n> +    logger.info('Final CT curve:')\n>      for i in range(len(ct_curve)//3):\n>          j = 3*i\n> -        Cam.log += '\\n  ct: {}  '.format(ct_curve[j])\n> -        Cam.log += '  r: {}  '.format(ct_curve[j+1])\n> -        Cam.log += '  b: {}  '.format(ct_curve[j+2])\n> +        logger.info('  ct: {}  '.format(ct_curve[j]))\n> +        logger.info('  r: {}  '.format(ct_curve[j+1]))\n> +        logger.info('  b: {}  '.format(ct_curve[j+2]))\n>  \n>      \"\"\"\n>      plotting code for debug\n> @@ -303,7 +304,7 @@ def get_alsc_patches(Img, colour_cals, grey=True):\n>      \"\"\"\n>      if grey:\n>          cen_coords = Img.cen_coords[3::4]\n> -        col = Img.col\n> +        col = Img.color\n>          patches = [np.array(Img.patches[i]) for i in Img.order]\n>          r_patchs = patches[0][3::4] - Img.blacklevel_16\n>          b_patchs = patches[3][3::4] - Img.blacklevel_16","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 DCC06C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 29 Aug 2024 23:17:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9CEBD63458;\n\tFri, 30 Aug 2024 01:17:13 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9BDB56002E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Aug 2024 01:17:11 +0200 (CEST)","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 9761D735;\n\tFri, 30 Aug 2024 01:16:02 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"u3Us7GNt\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1724973362;\n\tbh=bmqJF9EvmKvGCU3ZuHYdi+eJsayRp71cy9+cDL5Xs0Q=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=u3Us7GNtVUXFUjzSyeMrip+06D+EwVLfbA3TRidELDmTWX7yn8Jco/WclW4wGYTaJ\n\thqmYGvS8l3Ls2+KwSYaUabVaUwVOl/Zqo1iZAkmCKdKEksR7C+A8Vf6m/sSZY7Z9nW\n\tnBzlbhc0vg0kXr8kVskrxDEaLkdYY12o3WFPW3Ck=","Date":"Fri, 30 Aug 2024 02:16:40 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v4 4/6] libtuning: Modify ctt_awb.awb() so that it can\n\trun in our context","Message-ID":"<20240829231640.GA26181@pendragon.ideasonboard.com>","References":"<20240813084451.44099-1-stefan.klug@ideasonboard.com>\n\t<20240813084451.44099-5-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240813084451.44099-5-stefan.klug@ideasonboard.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>"}}]