iOS-OpenCV之opencv2.framework

1.下载OpenCV,地址:
GitHub - opencv/opencv: Open Source Computer Vision Library 

2.查看下载文件路径opencv/platfroms/ios/readme.txt,里面有生成步骤,文件内容为:

Building OpenCV from Source, using CMake and Command Line

cd ~/

python opencv/platforms/ios/build_framework.py ios

If everything's fine, a few minutes later you will get ~//ios/opencv2.framework. You can add this framework to your Xcode projects.


3.具体步骤

在桌面创建一个文件夹,命名为framework,在控制台进入到framework路径下,比如:cd /users/wyg/desktop/framerorks(可以直接拖拽文件到控制台)

从opencv官网,或者从GitHub下载文件,将下载好的文件放到上一步创建的frameworks中

在控制台执行操作python opencv/platforms/ios/build_framework.py ios

如果上步骤出现错误,并且错误如图一所示,先安装cmake,使用Homebrew,指令为:brew install cmake,然后重新执行python opencv/platforms/ios/build_framework.py ios即可,成功后,如图二所示。


4.图示

iOS-OpenCV之opencv2.framework_第1张图片
图一(错误日志)


iOS-OpenCV之opencv2.framework_第2张图片
图二(opencv2.framework)

你可能感兴趣的:(iOS-OpenCV之opencv2.framework)