Installing OpenCV in Python 2.7 in Windows with Proper Documentation
Python Packages to be installed: Before starting there is need to install Python 2.7 and Numpy where Matplotlib is optional
Installing Python 2.7 for Windows: Python 2.7 can be installed from this link. Please go to the download section and install it. Keep in mind that while installing please add it to the path
Installing NumPy package to windows: You can either use the pip command to install it by typing pip install NumPy in the command prompt or there is another way of downloading wheel files. Let me show you the other way. Please go to this link. Once the required package is downloaded, please install it using the pip command. Please see the below screenshot.
Once the above packages are installed, we are ready to download the opencv package. Please visit the following link to download opencv. I have python 2.7 and used OpenCV 3.0 from the list of version. When you have successful in downloading and extracting, final files in the opencv will have the following look.
Trick: Now it is the time to go for the trick. Please go to the folder build inside the opencv folder. Please approach to python folder and go for 2.7 and finally x64/x86. This depends on your architecture. You will find the file cv2. Please see the below screenshot to understand my statement in broader sense.
Please copy this file and paste it in the sub-folder site-packages which is inside the folder Lib which is inside the folder Python 2.7. Please see the path from the below screenshot.
Thanks for finding some time to read this post. Hope images and writing helped you.
Originally published at https://ersanpreet.wordpress.com on August 4, 2018.