易截截图软件、单文件、免安装、纯绿色、仅160KB

opencv python cool

当年做毕业论文的时候openCV就像是我的瑞士军刀,太有感情了。如今用了一年多的python,发现openCV也有python版本了,真是太酷了!当然python在处理图像时还可以用其它库例如PIL(Python Imaging Library ),一种轻量级的图像库。目前openCV1.0版本对应的python版本为2.5,openCV2.0对应python 2.6。
附录:
1. 一篇介绍图像处理库是 PIL(Python Image Library)的blog:
http://blog.csdn.net/lanphaday/archive/2007/10/28/1852726.aspx
2. openCV简介
OpenCV全程open source computer vision library.是Intel开发的一个计算机视觉库,包含了多种计算机图形图像处理的库,目前版本为V1.0,可以在商业和研究领域免费实用。
主要用于处理
图像处理
计算机视觉
模式识别
物体识别(人脸识别,Object识别)
运动跟踪
3. 在python中使用OpenCV
在python中使用OpenCV
http://www.opencv.org.cn/index.php/%E5%9C%A8python%E4%B8%AD%E4%BD%BF%E7%94%A8OpenCV
安装python2.5
到以下地址下载, 然后默认安装.
http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi
安装OpenCV
下载OpenCV, 安装后将对应的bin目录添加到PATH变量.
http://www.opencv.org.cn/download/OpenCV_1.0.exe
配置OpenCV的python接口
打开目录 OpenCV\interfaces\swig\python, 运行以下命令:
setup-for-win.py build
setup-for-win.py install
测试
编写以下代码:
# -*- coding:utf-8 -*-
# mycv.py

import sys

# 导入OpenCV模块

from opencv.cv import *
from opencv.highgui import *

if __name__ == '__main__':

# 打开图像

image = cvLoadImage ("lena.jpg")

# 创建窗口

cvNamedWindow ("mywin")

# 显示图像

cvShowImage ("mywin", image)
cvWaitKey (0)


相关文档:

PEP 0263 Defining Python Source Code Encodings

 
PEP 0263
Defining Python Source Code Encodings
Python will default to ASCII as standard encoding if no other
encoding hints are given.
To define a source code encoding, a magic comment must
be placed into the source files either as first or second
line in the file, suc ......

Python几种并发实现方案的性能比较

 
#!/Library/Frameworks/Python.framework/Versions/2.5/bin/python
# encoding: utf-8
import sys, time
import thread
 
SLEEP_TIME = 0.0001
 
def run_benchmark(n, m):
    # print(">> Python 2.5.1, stackless 3.1b3 here (N=%d, M=%d)!\n" % (n, m))
    lock ......

eat python 003

Documentation for C's fopen():
---
r Open text file for reading. The stream is positioned at the beginning
of the file.
r+ Open for reading and writing. The stream is positioned at the
beginning of the file.
w Truncate file to zero length or create text file for writing. The
stream is posi ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号