day1 Opencv安装 python 2.7 (32位)
【参考安装步骤】 http://opencv-python-tutroals.readthedocs.io/en/latest/index.html
http://blog.csdn.net/huruzun/article/details/39395343
1.环境
win7 64
python2.7 32位 https://www.python.org/downloads/
切记:安装过程中,添加到环境变量PATH中
查看python是32位还是64位?
2.openCV安装
2.1 安装 numpy
下载地址:https://sourceforge.net/projects/numpy/files/NumPy/1.7.1/numpy-1.7.1-win32-superpack-python2.7.exe/download
打开cmd到存放文件的当前目录,(我的就在桌面放的)
执行 pip2 install numpy-1.13.+mkl-cp27-cp27m-win32
2)安装VC
error错误:缺少 Visual C++ 9.0
error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
下载地址:https://www.microsoft.com/en-us/download/details.aspx?id=44266
安装vc成功后,cmd执行命令 pip2 install numpy-1.13.1+mkl-cp27-cp27m-win32
3) 安装成功
python环境下: import numpy
2.2 安装matplotlib
下载地址:https://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.3.0/matplotlib-1.3.0.win32-py2.7.exe
1). error报错:缺少dateutil模块
raise ImportError("matplotlib requires dateutil")
ImportError: matplotlib requires dateutil
dateutil模块 下载地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-dateutil
2)报错: 缺少pyparsing模块
raise ImportError("matplotlib requires pyparsing")
ImportError: matplotlib requires pyparsing
pyparsing模块,下载地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyparsing
3)安装成功
2.3 安装opencv
1)下载
地址 https://sourceforge.net/projects/opencvlibrary/files/latest/download?source=files
双击安装
2)复制配置文件
到 安装目录下的 C:\opencv\build\python\2.7\x86 将cv2.pyd复制到C:\Python27\Lib\site-packages
3)安装成功:
4)查看opencv版本
在命令行输入以下代码:
python
import cv2
cv2.__version__
3. 测试程序
import numpy as np
import matplotlib.pyplot as plt N = 5
menMeans = (20, 35, 30, 35, 27)
menStd = (2, 3, 4, 1, 2) ind = np.arange(N) # the x locations for the groups
width = 0.35 # the width of the bars fig, ax = plt.subplots()
rects1 = ax.bar(ind, menMeans, width, color='r', yerr=menStd) womenMeans = (25, 32, 34, 20, 25)
womenStd = (3, 5, 2, 3, 3)
rects2 = ax.bar(ind+width, womenMeans, width, color='y', yerr=womenStd) # add some
ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(ind+width)
ax.set_xticklabels( ('G1', 'G2', 'G3', 'G4', 'G5') ) ax.legend( (rects1[0], rects2[0]), ('Men', 'Women') ) def autolabel(rects):
# attach some text labels
for rect in rects:
height = rect.get_height()
ax.text(rect.get_x()+rect.get_width()/2., 1.05*height, '%d'%int(height),
ha='center', va='bottom') autolabel(rects1)
autolabel(rects2) plt.show()
import cv2
import numpy as np img = cv2.imread("22.png")
emptyImage = np.zeros(img.shape, np.uint8) emptyImage2 = img.copy() emptyImage3=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) cv2.imshow("EmptyImage3", emptyImage3)
cv2.waitKey (0)
cv2.destroyAllWindows()
day1 Opencv安装 python 2.7 (32位)的更多相关文章
- PL/SQL Developer安装详解(32位客户端免安装版)
PL/SQL Developer是一个集成开发环境,专门开发面向Oracle数据库的应用.PL/SQL也是一种程序语言,叫做过程化SQL语言(Procedural Language/SQL).PL/S ...
- Ubuntu 14.04(32位)安装Oracle 11g(32位)全过程
1.将系统更新到最新:sudo apt-get updatesudo apt-get dist-upgrade2.安装Oracle所需的依赖包:sudo apt-get install automak ...
- JDK_如何查看安装的jdk是32位还是64位?
1. 1.1.32位系统只能装 32位 jdk 1.2.64位系统,安装的 32位JDK 和 64位JDK 是不同的目录 1.2.1.32位的路径 类似:C:\Program Files (x86)\ ...
- oracle安装—Windows7旗舰版32位安装oracle10g方法
首先要下载支持Vista版本的Oracle 10g下载完成后解压出来:http://download.oracle.com/otn/nt/oracle10g/10203/10203_vista_w2k ...
- oracle11g 卸载和安装(win7,32位)
完全卸载oracle11g步骤:1. 开始->设置->控制面板->管理工具->服务 停止所有Oracle服务.2. 开始->程序->Oracle - OraDb11 ...
- mysql图文安装教程(win7 32位 亲测)
一.下载mysql:http://www.mysql.com/downloads/ 弹出: 你需要有一个 Oracle Web 帐户,没有的话,注册一个: 勾选许可: 输入搜索条件: 下载MySQL ...
- 在debian下安装QT 5.10 32位
准备工作: 在开始之前最好把GCC升级到5.0以上. 如果升级后出现“libstdc++.so.6: version `CXXABI_1.3.9' not found”错误,可以参考https://b ...
- 如何查看安装的java是32位的,还是64位的
命令 java -d32 -version 或者 java -d64 -version
- Win7安装Python失败 提示Setup failed
一.安装报错 如图所示,双击Python安装包后进行安装显示Setup failed 安装失败: 二.错误排除 1.首先查看自己的计算机是否已经安装了 Win7 Service Pack 1大补丁,没 ...
随机推荐
- hql语句中的分页显示
public List<User> getUserList(int pageInfo) { DBUtil dbutil = new DBUtil(); Session session = ...
- Git版本控制 备忘录
安装Git: 在Linux上安装Git: sudo apt-get install git 在windows上安装Git: 从https://git-for-windows.github.io下载,然 ...
- CString char BSTR 转换
关于字符集不一的历史原因,可以参考: UNICODE与ANSI的区别 以下是网上转载的资料.我将辅以自己的实例,说明并总结关系. 一.CString, int, string, char*之间的转换 ...
- 2241. [SDOI2011]打地鼠【暴力+剪枝】
Description 打地鼠是这样的一个游戏:地面上有一些地鼠洞,地鼠们会不时从洞里探出头来很短时间后又缩回洞中.玩家的目标是在地鼠伸出头时,用锤子砸其头部,砸到的地鼠越多分数也就越高. 游戏中的锤 ...
- 【[JSOI2009]火星藏宝图】
这里是\(sb\)的\(O(nm)\)做法 上一篇题解里写的\(O(nm)\)做法并没有看懂,我真是好菜啊 这是一个用了斜率优化,但是复杂度仍然是\(O(nm)\)的做法 我们还是先写出简单的\(dp ...
- 使用loader打包静态文件-样式2
这篇我们了解下css-loader常用的配置项,要配置的话,use里面就不再是一个字符串了 // 打包模块不知道该怎么办,就去模块配置里面该怎么办 module: { // 规则 rules: [{ ...
- JQuery资源网站(收藏)
收藏几个不错的JQuery资源网站,以后备用,给共享者点个赞!!! http://jquery.com/ http://www.htmleaf.com/ http://www.oschina.net/ ...
- ASP.NET Core MVC中的IActionFilter.OnActionExecuted方法执行时,Controller中Action返回的对象是否已经输出到Http Response中
我们在ASP.NET Core MVC项目中有如下HomeController: using Microsoft.AspNetCore.Mvc; namespace AspNetCoreActionF ...
- Archlinux+gnome安装中文输入法
环境:archlinux+gnome 1.首先需要配置Archlinuxcn源 打开/etc/pacman.conf,添加 [archlinuxcn] Server = https://mirrors ...
- 我们比较常见的PHP实现openSug.js参数调试
这是一款利PHP对百度搜索下拉框提示免费代码实现参数配置调试的程序源代码. 由想要对网站进行搜索下拉调试的站长朋友们进行方便.快速的效果演示,具体参考下面的PHP代码. 如何使用? 请新建一份PHP文 ...