MATLAB: Splitting a video into frames using image function after using mmreader to read video file…

image analysisimage functionimage processing

*I wasn't being able to bring an avi file into the workspace, so I brought the video into the MATLAB file and played it using implay…then I want to split it into its individual frames..
According to the solution by Walter Roberson on
n=size('cell.avi')
n =
1 8
for frame= 1:n
('cell.avi')(frame)=getframe;
|
But I get_ :Error: Unbalanced or unexpected parenthesis or bracket.
_
image function!!*
Now I want the individual frames as individual images, so I put: image(('cell.avi')(1).cdata) image(('cell.avi')(1).cdata) | *Error: Unbalanced or unexpected parenthesis or bracket. * *What is wrong? I've been able to load the movie, but now I can't split it into the frames using

Best Answer

Look at the help for mmreader() . . . again . . . more carefully this time. You'll see read() does not take a string, it take the movie object, and the number of the frame you want to read. So instead of
video = read('cell.avi');
you'd want
% Read from ii from movie M
oneFrame = read(M, ii);
Related Question