From patchwork Wed May 7 15:31:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 23348 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 03C6DC3226 for ; Wed, 7 May 2025 15:31:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2765F68B31; Wed, 7 May 2025 17:31:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="ft8dtGxM"; dkim-atps=neutral Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 38E8368AD8 for ; Wed, 7 May 2025 17:31:07 +0200 (CEST) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-441ab63a415so71346955e9.3 for ; Wed, 07 May 2025 08:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1746631866; x=1747236666; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=s8TbdxR/8uN193SXKRQF+AG6xd8auv5BiVoyK+ZJIFQ=; b=ft8dtGxMPs6pQXGwvH1ANmQkfZQwfWERPToPVzdDBGcQlk6ErSDZrjuiifKsNAHOUl RbzF6saBoXC1t5JwOOD7LSAlwFJ3bTFmHBJVmM2YiVTXCD2RNLzjykt8PxCLD3Zu0EEa /ir2DsDzM0TyVIZX+E9MxdjDZhoUkwcTMOQQDHtzddWK9Z3qLM7eKhy7eOrCmIWiKgTm HUovme++iVdXwY55dSeKkR37CC/wE/hwxq8JvDLGYZWX2pop7h+NtWlSXmP+TdxvxBJG A7MqEIi4yKUuiVDS0ZPfxeEw78vCtzjsoNkTkjjkPNpIzsaOUlyWnuzwcH4cJQRr0f4T hhGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746631866; x=1747236666; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s8TbdxR/8uN193SXKRQF+AG6xd8auv5BiVoyK+ZJIFQ=; b=FUAsN+hWLjZvFrzHCyP9pGW5HupmjAlfhnLigHIplxH+Iw/6pW/dEl36JX+7R+HO9X 9e0J54999gakAId7TDoHIyI1Zs2uz60LjFg3xfXkEINE0okoNmXwXQxxKuyzOiwGDNK5 dxVCpo6I3uu+rL/o5EY5/U9UeRArW+HONA2TsNuNCDe7GpSdW9XKpbkte0lOKoEPww09 QMoPMJfho7XE+nauhTXIVDyDlstD5wNBFTbVLULV/MFnHk3hKONDeWwmio02K85gPeUu ZGZqTUYpp0ARuenr9etbGLpW6+MhBsbOvkra44eXD5eIszEA6vXX8x/Int3bREIwMjor 1M7w== X-Gm-Message-State: AOJu0Yx0YcluoQ87EM33mu5Vv8DdPicp/5JKGwW+x9SW89kH9/oKCRcX QrX+XxmbcXhUDPjMko3o7Ku/Q0dayfOZcTNjel3GCIkf7zColJxMUNNdfZlfkzMdPGjXdEeB3Gl 6jM0= X-Gm-Gg: ASbGncuTVHAoOQPtNcE5SAieu4cFWGHJwXkR6yE4+SjDuw8C8GMfdehDaDvaZuNnhLe EK8TzaKixBaUXDPzoYUJKrabTcwuNR2QK0eZ3Svrz7DvhCdF1PiumP64kpZCO0nTT7cQAEB/Nzu 5S97WY085pnXSXBf+tPSBVVSmidH/9io9KNOyOWJH2DvGdoyZPow8pLm7Wptlkh37VHqyVMXsmU LBAqcJxxi1E5CYDoqQY281KhhP18xUz6KeGIv9XXX6cOKcnJjyziWIIH66zVKiX2tMXfWPqR8CN ReeEjsoScIuzwJ/OiofPLe8DB5UfvbBrfNiHesm/mWhpwep8EjO7rduFFJpklDqmq/HtVbxfJVk = X-Google-Smtp-Source: AGHT+IEn2Zs4hxbof2feLBrHbwe+f0U+0J7CLK9cTcmmOJLX0V8najTGVuPOVXcUeh+nrPaC2F2aMg== X-Received: by 2002:a05:600c:4eca:b0:441:a715:664a with SMTP id 5b1f17b1804b1-441d44dd0c6mr25356225e9.20.1746631866162; Wed, 07 May 2025 08:31:06 -0700 (PDT) Received: from davidp-xps-13.pitowers.org ([2a00:1098:3142:1f:625b:4a21:8e09:bbdd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-442cd3b7dd5sm4324455e9.35.2025.05.07.08.31.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 08:31:05 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Cc: David Plowman Subject: [PATCH] utils: raspberrypi: ctt: Fix integer division error calculating LSC cell size Date: Wed, 7 May 2025 16:31:03 +0100 Message-Id: <20250507153103.253107-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.34.1 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 cell sizes must be cast to integers as the parameters that were passed in may be floats. Bug: https://github.com/raspberrypi/libcamera/issues/260 Signed-off-by: David Plowman Fixes: 36ba0e551507 ("utils: raspberrypi: ctt: Fix NaNs in lens shading tables") Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck --- utils/raspberrypi/ctt/ctt_alsc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/raspberrypi/ctt/ctt_alsc.py b/utils/raspberrypi/ctt/ctt_alsc.py index f4fd09e3..5d8b2ced 100644 --- a/utils/raspberrypi/ctt/ctt_alsc.py +++ b/utils/raspberrypi/ctt/ctt_alsc.py @@ -131,7 +131,7 @@ def alsc(Cam, Img, do_alsc_colour, plot=False, grid_size=(16, 12), max_gain=8.0) pixels. """ w, h = Img.w/2, Img.h/2 - dx, dy = (w - 1) // (grid_w - 1), (h - 1) // (grid_h - 1) + dx, dy = int((w - 1) // (grid_w - 1)), int((h - 1) // (grid_h - 1)) """ average the green channels into one