【参考安装步骤】 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位)的更多相关文章

  1. PL/SQL Developer安装详解(32位客户端免安装版)

    PL/SQL Developer是一个集成开发环境,专门开发面向Oracle数据库的应用.PL/SQL也是一种程序语言,叫做过程化SQL语言(Procedural Language/SQL).PL/S ...

  2. Ubuntu 14.04(32位)安装Oracle 11g(32位)全过程

    1.将系统更新到最新:sudo apt-get updatesudo apt-get dist-upgrade2.安装Oracle所需的依赖包:sudo apt-get install automak ...

  3. 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)\ ...

  4. oracle安装—Windows7旗舰版32位安装oracle10g方法

    首先要下载支持Vista版本的Oracle 10g下载完成后解压出来:http://download.oracle.com/otn/nt/oracle10g/10203/10203_vista_w2k ...

  5. oracle11g 卸载和安装(win7,32位)

    完全卸载oracle11g步骤:1. 开始->设置->控制面板->管理工具->服务 停止所有Oracle服务.2. 开始->程序->Oracle - OraDb11 ...

  6. mysql图文安装教程(win7 32位 亲测)

    一.下载mysql:http://www.mysql.com/downloads/ 弹出: 你需要有一个 Oracle Web 帐户,没有的话,注册一个: 勾选许可: 输入搜索条件: 下载MySQL ...

  7. 在debian下安装QT 5.10 32位

    准备工作: 在开始之前最好把GCC升级到5.0以上. 如果升级后出现“libstdc++.so.6: version `CXXABI_1.3.9' not found”错误,可以参考https://b ...

  8. 如何查看安装的java是32位的,还是64位的

    命令 java -d32 -version 或者 java -d64 -version

  9. Win7安装Python失败 提示Setup failed

    一.安装报错 如图所示,双击Python安装包后进行安装显示Setup failed 安装失败: 二.错误排除 1.首先查看自己的计算机是否已经安装了 Win7 Service Pack 1大补丁,没 ...

随机推荐

  1. PhoneGap 加速计 api 获取加速计 x 轴 y 轴 z 轴信息

    一.PhoneGap 加速计 Accelerometer 对象介绍 1.主要方法 accelerometer.getCurrentAcceleration 获取当前设备在 x,y,z 轴上的加速度信息 ...

  2. C++作用域 (二)

    http://www.cnblogs.com/wolf-lifeng/p/3156936.html 2.3全局作用域 2.3.1概述 全局作用域是最大的名字空间作用域,不同于用户自定义的名字空间作用域 ...

  3. 【转+修改】容联云通讯api调用短信发送调用

    转自   https://my.oschina.net/u/1995134/blog/814540 需要荣联云通讯 的 相对应SDKjar包. CCP_REST_SMS_SDK_JAVA_v2.6.3 ...

  4. gluoncv,faster rcnn 处理难样本

    难样本,是我们在标注的时候,连肉眼都看不清的小像素物体,也可以说是既不是正样本,也不是负样本. 利用gluoncv时,这些标注框也实在存在,gluoncv会实在将他当做一个GT,但我们知道这是不好的. ...

  5. ArcFac_C#_DEMO开发

    手上有一个项目,需要检验使用本程序的,是否本人!因为在程序使用前,我们都已经做过头像现场采集,所以源头呢是不成问题的,那么人脸检测,人脸比对,怎么办呢?度娘了下,目前流行的几个人脸检测,人脸比对核心, ...

  6. spring aop,静态及动态代理例子

    @Aspect@Componentpublic class AopText { @Pointcut("execution(public * com.llf.service.*Service. ...

  7. 解决Linux 安装python3 .5 解决pip 安装无法成功问题ssl安全拦截无法pip安装库问题

    pip is configured with locations that require TLS/SSL, however the ssl module in Python is not avail ...

  8. POJ 2352 stars (树状数组入门经典!!!)

    Stars Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 54352   Accepted: 23386 Descripti ...

  9. 404 Note Found 队-Alpha9

    目录 组员情况 组员1(组长):胡绪佩 组员2:胡青元 组员3:庄卉 组员4:家灿 组员5:凯琳 组员6:翟丹丹 组员7:何家伟 组员8:政演 组员9:黄鸿杰 组员10:刘一好 组员11:何宇恒 展示 ...

  10. C#实体更新指定的字段

    接口类: /// <summary> /// 更新指定字段 /// </summary> /// <param name="entity">实体 ...