[{"id":36427,"web_url":"https://patchwork.libcamera.org/comment/36427/","msgid":"<8b6bdd5d-0f32-4cab-b4b7-d85f731e57bb@ideasonboard.com>","date":"2025-10-24T11:00:37","subject":"Re: [PATCH v1 26/35] ipa: rkisp1: awb: Ignore empty AWB statistics","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2025. 10. 24. 10:50 keltezéssel, Stefan Klug írta:\n> When the AWB engine doesn't find a valid pixel because all pixels lie\n> outside the configured colour range it returns an AWB measurement value\n> of 255, 255, 255. This leaves the regulation in an unrecoverable state\n> noticeable by a completely green image. Fix that by skipping the AWB\n> calculation in case there were no valid pixels.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>   src/ipa/rkisp1/algorithms/awb.cpp | 5 +++++\n>   1 file changed, 5 insertions(+)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\n> index 27109478c340..81c767531c03 100644\n> --- a/src/ipa/rkisp1/algorithms/awb.cpp\n> +++ b/src/ipa/rkisp1/algorithms/awb.cpp\n> @@ -313,6 +313,11 @@ void Awb::process(IPAContext &context,\n>   \t\treturn;\n>   \t}\n> \n> +\tif (awb->awb_mean[0].cnt == 0) {\n> +\t\tLOG(RkISP1Awb, Warning) << \"AWB statistics are empty\";\n> +\t\treturn;\n> +\t}\n> +\n\nIsn't this already there? (Although with \"Debug\" instead of \"Warning\".)\n\nhttps://gitlab.freedesktop.org/camera/libcamera/-/commit/0069b9ceb1e03d5887ac614e35d79602b003ff27\n\n\n\n>   \tRGB<double> rgbMeans = calculateRgbMeans(frameContext, awb);\n> \n>   \t/*\n> --\n> 2.48.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2F13EBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Oct 2025 11:00:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 06EF8608C0;\n\tFri, 24 Oct 2025 13:00:43 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3D6816087D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Oct 2025 13:00:41 +0200 (CEST)","from [192.168.33.13] (185.221.141.231.nat.pool.zt.hu\n\t[185.221.141.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 45698A8F;\n\tFri, 24 Oct 2025 12:58:55 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Z44DFZg/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761303535;\n\tbh=Ya5ItU3jYSjFbWgJ/klho3ucJd8RBy7Od7sAxh0gBw8=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=Z44DFZg/Iu67zImKNoNLZTrR/4mJYUpGc8NGfHPYJTgZe3x4mguEl+dcPlMbT4bBj\n\tPN04PFLywcp6eJlpQEI1X2pgPqiJDJ26jAsScORXKSUXhvABzMjSE2AUi0FMwYe1qo\n\tfO7teBfiK1O9nUgemoMZaQFtRC+FXrHXT31Gmjzo=","Message-ID":"<8b6bdd5d-0f32-4cab-b4b7-d85f731e57bb@ideasonboard.com>","Date":"Fri, 24 Oct 2025 13:00:37 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v1 26/35] ipa: rkisp1: awb: Ignore empty AWB statistics","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20251024085130.995967-1-stefan.klug@ideasonboard.com>\n\t<FGLjhEDsIrCtCj9sdh6IKq12Inudt4zprCrckRP4W_7gasKoBsgWqpkzvAvjzsgySE08RAfSiKeYYFejpJSWTg==@protonmail.internalid>\n\t<20251024085130.995967-27-stefan.klug@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20251024085130.995967-27-stefan.klug@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]