opencv报错 error: (-215) size.width>0 && size.height>0 in function cv::imshow
使用opencv读取摄像头并且显示事出现此问题:
后来发现是图像为空时的错误,加入:
if(!frame.empty())
imshow("video",frame);
完整的代码:
int main()
{
/* unsigned char buf_show[1920*1080*3];
uint32_t addr_bar0;
unsigned char *bar0_map_base;
long int screensize = 0;
unsigned char *fbp = NULL;
unsigned char *ptail;
Mat MatRGB ;*/
VideoCapture cap();
if(!cap.isOpened())
printf("camre open failed!\n");
Mat frame;
namedWindow("video");
if(!frame.empty())
imshow("video",frame);
else
printf("image empty\n");
)
{
cap>>frame;
if(!frame.empty())
imshow("video",frame);
else
printf("image empty\n");
)==)
break;
}
cap.release();
opencv报错 error: (-215) size.width>0 && size.height>0 in function cv::imshow的更多相关文章
- vue报错Error in render: "TypeError: Cannot read property '0' of undefined"
通常有两种情况: 1.在模板的html标签上使用length报错 vue 中使用 length判断的时候,有时会报错,如下: <div class="item_list" v ...
- nginx检查报错 error while loading shared libraries: libprofiler.so.0: cannot open shared object file: No such file or directory
在centos7.3上编译安装nginx-1.12.2 启动测试出错 [root@web02 local]# /usr/local/nginx/sbin/nginx -t /usr/local/ngi ...
- 解决报错Error response from daemon: Get https://10.0.0.110/v2/: dial tcp 10.0.0.110:443: connect: connection refused
修改 #https不需要验证,否则要加上以下配置# 意思就是非安全仓库,加上重启就OK了! vim /lib/systemd/system/docker.service --insecure-regi ...
- (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 ...
- error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'
用Python打开图像始终提示错误 error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\highgui\src\window.c ...
- mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法
1. 问题背景 InnoDB是新版MySQL(v5.5及以后)默认的存储引擎,之前版本的默认引擎为MyISAM,因此,低于5.5版本的mysql配置文件.my.cnf中,关于InnoD ...
- 【MySQL笔记】mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法
step1:查看 1.1 Mysql命令行里输入"show engines:"查看innoddb数据引擎状态, 1.2 show variables "%_buffer% ...
- android sdk启动报错error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037:
android sdk启动报错error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: 问题原因: ...
- wince6.0 编译报错:"error C2220: warning treated as error - no 'object' file generated"的解决办法
内容提要:wince6.0编译报错:"error C2220: warning treated as error - no 'object' file generated" 原因是 ...
随机推荐
- linux SPI驱动——spidev之deive(五)
1.定义board设备 1: struct spi_board_info { 2: /* the device name and module name are coupled, like platf ...
- 【Selenium+Python Webdriver】报错之:TypeError: user_login() missing 1 required positional argument: 'self'
先贴一下源码: base.py文件如下: from selenium import webdriver class Page(object): ''' 页面基础类,用于所有页面的继承 ''' rb_u ...
- 扒一扒P2P风控的底牌(转)
互联网金融,这里面水就太深了,能当理财买的一般有两类,一个是货币基金,比如余额宝,这个大家已经十分清楚了,没什么风险, 但问题就是收益越来越低.实在是不过瘾了.而另外一种就是P2P理财了,收益很高,也 ...
- C#抓取网面上的html内容(JS动态生成的无法抓取)
抓取内容的代码: /// </summary> /// <param name="url">路径URL</param> /// <para ...
- 一步一步学ios UITextView(多行文本框)控件的用法详解(五5.8)
本文转载至 http://wuchaorang.2008.blog.163.com/blog/static/48891852201232014813990/ 1.创建并初始化 创建UIText ...
- gulp的使用方法
---恢复内容开始--- 什么是gulp? Gulp.js是一个自动化构建工具,开发者可以使用它在项目开发过程中自动执行常见任务. 使用步骤: 1.全局安装gulp: npm install - ...
- IIS发布问题集锦
1. 2.文件都是Not Found 3.删除了PrecompiledApp.config文件就可以了: 4.预编译:http://blog.darkthread.net/post-2012-04-2 ...
- ajax学习笔记(3)--$.get()方法
<head runat="server"> <title>jQuery中的$.get()方法</title> <script src=&q ...
- python数据分析之:数据加载,存储与文件格式
前面介绍了numpy和pandas的数据计算功能.但是这些数据都是我们自己手动输入构造的.如果不能将数据自动导入到python中,那么这些计算也没有什么意义.这一章将介绍数据如何加载以及存储. 首先来 ...
- ME01 创建货源清单
[转自 http://blog.sina.com.cn/s/blog_6466e5f70100ix3p.html ] SAP中采购货源清单创建的方法有以下几种: 1.ME01 手动逐个创建. 2.ME ...