From patchwork Fri Jul 5 14:41:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20589 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 631AFBD87C for ; Fri, 5 Jul 2024 14:42:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BA3E362E23; Fri, 5 Jul 2024 16:42:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="akuDqnqf"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C55C5619BF for ; Fri, 5 Jul 2024 16:42:13 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:60b6:33a3:3a20:6030]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CB9124CC; Fri, 5 Jul 2024 16:41:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1720190503; bh=a0rW6zl9ebM2w9OvBs77zxiSa7eJVUKdtBEXxAma6Bc=; h=From:To:Cc:Subject:Date:From; b=akuDqnqfiUPQTBuev7wSuuAaYNvGIVnv48VBktHoCVAZZG8nBlAFF5sGc7uUP0/iD AF4R3iqkXQAHTPU+os+VWoAtqTGdwnKK4QGBgRlqtKkGYb3X5WeYBP3S9qpePKYymN BL95RINZiaPeRT1fFTriufSHTBTJKaI4eVlS28vw= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v4 00/23] Add ccm calibration to libtuning Date: Fri, 5 Jul 2024 16:41:36 +0200 Message-ID: <20240705144209.418906-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. Changes in v4: - Fixed error handling when ccm could not be calibrated (P16) - Collected tags - Improved commit messages (especially in [PATCH v4 20/23] tuning: rkisp1: Add some static modules) - Fixed a few typos 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 | 28 ++ utils/tuning/libtuning/modules/lsc/lsc.py | 5 +- .../libtuning/modules/lsc/raspberrypi.py | 12 +- utils/tuning/libtuning/modules/lsc/rkisp1.py | 20 +- 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, 1217 insertions(+), 83 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