using a video instead of a sequence of Images

Hello everybody
I am really curious about this. Please let me know if you have got an idea. I have got a matlab code which process 200 images and reports the coordinate of the specific point of my object. When I record the images, I have got an option to save the image sequences as video. Would it be possible to use one single video instead of processing image by image and get the same result.
Thanks alot in advance!!!

 Risposta accettata

Yes very much possible...you can read a vide frame by frame using:
vidObj = VideoReader(yourvideo);
numFrames = 0;
while hasFrame(vidObj)
F = readFrame(vidObj);
numFrames = numFrames + 1;
imagesc(F)
drawnow
end
numFrames

4 Commenti

Thank for the answer. I am able to read the video, however, in my loop it takes the first frame of the video, and report its position, next time it reports the same frame again again although i put it all in a loop.
your video might be like that only.
engineer
engineer il 31 Gen 2019
Modificato: engineer il 31 Gen 2019
Not really, it has got 101 frames which are different from each other. it proceses the first one only. do you have an example of video processing in a (for) loop frame by frame?
this code worked fine for me...

Accedi per commentare.

Più risposte (0)

Richiesto:

il 31 Gen 2019

Commentato:

il 31 Gen 2019

Community Treasure Hunt

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

Start Hunting!

Translated by