[{"id":22997,"web_url":"https://patchwork.libcamera.org/comment/22997/","msgid":"<YoPI8phT0L4sSekA@pendragon.ideasonboard.com>","date":"2022-05-17T16:10:26","subject":"Re: [libcamera-devel] [PATCH v2 10/13] py: cam_qt: cosmetic cleanups","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nThank you for the patch.\n\nOn Tue, May 17, 2022 at 05:33:22PM +0300, Tomi Valkeinen wrote:\n> Drop irrelevant or wrong comments, merge separate_components() into\n> demosaic(), and add mfb_to_rgb().\n> \n> No functional changes.\n> \n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/py/cam/cam_qt.py | 64 +++++++++-----------------------------------\n>  1 file changed, 13 insertions(+), 51 deletions(-)\n> \n> diff --git a/src/py/cam/cam_qt.py b/src/py/cam/cam_qt.py\n> index 5753f0b2..fb485b9b 100644\n> --- a/src/py/cam/cam_qt.py\n> +++ b/src/py/cam/cam_qt.py\n> @@ -19,19 +19,8 @@ def rgb_to_pix(rgb):\n>      return pix\n>  \n>  \n> -def separate_components(data, r0, g0, g1, b0):\n> -    # Now to split the data up into its red, green, and blue components. The\n> -    # Bayer pattern of the OV5647 sensor is BGGR. In other words the first\n> -    # row contains alternating green/blue elements, the second row contains\n> -    # alternating red/green elements, and so on as illustrated below:\n> -    #\n> -    # GBGBGBGBGBGBGB\n> -    # RGRGRGRGRGRGRG\n> -    # GBGBGBGBGBGBGB\n> -    # RGRGRGRGRGRGRG\n> -    #\n> -    # Please note that if you use vflip or hflip to change the orientation\n> -    # of the capture, you must flip the Bayer pattern accordingly\n> +def demosaic(data, r0, g0, g1, b0):\n> +    # Separate the components from the Bayer data to RGB planes\n>  \n>      rgb = np.zeros(data.shape + (3,), dtype=data.dtype)\n>      rgb[r0[1]::2, r0[0]::2, 0] = data[r0[1]::2, r0[0]::2]  # Red\n> @@ -39,17 +28,9 @@ def separate_components(data, r0, g0, g1, b0):\n>      rgb[g1[1]::2, g1[0]::2, 1] = data[g1[1]::2, g1[0]::2]  # Green\n>      rgb[b0[1]::2, b0[0]::2, 2] = data[b0[1]::2, b0[0]::2]  # Blue\n>  \n> -    return rgb\n> -\n> -\n> -def demosaic(rgb, r0, g0, g1, b0):\n> -    # At this point we now have the raw Bayer data with the correct values\n> -    # and colors but the data still requires de-mosaicing and\n> -    # post-processing. If you wish to do this yourself, end the script here!\n> -    #\n>      # Below we present a fairly naive de-mosaic method that simply\n>      # calculates the weighted average of a pixel based on the pixels\n> -    # surrounding it. The weighting is provided b0[1] a b0[1]te representation of\n> +    # surrounding it. The weighting is provided by a byte representation of\n>      # the Bayer filter which we construct first:\n>  \n>      bayer = np.zeros(rgb.shape, dtype=np.uint8)\n> @@ -69,29 +50,6 @@ def demosaic(rgb, r0, g0, g1, b0):\n>      borders = (window[0] - 1, window[1] - 1)\n>      border = (borders[0] // 2, borders[1] // 2)\n>  \n> -    # rgb_pad = np.zeros((\n> -    #    rgb.shape[0] + borders[0],\n> -    #    rgb.shape[1] + borders[1],\n> -    #    rgb.shape[2]), dtype=rgb.dtype)\n> -    # rgb_pad[\n> -    #    border[0]:rgb_pad.shape[0] - border[0],\n> -    #    border[1]:rgb_pad.shape[1] - border[1],\n> -    #    :] = rgb\n> -    # rgb = rgb_pad\n> -    #\n> -    # bayer_pad = np.zeros((\n> -    #    bayer.shape[0] + borders[0],\n> -    #    bayer.shape[1] + borders[1],\n> -    #    bayer.shape[2]), dtype=bayer.dtype)\n> -    # bayer_pad[\n> -    #    border[0]:bayer_pad.shape[0] - border[0],\n> -    #    border[1]:bayer_pad.shape[1] - border[1],\n> -    #    :] = bayer\n> -    # bayer = bayer_pad\n> -\n> -    # In numpy >=1.7.0 just use np.pad (version in Raspbian is 1.6.2 at the\n> -    # time of writing...)\n> -    #\n>      rgb = np.pad(rgb, [\n>          (border[0], border[0]),\n>          (border[1], border[1]),\n> @@ -168,7 +126,7 @@ def to_rgb(fmt, size, data):\n>          bayer_pattern = fmt[1:5]\n>          bitspp = int(fmt[5:])\n>  \n> -        # TODO: shifting leaves the lowest bits 0\n> +        # \\todo shifting leaves the lowest bits 0\n>          if bitspp == 8:\n>              data = data.reshape((h, w))\n>              data = data.astype(np.uint16) << 8\n> @@ -195,8 +153,7 @@ def to_rgb(fmt, size, data):\n>          assert(idx != -1)\n>          b0 = (idx % 2, idx // 2)\n>  \n> -        rgb = separate_components(data, r0, g0, g1, b0)\n> -        rgb = demosaic(rgb, r0, g0, g1, b0)\n> +        rgb = demosaic(data, r0, g0, g1, b0)\n>          rgb = (rgb >> 8).astype(np.uint8)\n>  \n>      else:\n> @@ -205,6 +162,13 @@ def to_rgb(fmt, size, data):\n>      return rgb\n>  \n>  \n> +# A naive format conversion to 24-bit RGB\n> +def mfb_to_rgb(mfb, cfg):\n> +    data = np.array(mfb.planes[0], dtype=np.uint8)\n> +    rgb = to_rgb(cfg.pixel_format, cfg.size, data)\n> +    return rgb\n> +\n> +\n>  class QtRenderer:\n>      def __init__(self, state):\n>          self.state = state\n> @@ -334,9 +298,7 @@ class MainWindow(QtWidgets.QWidget):\n>                  qim = ImageQt(img).copy()\n>                  pix = QtGui.QPixmap.fromImage(qim)\n>              else:\n> -                data = np.array(mfb.planes[0], dtype=np.uint8)\n> -                rgb = to_rgb(cfg.pixel_format, cfg.size, data)\n> -\n> +                rgb = mfb_to_rgb(mfb, cfg)\n>                  if rgb is None:\n>                      raise Exception('Format not supported: ' + cfg.pixel_format)\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 832B9C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 May 2022 16:10:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3DDF46041E;\n\tTue, 17 May 2022 18:10:36 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1DDDA6041D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 May 2022 18:10:34 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [45.131.31.124])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 740BC484;\n\tTue, 17 May 2022 18:10:33 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652803836;\n\tbh=tXhUdlhqMocb25yDPxf82DkQHeAh9TWLAIIb5vUReO8=;\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=cufdHRvTr+v/e4XJDDrHzn05uBor9lqm4sCRRnr+NjTXdgJJ3+4yHBdJ/ate7RCDv\n\tjwuuhAVKeuk+Pnw6/rBrerK1njUU2bx6o9CwoFFB5w6IsiLIkJ91tRadfKHP+w+tA0\n\tln/WLnq3BpeaHj/gFjlAlIy8ZM7IJkmlfipqXdsEg51w52LMfgHotn+BScwIiCksmw\n\tdliANcojfXwC6lz8u088URkdTiwmQALRptsIGbdsvLcPEM6fgBNyO2pnGQLV7Yj2vl\n\tgBrikh1b9GG4yZB5YWtZ5hWr8xeZHxOi+IasWpOJ8GMM+ZTluffH4BvN6PYHFTOSKV\n\t9XJv8i3lPEJUg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652803833;\n\tbh=tXhUdlhqMocb25yDPxf82DkQHeAh9TWLAIIb5vUReO8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=WP7pT6fvfKWCUODEnZw7xVbWgrO7AdN0Qj4ISsF0kZ3KyJoRyDGjnUtXVYXcFHm0P\n\ty6G4Sx0i/QWyaUTlqrYKksX4guRNBXa9dkvnXpYRjy1D+USc5PExJMhxE/6B0cgwfN\n\tCKoQsCrQi/58nbI7yyG1lC9NlT/fpmXsm1B9uBQI="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"WP7pT6fv\"; dkim-atps=neutral","Date":"Tue, 17 May 2022 19:10:26 +0300","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<YoPI8phT0L4sSekA@pendragon.ideasonboard.com>","References":"<20220517143325.71784-1-tomi.valkeinen@ideasonboard.com>\n\t<20220517143325.71784-11-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220517143325.71784-11-tomi.valkeinen@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 10/13] py: cam_qt: cosmetic cleanups","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":23011,"web_url":"https://patchwork.libcamera.org/comment/23011/","msgid":"<165280678195.2416244.10808000838190719312@Monstersaurus>","date":"2022-05-17T16:59:41","subject":"Re: [libcamera-devel] [PATCH v2 10/13] py: cam_qt: cosmetic cleanups","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Tomi Valkeinen (2022-05-17 15:33:22)\n> Drop irrelevant or wrong comments, merge separate_components() into\n> demosaic(), and add mfb_to_rgb().\n> \n> No functional changes.\n> \n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n\nOut of curiosity, is this a usable performance doing demosaicing in\nnumpy? Or is it ... very slow ?\n\nEither way, the performance isn't a topic of this patch.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/py/cam/cam_qt.py | 64 +++++++++-----------------------------------\n>  1 file changed, 13 insertions(+), 51 deletions(-)\n> \n> diff --git a/src/py/cam/cam_qt.py b/src/py/cam/cam_qt.py\n> index 5753f0b2..fb485b9b 100644\n> --- a/src/py/cam/cam_qt.py\n> +++ b/src/py/cam/cam_qt.py\n> @@ -19,19 +19,8 @@ def rgb_to_pix(rgb):\n>      return pix\n>  \n>  \n> -def separate_components(data, r0, g0, g1, b0):\n> -    # Now to split the data up into its red, green, and blue components. The\n> -    # Bayer pattern of the OV5647 sensor is BGGR. In other words the first\n> -    # row contains alternating green/blue elements, the second row contains\n> -    # alternating red/green elements, and so on as illustrated below:\n> -    #\n> -    # GBGBGBGBGBGBGB\n> -    # RGRGRGRGRGRGRG\n> -    # GBGBGBGBGBGBGB\n> -    # RGRGRGRGRGRGRG\n> -    #\n> -    # Please note that if you use vflip or hflip to change the orientation\n> -    # of the capture, you must flip the Bayer pattern accordingly\n> +def demosaic(data, r0, g0, g1, b0):\n> +    # Separate the components from the Bayer data to RGB planes\n>  \n>      rgb = np.zeros(data.shape + (3,), dtype=data.dtype)\n>      rgb[r0[1]::2, r0[0]::2, 0] = data[r0[1]::2, r0[0]::2]  # Red\n> @@ -39,17 +28,9 @@ def separate_components(data, r0, g0, g1, b0):\n>      rgb[g1[1]::2, g1[0]::2, 1] = data[g1[1]::2, g1[0]::2]  # Green\n>      rgb[b0[1]::2, b0[0]::2, 2] = data[b0[1]::2, b0[0]::2]  # Blue\n>  \n> -    return rgb\n> -\n> -\n> -def demosaic(rgb, r0, g0, g1, b0):\n> -    # At this point we now have the raw Bayer data with the correct values\n> -    # and colors but the data still requires de-mosaicing and\n> -    # post-processing. If you wish to do this yourself, end the script here!\n> -    #\n>      # Below we present a fairly naive de-mosaic method that simply\n>      # calculates the weighted average of a pixel based on the pixels\n> -    # surrounding it. The weighting is provided b0[1] a b0[1]te representation of\n> +    # surrounding it. The weighting is provided by a byte representation of\n>      # the Bayer filter which we construct first:\n>  \n>      bayer = np.zeros(rgb.shape, dtype=np.uint8)\n> @@ -69,29 +50,6 @@ def demosaic(rgb, r0, g0, g1, b0):\n>      borders = (window[0] - 1, window[1] - 1)\n>      border = (borders[0] // 2, borders[1] // 2)\n>  \n> -    # rgb_pad = np.zeros((\n> -    #    rgb.shape[0] + borders[0],\n> -    #    rgb.shape[1] + borders[1],\n> -    #    rgb.shape[2]), dtype=rgb.dtype)\n> -    # rgb_pad[\n> -    #    border[0]:rgb_pad.shape[0] - border[0],\n> -    #    border[1]:rgb_pad.shape[1] - border[1],\n> -    #    :] = rgb\n> -    # rgb = rgb_pad\n> -    #\n> -    # bayer_pad = np.zeros((\n> -    #    bayer.shape[0] + borders[0],\n> -    #    bayer.shape[1] + borders[1],\n> -    #    bayer.shape[2]), dtype=bayer.dtype)\n> -    # bayer_pad[\n> -    #    border[0]:bayer_pad.shape[0] - border[0],\n> -    #    border[1]:bayer_pad.shape[1] - border[1],\n> -    #    :] = bayer\n> -    # bayer = bayer_pad\n> -\n> -    # In numpy >=1.7.0 just use np.pad (version in Raspbian is 1.6.2 at the\n> -    # time of writing...)\n> -    #\n>      rgb = np.pad(rgb, [\n>          (border[0], border[0]),\n>          (border[1], border[1]),\n> @@ -168,7 +126,7 @@ def to_rgb(fmt, size, data):\n>          bayer_pattern = fmt[1:5]\n>          bitspp = int(fmt[5:])\n>  \n> -        # TODO: shifting leaves the lowest bits 0\n> +        # \\todo shifting leaves the lowest bits 0\n>          if bitspp == 8:\n>              data = data.reshape((h, w))\n>              data = data.astype(np.uint16) << 8\n> @@ -195,8 +153,7 @@ def to_rgb(fmt, size, data):\n>          assert(idx != -1)\n>          b0 = (idx % 2, idx // 2)\n>  \n> -        rgb = separate_components(data, r0, g0, g1, b0)\n> -        rgb = demosaic(rgb, r0, g0, g1, b0)\n> +        rgb = demosaic(data, r0, g0, g1, b0)\n>          rgb = (rgb >> 8).astype(np.uint8)\n>  \n>      else:\n> @@ -205,6 +162,13 @@ def to_rgb(fmt, size, data):\n>      return rgb\n>  \n>  \n> +# A naive format conversion to 24-bit RGB\n> +def mfb_to_rgb(mfb, cfg):\n> +    data = np.array(mfb.planes[0], dtype=np.uint8)\n> +    rgb = to_rgb(cfg.pixel_format, cfg.size, data)\n> +    return rgb\n> +\n> +\n>  class QtRenderer:\n>      def __init__(self, state):\n>          self.state = state\n> @@ -334,9 +298,7 @@ class MainWindow(QtWidgets.QWidget):\n>                  qim = ImageQt(img).copy()\n>                  pix = QtGui.QPixmap.fromImage(qim)\n>              else:\n> -                data = np.array(mfb.planes[0], dtype=np.uint8)\n> -                rgb = to_rgb(cfg.pixel_format, cfg.size, data)\n> -\n> +                rgb = mfb_to_rgb(mfb, cfg)\n>                  if rgb is None:\n>                      raise Exception('Format not supported: ' + cfg.pixel_format)\n>  \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 DC58BC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 May 2022 16:59:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 368066041E;\n\tTue, 17 May 2022 18:59:47 +0200 (CEST)","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 7997D6041D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 May 2022 18:59:45 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DF9F94A8;\n\tTue, 17 May 2022 18:59:44 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652806787;\n\tbh=D80krqih1OtW185O91n35TYobHtEb+iJuPtmz83E6NU=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=LLlQj1Qv28yGwEQYoM7ZjhGp/ouVuUam3r7VMD9S2fm25TYtoMieX45WcKk4XJcYI\n\tzJ8bpiH+OKQzk4TUpsHHNB7ZO2yVfWGurt85YRkHRMEooj08ZRD9WluT01pfIdijsP\n\tC8C+Pg8As62R0B5bXhNkk8CUnZ8KfOOoQWRt8KAv0ze4z+2lOQ3qggcjeGUiW9OfbZ\n\tWKmPf1D4tDKRsw6zl3bKlzw4ZuC/hasBBscbcYypO+rsKU9T3rje3lWQVBYCGB9CXy\n\tBFT3YbLvsy1WWFChXovJT+2yH0CwPFnqQRnDHEvvEABmMj0hIH6+C8s3Lg0zL8o31A\n\tQQFXyI49mbD5A==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652806785;\n\tbh=D80krqih1OtW185O91n35TYobHtEb+iJuPtmz83E6NU=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=nhTLUpFGA4LbY8VIdKrjDwUbrf+/PSLB3fd8iFffmq14/aOfvSvHykHBCu8UIHHzS\n\te957b2aYsCNE2xbguOQxrAVXgf0ZupH2TKUZAESTE+MRpwmj4SdVcJDiy3s73wKg9c\n\tAD/X+n0XHAE6cs+bz8xGXz2E6rrrqlpofuPH1/PM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"nhTLUpFG\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220517143325.71784-11-tomi.valkeinen@ideasonboard.com>","References":"<20220517143325.71784-1-tomi.valkeinen@ideasonboard.com>\n\t<20220517143325.71784-11-tomi.valkeinen@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tJacopo Mondi <jacopo@jmondi.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tTomi Valkeinen <tomi.valkeinen@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 17 May 2022 17:59:41 +0100","Message-ID":"<165280678195.2416244.10808000838190719312@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2 10/13] py: cam_qt: cosmetic cleanups","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23026,"web_url":"https://patchwork.libcamera.org/comment/23026/","msgid":"<230e807d-9b65-1d40-bcb7-9a86982a9a49@ideasonboard.com>","date":"2022-05-18T06:18:42","subject":"Re: [libcamera-devel] [PATCH v2 10/13] py: cam_qt: cosmetic cleanups","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/people/109/","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"content":"On 17/05/2022 19:59, Kieran Bingham wrote:\n> Quoting Tomi Valkeinen (2022-05-17 15:33:22)\n>> Drop irrelevant or wrong comments, merge separate_components() into\n>> demosaic(), and add mfb_to_rgb().\n>>\n>> No functional changes.\n>>\n>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> \n> Out of curiosity, is this a usable performance doing demosaicing in\n> numpy? Or is it ... very slow ?\n\nIt's usable, although I don't think it works quite right. The image is \npurplish, at least with vivid. I think it used to work, but I haven't \nused it with vivid before.\n\n  Tomi","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 07610C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 06:18:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2C96E65659;\n\tWed, 18 May 2022 08:18:47 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B10E060422\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 08:18:45 +0200 (CEST)","from [192.168.1.111] (91-156-85-209.elisa-laajakaista.fi\n\t[91.156.85.209])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B3A4F48F;\n\tWed, 18 May 2022 08:18:44 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652854727;\n\tbh=QYrv/cZF1n4/LQXFpiuf1HTRerzVJNwOqou4kQRIF9g=;\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:\n\tFrom;\n\tb=2qgZqUch8b3IKLtIvZrrDAAhVEx89jvrzmYb7FZlZX5m0/LEKxrpV6VYvw6BD1MRN\n\tKxFYsCMlTMYDKnAQBL+lmO4ExJVORcoGnx0LoUMAjssYXwQQOp3ui7vOItyuiQ6XE+\n\tYBAdCeff9IOux5Sh9/qL/aZEF72kaU3o5LZk9kDSrqoWcNa7K4xMzAqRbViWSOhqCW\n\teTWZ2Td6W4fC/suFfZ7KcZ4tgFvvMJ6HXVz5dNcAw0GY3U/g9nEWvUs9qs1LTIdiQa\n\tayXJL6z14ytYusk2xgfRVIO5pZ8ge1wFbm5xofb/1RixDYN4l1XiBSa4pTxsFP5vXP\n\t2ayxStP15uwoA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652854725;\n\tbh=QYrv/cZF1n4/LQXFpiuf1HTRerzVJNwOqou4kQRIF9g=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=RuJckuehF1/ju1AdmUApp/zU9W/7K46t5pqP6SIaQN26dhURCVrHLNM8qUKKHa4Y3\n\tqJ1KvGuaKe9jMa3jbSrxE7tMfikWMBDFXM7PCqSDSBfoArROYNTZHtY3j6iO94HZ6G\n\tPw2RJ+3WmSgVfPUPX+vHL/obCey/bX66tkB+9BZE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"RuJckueh\"; dkim-atps=neutral","Message-ID":"<230e807d-9b65-1d40-bcb7-9a86982a9a49@ideasonboard.com>","Date":"Wed, 18 May 2022 09:18:42 +0300","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.8.0","Content-Language":"en-US","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>,\n\tJacopo Mondi <jacopo@jmondi.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220517143325.71784-1-tomi.valkeinen@ideasonboard.com>\n\t<20220517143325.71784-11-tomi.valkeinen@ideasonboard.com>\n\t<165280678195.2416244.10808000838190719312@Monstersaurus>","In-Reply-To":"<165280678195.2416244.10808000838190719312@Monstersaurus>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v2 10/13] py: cam_qt: cosmetic cleanups","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":"Tomi Valkeinen via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]