Skip to content

Instantly share code, notes, and snippets.

@ayee
Last active January 25, 2021 23:21
Show Gist options
  • Save ayee/7ce2ca057f00866c0e7c82ace04ef138 to your computer and use it in GitHub Desktop.
Save ayee/7ce2ca057f00866c0e7c82ace04ef138 to your computer and use it in GitHub Desktop.
How to Install opencv for iOS on OSX
  1. Install cmake
  2. Add to cmake to PATH
PATH=$PATH:/Applications/CMake.app/Contents/bin
  1. Clone OpenCV repository
cd ~/<my_working _directory>
git clone https://github.com/opencv/opencv.git
  1. Make symbolic link for Xcode to let OpenCV build scripts find the compiler, header files etc
cd /
sudo ln -s /Applications/Xcode.app/Contents/Developer Developer
  1. Build OpenCV framework
cd ~/<my_working_directory>
python opencv/platforms/ios/build_framework.py ios

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment