⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 movie_from_frames.m

📁 将一系列图象转换成avi电影
💻 M
字号:
%This function makes a simple avi movie from a sequence of frames
%The user can control the display time of each frame. The movie is created
%in the same folder where this function is run.
%
%Usage:
%      Inputs:          
%             name: root name of the framse 
%         filetype: '.bmp'   ,  '.jpg'  , '.jpeg' , '.tif'  ,,,,
% number_of_frames: number of the frames
% display_time_of_frame: it is the display time of each frame  
%           
%           Output:
%  it creates a file named as Movie.avi in the same folder of this function
%           
%            Usage: Try the simple provided example
%   Movie_from_frames('image','.bmp',4,10)
%This function is written by :
%                             Nassim Khaled
%                             American University of Beirut
%                             Research Assistant and Masters Student


function Movie_from_frames(name,filetype,number_of_frames,display_time_of_frame)
mov = avifile('MOVIE.avi');
count=0;
for i=1:number_of_frames
    name1=strcat(name,num2str(i),filetype);
    a=imread(name1);
    while count<display_time_of_frame
        count=count+1;
        imshow(a);
        F=getframe(gca);
        mov=addframe(mov,F);
    end
    count=0;
end
close all
mov=close(mov);
    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -