How to convert video to spatio-temporal volumes in python
<p>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 <img src="http://i.stack.imgur.com/BXJxR.jpg" alt="here"></p>

<p>Read the video file using</p>

<pre><code>cap = cv2.VideoCapture(fileName)
</code></pre>

<p>Go over each frame:</p>

<pre><code>while(cap.isOpened()):

    # Read frame
    ret, frame = cap.read()
</code></pre>

<p>If you want you can just insert every frame to a 3D matrix to get the spatio-temporal matrix that you wanted</p>

python opencv video image-processing video-processing