当前位置:网站首页>Opencv报错:(parameter or structure field))Unrecognized or unsupported array type in functon ‘cvGetMat‘
Opencv报错:(parameter or structure field))Unrecognized or unsupported array type in functon ‘cvGetMat‘
2022-07-26 03:05:00 【璇焱如柳】
1.报错信息

2.代码
#include <iostream>
#include <libavutil/avutil.h>
#include <opencv2/highgui.hpp>
#include <opencv4/opencv2/imgproc.hpp>
main()
{
cv::VideoCapture videoshow;
cv::Mat image;
videoshow.open("/home/lfh/图片/vedio_test.avi");
cv::namedWindow("读取画面显示");
while(1)
{
videoshow.read(image);
cv::imshow("读取画面显示", image);
waitKey(20);
}
videoshow.~VideoCapture();
return 0;
}
3.原因及修改
问题出在循环里边,while(1)意思是一直执行循环体里的代码,但是视频文件的长度是有限的,所以当视频读完的时候就出错了。将循环体修改为
while(videoshow.read(image))
{
cv::imshow("读取画面显示", image);
waitKey(20);
}
即可。因为如果videoshow.read(image)还能读取到数据,会返回1
边栏推荐
- Opening method of win11 microphone permission
- VOFA+ 串口调试助手
- Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 1)
- .net serialize enumeration as string
- MySQL教程:MySQL数据库学习宝典(从入门到精通)
- Usage of '...' in golang
- How about GF Securities? Is it safe to open an account online?
- Wechat official account mutual aid, open white groups, and small white newspaper groups to keep warm
- Win11麦克风权限的开启方法
- 万维网、因特网和互联网的区别
猜你喜欢
随机推荐
复制列表时踩过的坑:浅拷贝与深拷贝
Win11更改磁盘驱动器号的方法
(九)属性自省
Multithreaded programming
Design of golang lottery system
Machine learning foundation plan 0-2: what is machine learning? What does it have to do with AI?
Usage of arguments.callee
案例:使用keepalived+Haproxy搭建Web群集
File operation (I) -- File introduction and file opening and closing methods
多线程编程
富文本转化为普通文本
事半功倍:学会WEB性能测试用例设计模型
.net serialize enumeration as string
ShardingSphere数据分片
OxyCon 2022 网络抓取前沿大会即将开启!
Parallelloopbody in opencv
Win11 hide input method status bar method
Extended Physics-InformedNeural Networks论文详解
如何正确计算 Kubernetes 容器 CPU 使用率
Teach you to rely on management hand in hand









