Configure Python + opencv in Notepad ++ for Windows 7

Source: Internet
Author: User

1,
Download the latest notepad1_6.2.1installation from http://notepad-plus-plus.org;

2,
Slave;

3,
Open notepad ++, press F5 or run (r) --> Run (r )..., Pop up and run... Dialog box, set cmd
/K Python "$ (full_current_path)" & Echo. & pause & Exit enter in the edit box, click Save ..., In the displayed cut dialog box, enter the name as "run ".
Python (you can enter it as needed) and set the shortcut key (the only rule is, do not conflict with the already set, otherwise it will not take effect, this shortcut key can be modified), such as Ctrl + F5, click OK to close running... Window, click Cancel;

4,
Test whether the setting is successful: Print "Hello world! ", Then Ctrl + F5;

5,
Download and install opencv2.3.1: http://blog.csdn.net/fengbingchun/article/details/7288079;

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

7,
Copy all the files in the build \ Python \ 2.7 folder under opencv2.3.1 to D: \ python27 \ Lib \ Site-packages, and double-click D: \ soft \ opencv2.3.1 \ opencv \ samples \ drawing in the python folder. py file. If it runs correctly, the configuration is correct.

 

In notepad ++, create an empty file and enter the following statement:

# Show an image

 

Print "C interface"

 

# Import cv2.cv as CV

Import 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)

 

Save as test. py and run it to display an image.

 

References:

1,
Http://my.oschina.net/neo600/blog/81480

2,
Http://hi.baidu.com/hellosim/item/923df28669ee45c2ee083df3

3,
Http://www.colobu.com /? P = 123001

4,
Http://wenku.baidu.com/view/f877eee8aeaad1f346933faf.html

5,
Http://blog.csdn.net/nwpulei/article/details/7277511

6,
Http://blog.sina.com.cn/s/blog_75e063c10101bfj5.html

7,
Http://www.lfd.uci.edu /~ Gohlke/pythonlibs/# numpy

8,
Http://blog.csdn.net/bh20077/article/details/6946046

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.