Video processing question RE zeros function

1 view (last 30 days)
Hello all.
I've got the below code modified from a tutorial, it takes a video, breaks it up into frames then reassembles it, I understand how most of it works except for the zeros function part.
I understand that it is making an array of zeros or at least a series of arrays of zeros? however I'm not sure how this relates to the actual program itself apart from it having something to do with the size of an individual frame and have no idea what the class function at the end is for or even how many different kinds of arrays that particular function makes.
At the moment I am just trying to get my head around the simplest part of the program before modifying the "for" section.
Can anyone with a bit more experience actually explain to me what that part of the program actually does.
%basics
clc
Grapefruit = VideoReader('Grapefruit.mp4')
nframes = get(Grapefruit, 'NumberOfFrames');
I = read(Grapefruit, 1);
TaggedFruit = zeros([size(I,1) size(I,2) 3 nframes], class(I));
for k = 1 : nframes
Frame = read(Grapefruit, k);
TaggedFruit(:,:,:,k) = Frame;
end
frameRate = get(Grapefruit,'FrameRate');
implay(TaggedFruit,frameRate);

Answers (0)

Community Treasure Hunt

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

Start Hunting!