【发布时间】:2017-04-06 09:03:33
【问题描述】:
我通过 QMediaPlayer 获得了视频输入,然后我想逐帧读取并使用其他视觉算法处理所有帧。但我不知道如何从视频中一帧一帧地获取帧的每个像素...
在 OpenCV 库中,我可以使用 cv::VideoCapture 和 cv::Mat 轻松解决该问题。
cv::VideoCapture capture(filename);
cv::Mat img;
capture >> img; // 'img' contains the first frame of the video.
capture >> img; // 'img' contains the second frame of the video.
如果有人已经处理过此类问题,请帮助我。
非常感谢。
【问题讨论】:
-
如果它对你有用,使用 OpenCV 没有任何问题:)