【参考安装步骤】 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. Java并发案例04---生产者消费者问题03--使用ReentrantLock

    /** * 面试题:写一个固定容量同步容器,拥有put和get方法,以及getCount方法, * 能够支持2个生产者线程以及10个消费者线程的阻塞调用 * * 使用wait和notify/notif ...

  2. js中this应用

    this是js的一个关键字,随着函数使用场合不同,this的值会发生变化.但是总有一个原则,那就是this指的是调用函数的那个对象. 1.纯粹函数调用. function test() { this. ...

  3. 解决Bug步骤

    1.看报错.将bug定位到文件.类.方法. 2.打断点.将bug定位到具体代码行号. 3.分析断点输出结果. 4.结合报错和断点结果,修改代码. 总之:拆解问题.定位问题.分析问题.解决问题.

  4. Tomcat中日志组件

    Tomcat日志组件 AccessLog接口 public interface AccessLog { public void log(Request request, Response respon ...

  5. ORACLE NLS_LENGTH_SEMANTICS 参数的用途

    NLS_LENGTH_SEMANTICS参数是一个专为创建CHAR和VARCHAR2两种字符型的列时,指定使用的字节长度,还是使用字符长度的定义方式,有byte和char两种值,默认为byte. 当设 ...

  6. CSS3 - 新单位vw、vh、vmin、vmax使用详解(附样例)

    像 px.em 这样的长度单位大家肯定都很熟悉,前者为绝对单位,后者为相对单位.CSS3 又引入了新单位:vw.vh.vmin.vmax.下面对它们做个详细介绍. 一.基本说明 1,vw.vh.vmi ...

  7. HDU 1711 Number Sequence (KMP简单题)

    Number Sequence Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  8. C#中枚举

    1.枚举是一组命名整形常量,枚举类型使用Enum关键字进行声明的.在C#中枚举是值数据类型,枚举包含自己的值,且不能继承或传递继承.

  9. ubuntu 14.04 将窗体button移到右边

    刚刚安装了Ubuntu 14.04,想改动窗体button的位置.但依照曾经的办法发现不行了,在gconftool-->apps中找不到metacity. 多方查找后找到解决方式,例如以下 Ub ...

  10. ./redis-trib.rb 报错:/usr/local/rvm/gems/ruby-2.4.2/gems/redis-4.0.1/lib/redis/client.rb:119:in `call': ERR Slot 0 is already busy (Redis::CommandError)

    错误提示是 slot插槽被占用了(这是 搭建集群前时,以前redis的旧数据和配置信息没有清理干净.) 解决方案是 用redis-cli 登录到每个节点执行  flushall  和 cluster ...