用Python打开图像始终提示错误

error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:352:
error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'
 import cv2 as cv
img = cv.imread('D:\BjutDeeplearning\Opencvtest\python-opencv05\\black.jpg')
cv.imshow("img", img)
print(img.shape)
cv.waitKey(0)
cv.destroyAllWindows()

三个注意:

图片放在非中文路径进行读取,

图片改为非中文名,

图片名称前用双\\或者路径前面加r,使用原始字符串:

r'D:\BjutDeeplearning\Opencvtest\python-opencv05\black.jpg'。

error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'的更多相关文章

  1. error:Assertion failed ((unsigned)i0 < (unsigned)size.p[0]) in cv::Mat::at

    问题原因: 访问像素时指针越界造成的 解决办法: 1.检查指针下标是否正确 2.row和col是否写反了

  2. error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

    这个报错一般是因为你图像的路径写错了,找不到图像而导致的. 解决问题的朋友麻烦点个推荐呗!嘿嘿

  3. opencv 中出现错误 -215:Assertion failed

    cv2.error: OpenCV(4.0.1) D:\Build\OpenCV\opencv-4.0.1\modules\imgproc\src\color.cpp:181: error: (-21 ...

  4. (python走过的坑)OpenCV中错误opencv-3.3.1\modules\highgui\src\window.cpp:339: error: (-215) size.width>0 && size.height>0 in function cv::imshow

    第一次在python中使用OpenCV(cv2),运行时报错opencv-3.3.1\modules\highgui\src\window.cpp:339: error: (-215) size.wi ...

  5. [error]OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in resize, file modules/imgproc/src/resize.cpp, line 3289

    error OpenCV Error: Assertion failed (ssize.width > && ssize.height > ) terminate call ...

  6. Solve Error Debug Assertion Failed Expression vector iterators incompatible Using PCL in Release Mode of VS2010

    When using PCL 1.4.0 in the release mode building under VS2010, we might sometime get the error &quo ...

  7. C++ error:Debug Assertion Failed.Expression:_BLOCK_TYPE_IS_VALID(phead->nBlock)

    Debug Assertion Failed.Expression:_BLOCK_TYPE_IS_VALID(phead->nBlockUse) 关于上面这个错误,我在上一篇文章中的程序遇到过了 ...

  8. opencv报错 error: (-215) size.width>0 && size.height>0 in function cv::imshow

    使用opencv读取摄像头并且显示事出现此问题: 后来发现是图像为空时的错误,加入: if(!frame.empty()) imshow("video",frame); 完整的代码 ...

  9. (C++) Assertion failed: !"Bad error code", file VMem.c, line 715

    (C++) Assertion failed: !"Bad error code", file VMem.c, line 715 Misc error. myInterface F ...

随机推荐

  1. 【Labview入门】子VI的调用

    labview版本:Labview2015 Labview里面也可以向C语言等变成语言一样调用子程序,本文带你一步一步实现子VI的创建与调用. 第一步 写好程序 首先我们写个简单的加法程序: 我们的目 ...

  2. vue element NavMenu 莫名出现蓝色边框

    最近在开发一款官网,使用的是element,在头菜单NavMenu,的时候没有设置任何的边框属性,结果出现了如下图所示的边框线. 点击有二级菜单时出现 找了好多方法发现是有一个属性影响到了,:focu ...

  3. 百万年薪python之路 -- 面试之葵花宝典

    关于for面试题: for i in "alex": pass print(i) 结果: x 关于字符串的面试题: s = "给章超印倒一杯卡布奇洛" s[:: ...

  4. 从零开始把项目发布到Nuget仓库中心

    从零开始把项目发布到Nuget仓库中心 我的项目地址 https://github.com/Ants-double/dasuan ### 前期准备 下载并注册nuget帐号 下载地址 https:// ...

  5. 非确定的自动机NFA确定化为DFA

    摘要: 在编译系统中,词法分析阶段是整个编译系统的基础.对于单词的识别,有限自动机FA是一种十分有效的工具.有限自动机由其映射f是否为单值而分为确定的有限自动机DFA和非确定的有限自动机NFA.在非确 ...

  6. C++沉思录笔记 —— 序幕

    #include <stdio.h>   class Trace{public: void print(const char* s) { printf("%s\n", ...

  7. django-URL反向解析Reverse(九)

    解决path中带参数的路径. reverse(viewname,urlconf=None,args=None,Kwargs=None,current_app=None) book/views.py f ...

  8. 设计模式C++描述----12.享元(Flyweight)模式

    一. 概述 在面向对象系统的设计何实现中,创建对象是最为常见的操作. 这里面就有一个问题:如果一个应用程序使用了太多的对象,就会造成很大的存储开销.特别是对于大量轻量级(细粒度)的对象,比如在文档编辑 ...

  9. markdown 入门教程(完整版)

    Markdown是一种可以使用普通文本编辑器编写的标记语言,通过简单的标记语法,它可以使普通文本内容具有一定的格式. 1. 标题 Markdown支持6种级别的标题,对应html标签 h1 ~ h6 ...

  10. asp.net core Api集成Swagger

    当我们通过vs创建了一个api项目后,便可以开始集成swagger了 一.Swagger集成 从“程序包管理器控制台”窗口进行安装,执行Install-Package Swashbuckle.AspN ...