I am doing my project in video analytics. I have to densely sample video. Sampling means converting video to spatio-temporal video volumes. I am using the python language. How can I do that in python? Is that option available in opencv or any other package? Input video sequence and desired output is shown
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Read the video file using
cap = cv2.VideoCapture(fileName)
Go over each frame:
while(cap.isOpened()):
# Read frame
ret, frame = cap.read()
If you want you can just insert every frame to a 3D matrix to get the spatio-temporal matrix that you wanted