今天在PyCharm上配置了opencv,直接在opencv官网下载python版本的,不过要看清楚版本号。
“win + r” 搜索cmd,打开放置下载的文件的文件夹,使用install安装
在pycharm配置时,
File — Settings — project interpreter 点“+”号,搜索opencv,再点install package 即可。
使用时遇到 AttributeError: module 'cv2' has no attribute 'CreateImage' 的问题
突然发现
新的OpenCV的接口中没有CreateImage接口。即没有cv2.CreateImage这样的函数。如果要创建图像,需要使用numpy的函数
好吧。。。。
使用
emptyImage = np.zeros(img.shape, np.uint8)
来创建图像