Sample programs for OpenCV and Swift and iOS and OS X.
Those projects uses OpenCV version 3.1.0. However, OpenCV binary isn't include in thorse projects. You can get OpenCV binary by following steps.
- Download
opencv2.framework.zip
from http://sourceforge.net/projects/opencvlibrary/files/opencv-ios/3.1.0/. - Unpack the file.
- Copy
opencv2.framework
intoOpenCVSample_iOS
directory.
This approach may fail on new macOS. Because QTKit necessary to build have been removed from macOS 10.12. Use OS X 10.11 or try a next approach.
- Prepare CMake. (e.g.
port install cmake
) - Download
opencv-3.1.0.zip
from https://sourceforge.net/projects/opencvlibrary/files/opencv-unix/3.1.0/. - 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.1.0/platforms/osx/build_framework.py osx
- Copy
osx/opencv2.framework
intoOpenCVSample_OSX
directory.
For macOS 10.12 and latest OpenCV.
- Prepare CMake. (e.g.
port install cmake
) - Prepare a working directory. (e.g.
mkdir ~/foo
) - Open terminal at the working directory. (e.g.
cd ~/foo
) - Tune the setting of git.
git config --global http.postBuffer 524288000
- Download source code.
git clone https://github.com/Itseez/opencv.git
- Run a build script.
python opencv/platforms/osx/build_framework.py osx
- Copy
osx/opencv2.framework
intoOpenCVSample_OSX
directory.
- macOS 10.12
- iOS 10.0
- Xcode 8.0
- Swift 3.0
Please read this file.