问题
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
来源:https://stackoverflow.com/questions/39606892/how-to-convert-video-to-spatio-temporal-volumes-in-python