Install openCV, used for python, and osxopencv in mac osX
OpenCV is an open-source image processing library with a large amount of content. For more information, see Baidu ~
A blog is recorded on a mac, installed with openCV, and then used python to reference the openCV library.
Environment:
Python 2.7.5
It is convenient to use brew to install openCV, and brew is a package manager, which is very easy to use, similar to apt-get of ubantu.
If not installed, you can look at here http://brew.sh/index_zh-cn.html
Run the following command:
Brew tap homebrew/science
Brew install opencv
Homebrew/science, see the name to know, contains a lot of scientific research related library, specific can see here: https://github.com/Homebrew/homebrew-science
During brew install installation, the following error occurs:
Error "curl: (56) SSLRead () return error-9841"You can try to modify the DNS of the machine and use 8.8.8.8 as the dns.
After the installation is successful
ZH:~ zhonghuan$ brew install opencv==> Downloading https://github.com/Itseez/opencv/archive/2.4.9.tar.gz######################################################################## 100.0%curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.==> Trying a full download######################################################################## 100.0%==> cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.9 -DCMAKE_BUILD==> make==> make install==> CaveatsIf you need Python to find the installed site-packages: echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth==> Summary
Because python is selected as the programming language, we need to let python know the existence of opencv. Observe the installation information.
Here is a sentence:
If you need Python to find the installed site-packages: echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
So we can just follow what it says and enter the following in the terminal:
echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
To test, input python in the terminal,
Then enter:
Import cv
Import cv2
If no problem exists, the installation is successful.
I just installed python for mac27 in mac, but I still need a graphics library for learning. I copied the library in win to the python folder.
Download and install XCODE directly. The official integrated development environment is free and easy to use. It also comes with various language development tools, including python, perl, c, c ++, objc, and so on.
An error occurred while installing mysql for python in mac environment.
You need to install Command Line Tools of Xcode.
Developer.apple.com/downloads/index.action
You need to log on with an Apple Developer account
At the same time, make sure that mysql installed on the machine is normal. Otherwise, another error occurs when you install MySQL-python.