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()

最新文章

  1. Delphi 控件大全
  2. 封装一个UILabel圆形边框显示进度
  3. 信息安全系统设计基础第四次实验报告20135324&&20135330
  4. 【IOS笔记】Creating Custom Content View Controllers
  5. mysql存入数据出错总结
  6. 部署git服务器 gitServer 软件
  7. 2015GitWebRTC编译实录7
  8. echarts标准饼图(一)——基本配置demo
  9. WIN32 根据程序名(映像名称)终止外部程序
  10. jsp中Java代码中怎么获取jsp页面元素
  11. poj2392 Space Elevator(多重背包)
  12. 百度地图 iOS SDK - 坐标转换方法
  13. python全栈开发day99-DRF序列化组件
  14. mybatis07--关联查询一对多
  15. codeforces 578a//A Problem about Polyline// Codeforces Round #320 (Div. 1)
  16. 算法篇---Shell排序(希尔)算法
  17. Qwe中的数值结算
  18. Java使用Redisson分布式锁实现原理
  19. CCF CSP 201312-4 有趣的数
  20. Java程序设计17——多线程-Part-C

热门文章

  1. 十.iSCSI网络磁盘
  2. 工作流学习之--TPFlow数据库分析
  3. 在其他博客里看到的比较好的map用法,进行储存啦啦~ x
  4. tarjan模板完整版
  5. PHP全栈学习笔记31
  6. 微信小程序入门与实战 从0到1进行细致讲解 涵盖小程序开发核心技能下载
  7. NPM私有包部署到私有仓库
  8. C#读写三菱PLC数据 使用TCP/IP 协议
  9. linux 关机/重启命令总结
  10. ML_Review_PCA(Ch4)