这是我的程序,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
#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()
的简短代码。
相关文章:
- 使用FFMPEG将RGB图像序列保存到.mp4时出现问题
- 如何使用Python从C++中读取谷物序列化数据
- 读取文件中所有可能的十六进制 16 字节序列并打印每个序列
- 如何读取单个字符并在输入两个字符序列时输出? 使用 while 循环和C++
- C++ - 将 int 读取为字母和数字序列
- 对于 ~95% 写入/5% 读取线程安全的无序列图,有没有一个简单的解决方案?
- 从一个文件中读取多个序列化对象
- 增加 gil 读取图像错误
- 如何使用 OpenImageIO 和 read_tiles() 读取平铺图像
- 在 matlab 中调用 opencv 的图像时,无法读取 C++ 中的图像
- 视觉C++:图像序列加载错误
- 这是我的程序,C++使用 OpenCv 库从数据集中读取图像序列,但它没有运行
- 使用OpenCv使用图像序列计算相机校准中的本征估计误差和外在误差
- 从位图图像文件读取像素数据值
- OpenCV,在显示图像时读取用户文本输入(使用 waitKey)
- 是否可以使用c++ /OpenFrameworks将图像(或图像序列)作为硬件设备(网络摄像头)传递给Mac OSX ?
- 读取图像序列的最快方法是什么?
- 使用QT的图像序列播放器
- 流式图像序列与Live555
- 创建一个视频从图像序列在开放cv