OpenCV Python的安裝與設定

原文链接:http://blog.udn.com/mark52home/30574225

參考資料:

https://archer1609wp.wordpress.com/2015/06/02/opencv%E5%9C%A8windows%E7%92%B0%E5%A2%83%E4%B8%8B%E5%AE%89%E8%A3%9Dopencv%E3%80%81%E8%A8%AD%E5%AE%9Avisual-studio%E5%8F%8Apython2-7/

環境設定

Step 1: 安裝Python

https://www.python.org/ 下載並安裝Python 2.7版,更新的版本OpenCV 2並不支援。

Step 2: 安裝Libraries

" D:\project\opencv\build\python\2.7″" D:\project\opencv\build\python\2.7\x86″內的所有檔案放到"D:\Python27\Lib\site-packages"

Step 3: 下載NumPy

NumPyOpenCV需要用到的extension,如安裝的是32-bitPython,可到https://pypi.python.org/pypi/numpy下載CP27版的NumPy64-bit版則需要到http://www.lfd.uci.edu/~gohlke/pythonlibs/下載非官方版。

Step 4: 安裝NumPy

將下載回來的.whl檔放到"D:\Python27\Scripts",透過cmd執行同位置的pip2.7.exe,加入該.whl檔作為argumentpip就會安裝好NumPy

 

Download numpy-1.9.2+mkl-cp27-none-win32.whl fromhttp://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy .

Copy the file to D:\Python27\Scripts

Run cmd from the above location and type

pip install numpy-1.9.2+mkl-cp27-none-win32.whl

You will hopefully get the below output:

 
  

 
  
Processing D:\python27\scripts\numpy-1.9.2+mkl-cp27-none-win32.whl
Installing collected packages: numpy
Successfully installed numpy-1.9.2

Step 5: 測試匯入

Step 6: 安裝matplotlib

Download matplotlib-1.4.3-cp27-none-win_amd64.whl

http://matplotlib.org/downloads.html

使用PIP安裝,Fail

再下載matplotlib-1.4.3.win-amd64-py2.7.exe

執行安裝, package會在D:\Python27\Lib\site-packages

你可能感兴趣的:(OpenCV_Python)