cv2---imread---error
when I use the cv2.imred() which is absolute path path = r'C:\\Users\\hp\\Desktop\\常用Python代码\\mycv2\\998dcd7a46333361fff21eafd563b3d1.jpg',
it occurred : cv2.error: OpenCV(3.4.4) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:356: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'
but use the relative it's ok
this is my code:
#coding: utf-8
import cv2
import numpy as np
path = r'C:\\Users\\hp\\Desktop\\常用Python代码\\mycv2\\998dcd7a46333361fff21eafd563b3d1.jpg'
img = cv2.imread(path)
cv2.imshow("image", img)
cv2.waitKey(10000)
cv2.destroyAllWindows()
how to solve this problem?
reason:my absolute path has Chinese character
and I change it, it works
#coding: utf-8
import cv2
import numpy as np
path = r'C:\\Users\\hp\\Desktop\\My_Python_Code\\mycv2\\998dcd7a46333361fff21eafd563b3d1.jpg'
img = cv2.imread(path)
cv2.imshow("image", img)
cv2.waitKey(10000)
cv2.destroyAllWindows()
最新文章
- Delphi 控件大全
- 封装一个UILabel圆形边框显示进度
- 信息安全系统设计基础第四次实验报告20135324&;&;20135330
- 【IOS笔记】Creating Custom Content View Controllers
- mysql存入数据出错总结
- 部署git服务器 gitServer 软件
- 2015GitWebRTC编译实录7
- echarts标准饼图(一)——基本配置demo
- WIN32 根据程序名(映像名称)终止外部程序
- jsp中Java代码中怎么获取jsp页面元素
- poj2392 Space Elevator(多重背包)
- 百度地图 iOS SDK - 坐标转换方法
- python全栈开发day99-DRF序列化组件
- mybatis07--关联查询一对多
- codeforces 578a//A Problem about Polyline// Codeforces Round #320 (Div. 1)
- 算法篇---Shell排序(希尔)算法
- Qwe中的数值结算
- Java使用Redisson分布式锁实现原理
- CCF CSP 201312-4 有趣的数
- Java程序设计17——多线程-Part-C