Sample programs for OpenCV and Swift and iOS and macOS.
Those projects uses OpenCV version 3.3.0. However, OpenCV binary isn't include in thorse projects. You can get OpenCV binary by following steps.
- Download
opencv-3.3.0-ios-framework.zip
from https://github.com/opencv/opencv/releases/download/3.3.0/opencv-3.3.0-ios-framework.zip. - Unpack the file.
- Copy
opencv2.framework
intoOpenCVSample_iOS
directory.
If using above the binary, the linker may report many warnings such 'direct access in function '
___cxx_global_var_init' from file...
' on build. :-(
- Prepare CMake. (e.g.
port install cmake
) - Download
opencv-3.3.0.zip
from https://github.com/opencv/opencv/archive/3.3.0.zip. - Prepare a working directory. (e.g.
mkdir ~/foo
) - Unpack the file into the working directory.
- Open terminal at the working directory. (e.g.
cd ~/foo
) - Run a build script.
python opencv-3.3.0/platforms/osx/build_framework.py osx
- Copy
osx/opencv2.framework
intoOpenCVSample_OSX
directory.
- macOS 10.12.6 (Recommended)
- iOS 11.0 (Recommended)
- Xcode 9.0
- Swift 4.0
Please read this file.