Installation of OpenCV for Python

Welcome once again, today's my post is about installation of OpenCV for Python(Windows).

Linux users click here to see installation process of OpenCV on Linux.

First Way

Step 1: Download Windows msi installer of Python   2.7 from here.

Step 2: install numpy(required) and                   matplotlib(optional) libraries.
    (a) installation of numpy.
         (1) Download
        numpy‑1.13.1+mkl‑cp27‑cp27m‑win32.whl
        from here and extract file using 7zip.
        (2)copy numpy folder from extracted folder                and paste it into C:\python27\lib\site-packages.
          (3) Verify installation:
              Import numpy in Python IDLE.
     (b) installation of matplotlib.
           click here

Step 3: download latest release of OpenCV of from here and extract it into C drive.

Step 4: copy cv2.pyd file from C:\opencv\build\python\2.7\x86 and paste it into C:\python27\lib\site-packages.

(
Post update:
 set the system environment variables for OpenCV:
    (a) My Computer > Properties > Advanced system           setting > Environment variables.
    (b) create a new system variable.
          Variable name: OPENCV_DIR
          Value: C:/opencv
)

Verify installation:
Open Python IDLE and import cv2

If you have problem in installation process, please share with us in comments. We will try to give solution.

Thanks friends
By R Patidar

Post a Comment

0 Comments