我用QMediaPlayer獲得了一個視頻輸入,然後我想逐幀讀取幀並用其他視覺算法處理所有幀。但我不知道如何從視頻逐幀獲取幀並訪問幀的每個像素...在OpenCV庫中,我可以很輕鬆地使用cv :: VideoCapture解決這個問題, CV ::墊。如何從Qt框架中的視頻逐幀獲取幀?
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沒有問題,如果它適合你當然:) –