xcode 如何在 iOS 中使用 openCV?我只是无法正确导入框架

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35858229/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:37:11  来源:igfitidea点击:

How to use openCV in iOS? I just can't import the framework correctly

iosxcodeopencv

提问by RiTianRan

How can I add opencv2 correctly to Xcode? I just download from the website the opencv2.framework.zip, enter image description hereand then I unzip the opencv2 ,finally appears opencv2.framework. enter image description hereand then I build an xcode project, choose ios single view. enter image description herethen I try to add opencv2.framework to the project enter image description herethen I compile the project, It shows that: enter image description herewhat's happening here?I'm new here and I just can't figure out a solution. Thank you very much for your help!

如何将 opencv2 正确添加到 Xcode?我只是从网站上下载了opencv2.framework.zip, 在此处输入图片说明然后我解压了opencv2,最后出现了opencv2.framework。 在此处输入图片说明然后我构建了一个xcode项目,选择ios单视图。 在此处输入图片说明然后我尝试将 opencv2.framework 添加到项目 在此处输入图片说明然后我编译项目,它表明: 在此处输入图片说明这里发生了什么?我是新来的,我只是想不出解决方案。非常感谢您的帮助!

采纳答案by Kurt Sebastian Jacobs

I've put together a guide to use OpenCV using the .framework file (if you prefer it over cocoa pods as suggested above) you may have a look here. It works for both OpenCV2 iOS and the newer OpenCV3 iOS.

我已经整理了一个使用 .framework 文件使用 OpenCV 的指南(如果你更喜欢它而不是上面建议的可可豆荚),你可以看看这里。它适用于 OpenCV2 iOS 和更新的 OpenCV3 iOS。

http://kurtjacobs.weebly.com/computer-vision/up-and-running-with-opencv-30-for-ios

http://kurtjacobs.weebly.com/computer-vision/up-and-running-with-opencv-30-for-ios

Good luck!

祝你好运!

回答by close.toyou

You can download the opencv2 .framework, then in Xcode project, click the targets selected build phases. Click link Binary with libraries, click add other and select the .framework, clang.

您可以下载 opencv2 .framework,然后在 Xcode 项目中,单击目标选择构建阶段。单击链接 Binary with libraries,单击添加其他并选择 .framework,clang。

回答by Azazi

Try and use Cocoapods to install it. If you haven't used Cocoapods before, it is a "CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects." More information is available on its website HERE.

尝试使用 Cocoapods 来安装它。如果你之前没有使用过 Cocoapods,那就是“CocoaPods 是 Swift 和 Objective-C Cocoa 项目的依赖管理器”。更多信息可在其网站上这里

To install OpenCV using Cocoapods, add pod 'OpenCV'to your pod file, and use the command pod install. Please refer to the OpenCV for iOS Cocoapods Readme page (https://cocoapods.org/pods/OpenCV) for more details.

要使用 Cocoapods 安装 OpenCV,请添加pod 'OpenCV'到您的 pod 文件中,然后使用命令pod install. 请参阅 OpenCV for iOS Cocoapods 自述页面 ( https://cocoapods.org/pods/OpenCV) 了解更多详细信息。