"Python" + "OpenCV" Environment configuration

Source: Internet
Author: User

Environment: Windows 7 + Python 2.7 + OpenCV 2.4.5

First, OpenCV
1) Download the OPENCV installation package for Windows. OpenCV download page: http://sourceforge.net/projects/opencvlibrary/files/opencv-win/
2) Direct Download opencv-2.4.5.exe (278.9 MB)

Installation. You'll find that it's actually the decompression process.

Second, Python
1) Download the Python installation package for Windows. Python download page: http://www.python.org/getit/
Download Python 2.7.5 Windows Installer directly
2) installation.
3) Expand Python's third-party library--OPENCV Python Library
Enter the installation directory of the OpenCV to find: \build\python\2.7\cv2.pyd
Copy the Cv2.pyd to the subdirectory of Python: \lib\site-packages\

Put the OpenCV directory "D:\Program files\opencv\build\python\2.7" under "Cv2.pyd"
Copy to the Python directory ". \program Files\python27\lib\site-packages", then;

OK, so the environment is set up.

Third, test the sample program
OpenCV comes with many sample programs and goes to subdirectories under the OPENCV installation directory: \samples\python2\, you can see a lot of files with a. py suffix;
Open a. py file with Python, press the F5 key to run, see the effect

Import Cv2

  

"Python" + "OpenCV" Environment configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.