{"id":22487,"url":"https://patchwork.libcamera.org/api/1.1/covers/22487/?format=json","web_url":"https://patchwork.libcamera.org/cover/22487/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250109115412.356768-1-stefan.klug@ideasonboard.com>","date":"2025-01-09T11:53:51","name":"[v1,00/11] Add Bayesian AWB algorithm to libipa and rkisp1","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/1.1/people/184/?format=json","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/22487/mbox/","series":[{"id":4938,"url":"https://patchwork.libcamera.org/api/1.1/series/4938/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4938","date":"2025-01-09T11:53:51","name":"Add Bayesian AWB algorithm to libipa and rkisp1","version":1,"mbox":"https://patchwork.libcamera.org/series/4938/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/22487/comments/","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 01B90C32EA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Jan 2025 11:55:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9916C684E2;\n\tThu,  9 Jan 2025 12:55:07 +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 6905061891\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Jan 2025 12:55:05 +0100 (CET)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:93b9:eca8:897d:eae6])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 980135B3;\n\tThu,  9 Jan 2025 12:54:11 +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=\"uLoAT3Va\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1736423651;\n\tbh=9nvtIRHdC9iG7g0qs4U4uzGMbofIs7YxteVBIY5gJsc=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=uLoAT3VaVyqEGwLvqESr6lpgWmqWn2bUnTkH2x1fvdHyprY/9oYogbNKfpEaNW4T3\n\tWG9xNRe9ewljOeGhO9mmhyeJqkAX93ByF/DlQPpgqhka6Y+4YDZYgpi88wJzH6bJPF\n\tyVAALm9GYyPyWZ3XDcJBlLPMEDJ95Pv0IHNg54J8=","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","Subject":"[PATCH v1 00/11] Add Bayesian AWB algorithm to libipa and rkisp1","Date":"Thu,  9 Jan 2025 12:53:51 +0100","Message-ID":"<20250109115412.356768-1-stefan.klug@ideasonboard.com>","X-Mailer":"git-send-email 2.43.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>"},"content":"The Bayesian AWB algorithm improves the AWB performance by taking prior\nlikelihoods for a colour temperature given a measured lux level into\naccount.\n\nThe algorithm was first implemented by RaspberryPi and is documented in\nthe RaspberryPi camera guide. This series takes that implementation and\nadapts it for the use on libipa and the rkisp1 pipeline. It still keeps\nthe grey world algorithm as a fallback or as a simple alternative that\ndoes not require any tuning.\n\nPatches 1-2 add small utility functions in lipia.\n\nPatches 3-7 prepare for the bayes AWB integration. First some base\nclasses are added to be able to implement different AWB algorithms with\na common interface. Then the grey world algorithm from rkisp1 is moved\ninto libipa.\n\nPatches 8-10 add the bayes AWB algorithm to libtuning and libipa and\nintegrate it into the rkisp1 IPA.\n\nPatch 13 is a small fix to start the camera with better default gains.\n\nThe integration of the actual lux measurements from the Lux algorithm is\nmissing in this series and will be added in an upcoming version.\n\nBest regards,\nStefan\n\nStefan Klug (11):\n  libipa: interpolator: Add accessor to internal data\n  libipa: pwl: Add clear() function\n  libipa: Add AWB algorithm base class\n  libipa: awb: Add helper functions for AWB mode support\n  libipa: Add grey world AWB algorithm\n  ipa: rkisp1: Move calculation of RGB means into own function\n  ipa: rkisp1: Use grey world algorithm from libipa\n  libtuning: module: awb: Add bayes AWB support\n  libipa: Add bayesian AWB algorithm\n  ipa: rkisp1: Add support for bayes AWB algorithm from libipa\n  ipa: rkisp1: awb: Apply gains based on default colour temperature on\n    start\n\n src/ipa/libipa/awb.cpp                       | 237 ++++++++++\n src/ipa/libipa/awb.h                         |  63 +++\n src/ipa/libipa/awb_bayes.cpp                 | 457 +++++++++++++++++++\n src/ipa/libipa/awb_bayes.h                   |  67 +++\n src/ipa/libipa/awb_grey.cpp                  | 114 +++++\n src/ipa/libipa/awb_grey.h                    |  35 ++\n src/ipa/libipa/interpolator.cpp              |  10 +-\n src/ipa/libipa/interpolator.h                |   5 +\n src/ipa/libipa/meson.build                   |   6 +\n src/ipa/libipa/pwl.cpp                       |   5 +\n src/ipa/libipa/pwl.h                         |   1 +\n src/ipa/rkisp1/algorithms/awb.cpp            | 171 ++++---\n src/ipa/rkisp1/algorithms/awb.h              |   7 +-\n utils/tuning/config-example.yaml             |  34 +-\n utils/tuning/libtuning/modules/awb/awb.py    |  16 +-\n utils/tuning/libtuning/modules/awb/rkisp1.py |  21 +-\n 16 files changed, 1178 insertions(+), 71 deletions(-)\n create mode 100644 src/ipa/libipa/awb.cpp\n create mode 100644 src/ipa/libipa/awb.h\n create mode 100644 src/ipa/libipa/awb_bayes.cpp\n create mode 100644 src/ipa/libipa/awb_bayes.h\n create mode 100644 src/ipa/libipa/awb_grey.cpp\n create mode 100644 src/ipa/libipa/awb_grey.h"}