Can we store the frames of a video in a variable or by any other method?

3 vues (au cours des 30 derniers jours)
Chandvi Arora
Chandvi Arora le 19 Juil 2017
Commenté : Walter Roberson le 19 Juil 2017
I basically need to create a frame memory(i.e. simply a place to store frames in my video) for my video. How can I do that? And secondly, after creation of such memory, how can I perform motion compensation based prediction(of the next frame) from the memory?

Réponses (1)

Walter Roberson
Walter Roberson le 19 Juil 2017
Approximately,
idx = 0;
while hasFrame(videoobject)
idx = idx + 1;
stored_frames{idx} = readFrame(videoobject);
end
Note: If the video is stored in a file, then I would recommend reading the file through once just to count the frames so you can pre-allocate the stored_frames variable.
Also, it can be more efficient to instead use a multidimensional numeric array instead of using cell arrays.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by