From patchwork Fri Aug 22 12:37:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 24176 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 6D56DBD87C for ; Fri, 22 Aug 2025 12:37:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 15501692EE; Fri, 22 Aug 2025 14:37:17 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="O94l/ds0"; dkim-atps=neutral Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 28E2C613DC for ; Fri, 22 Aug 2025 14:37:14 +0200 (CEST) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-45a15fd04d9so20913625e9.1 for ; Fri, 22 Aug 2025 05:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1755866233; x=1756471033; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wiumghQ1tOf7RLY7Ch6y8G0M/NNIVVdnDRDSrg9IvwI=; b=O94l/ds0ztDMH31p71t/DjqMtYpp+ob2056RnggaRTGinImNyki9ZfmZCPm8FET5lE aPRbbeZTr0z7Pt6Fq0RXOFfpirGGHdjbAJ2dclqgB5Wg3NnYflZj1IbjcwJVuNCfgoTv /YC87EyQpX+1WliQceHbjxOf1L4cEmZ+GtbvKa7lKi7LXpYyoNVwGSyv8hKDE5PfMTvT RguLRqNP3HIRyylp+rImByjjak/UFqsiwblG/ol6D6I7LnIj4pu0Dn9FoivmNhEcOnt7 K//n1Sd4VMLR+uu3R1Y7WKgrrEjoBsERpaDLUjXO+G4mLBGyeqAzOzOArFesjjQ8X9MC nFzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755866233; x=1756471033; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wiumghQ1tOf7RLY7Ch6y8G0M/NNIVVdnDRDSrg9IvwI=; b=ByNThWEe22ce3xH7u9c9300OQIPjDYs967cXJW2Kt0RQqKraqWM4KT4OMrnCNvAlCc mKqXV54yhfsQ2oCggsBukxhPQ2s9pN9D6NTRRKXUeD/JCuInzE1YkdjUGoKJMscmHMQ4 aZCamLqiw3f1yGw9YyzH+/E5NGqOu5Tu4niObxx7NBhTaFra3NW6x0rWB5TW004EFmrK 1EvvbS753Sfq+q6nu0PP6BKx0ICcz9dM5OENIzbQwlayr+HQG/UP1cuiSZi5qfPIShmR Ud/7f1WGCwnBYlfk3O1s8gBlSnFNnKFQESlGRkq0P4QCrgs71LqbHEONWQyhkvz7kyvW 0ZRg== X-Gm-Message-State: AOJu0Yx6Pp0AtHhkMdh1UtRhOOxkXHwBRCRG0+qU7zF7BJpGIgJnlR1Y vINZsH+EfyVQFvj5GnvXxhTzUsOKI5AmbfoN5QDuUbB2bPYe5qt9SkzdhXjTEcHMxNOk4eEtyPM FiZkc X-Gm-Gg: ASbGncsbkmnDM5LQfBDZFeGq8A1nMTra7vvIePNEqj4EfsyWEOXayESrUNJjWzLyuq5 yulBiR6vv8HpNS3slNl1Bqkss4H/g6qGS/gNG1uHKRMmU0298jqCaqQd26kvfskciRSM/6ym1/E IKcA53pGEv5JnRIYOlu/5wkp28OnOCUiCiaFvRG8GIk6LkjVusl8E/RuCpCsxYTEhTEjRtvDzQG X4pZgQruRpCHxdxUY4ZjeyJrURqVjVg6iTsrPjvmUquj50jQmhnWXH7QDmyxa8hH4wffIUzNEmd H+ylFZo/3JZ3zKeseiZuFIJiOLDaFbRA9iN3+IWiMUH88CTLfPFyryBkUKFBn7x6R9wE8GiErav FHAKi4v8d3YeBim8JEmCbfKr3jpawseHFukUS/yQseIFd+tUA2r5k1K9PLQFMu3OuF2iCkRVOAQ bt+J/gVpadwoMUx8wHorSaJ8tmTFKiP6jJo2wUD7g= X-Google-Smtp-Source: AGHT+IHgE7csRxHLYKP8b2kF6NhHpECDTOq09/WA6PwH1yKKhDBUOTlSf9M5BDM6Z2ogrkPmeeczIw== X-Received: by 2002:a05:600c:3b0c:b0:455:f7d5:1224 with SMTP id 5b1f17b1804b1-45b51791ed7mr22993995e9.9.1755866233355; Fri, 22 Aug 2025 05:37:13 -0700 (PDT) Received: from raspberrypi.pitowers.org ([2a00:1098:3142:1f:ffc9:aff6:7f7f:893b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3c07487986fsm16685787f8f.1.2025.08.22.05.37.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Aug 2025 05:37:12 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Cc: David Plowman Subject: [PATCH 1/6] utils: raspberrypi: ctt: Update noise/sharpness tuning Date: Fri, 22 Aug 2025 13:37:04 +0100 Message-Id: <20250822123709.16966-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250822123709.16966-1-david.plowman@raspberrypi.com> References: <20250822123709.16966-1-david.plowman@raspberrypi.com> 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" The default noise/sharpness/gamma values are updated to reflect the latest camera tuning work. - Denoise is inceased when not using temporal denoise. - Denoise is reduced when benefitting from temporal denoise. - Over-sharpening is reduced. - High contrast gamma is slightly reduced. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck --- utils/raspberrypi/ctt/ctt.py | 3 +- utils/raspberrypi/ctt/ctt_pisp.py | 106 +++++++++++++++++------------- 2 files changed, 64 insertions(+), 45 deletions(-) diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py index 186afda5..93a8e8fb 100755 --- a/utils/raspberrypi/ctt/ctt.py +++ b/utils/raspberrypi/ctt/ctt.py @@ -436,7 +436,8 @@ class Camera: write to json """ self.json['rpi.noise']['reference_constant'] = int(noise_out[1]) - self.json['rpi.noise']['reference_slope'] = round(noise_out[0], 3) + # Results are better with about 40% higher deviation. + self.json['rpi.noise']['reference_slope'] = round(1.4 * noise_out[0], 3) self.log += '\nNOISE calibrations written to json' print('Finished NOISE calibrations') diff --git a/utils/raspberrypi/ctt/ctt_pisp.py b/utils/raspberrypi/ctt/ctt_pisp.py index a59b053c..8a5fc03f 100755 --- a/utils/raspberrypi/ctt/ctt_pisp.py +++ b/utils/raspberrypi/ctt/ctt_pisp.py @@ -29,11 +29,11 @@ json_template = { { "sdn": { - "deviation": 1.6, - "strength": 0.5, + "deviation": 0.6, + "strength": 0.95, "deviation2": 3.2, "deviation_no_tdn": 3.2, - "strength_no_tdn": 0.75 + "strength_no_tdn": 0.95 }, "cdn": { @@ -42,7 +42,7 @@ json_template = { }, "tdn": { - "deviation": 0.8, + "deviation": 1.0, "threshold": 0.05 } }, @@ -50,11 +50,11 @@ json_template = { { "sdn": { - "deviation": 1.6, - "strength": 0.5, + "deviation": 0.6, + "strength": 0.95, "deviation2": 3.2, "deviation_no_tdn": 3.2, - "strength_no_tdn": 0.75 + "strength_no_tdn": 0.95 }, "cdn": { @@ -71,11 +71,11 @@ json_template = { { "sdn": { - "deviation": 1.6, - "strength": 0.5, + "deviation": 0.6, + "strength": 0.95, "deviation2": 3.2, "deviation_no_tdn": 3.2, - "strength_no_tdn": 0.75 + "strength_no_tdn": 0.95 }, "cdn": { @@ -714,38 +714,56 @@ json_template = { "rpi.contrast": { "ce_enable": 1, "gamma_curve": [ - 0, 0, - 1024, 5040, - 2048, 9338, - 3072, 12356, - 4096, 15312, - 5120, 18051, - 6144, 20790, - 7168, 23193, - 8192, 25744, - 9216, 27942, - 10240, 30035, - 11264, 32005, - 12288, 33975, - 13312, 35815, - 14336, 37600, - 15360, 39168, - 16384, 40642, - 18432, 43379, - 20480, 45749, - 22528, 47753, - 24576, 49621, - 26624, 51253, - 28672, 52698, - 30720, 53796, - 32768, 54876, - 36864, 57012, - 40960, 58656, - 45056, 59954, - 49152, 61183, - 53248, 62355, - 57344, 63419, - 61440, 64476, + 0, 0, + 512, 2518, + 1024, 5033, + 1536, 7175, + 2048, 9309, + 2560, 10814, + 3072, 12312, + 3584, 13773, + 4096, 15225, + 4608, 16566, + 5120, 17899, + 5632, 19221, + 6144, 20534, + 6656, 21684, + 7168, 22826, + 7680, 24024, + 8192, 25212, + 9216, 27251, + 10240, 29167, + 11264, 30947, + 12288, 32696, + 13312, 34309, + 14336, 35849, + 15360, 37194, + 16384, 38445, + 17408, 39598, + 18432, 40732, + 19456, 41717, + 20480, 42687, + 22528, 44343, + 24576, 45871, + 26624, 47222, + 28672, 48441, + 30720, 49460, + 32768, 50470, + 34816, 51476, + 36864, 52480, + 38912, 53382, + 40960, 54294, + 43008, 55155, + 45056, 56035, + 47104, 56920, + 49152, 57824, + 51200, 58737, + 53248, 59666, + 55296, 60604, + 57344, 61558, + 59392, 62529, + 61440, 63516, + 63488, 64519, 65535, 65535 ] }, @@ -754,8 +772,8 @@ json_template = { "rpi.cac": { }, "rpi.sharpen": { - "threshold": 0.25, - "limit": 1.0, + "threshold": 0.75, + "limit": 0.5, "strength": 1.0 }, "rpi.hdr":