image thumbnail

Simple StopMotion Film Studio

by

 

Capture frames from image aquisition devices and create your own stop motion animation.

AviSettings
function AviSettings

%% Global parameters

global Video Settings Objects

str(1) = {Settings.DeviceID};
str(2) = {num2str(Settings.Adaptor)};
str(3) = {num2str(Settings.FPS)};
str(4) = {num2str(Settings.Quality)};
str(5) = {Settings.Title};
str(6) = {Settings.AviOut};
str(7) = {num2str(Settings.Capture)};
str(8) = {num2str(Settings.Interval)};
str(9) = {num2str(Settings.SceneLength)};


%% Frame ID
answer = inputdlg({'Device ID','Adaptor','Frames per second','Output quality',...
    'Film Title','Avi filename','Number of frames per capture','Capture interval (seconds)','Scene Length (seconds'},'Settings',[1,32; 1,32; 1,32; 1,32; 1,32; 2,32; 1,32; 1,32; 1,32],str);

%% Update Settings
Settings.DeviceID       = char(answer(1));
Settings.Adaptor        = str2double(char(answer(2)));
Settings.FPS            = str2double(char(answer(3)));
Settings.Quality        = str2double(char(answer(4)));
Settings.Title          = char(answer(5));
Settings.AviOut         = char(answer(6));
Settings.Capture        = str2double(char(answer(7)));
Settings.Interval       = str2double(char(answer(8)));
Settings.SceneLength    = str2double(char(answer(8)));

%% Update camera
Video = videoinput('winvideo', Settings.Adaptor, Settings.DeviceID);

set(gcf,'CurrentAxes',Objects.LiveView);
cla; hold on; stop(Video);
Video.ReturnedColorSpace = 'rgb';
Video.FramesPerTrigger = 1;
vidRes = get(Video, 'VideoResolution'); 
nBands = get(Video, 'NumberOfBands');

% Background image
Objects.LiveViewFrameA = image(ones(vidRes(2), vidRes(1), nBands));

% Live View
Objects.LiveViewFrameB = image(zeros(vidRes(2), vidRes(1), nBands));
preview(Video,Objects.LiveViewFrameB);
preview(Video,Objects.LiveViewFrameB);

%% Update view
SetFrames;




Contact us