Windows OpenCV 2.x.x Python 2.7.x Configuration

Source: Internet
Author: User

Recently learning Python, and if you have image processing, try to use the OpenCV library under Python, and here are some things to note about configuration installation:

(If you've already installed OpenCV 2, and Python2.7)

1. What do you think of your OPENCV version to support Python version, go to OPENCV installation directory to view: such as my D:\Program files\opencv2.4.8\opencv\build\python\ 2.7, is the version that supports Python2.7.

2. Use OpenCV also need to install numpy, download and python version consistent numpy, Opencv2 need numpy1.8.1, use 1.6.1 will error, I do not know why.

numpy1.8.1 Download Connection: Click to open link

3. Be sure to unify the 32-bit or 64-bit, 32-bit will be loaded 32-bit, Python

4. The final step requires a simple configuration: OpenCV folder, build->python->2.7 copy 2.7 under the Cv2.pyd to ... \python27\lib\site-packages, you can.


Note: The x86 is 32 bits and the x64 is 64 bits, same as the corresponding version of the front.


To test whether the installation was successful:

1. Enter the. Directory: \opencv2.3.1\samples\python Double-click drawing.py or CD to directory and then Python drawing.py

2. Write a small program to read the display image yourself:

Import cv2  img = Cv2.imread ("./faces.jpg")  cv2.imshow ("Image", img)  </span>

Included: Using Python and OpenCV to detect the barcode on the image, including the source code, for everyone to learn click to open the link

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Windows OpenCV 2.x.x Python 2.7.x Configuration

Related Article

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.