How to convert video to spatio-temporal volumes in

2020-08-01 11:42发布

问题:

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