基本练习,调用opencv库函数显示图像
>>> import cv2
>>> fn="baboon.jpg"
>>> if __name__=='__main__':
... print 'http://blog.csdn.net/myhasp1'
... print 'myhasp1@qq.com'
... print
... print 'loading %s ...' % fn
... img = cv2.imread(fn)
... cv2.imshow('preview',img)
... cv2.waitKey()
... cv2.destroyAllWindows()
...
运行结果屏幕截图如下
哈哈,是不是很酷炫!