Windows7 Configuring PYTHON2.7+OPENCV in Eclipse

Source: Internet
Author: User

1. From http://www.oracle.com/technetwork/java/javase/downloads/ jdk-7u2-download-1377129.html download Jdk-7u2-windows-i586.exe, install to D:\ProgramFiles\Java,

and add the D:\ProgramFiles\Java\jdk1.7.0_02\bin to the environment variable;

2. Download the Eclipse Classic version from http://www.eclipse.org/downloads/and unzip it;

3. Download Python-2.7.3.msi from http://www.python.org/to the D:\Python27 directory and add D:\Python27 to the environment variable path;

4. Download PyDev2.7.1 from https://sourceforge.net/projects/pydev/files/, unzip, generate features and plugins two folders;

5. Copy the Pydev2.7.1/features and pydev2.7.1/plugins two folders to the Eclipse/dropins folder to restart Eclipse;

7. Copy the contents of the Pydev2.7.1/features to the Eclipse/features folder and copy the contents of the Pydev2.7.1/plugins to the Eclipse/plugins folder;

8. Restart Eclipse,

Window-->preferences-->pydev-->editor-->interpreter–python: Click New...,interpreter Name: Python2.7.1,interpreter Executable:d:\python27\python.exe, click OK, pop-up selection needed dialog-->select all, click OK, click OK;

9. Test whether to build the correct:file-->new-->project...--> select Pydev under Pydev project-->next,project Name:testpython, Project type :P Ython,grammar version:2.7, interpreter:python2.7.1, select Create ' src ' folder and add it to Thepythonpath, click Finish;

10. Select Testpython, right-click-->new-->other...--> Select Pydev &module-->next-->name:test-->finish under Pydev Enter a statement: print "Hello world!", click Run-->run as-->python Run, run correctly, the configuration is successful;

11. Download the installation OpenCV2.3.1:

http://blog.csdn.net/fengbingchun/article/details/7288079;

12. Download numpy-1.6.2-win32-superpack-python2.7 installation from https://sourceforge.net/projects/numpy/;

13. Copy all files under the build-->python-->2.7 folder under the OpenCV2.3.1 folder to D:\Python27\Lib\site-packages, and double-click D:\soft\OpenCV2.3.1\ Opencv\samples\python folder under the drawing.py file, if it can run correctly, the configuration is correct;

14. Final Test: Enter the following statement in the test.py file to run correctly.

#show an image

Print "Cinterface"

Import Cv2.cvas CV

im = CV. LoadImage ("E:\\python\\1.jpg")

Cv. Namedwindow ("Source")

Cv. ShowImage ("Source", IM)

Cv. Waitkey (0)

Print "C++interface"

Import Cv2

im = Cv2.imread ("e:\\python\\1.jpg")

Cv2.namedwindow ("Source")

Cv2.imshow ("Source", IM)

Cv2.waitkey (0)

Reference documents:

1, http://www.ourunix.org/post/320.html

2, http://pydev.org/manual_101_install.html

3, HTTP://WWW.LINUXSO.COM/LINUXBIANCHENG/10600.HTMLL

4, http://www.cnblogs.com/huzhiwei/archive/2012/09/07/2674676.html

5, http://www.cr173.com/html/7367_1.html

Original link: http://blog.csdn.net/fengbingchun/article/details/8187446#comments

Windows7 Configuring PYTHON2.7+OPENCV in Eclipse

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.