From patchwork Fri Jun 28 10:46:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20459 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 E302ABD87C for ; Fri, 28 Jun 2024 10:48:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A13CA62C9C; Fri, 28 Jun 2024 12:48:40 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YgR+c1bN"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8BB30619E5 for ; Fri, 28 Jun 2024 12:48:39 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:82ab:924:d918:cd24]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0E978735; Fri, 28 Jun 2024 12:48:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719571695; bh=hn+ggIMaDCZAAzqfTNxtpJjkQDl4zDfHrqNLzr+trKg=; h=From:To:Cc:Subject:Date:From; b=YgR+c1bNmjXOXrRVDo1CQ+YO3oEuG9oBmBQRh+XxKaqN4J3orIcJFNA7TPTtNJtix 1CFj+jQGPl/UatLnJQqaU23BYu2uF2J6y+5S0N81ArBQ5qgzObT0KXrviJ+T39woDM FSsW4G4VS0J0khQVpTZ++k3t0KpxGe/sso4Vum2E= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v2 00/25] Add ccm calibration to libtuning Date: Fri, 28 Jun 2024 12:46:53 +0200 Message-ID: <20240628104828.2928109-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 Paul Elder (1): libtuning: modules: Add initial CCM module Stefan Klug (24): 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: 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: agc: Fix kwargs handling 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: Make blacklevel optional tuning: rkisp1: Add blc module 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 | 18 +- utils/tuning/libtuning/libtuning.py | 23 +- utils/tuning/libtuning/macbeth.py | 65 ++- utils/tuning/libtuning/macbeth_ref.pgm | 2 +- utils/tuning/libtuning/modules/agc/agc.py | 3 +- utils/tuning/libtuning/modules/agc/rkisp1.py | 2 +- .../tuning/libtuning/modules/blc/__init__.py | 5 + utils/tuning/libtuning/modules/blc/blc.py | 46 ++ .../tuning/libtuning/modules/ccm/__init__.py | 6 + utils/tuning/libtuning/modules/ccm/ccm.py | 44 ++ utils/tuning/libtuning/modules/ccm/rkisp1.py | 34 ++ utils/tuning/libtuning/modules/lsc/lsc.py | 3 +- .../libtuning/modules/lsc/raspberrypi.py | 12 +- utils/tuning/libtuning/modules/lsc/rkisp1.py | 11 +- utils/tuning/libtuning/modules/static.py | 24 ++ utils/tuning/libtuning/parsers/yaml_parser.py | 9 +- utils/tuning/libtuning/utils.py | 92 +++- utils/tuning/requirements.txt | 7 + utils/tuning/rkisp1.py | 23 +- 26 files changed, 1279 insertions(+), 80 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/blc/__init__.py create mode 100644 utils/tuning/libtuning/modules/blc/blc.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