In this section, we will cover the steps to install OpenCV in various operating systems.
The following steps will install OpenCV on macOS:
- The first step is to install Xcode on your system. You can install Xcode from the App Store for free. Install the open Terminal and execute this command to accept the license:
sudo xcodebuild –license
- Now, type
agree
at the end of the document. Then, you need to install command-line tools using Xcode by executing this command:
sudo xcode-select –install
- The next step is to install OpenCV using the
homebrew
command. To install usinghomebrew
, execute these commands:
brew tap homebrew/science brew install opencv3 --with-contrib --with-python3 --without-python
- Now, the final step is to link OpenCV and Python. For doing this, first you need to change the filename in
/usr/local/opt/opencv3/lib/python3.5/site-packages/
fromcv2.cpython-35m-darwin.so to cv2.so
by executing these commands:
cd/usr/local/opt/opencv3...