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)
Ïà¹ØÎĵµ£º
Ò»¸öÓÐȤµÄÍøÕ¾£º
http://www.pythonchallenge.com/
¼¯ÓéÀÖÓëѧϰÓÚÒ»Ì壬ÔÚ¿ª¶¯ÄԽ¹ØµÄ¹ý³ÌÖУ¬²»µ«À©Õ¹ÁË˼ά£¬»¹¶ÔPython¼ÓÉîÁËÀí½â¡£
Ò»¹²33¹Ø£¬Ã¿´³¹ýÒ»¹Ø¶¼¿ÉÒÔÔÚÌáʾϲ鿴×÷Õ߸ø³öµÄSolution¡£
µÚ0¹Ø£¨Ö¸µ¼¹Ø£©£º
³öÏÖÒ»·ù»Ã棬ÉÏÃæд×Å2**38£¬½ÌÄãÈçºÎ½øÈëÏÂÒ»¹Ø¡£
&nb ......
PythonǶÈëC++Ïê½â(1)--HelloWorld
À´CSDNµÄʱºò£¬¸Õ¸Õ½Ó´¥Python£¬ÄÇʱºò¶ÔPythonµÄǶÈ벿·ÖºÜ¸ÐÐËȤ£¬Ö»ÊÇһֱûÓÐʱ¼äÀ´ÅªÇåÆäÃæÉ´£¬Òò´ËҲһֱûÓÐʹÓÃǶÈëµÄ¹¦ÄÜ£¬ÁíÒ»¸öÔÒòÊÇÎÒ»¹Ã»ÓÐÕæÕýÓÃPythonд¹ýÒ»¸öÕýʽµÄÓÐÓõãµÄ¶«Î÷£¬²»¹ý£¬ÏÖÔڻعýÍ·À´¼ÌÐø¿´ÕâÒ»²¿·Ö£¬·¢ÏÖ»¹ÊÇͦ¼òµ¥µÄ¡£ÒÔÇ°Ïë°ÑÕⲿ·Ö·Òë³öÀ´£¬¿ÉÊÇÓ ......
½ñÌìÓöµ½Ò»¸öÒ»¸öÎÊÌ⣬Êǽ«×Ö·û´®ÀàÐ͵Äʱ¼äת»¯ÎªUTCʱ¼ä¡£ÀýÈçtime_str = "2009/11/09 12:23:23" ת»¯ÎªUTC intÐÍ¡£
ÕÒÁËһЩ×ÊÁÏ£¬·¢ÏÖtimeÄ£¿é¾ÍÄÜÍê³ÉÕâ¸öת»»¡£
import time
time_str = "2009/11/09 12:23:23"
time_s = time.strptime(time_str,"%Y/%m/%d %H:%M:%S")
utc_f = time.mktime(time_s)
utc_i = int ......
֪ʶµã
1.Ïß³ÌÊÇ“ÇáÁ¿¼¶”½ø³Ì£¬ÒòΪÏà½ÏÓÚ½ø³ÌµÄ´´½¨ºÍ¹ÜÀí£¬²Ù×÷ϵͳͨ³£»áÓýÏÉÙµÄ×ÊÔ´À´´´½¨ºÍ¹ÜÀíÏ̡߳£²Ù×÷ϵͳҪΪн¨µÄ½ø³Ì·ÖÅäµ¥¶ÀµÄÄÚÔÚ¿Õ¼äºÍÊý¾Ý£»Ïà·´£¬³ÌÐòÖеÄÏß³ÌÔÚÏàͬµÄÄÚ´æ¿Õ¼äÖÐÖ´ÐУ¬²¢¹²ÏíÐí¶àÏàͬµÄ×ÊÔ´¡£¶àÏ̳߳ÌÐòÔÚ½áÄÚ´æµÄʹÓÃЧÂÊÒªÓÅÓÚ¶à½ø³Ì³ÌÐò¡£
2.pythonÌṩÁËÍêÕûµÄ¶àÏß ......
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 ......