Opencv处理AttributeError: ‘NoneType‘ object has no attribute ‘copy‘
在做一个答题卡识别的项目中,遇到了此问题,
报错的代码如下:
image = cv2.imread(args["image"])
contours_img = image.copy()
AttributeError如下:
File "E:/Python/python_user/Practice_codes/second/answer sheet/get_answer.py", line 78, in <module>contours_img = image.copy()
AttributeError: 'NoneType' object has no attribute 'copy'
最终找到错误代码端为配置部分如下:
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True,help="path to the input image")
修改为:
`ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=False, default='文件位置/test_01.png',
总结:个人此情况主要是两个方面,第一个是配置原因,第二个是文件路径的问题,检查文件路径以及 ‘_’, 文件路径不要中文,具体路径要写明测试图像名称。
Opencv处理AttributeError: ‘NoneType‘ object has no attribute ‘copy‘相关推荐
- 成功解决AttributeError: 'NoneType' object has no attribute '__array_interface__'
成功解决AttributeError: 'NoneType' object has no attribute '__array_interface__' 目录 解决问题 解决思路 解决方法 原因及思路 ...
- FlyAI出现AttributeError: 'NoneType' object has no attribute 'input_x'问题解决
FlyAI是一个AI竞赛平台,不过多介绍,见官网:https://www.flyai.com/ 笔者系统:Ubuntu 16.04 (安装了ROS kinetic) 使用以下命令进行测试时 ./fl ...
- 报错分析:【AttributeError: ‘NoneType‘ object has no attribute ‘shape‘】
-----------------------------------志当高远且脚踏实------------------------------------程_七辰 关于OpenCV读取图片报错 前 ...
- Traceback (most recent call last): File AttributeError: 'NoneType' object has no attribute 'group'
Traceback (most recent call last):File "<stdin>", line 1, in <module> Attribut ...
- Keras问题“AttributeError: 'NoneType' object has no attribute 'update”解决
BUG 在使用Keras训练模型时,在每个epoch完成后save_model时会报错 "AttributeError: 'NoneType' object has no attribute ...
- pyspark AttributeError: 'NoneType' object has no attribute 'setCallSite'
pyspark: AttributeError: 'NoneType' object has no attribute 'setCallSite' 我草,是pyspark的bug.解决方法: prin ...
- Pywinauto 应用后端类型选择错误:AttributeError: ‘NoneType‘ object has no attribute ‘backend‘. 原因及解决办法
AttributeError: 'NoneType' object has no attribute 'backend'. 错误原因: 选择的应用后端类型不对. windows 上应用的后端类型有两种 ...
- 成功解决AttributeError: ‘NoneType‘ object has no attribute ‘shape‘
成功解决AttributeError: 'NoneType' object has no attribute 'shape' 目录 解决问题 解决思路 解决方法 解决问题 multiplier = [ ...
- AttributeError: 'NoneType' object has no attribute 'grid'报错解决方案
1问题描述: 当我们在使用tkinter时经常遇到AttributeError: 'NoneType' object has no attribute 'grid'的报错 2.原因分析: import ...
最新文章
- RHEL 5 设置 YUM
- Sharepoint 2010 Powershell去增加 上传文件类型
- tsconfig.json配置
- 域环境下用组策略禁止客户机更改IP
- 【原创】Git删除暂存区或版本库中的文件
- java stream Collectors
- 根据工资计算税费html,个税计算器2021 - 个人所得税计算器2021 - 最新个人所得税税前工资税后工资计算公式...
- 和技术大咖们一起工作是怎样的体验?擎创招人进行时,你~要上车吗?
- c语言 定时器作用,单片机定时器的作用及使用方法详解
- 四大维度,七大案例,300+测试问题,《腾讯手游测试实战手册》发布
- python 查找excel内容所在的单元格_python 读取excel中单元格的内容
- RC复位电路上二极管的作用
- android 单手模式 cm,怎么开启单手模式 安卓自定义单手操作模式缔造教程
- java getreader_异常处理:getReader() has already been called for this request
- php psy,psysh --php交互式控制台
- android am 拨打电话,adb 之android的神器am
- 怎么把php转变成word文档,表格怎么转换成word文档
- 敏捷悖论之:站会的三种状态
- 基于python的人脸识别考勤_face++与python实现人脸识别签到(考勤)功能
- 我爬了商圈百晓生花爷的星球,都是些什么样的大佬花友!
热门文章
- Docker专题(二)-Docker安装与启动
- python三大,Python三大器
- 读书笔记:《机器人SLAM导航核心技术与实战》导读
- 2015-4-23 bav总结
- 现在程序员圈竞争激烈,如何才能避免焦虑?如何才能打破现状......
- 以太空为主题的Golang简介
- sql sever 树的基础查询
- 最简单的makefile编写练习【main.c addc.c addc.h makefile】
- 说话人识别相关基础知识整理(持续更新)
- html5 图片局部马赛克,javascript - JS实现马赛克图片效果完整示例