基本練習,調用opencv庫函數顯示圖像
>>> import cv2
>>> fn="baboon.jpg"
>>> if __name__=='__main__':
... print 'http://blog.csdn.net/myhasp1'
... print '[email protected]'
... print
... print 'loading %s ...' % fn
... img = cv2.imread(fn)
... cv2.imshow('preview',img)
... cv2.waitKey()
... cv2.destroyAllWindows()
...
運作結果螢幕截圖如下
哈哈,是不是很酷炫!