OpenCV 2.3.1 Python Bindings installation on Windows 7

Today I searched several post about how to install OpenCV Python bindings on Windows 7. And I found many of them made it too complicated.

Here is my simple solution. Many thanks to Christoph Gohlke, Laboratory for Fluorescence Dynamics, University of California, Irvine, his work makes many Python modules be easy to be installed on Windows.

Simple steps:

  1. Install numpy for python, as OpenCV 2.3.1 needs this. normally choose the MKL version and the relevant python version and OS architecture( x86 or amd64)
  2. Install OpenCV , choose the relevant python version and OS architecture( x86 or amd64) as numpy
  3. The tricky part: as opencv 2.3.1 has been evolved to cv2, the old cv functions has been moved to cv2.cv. The workaround is create a cv.py file with
    from cv2.cv import *
    
  4. Copy this cv.py file under directory %PYTHON_HOME%\Lib\site-packages
  5. Now you can import cv to wrote OpenCV code. Have fun:)
Advertisements

AndroidDriver for Selenium Python Client

My first real project!

这是我第一次想把自己工作相关的东西拿出来开源,这也是我觉得我迄今为止做成的最像个样也最有成就感的一个工程:

  • 一是之前自己都没有用SCM,现在用上git后发现真的非常之方便好用
  • 二是之前都是在博客上发布些自己写的小工具,不能真正和世界挂钩。其实自己写过很多和Android自动化测试相关的东西了,只是没公开而已。这次是给Selenium+Android写的,应该有挺多人能从我写的东西里面受益吧。

本来想是不是能争取做selenium的一个committer提交的,不过鉴于俺新手的水平,没敢提。先自己练着吧。。。

这个是我的开源项目地址:https://github.com/truebit/AndroidWebDriver4Python

说明文档,需要知道的都在里面了:https://github.com/truebit/AndroidWebDriver4Python/blob/master/README

现在是1.0-final版,做了20次的压力测试(真机和模拟器各10次),没有问题

下一步准备实现同时对多个设备的操作,应该不是啥大问题。

大家如果有什么问题或者建议请在GitHub提出来,也可以在微博上问我:@SeganW

题外话,在家的时候提交修改出现以下错误:

error: The requested URL returned error: 403 while accessing https://truebit@github.com/truebit/AndroidWebDriver4Python.git/info/refs

fatal: HTTP request failed

后来终于知道:原来GitHub只有ssh形式的clone代码才是可以读写的。要修改也挺简单:

编辑该repo目录下的.git/config文件,找到url那行,把前面的https://truebit改成ssh://github 改完的效果是这样的:

url = ssh://git@github.com/truebit/AndroidWebDriver4Python.git

改之前是

https://truebit@github.com/truebit/AndroidWebDriver4Python.git

其实就是从read-only的https改成read-write的ssh!