2017-08-28 106 views
1

我正在嘗試使用ICDAR2015數據集,這是從視頻文件問題進行的文本檢測和分類。我之前從事過靜態圖像上的文本檢測和分類問題研究,但從未從事視頻數據工作。從視頻中檢測和分類文本

是否有一些庫/工具可以幫助我從視頻中截取不同幀的圖像? 謝謝。

回答

3

只要視頻未加密,根據您使用的平臺,屏幕抓取幀的方式有很多。

鑑於你的問題域與域您的經驗,OpenCV的一個開源計算機視覺庫可能是一個很好的匹配:

的doucmention包括例子來捕捉視頻幀:

例如形成上面的教程,從文件中讀出的視頻:

import numpy as np 
import cv2 

cap = cv2.VideoCapture('vtest.avi') 

while(cap.isOpened()): 
    ret, frame = cap.read() 

    //Do whatever work you want on the frame here - in this example 
    //from the tutorial the image is being converted from one colour 
    //space to another 
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) 

    //This displays the resulting frame - you may or may not not need 
    //this for your case 
    cv2.imshow('frame',gray) 
    if cv2.waitKey(1) & 0xFF == ord('q'): 
     break 

cap.release() 
cv2.destroyAllWindows()