OpenCV-Python on Windows with Anaconda 3

Ping-Lun Liao
2 min readFeb 7, 2019

--

OpenCV is a open source computer vision library for real-time applications. It supports many programming languages such as C++, C, Python and Java. In this tutorial, OpenCV is installed with Anaconda 3 running on Windows 10. OK, let’s get started.

OpenCV 是一套開發電腦視覺即時處理的函式庫,支援多種程式語言,例如C++、C、Python、Java,本文會在Windows 10上安裝OpenCV與Anaconda 3,我們開始吧!

https://www.anaconda.com/download/ 下載 Anaconda 3,使用預設設定來安裝。

2. 使用 Anaconda Prompt (Using Anaconda Prompt)

Open the Anaconda Prompt in Anaconda 3 application folder. And test it with the command:
開啟應用程式Anaconda中的Prompt,輸入下面指令:

conda --version

The conda version will display on the prompt windows:
conda的版本資訊會顯示在 prompt 視窗中:

3. 建立Python環境 (Create an Python Environment)

Enter the following commands in the prompt windows:
在prompt視窗中輸入下面指令:

conda create --name userNameCV python=3.6

activate userNameCV

The “userNamceCV” could be any name you like.
“userNamceCV” 可以任意命名。

Checking the Python version:

檢查 Python 版本:

python--version

4. 安裝 OpenCV 3 與相依套件 (Install OpenCV 3 and Dependencies)

Enter the following commands in the prompt windows:
在prompt視窗中輸入下面指令:

conda install numpy
conda install anaconda-client
conda install -c conda-forge opencv

Now, checking OpenCV 3 is installed.
檢查Python版本:

python
>>> import cv2

>>> cv.__version__

Congratulation!!! Now, you can use Python and OpenCV3.

恭喜,現在你可以用Python來執行OpenCV3了。

References:

[1] https://github.com/conda-forge/opencv-feedstock/blob/master/README.md
[2] https://chrisconlan.com/installing-python-opencv-3-windows/

Originally published at yunlinsong.blogspot.com on February 7, 2019.

--

--

No responses yet