How to Install OpenCV Package to WinPython
Nowadays, it will be strange for a programmer to never heard of Python. According to this post on stackoverflow's blog, Python is one of the most fastest growing programming languages. Since my programming skill is not in the advance realm, I can't compare each programming languages to justify the idea why Python is so popular. So I will put reasons aside, and start following where the crowd goes.
Should you want to start programming in Python, you could make use of available distributions such as WinPython instead of installing from Python's website. The reasons are:
- WinPython by default act as a portable software. As I read in some articles, there are some cases where you want to use different versions of Python packages (some kind of library) in your projects. Let's say, your "Project A" needs "Version 1.0.1 of package xxx", and "Project B" needs "Version 1.1.5 of package xxx". You can simply install two WinPythons, which one of it contains "Version 1.0.1 of package xxx" and the other contains "Version 1.1.5 of package xxx".
- WinPython comes with a lot of packages, saving you from trouble installing them separately along with their dependencies. The packages included in WinPython such as numpy, matplotlib, pandas, sklearn, even the popular tensorflow! If you never heard any of them, you don't have to worry because as you progress with Python you will see them... often.
I think those two reasons are enough to choose WinPython over the default Python installer. In the near future, I will have some posts in this blog regarding image processing with Python (maybe with some other languages too), so I will share the steps on how to add the OpenCV package to WinPython. You can add it following these steps:
- If you haven't install WinPython, download it from here then install it first. The installation is pretty straight forward. You just need to provide the location where it should unpack all the files. You can start the Python interpreter by double-clicking the WinPython Command Prompt.exe. In some cases, you might need to run it as Administrator.
![]() |
WinPython Installation Folder |
- Download the pre-compiled OpenCV from this link.
- Install it in your folder of choice.
- Copy opencv\build\python\(architecture)\(opencv_version)\cv2.pyd from OpenCV instalation folder.
- Paste it to WinPython instalation folder, WinPython-(architecture)-(version)\python-(version)\Lib\site-packages\.
- Start Python interpreter.
- Type import cv2 then execute it. If there are no errors, that means your OpenCV package is ready to be used. Congrats!
![]() |
Testing OpenCV Installation |
With this we are ready to use OpenCV with Python! Have fun!
Comments
Post a Comment