Computer vision : OpenCV / Python installation

1. Introduction

In this post, we’ll detail how to install Python and OpenCV on a Windows 7 system.

2. Python installation

2.1 Download / Installation

At this time, OpenCV 3.0 is not fully ready to run with Python 3.X, we’ll download Python 2.7 from here and proceed to the installation.


You will also need to install some libraries :
Numpy : package for scientific computing with Python.
Matplotlib : Matplotlib is a python library for making publication quality plots.

Everything should be installed in C:/Python27/

2.2 Test

To test, start the Python IDLE.

Load numpy :

“Hello World” with Python :

python-hello-world

3. OpenCV installation

3.1 Download / Installation

You can download OpenCV from the official website. Then start the setup and extract all the files to a temporary file in your documents :
opencv-selfextract

OpenCV installation is done by copying cv2.pyd from opencv\build\python\2.7\x86 to C:\Python27\Lib\site-packages.

3.2 Test

One this is done, we load the OpenCV library :

python-opencv-loaded

Everything is ready !

Leave a Reply

Your email address will not be published. Required fields are marked *