From patchwork Fri Mar 24 14:28:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Semkowicz X-Patchwork-Id: 18443 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 8DA24C0F2A for ; Fri, 24 Mar 2023 14:29:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CDEC262711; Fri, 24 Mar 2023 15:29:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1679668166; bh=01tRbLHWCPl0sLDF77eNH/RnW2NKrPigNlq1E61mMR0=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=SZKZ7DwkSqpYm0Y0SfaTbUI74LVrK6zx0lY0igv9xp3ZLGdx+BL7HZKZh4r2aoD22 1BORSEEiI1dB5ClnBYHtNbqBYEdLieequNXVgbljY8HZmbHi2CFktmDjL1erLdnIIP JeSUG0PbSv20OEFP4o9ZcVUueQoYfurmxKyn4hVKkvpFe9RDgw2EkpzOzz8q4GIKof TN/IPkk6jo3P+tAJ+/Pp/ifLkYCkMB8oUbVMRKH0Ld+RSlxsDecU570SDs+JR45lz+ 2hHVlP81ZIg87cSda/op8ndu/IHSqEdWl+GqldsVhZEpGDF9CVWfeXze1OAU5Y8EgP kTx6q5ha+719w== Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 37AE261ECF for ; Fri, 24 Mar 2023 15:29:25 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=thaumatec-com.20210112.gappssmtp.com header.i=@thaumatec-com.20210112.gappssmtp.com header.b="brizhEej"; dkim-atps=neutral Received: by mail-lj1-x234.google.com with SMTP id x20so1898627ljq.9 for ; Fri, 24 Mar 2023 07:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thaumatec-com.20210112.gappssmtp.com; s=20210112; t=1679668164; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=DRcR9kxvFPodrS9nN+D9pr9tkWVi5EotvdBbbiybXc0=; b=brizhEejqo6G+Q5HMufS4EyzGPh7sacL3i9VbZ8j8TPIMkshCmc+azqfBU1/kdR39x 5uxuu5eIPeZiYsqewlgOM6/qkIHTmMYS5cDaWeVqypx/vgUo0vsgnuoYKYIttLiHx064 RRKNFd2zoXfCuuu/y7E22xBjJDnicayMgl17aY0fMwIusn9eIQK2W6+nu6HTHnQEriva lp6pp7RZ4RP9LDSC2LF0B6bg8tBJlhA+Y+0C53iaq4djjAdFmKPRvi4nVeYvD23s9v2y 17yO6mqxp/RwRaKLiEr85bx/A3sRAwkXArAN6jLVkXNbzwsIZSvrdPZGwD9t/XtNfpPN IJfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679668164; 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=DRcR9kxvFPodrS9nN+D9pr9tkWVi5EotvdBbbiybXc0=; b=ZnPBKNm8/lrug8UWOvNdbudJvxTXQoBRhcTBjmPn0X2NQJfplLtBIzgahZcR2qeRsg sGdaFPsJxqycvUIuwFrIJeFNyQ9YPi/NcQIML5N5Jr8/jgZoCq3S/EzaEuva0ojIEz6g AD2kbPax0Q9BonLMleDfSp1KSCBaoplp+vy/06Ooa8qL2FQJHjCDspKzFZlL8H+6tmL4 iFNOwwXwHNt0J23WPOTatOV2Cmi6uin00ERKxx4JOGBB3u5VN/5c7zz5CX9+xxpBoPGU HfKL0zQb1iRBPG6zGwh8AfKHW7lPVuFlNftrk8uAeoU7zLnFmLzJn5q0A/eifZ+AlGNA ECAg== X-Gm-Message-State: AAQBX9dmzaz3C2ZPqVVYGIwo8SB0uKav9B6JhL3R67T1HYa00eSRp/eh BI51lpIiLot3ci2sb+OHRmBRZiszAerOzDuTWcA= X-Google-Smtp-Source: AKy350Y/5ROn2Eugzh7qC+C5o8EJV+NRCxy+CJsYtmtmSdhiyBXXZvQKP1hiEGllATmhtCoPg4Ibzw== X-Received: by 2002:a2e:a418:0:b0:298:9e7b:d07b with SMTP id p24-20020a2ea418000000b002989e7bd07bmr940922ljn.30.1679668164243; Fri, 24 Mar 2023 07:29:24 -0700 (PDT) Received: from localhost.localdomain ([91.90.166.178]) by smtp.gmail.com with ESMTPSA id j21-20020a2e8515000000b002a10b2ea089sm981714lji.16.2023.03.24.07.29.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 07:29:23 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 24 Mar 2023 15:28:58 +0100 Message-Id: <20230324142908.64224-1-dse@thaumatec.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 00/10] ipa: rkisp1: Add autofocus algorithm 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: , X-Patchwork-Original-From: Daniel Semkowicz via libcamera-devel From: Daniel Semkowicz Reply-To: Daniel Semkowicz Cc: jacopo.mondi@ideasonboard.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This is the updated version of the common contrast based Auto Focus algorithm implementation and it's usage for RkISP1 AF implementation. Main changes in v5: - Improve documentation - Fix language errors in the documentation - Remove default branches in some of the switch cases - Remove unused fineCompleted_ and previousContrast_ variables in AfHillClimbing - Fix incorrect multiline comments indention - Add "to do" lists to the AfHillClimbing and rkisp1::Af - Add static_cast in additional places pointed by clang-tidy - Change "fine-search-range" tuning parameter to be expressed in percents - Connect setLensControls() slot in PH, only if lens is available - Rework setLensControls() to iterate through the control list, instead of calling contains() and get(). Daniel Semkowicz (10): rkisp1: Add camera lens to PH and expose it to the IPA ipa: rkisp1: Add lens limits to the session config ipa: Add base class defining AF algorithm interface ipa: Add common contrast based AF implementation ipa: af_hill_climbing: Add "Windows" metering mode ipa: rkisp1: Add AF algorithm based on AfHillClimbing ipa: rkisp1: af: Add "Windows" Metering mode ipa: rkisp1: Add AF controls to the RkISP1 IPA rkisp1: Control camera lens position from IPA ipa: rkisp1: Add OV5675 tuning file include/libcamera/ipa/rkisp1.mojom | 2 + src/ipa/libipa/algorithms/af.cpp | 159 +++++++ src/ipa/libipa/algorithms/af.h | 45 ++ .../libipa/algorithms/af_hill_climbing.cpp | 418 ++++++++++++++++++ src/ipa/libipa/algorithms/af_hill_climbing.h | 101 +++++ src/ipa/libipa/algorithms/meson.build | 11 + src/ipa/libipa/meson.build | 6 + src/ipa/rkisp1/algorithms/af.cpp | 179 ++++++++ src/ipa/rkisp1/algorithms/af.h | 54 +++ src/ipa/rkisp1/algorithms/meson.build | 1 + src/ipa/rkisp1/data/meson.build | 1 + src/ipa/rkisp1/data/ov5675.yaml | 18 + src/ipa/rkisp1/ipa_context.cpp | 25 ++ src/ipa/rkisp1/ipa_context.h | 10 + src/ipa/rkisp1/rkisp1.cpp | 30 ++ src/libcamera/pipeline/rkisp1/rkisp1.cpp | 18 + 16 files changed, 1078 insertions(+) create mode 100644 src/ipa/libipa/algorithms/af.cpp create mode 100644 src/ipa/libipa/algorithms/af.h create mode 100644 src/ipa/libipa/algorithms/af_hill_climbing.cpp create mode 100644 src/ipa/libipa/algorithms/af_hill_climbing.h create mode 100644 src/ipa/libipa/algorithms/meson.build create mode 100644 src/ipa/rkisp1/algorithms/af.cpp create mode 100644 src/ipa/rkisp1/algorithms/af.h create mode 100644 src/ipa/rkisp1/data/ov5675.yaml