这是我的程序,C++使用 OpenCv 库从数据集中读取图像序列,但它没有运行

That is my program in C++ using OpenCv library to read the sequence of images from a dataset, but it doesn't run

本文关键字:图像序列 读取 集中 数据集 运行 程序 我的 C++ 使用 OpenCv 数据      更新时间:2023-10-16
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
VideoCapture cap("F:/TestIJCNN2013Download/%05d.ppm");
Mat frame;
cap >> frame;
cap.read(frame);
imshow("frame" , frame);
return 0;
}

程序编译时错误为零,但未运行。我怎样才能正确运行程序,是错误的逻辑还是其他什么。

您错过了cv::waitKey()调用。除非您使用此功能,否则不会显示图像。

有关更多详细信息,请参阅有关使用VideoCapture()的简短代码。