Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure OpenCV2.3.1+Python2.7.3+Numpy

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "how to configure OpenCV2.3.1+Python2.7.3+Numpy". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to configure OpenCV2.3.1+Python2.7.3+Numpy" can help you solve the problem.

My machine is 64-bit win7, using python2.7.3,OpenCV is 2.3.1, online reference to a lot of found that simply can not be used, the following self-test can.

The commonly used scientific computing packages are numpy, scipy, matplotlib, pandas, etc., which need to be installed one by one. Here is a solution that is to install EPD or Python. I installed EPD, which packages many kinds of python scientific computing libraries together, which is more convenient.

(1) assemble the EPD, and the python path will work by default.

(2) install the pandas and click it by default.

(3) install OpenCV, and it will extract the directory under this folder by default, something like this:

Go to opencv- > build- > python, and copy the contents of the 2.7directory. This is it.

Copy things to the installation directory of python. The default is under Lib- > site-packages under C:\ python27.

(4) Test:

(1) go to the original OpenCV directory samples- > python, and double-click drawing.py. If the configuration is correct, you can see it.

When it comes to drawing on the screen, it goes something like this:

Just see this!

(2) read and display the image under the test

Import cv2import cvimport numpy as np # tests whether there is a problem with numpy, the same below, unnecessary import scipy as spimport matplotlib as mtimport pandas as pdimg = cv2.imread ('C:\ Users\ Administrator\ Desktop\ cat.jpg') cv2.imshow ('Cat',img); # display graphics

Results:

This is the end of the content about "how to configure OpenCV2.3.1+Python2.7.3+Numpy". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report