I am trying to make a function that takes in a movie (.AVI) and produce series of images (.TIF).
I know that I can use this in the command line:
obj = VideoReader('movie.m');
vid = read(obj);
frames = obj.NumberOfFrames;
for x = 1 : frames
imwrite(vid(:,:,:,x),strcat('frame-',num2str(x),'.tif'));
end
How do I make it into a function that inputs a movie and generate a series of tif images?
For example, I have a function that, when executed, generates "movie.avi" into the current folder. I want a function avitotif(movie.avi), that takes movie.avi and make series of tif images.
Thank you