Here I'll tell what you do to the install OpenCV 2.4x in Windows for Python 2.7.
pre-requisites (need to be downloaded):
Python:download latest version of Python 2.7 from Python site.
Numpy:download Numpy for Python 2.7 from here.
OpenCV 2.4:download OpenCV for Windows from here.
Install:
1) first install Python 2.7. Leave all settings as default. In this case, Python would be installed in default folder C:\Python27\
2) now install Numpy. Again leave everything default. Numpy would find Python directory and would be installed to the most appropriate folder.
3) now double-click OpenCV.exe. It'll ask for extraction folder. Give it as just C: \. It'll extract all files to C:\opencv\. Wait until everything is extracted.
4) Now copy everything in the folder C:\opencv\build\python\x86\2.7\ (most probably, there'll be is only one file Cv2.pyd ) and paste it in the folder C:\Python27\Lib\site-packages\
5) Now open your ' Python idle ' (from Start > All programmes > Python 2.7 > Python idle) and just type following :
Import Cv2
If everything OK, it would import CV2 module, otherwise an error message would be shown.
So it's very simple procedure. Try it yourself and let me know how it goes.
Nb:even If you is using 64-bit windows, do the same procedure. (Better don ' t go for 64-bit Python and Numpy)
Install OpenCV in Windows for Python