How to convert video to spatio-temporal volumes in python

北城余情 提交于 2020-01-01 20:01:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!