Hi,
Task: I have been tasked to come up with a MATLAB script that takes tiff images in a folder and creates a movie from them.
Details: There are hundreds of folders, each containing two subfolders, that contain hundreds of images each. I need the script to… >Go into folder 1 >Go into subfolder A >Create a video using the hundreds of images there and save it in the folder >Go back out to folder 1 >Go into subfolder B >Create video like above >Go back out and into folder 2 and so on until it has gone through all of the folders.
I know… this is a big job
Problems: I created a folder on my desktop and downloaded pictures of numbers 1-10 as samples. I found a script that will go into that folder and create a video from the images. But that's it. I don't know if the video is created or saved anywhere, and all the viewer shows is the single images that are in the folder.
Here's the code I used… found it on here and linked to a video explaining it.
clear allclose allclcframesPerSec = Enter #;movie_name = ('Enter name');aviobj = avifile(movie_name,'fps',framesPerSec); dname = ('C/blah/blah);top_file = [dname '\']; ls_top_file = ls(top_file); c = cellstr(ls_top_file); cc = c(3:length(c)); S = size(cc); a = 1; while a <= S(1) close all file = char(cellstr([top_file char(cc(a))])); data_n = char(cc(a)) file_name = char(cc(a)); figure fileToRead2 = [dname '\' file_name]; imshow((fileToRead2)) axis tight hold off h = getframe(gcf); aviobj = addframe(aviobj,h); a = a+1; endh = getframe(gcf); aviobj = addframe(aviobj,h); aviobj = close(aviobj);
Any tips on where to look, as I'm sure there are bits to my question that have been asked on here before.
Best Answer