From patchwork Thu Jun 30 14:35:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Semkowicz X-Patchwork-Id: 16482 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 1AC79BE173 for ; Thu, 30 Jun 2022 14:35:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 665AF6564E; Thu, 30 Jun 2022 16:35:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656599751; bh=0E8bHJbcitZ5Gz0AafM02LyJns1LWDO5VI1PJqHg0+Q=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dkfTjLTdxZT2MeR8UICzAlY+kxoY4mie8WNc1RGh3tc912X/PXqteXCgQYFSf22YI 2Q4HiS0NbJJXNPpvMH3+R1nqTgKYYm0Rs8ODe5ZXggS26ELF+q6WxJp5aj9VSDDYUE lAYruL2xu32W7EMF7o0buF4Nxm84WWKWd197PWb6Qc/7KvzbTQqBBIfoVKkZSJtcKb jhKXnmBl3krs572NclCKGozKvehH7rG2wdJ2TNmFAoo1xZmzno5UICauYtHqt/x+AL R4VAcRYQZibr+UHbTLniXS7Iox+CdL8QAUEXdGdrqxPXsiIc97ptaXv9pIgz5gv6KX NuFywO8zzzTYg== Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DB0AD6559A for ; Thu, 30 Jun 2022 16:35:49 +0200 (CEST) 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="wSyc7aRy"; dkim-atps=neutral Received: by mail-wr1-x432.google.com with SMTP id e28so22461626wra.0 for ; Thu, 30 Jun 2022 07:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thaumatec-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hgsegQ1Ce5HrQDQuHcZ+3r99hyJZ/fx9QEQDYGNYkyc=; b=wSyc7aRyLo8BXwU8Aof61WeMNEIDc/UrKJrnC6ENEl6WOYqvHv6pg6QACFb+iHs2jp FP8O3/AFkAiM58f7oAIjvTE+nrmwi6erDhtGfO0p05Z7rEchLnkqvNCBKzUs0WZ8zs8W F9a7d5WHGQ43Z4TsSSlzbSQe4Vye1vvuC6rIm3h7IWCOcRMbrw2DqgMsv59y3/c5KKnp l810zvd6v5nK+xRlx+mh3VO9nwFQmNqq38YPkXOBMoMbD0kZLUYraUKqPMmnNCwXPj0Z nZulvXE/m/sdFWQdfBTB+wbHhwqibJ3xCU9SFfa6oZ5DGXE29srdufsXW7w0raKE3Osv omFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hgsegQ1Ce5HrQDQuHcZ+3r99hyJZ/fx9QEQDYGNYkyc=; b=SaLc3T8N8dkjPa7VuCrG2E/h4zg6slswBhCdJpEMpJStLQcwwEQTBCObwDcjLb0HIU JOpd/QP/L8VnPB89JbJx20ulp3u8H+4ddXn/mHyNJdF/KtLXVggduwmwkAlf7XuD56HT 2TRMvQkX6Z3/wCIaeU22FAhMMj683Q6TQ7W5wTlM3hpVEVnHfXwVwl8Tpz5CAtR3O28N fxLT6LOf/GHrvIQlwbSB/mVFlr7pojg+7tNuqpUIVH5I6ALmR5SLGvjPOyfC6yBdaZ6W AZ/pKBk+os/9d7BNTd45pGzgdjuYdvENZsSXl88YYA9HNFwKVHiLxmdCD3qL7lKa47Vs cS2w== X-Gm-Message-State: AJIora9ZkXQTAYT8iIf802xKJDEIi+5OtxsPpj4GX5DoXmmOAPqgPCaa mgD5RswcEp16WOA3S0DDRbm1h8kqnliTyw== X-Google-Smtp-Source: AGRyM1uhz537RxPhaTGtBjsleUb3+1t5RXLSDVNUWRd6L7Yj26WKIedrF1hTg4gNVooDQYq55YqkRg== X-Received: by 2002:a5d:51d2:0:b0:21b:bd52:c9c9 with SMTP id n18-20020a5d51d2000000b0021bbd52c9c9mr9030552wrv.498.1656599749494; Thu, 30 Jun 2022 07:35:49 -0700 (PDT) Received: from localhost.localdomain (ip092042140082.rev.nessus.at. [92.42.140.82]) by smtp.gmail.com with ESMTPSA id r5-20020a05600c320500b0039db500714fsm6405945wmp.6.2022.06.30.07.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 07:35:48 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 30 Jun 2022 16:35:35 +0200 Message-Id: <20220630143543.39599-1-dse@thaumatec.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/8] 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 Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, The following set of patches introduces an autofocus algorithm for rkisp1 platforms. As there are common parts of code in the IPU3, RPi and now they would be repeated in rkisp1, I tried to separate the main control part of the AF algorithm in the new AfHillClimbing class. These changes make use of the freshly introduced algorithm registration mechanism. As there was a missing part for the easy way to get the specific algorithm from the dynamically loaded list, I added getAlgorithm() method to the Module class that. It was implemented in the fastest way to get it working, but I think we should improve it later. Maybe it would be good to extend algorithm creation and store also the name of corresponding algorithm to allow calling it by name instead of type. Especially that algorithms are loaded from tuning file by name. I am not sure if the directory structure I have chosen for the common code is a good place, so please correct me if I should place it somewhere else. Doxygen documentation part should be, for sure, more detailed, but I firstly want to wait for your comments about the code, just in case if there were any changes to the design. These changes depend on the "libcamera: rkisp1: Add lens control" changes that are still in the review process. Link: https://patchwork.libcamera.org/project/libcamera/list/?series=3228 I am waiting for your comments :) Best regards Daniel Semkowicz Daniel Semkowicz (8): ipa: Add base class defining AF algorithm interface ipa: Add class that implements base AF control algorithm ipa: rkisp1: Add AF algorithm basing on common AfHillClimbing class pipeline: rkisp1: Add basic AF controls to the supported controls list ipa: module: Add getAlgorithm() method ipa: rkisp1: Pass requests setting AF controls to the AF algorithm ipa: rkisp1: Add OV5675 tuning file ipa: rkisp1: Add "Windows" Metering mode to auto focus algorithm src/ipa/libipa/algorithms/af_algorithm.cpp | 77 ++++++ src/ipa/libipa/algorithms/af_algorithm.h | 39 +++ .../libipa/algorithms/af_hill_climbing.cpp | 89 +++++++ src/ipa/libipa/algorithms/af_hill_climbing.h | 251 ++++++++++++++++++ src/ipa/libipa/algorithms/meson.build | 11 + src/ipa/libipa/meson.build | 6 + src/ipa/libipa/module.cpp | 7 + src/ipa/libipa/module.h | 17 ++ src/ipa/rkisp1/algorithms/af.cpp | 132 +++++++++ src/ipa/rkisp1/algorithms/af.h | 41 +++ src/ipa/rkisp1/algorithms/meson.build | 1 + src/ipa/rkisp1/data/meson.build | 1 + src/ipa/rkisp1/data/ov5675.yaml | 12 + src/ipa/rkisp1/rkisp1.cpp | 72 ++++- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 12 +- 15 files changed, 762 insertions(+), 6 deletions(-) create mode 100644 src/ipa/libipa/algorithms/af_algorithm.cpp create mode 100644 src/ipa/libipa/algorithms/af_algorithm.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