OpenCVSample
OpenCVSample is an iOS app which contains an OpenCV wrapper file OpenCVSample.mm for integrating OpenCV APIs into iOS swift project.
System environment
- macOS Sierra Version 10.12.5
- Xcode Version 8.3.3 (installed from App Store)
- OpenCV 3.2 framework (downloaded from OpenCV website)
Build steps
- git clone this project
- download OpenCV 3.2 framework zip file and unzip it
- copy the unzipped file opencv2.framework to OpenCVSample/OpenCVSample
- build the project in Xcode
Tested devices
- iPhone 7 plus with iOS 10.2
Features
- Support convert image to grayscale image
- Support blur image by Gaussian Blur function
- Support detect edges by Canny Edge function
Notes
- To hide the warnings of “Documentation Issue”, set the option “Documentation Comments” to “No” in “Build Settings” page.
- To resolve the warnings of “Apple Mach-O Linker Warning Group”, download the source code of OpenCV and build the iOS frameowork manually with modified build_framework.py
```
- Patch build_framework.py
cd ~/
git clone https://github.com/opencv/opencv.git cp ~/ /OpenCVSample/build_framework.py.patch ~/ /opencv cd ~/ /opencv git apply < build_framework.py.patch
- Patch build_framework.py
cd ~/
-
Follow the instructions of OpenCV tutorial “Installation in iOS” to build iOS framework. http://docs.opencv.org/3.2.0/d5/da3/tutorial_ios_install.html
-
Copy the manually built opencv2.framework to ~/
/OpenCVSample/OpenCVSample ```