From patchwork Wed Jul 3 14:16:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20514 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 5BA3BBEFBE for ; Wed, 3 Jul 2024 14:17:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2041062E22; Wed, 3 Jul 2024 16:17:33 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mO+23E0P"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A9C8362C95 for ; Wed, 3 Jul 2024 16:17:31 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:9263:c199:9587:576]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 580F58A9; Wed, 3 Jul 2024 16:17:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1720016223; bh=QLrv0jdSGyt6TZQFqtb5bGFXXWLBLX1/+cvcYrvG7+s=; h=From:To:Cc:Subject:Date:From; b=mO+23E0P/C2Dp46grl0ir0RpvlekfoP9dtSQ7xMrHkU67Q9uqmqiTwFSA1to6e62I bH+KIXv9QwD7CxHa/4IZmRO3iNM2F8+3jkSfUgFlR9XVHIU+WyZZw4LgB4faoQ92eG 6Z8J3riGTlJCeUH58v6DB9tdBCrBu1TVcxqtQWdQ= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v3 00/23] Add ccm calibration to libtuning Date: Wed, 3 Jul 2024 16:16:49 +0200 Message-ID: <20240703141726.252368-1-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi all, this patch series improves the rkisp1 tuning tool support. With that code, it is possible to create a nice looking image on the imx8mp. It incorporates some logic from the raspberrypi tuning tools. This was used to get to a working state in a timely manner. After that further refactoring and algorithm development can take place. Feature wise it contains: - Added ccm calibration for the rkisp1 - Add static support for awb, filter, gamma and cproc - Fixed lsc correction tables - Some general fixes to make all that work Best regards, Stefan Changes in v3: - Replaced BLC module by a simple static module as the black level is now provided by the camera sensor helpers (seperate series). - Dropped P23 ([PATCH v2 23/25] libtuning: Make blacklevel optional). - Collected tags. - Fixed typos and comments from first review. - P12 is now split in two. Paul Elder (1): libtuning: modules: Add initial CCM module Stefan Klug (22): libtuning: Backport improvements in MacBeth search reliability libtuning: Fix reference image libtuning: Copy files from raspberrypi libtuning: Copy visualize_macbeth_chart from raspberry pi utils: tuning: Add requirements file and update readme libtuning: Fix imports libtuning: Migrate prints to python logging framework libtuning: Fix visualize_macbeth_chart() libtuning: Improve filename parsing libtuning: Implement a minimal yaml parser libtuning: Reactivate macbeth locator libtuning: Be a bit more verbose libtuning: lsc: rkisp1: Clip lsc values to valid range libtuning: Use the color member of the Image class libtuning: Remove need for Cam object from ccm libtuning: Handle cases, where no lsc tuning images are present libtuning: Only warn if processing returns None libtuning: Add static module tuning: rkisp1: Add some static modules libtuning: lsc: rkisp1: Do not calculate ratios to green libtuning: lsc: Prevent negative values libtuning: agc: rkisp1: Increase y-target utils/tuning/README.rst | 23 +- utils/tuning/config-example.yaml | 12 + utils/tuning/libtuning/ctt_awb.py | 378 ++++++++++++++++ utils/tuning/libtuning/ctt_ccm.py | 408 ++++++++++++++++++ utils/tuning/libtuning/ctt_colors.py | 30 ++ utils/tuning/libtuning/ctt_ransac.py | 71 +++ .../libtuning/generators/yaml_output.py | 8 +- utils/tuning/libtuning/image.py | 8 +- utils/tuning/libtuning/libtuning.py | 23 +- utils/tuning/libtuning/macbeth.py | 65 ++- utils/tuning/libtuning/macbeth_ref.pgm | 2 +- utils/tuning/libtuning/modules/agc/rkisp1.py | 2 +- .../tuning/libtuning/modules/ccm/__init__.py | 6 + utils/tuning/libtuning/modules/ccm/ccm.py | 41 ++ utils/tuning/libtuning/modules/ccm/rkisp1.py | 27 ++ utils/tuning/libtuning/modules/lsc/lsc.py | 5 +- .../libtuning/modules/lsc/raspberrypi.py | 12 +- utils/tuning/libtuning/modules/lsc/rkisp1.py | 14 +- utils/tuning/libtuning/modules/static.py | 24 ++ utils/tuning/libtuning/parsers/yaml_parser.py | 9 +- utils/tuning/libtuning/utils.py | 95 +++- utils/tuning/requirements.txt | 6 + utils/tuning/rkisp1.py | 24 +- 23 files changed, 1215 insertions(+), 78 deletions(-) create mode 100644 utils/tuning/config-example.yaml create mode 100644 utils/tuning/libtuning/ctt_awb.py create mode 100644 utils/tuning/libtuning/ctt_ccm.py create mode 100644 utils/tuning/libtuning/ctt_colors.py create mode 100644 utils/tuning/libtuning/ctt_ransac.py create mode 100644 utils/tuning/libtuning/modules/ccm/__init__.py create mode 100644 utils/tuning/libtuning/modules/ccm/ccm.py create mode 100644 utils/tuning/libtuning/modules/ccm/rkisp1.py create mode 100644 utils/tuning/libtuning/modules/static.py create mode 100644 utils/tuning/requirements.txt