From patchwork Sun Jul 30 08:13:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Wurmus X-Patchwork-Id: 52406 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id EA95527BBE9; Sun, 30 Jul 2023 09:43:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 743D427BBE2 for ; Sun, 30 Jul 2023 09:43:11 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qQ1Yy-00014y-Pl; Sun, 30 Jul 2023 04:14:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qQ1Yx-00014q-6a for guix-patches@gnu.org; Sun, 30 Jul 2023 04:14:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qQ1Yw-0001r0-VB for guix-patches@gnu.org; Sun, 30 Jul 2023 04:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qQ1Yw-0001y4-KX for guix-patches@gnu.org; Sun, 30 Jul 2023 04:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64945] [PATCH] gnu: opencv: Add descriptors for xfeatures2d. Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 30 Jul 2023 08:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64945 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64945@debbugs.gnu.org Cc: Ricardo Wurmus X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16907048277535 (code B ref -1); Sun, 30 Jul 2023 08:14:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Jul 2023 08:13:47 +0000 Received: from localhost ([127.0.0.1]:49291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQ1Yg-0001xS-Sg for submit@debbugs.gnu.org; Sun, 30 Jul 2023 04:13:47 -0400 Received: from lists.gnu.org ([2001:470:142::17]:34066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQ1Yf-0001xE-1K for submit@debbugs.gnu.org; Sun, 30 Jul 2023 04:13:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qQ1YZ-00014X-6b for guix-patches@gnu.org; Sun, 30 Jul 2023 04:13:39 -0400 Received: from sender3-of-o58.zoho.com ([136.143.184.58]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qQ1YU-0001iC-R6 for guix-patches@gnu.org; Sun, 30 Jul 2023 04:13:38 -0400 Delivered-To: rekado@elephly.net ARC-Seal: i=1; a=rsa-sha256; t=1690704807; cv=none; d=zohomail.com; s=zohoarc; b=F77g0XOsudPKIEMs15BN0mR6lUo5waRlEQopvf3eLzigHdCuw/7bOkASpkOv/oWoJL5JBOlKuuWE8FlanogmV0zAjZZiUs+S9N/yn4gZAnzhUp6PtkMTGC7nlfoSRYdlx6SgrWg7S+Q1OcIgh27szN+cP4mtZ7jPcbNqTMGFibQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690704807; h=Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=P3bEsqZw5Nay4fnH/k4c0h4zUaEPjQPqUIy/+774z8o=; b=km9WOdpr8LxM2nuMxvMhkMU2ycIIDhJoF7vP0gybxQhhxen8vOvksbO0FOdT3AjVqupcTqNZLGYsFX2LqcBl+dDENiX8NC8QnG9eZ4BZN8GMr7CbK/cJkX+0jlvtzYXX240DmVCwmSjFQOi35nyG6t3UW8rCtC1UpwEPXyeR10A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1690704807; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=P3bEsqZw5Nay4fnH/k4c0h4zUaEPjQPqUIy/+774z8o=; b=Ca7IWnq2yMPIVQwL4Pv93UCnQnVibB8W/GnFpGk4g+KBld3ESQZn/gOm4hQz1L8H czygLmaGCXBT73Ebs4VoZomH5FpYkT+1wOlVNHG2Qi4KT1R7XwZ3ofOuwlaPZ6CvhHU qQ5hvn/QtSJzSae3HgCB505XzicV4dpmJqVXB56g= Received: from localhost (21-108-142-46.pool.kielnet.net [46.142.108.21]) by mx.zohomail.com with SMTPS id 16907048048091020.4564604942569; Sun, 30 Jul 2023 01:13:24 -0700 (PDT) From: Ricardo Wurmus Date: Sun, 30 Jul 2023 10:13:20 +0200 Message-ID: <0e5d8492b0300c16d376cb41f3589cdcf789d31b.1690704800.git.rekado@elephly.net> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.184.58; envelope-from=rekado@elephly.net; helo=sender3-of-o58.zoho.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/image-processing.scm (opencv)[native-inputs]: Add boost and vgg descriptors. [arguments]: Place descriptor files in expected locations; do not disable xfeatures2d feature. --- gnu/packages/image-processing.scm | 48 ++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 7 deletions(-) base-commit: b5af0b9c016a65bf32b06a4f118c2ed48f3a80b3 prerequisite-patch-id: db4d32d59a5582f0ed3d20d572fb50a0305c9b5b prerequisite-patch-id: f18e5f68b072b6554aec1dccbf168ab00ca4c68d diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index 965eca82b7..b6b2457f3b 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -583,12 +583,8 @@ (define-public opencv ;; would get a compile error later: "-DPROTOBUF_UPDATE_FILES=ON" - ;; xfeatures2d disabled, because it downloads extra binaries from - ;; https://github.com/opencv/opencv_3rdparty - ;; defined in xfeatures2d/cmake/download_{vgg|bootdesc}.cmake - ;; Cmp this bug entry: - ;; https://github.com/opencv/opencv_contrib/issues/1131 - "-DBUILD_opencv_xfeatures2d=OFF") + ;; For xfeatures2d. + "-DOPENCV_SKIP_FEATURES2D_DOWNLOADING=ON") #:phases (modify-phases %standard-phases (add-after 'unpack 'disable-broken-tests @@ -641,7 +637,17 @@ (define-public opencv (copy-recursively (assoc-ref inputs "opencv-extra") "../opencv-extra") (copy-recursively (assoc-ref inputs "opencv-contrib") - "../opencv-contrib"))) + "../opencv-contrib") + + (substitute* "../opencv-contrib/modules/xfeatures2d/CMakeLists.txt" + (("download_(boost|vgg)_descriptors") "#")) + (copy-recursively (assoc-ref inputs "opencv-3rdparty-boost") + "../downloads/xfeatures2d") + (for-each (lambda (file) + (chmod file #o644)) + (find-files "../downloads/xfeatures2d" ".")) + (copy-recursively (assoc-ref inputs "opencv-3rdparty-vgg") + "../downloads/xfeatures2d"))) (add-after 'build 'do-not-install-3rdparty-file (lambda _ (substitute* "cmake_install.cmake" @@ -659,6 +665,34 @@ (define-public opencv (native-inputs `(("pkg-config" ,pkg-config) ("xorg-server" ,xorg-server-for-tests) ;For running the tests + ;; These are files that are derived from the binary descriptors that + ;; are part of the BinBoost package. The BinBoost package is released + ;; under GPLv2+. See + ;; https://www.epfl.ch/labs/cvlab/research/descriptors-and-keypoints/research-detect-binboost/ + ;; See xfeatures2d/cmake/download_boostdesc.cmake for commit hash. + ("opencv-3rdparty-boost" + ,(let ((commit "34e4206aef44d50e6bbcd0ab06354b52e7466d26")) + (origin + (method git-fetch) + (uri (git-reference (url "https://github.com/opencv/opencv_3rdparty") + (commit commit))) + (file-name (git-file-name "opencv_3rdparty" commit)) + (sha256 + (base32 + "13yig1xhvgghvxspxmdidss5lqiikpjr0ddm83jsi0k85j92sn62"))))) + ;; These are the Visual Geometry Group descriptors, released under + ;; BSD-3. They are generated files produced by the DLCO framework. + ;; See xfeatures2d/cmake/download_vgg.cmake for commit hash. + ("opencv-3rdparty-vgg" + ,(let ((commit "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d")) + (origin + (method git-fetch) + (uri (git-reference (url "https://github.com/opencv/opencv_3rdparty") + (commit commit))) + (file-name (git-file-name "opencv_3rdparty" commit)) + (sha256 + (base32 + "0r9fam8dplyqqsd3qgpnnfgf9l7lj44di19rxwbm8mxiw0rlcdvy"))))) ("opencv-extra" ,(origin (method git-fetch)