Opencv4.5.1+Visual Studio2019 程序运行窗口异常
最近刚开始学opencv,在读取视频文件的时候出现了问题
程序的功能都正常实现了,但是运行窗口上多了一堆奇怪的东西,如图
代码
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main()
{
VideoCapture video("D:/Downloads/rain.mp4");
if (video.isOpened())
{
cout << "视频中图像的宽度为:" << video.get(CAP_PROP_FRAME_WIDTH) << endl;
cout << "视频中图像的高度为:" << video.get(CAP_PROP_FRAME_HEIGHT) << endl;
cout << "视频帧率为:" << video.get(CAP_PROP_FPS) << endl;
cout << "视频总帧数为:" << video.get(CAP_PROP_FRAME_COUNT) << endl;
}
else
{
cout << "请输入正确的文件名称" << endl;
return -1;
}
while(1)
{
Mat output;
video >> output;
if (output.empty())
{
break;
}
imshow("video", output);
waitKey(1000 / video.get(CAP_PROP_FPS));
}
waitKey();
destroyAllWindows();
return 0;
}
应该是具体过程吧