OpenCV is an open source image processing library with a lot of content.
Want to know a lot of other, please yourself Baidu ~
Blog is recorded under the Mac. Install OPENCV. Then use Python to refer to the OpenCV library.
Environment is:
Python 2.7.5
Easy to use, brew is used to install Opencv,brew is a package manager, very useful, similar to Ubantu apt-get.
If not installed, can see here http://brew.sh/index_zh-cn.html
Then use the following command:
Brew Tap Homebrew/science
Brew Install OpenCV
Homebrew/science, see the name to know, including a lot of scientific research related to the library. Detailed to see here: https://github.com/Homebrew/homebrew-science
During the installation of the Brew install:
Error "Curl: (+) Sslread () return error-9841"
can try to change the machine's DNS, can use 8.8.8.8 as DNS.
After a successful installation, the display
zh:~ zhonghuan$ Brew Install opencv==> downloading https://github.com/Itseez/opencv/archive/2.4.9.tar.gz######### ############################################################### 100.0%curl: (+) 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 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 the programming language is selected when Python. So, we have to let Python know that OPENCV exists. Watch the installation information at this time.
There is such 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, let's just do what it says. In the terminal, enter:
echo '/usr/local/lib/python2.7/site-packages ' > ~/library/python/2.7/lib/python/site-packages/homebrew.pth
For a test. Enter Python in the terminal,
Then enter:
Import CV
Import Cv2
Suppose there is no problem. is installed successfully.
Install opencv,used for Python under Mac OSX