Windows platform and Linux platform installation see official documentation: http://docs.opencv.org/3.2.0/da/df6/tutorial_py_table_of_contents_setup.html
The Mac installation is not found on the official platform. Reference:
https://www.learnopencv.com/install-opencv-3-on-yosemite-osx-10-10-x/
The core directive is two sentences, super simple.
Brew Tap Homebrew/sciencebrew Install Opencv3
But there are a bunch of problems. The recording process is as follows:
1.
Brew Install Opencv3
Error:
Error:you must ' brew link OpenEXR ' before homebrew/science/opencv3 can be installed
2. Thought did not install OPENEXR, checked a bit http://www.openexr.com/think not to install also can, just have--without-openexr this option, therefore:
Brew Install Opencv3--WITHOUT-OPENEXR
Error:
Error:the ' Brew link ' step did not complete successfullythe formula built, but isn't symlinked into/usr/localcould not Symlink share/aclocal/cmake.m4/usr/local/share/aclocal is not writable. You can try again using: Brew link CMake ....... .....
3. Follow the prompts:
Brew Link Pkg-config
Error:
Error:could not symlink share/aclocal/pkg.m4/usr/local/share/aclocal are not writable.
4. Oh, no permission. So:
sudo brew link pkg-config
Error:
Error:running Homebrew as Root is extremely dangerous and no longer supported.
5. The original does not allow, then had to change the folder permissions
whoami# the following two commands of ' whoami ' replace sudo with the output of the command just now Chown-r ' whoami ': admin/usr/local/share sudo chown-r ' whoami ': admin/usr/ Local/local/bin
Brew link Pkg-configbrew link cmakebrew install opencv3--WITHOUT-OPENEXR
Success, estimated the first step in the beginning of the error, is not without permission to establish software connection problems.
6. Link to the Python environment, I'm linking to the Anaconda built tensorflow1.0 environment
Cd/users/yuetiezhu/anaconda2/envs/tensorflow1.0/lib/python2.7/site-packagesln-s/usr/local/Cellar/opencv3/3.2.0 /lib/python2.7/site-packages/cv2.so cv2.so
/usr/local/cellar/opencv3/3.2.0/lib/python2.7/site-packages no cv.py, only cv2.so, but it can be used.
7. Test
SOURCE Activate Tensorflow1.0pythonimport Cv2