#include <opencv2/opencv.hpp>
using namespace cv;
int main()
{
VideoCapture capture(0);
while(1)
{
Mat frame;
capture >> frame;
imshow("读取视频帧",frame);
waitKey(30);
}
system("pause");
return 0;
}
出现的报错:[ WARN:0@10.284] global /home/lzx/图片/opencv-4.5.5/opencv-4.5.5/modules/videoio/src/cap_v4l.cpp (1000) tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout.
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.5.5) /home/lzx/图片/opencv-4.5.5/opencv-4.5.5/modules/core/src/array.cpp:2494: error: (-206:Bad flag (parameter or structure field)) Unrecognized or unsupported array type in function 'cvGetMat'
请问这是为什么呢?