python计算机视觉编程调试问题

1. PCV包的安装

  1. 下载PCV库文件数据,下载地址:https://github.com/jesolem/PCV
  2. 将下载的文件解压至:C:\Users\Administrator\Desktop\PCV
  3. 打开cmd,执行如下指令:
    (1)cd C:\Users\Administrator\Desktop\PCV
    (2)python setup.py install
  4. 在pycharm中输入import PCV,测试是否安装成功

2. NameError: name ‘file’ is not defined

fp = file(filename, 'wb')修改为fp = open(filename, 'wb')

3. TypeError: write() argument must be str, not bytes

文件打开方式有问题,把之前的打开语句修改为用二进制方式打开就好了

filelist = get_imlist('E:/python/Python Computer Vision/test jpg/') #获取convert_images_format_test文件夹下的图片文件名(包括后缀名)
imlist = open('E:/python/Python Computer Vision/test jpg/imlist.txt','wb+')

你可能感兴趣的:(python计算机视觉)