From patchwork Tue Mar 14 14:48:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Semkowicz X-Patchwork-Id: 18391 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 DD6C9BD80A for ; Tue, 14 Mar 2023 14:49:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 10A0F62709; Tue, 14 Mar 2023 15:49:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1678805354; bh=uH0as5+ck4AhkXYhRQV2DalQ6o54ciPajksaMaWtZX8=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=JVshJjfzFlZvtSPWxq7ChdPNkI1rqY70SgHfQqeAAFrwq9gTmZa2JMJCNxghhTLPo ghUU0PKnsVDgDcsSQ/91U1JXjzSN3WXoLpGpKC2SHNOd+gVSwB7XwPzaPyEm4kJLGD Y777KscyN34mLSYhK8aQXZcLaPdkPohNYXquVFsQntvL3AMKHkpz5Pl/9IHARfL7Ez 6e7KWOYWCI3VuKrwLeFz2KDJoVBRyO63/3K+q54HYCV9/K5zzUbbP3oHjZngq148l3 QTyFZ3/JM5vYDO1bHSkB4CehwZ0XtaUjhRLnBwU2Vhze+/GRqxo1P/aR5p4IXhmt09 xkPBtSIES/cdg== Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 876FF626D6 for ; Tue, 14 Mar 2023 15:49:12 +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="mtAtenkk"; dkim-atps=neutral Received: by mail-lj1-x231.google.com with SMTP id z42so16242860ljq.13 for ; Tue, 14 Mar 2023 07:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thaumatec-com.20210112.gappssmtp.com; s=20210112; t=1678805351; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=swq/umBaIyF10xERJmvJkjptJHvXh/F7enwe9/QL+L0=; b=mtAtenkknfq1kPqv8R9DjeaS7/58a9OsGZ9yMmv8hewXkeRjfWS52M+05BVCf+bPFx uwKVT/ey7cJ+YU6uILj6Xo1HrApoUJON41q7v2EsrDtHZJm6hzafpC1+r3oxhjDZSb6U RfPcLL4DyovYm43K3bspi5y2vCiDaH6kQiYfNjoSosFbfolHNbFP7BqsZ/NAOXNNgSdX jrCmTF8d9Vsp5a4kFS3vUy4dsF+VF4aS4AhLrinXMa3vauTI57QPXC9IUNY7ArPVRzYl 9RulYVeyR2DplT5dZQdjv6RL5abSSPy3MRHC8d3fAnrf/sUAmqNICBpmG4C8ghfTkWwu Ax5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678805351; 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=swq/umBaIyF10xERJmvJkjptJHvXh/F7enwe9/QL+L0=; b=LPvMBhyvP4j02oThy1J1VyJj5b9r/p+Iwy20HyqjVQOBXxJn22IZS3FX17Lq6kAk8c tYJI9m0qK4X14xmQeEB+hAnerpWOrn9rOflKIGnGTX+LTiRoe+gkT8QXHWGxxjLQwGo/ qsbZ/E9n56cZ2l9+oZawOeDDVbnlH8X8M/rlnXzOoR5JxHeWJsej0tplo+feTrOnBMA/ Qsp1uwB1xdd4FEn4E8vpBkdTxGeMlxLtK+1mq7s2WeiNm5iNNXl/buM4XfHwdPAFA+il ThSMZwu2A4VQ5TusaDQzYjdw/SP0ZCNbagF2qrpkJdOkK8uNB1hhCsiT3ib5AJQFRAeO mcQA== X-Gm-Message-State: AO0yUKVlFsfY/kOfyX6SFX+F5yBE1ttjbYASItAk8eDqqpME8Lppg6bl 5cAmUZSxoH8RkpZ2JvDvwZZlWJN/26vjafGBuRk= X-Google-Smtp-Source: AK7set82sfwMowWeoWYL21kdnWaOoTxWyQcnPcoMVzTKftZUzZRuxy32EEn60VVMJtVLlXIMib+Xtg== X-Received: by 2002:a05:651c:2108:b0:294:712a:5190 with SMTP id a8-20020a05651c210800b00294712a5190mr15740141ljq.28.1678805351626; Tue, 14 Mar 2023 07:49:11 -0700 (PDT) Received: from localhost.localdomain ([91.90.166.178]) by smtp.gmail.com with ESMTPSA id q25-20020a2eb4b9000000b00295a35f30e1sm470961ljm.115.2023.03.14.07.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Mar 2023 07:49:11 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Tue, 14 Mar 2023 15:48:24 +0100 Message-Id: <20230314144834.85193-1-dse@thaumatec.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 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" Hi! This is the updated version of the common contrast based Auto Focus algorithm implementation and it's usage for RkISP1 AF implementation. Main changes: - class hierarchy changed to composition, - lens limits are now read from controls instead of being defined in the tuning file, - improved documentation - controls parsing was moved to the queueRequest() in the interface class as it should be reused by AF implementations. - `windows` metering mode control was moved from the rkisp1 platform-specific class to the AfHillClimbing, because it can be reused. Best regards Daniel Semkowicz 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 basing 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 | 155 +++++++ src/ipa/libipa/algorithms/af.h | 41 ++ .../libipa/algorithms/af_hill_climbing.cpp | 400 ++++++++++++++++++ src/ipa/libipa/algorithms/af_hill_climbing.h | 103 +++++ src/ipa/libipa/algorithms/meson.build | 11 + src/ipa/libipa/meson.build | 6 + src/ipa/rkisp1/algorithms/af.cpp | 168 ++++++++ src/ipa/rkisp1/algorithms/af.h | 50 +++ 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 | 22 + 16 files changed, 1043 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