Please help...Use Matlab to create a digital video slide show using pictures fro
ID: 2249393 • Letter: P
Question
Please help...Use Matlab to create a digital video slide show using pictures from google...etc.
Project 2: Digital Video Slideshow Due: 11/7/17 by 2:00 PM You will prepare a MATLAB program that generates a slide show. Your program will also create a video from the slide show. The video will show the slides, one after the other, from beginning to end. The video will be stored in an MPEG-4 file (having a filename of the form .mp4). You will also prepare a document that explains the story of your video.Explanation / Answer
clear all; close all;
%%%%%%%%%__CREATING A SLIDE SHOW___%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-------Store all the imput images in the current folder and store all the input images in the array of strings "input_image_list"----%
input_image_list=char('img1.png','img2.png','img3.png','img4.png','img5.png','img6.png','img7.png','img8.png');
pause on;
%-----Now show all the image one by one like a slide show-----%
%-----Use for loop to loop over all the images in the list of input images---%
for i=1:size(input_image_list,1)
a=imread(input_image_list(i,:));
imshow(a);
drawnow;
pause(1);
end
%%%%%%__CREATING A VIDEO___%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----Create a video writer Object as shown below---%
% video_Obj = VideoWriter('video.mp4','MPEG-4'); <<--use the mp4 profile if you OS/MATLAB version supports this format,
% Other wise let it use the default format
video_Obj = VideoWriter('video.mp4');
video_Obj.FrameRate = 1;
%-----Adjust the number of seconds per image according to your wish----%
no_of_secs_per_frame = [5 10 15 20 25 30 35 40];
% open the Object---%
open(video_Obj);
% Now loop over all the images and convert them to the frames of the video.mp4---%
for i=1:size(input_image_list,1)
input_image=imread(input_image_list(i,:));
% First convert the image to a the form of a 'frame'---%
frame = im2frame(input_image);
for numSecs=1:no_of_secs_per_frame(i)
writeVideo(video_Obj, frame);
end
end
% close the writer object
close(video_Obj);