How do make the guide?

1 view (last 30 days)
Marquel Dwi Putranto
Marquel Dwi Putranto on 18 Mar 2016
Edited: B.k Sumedha on 18 Mar 2016
1. After performing the Video (.avi) (Axes1)
proyek=guidata(gcbf);
axes(handles.axes1);
[a,b] = uigetfile('*.avi');
Vid = VideoReader (a);
VidFrame = read(Vid);
numFrame = get(Vid, 'NumberofFrames');
mov1(numFrame) = struct('cdata',[],'colormap',[]);
for i = 1:numFrame
f = VidFrame (:,:,:,i);
mov1(i).cdata=f;
mov1(i).colormap=[];
end;
movie(mov1,1);
set(proyek.figure1,'CurrentAxes',proyek.axes1);
set(imshow(Vid));
set(proyek.figure1,'Userdata',movie);
set(proyek.axes1,'Userdata',movie);
2. how to take images from Video?
3. then save the picture in the file
4. find a picture of the beginning and end of the save?
5. so appeared to Axes2 for pictures of the start and Axes3?

Answers (1)

B.k Sumedha
B.k Sumedha on 18 Mar 2016
I hope you are looking for something like this.
1) First create a folder named 'Frames'(without quotes) in your current directory.
Then you can do the following part :
close all
clear all
clc
delete('Frames\*.jpg');
[filename pathname] = uigetfile({'*.avi'},'Select A Video File');
I = VideoReader([pathname,filename]);
implay([pathname,filename]);
pause(3);
nFrames = I.numberofFrames;
vidHeight = I.Height;
vidWidth = I.Width;
mov(1:nFrames) = ...
struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),...
'colormap', []);
WantedFrames = 50;
for k = 1:WantedFrames
mov(k).cdata = read( I, k);
mov(k).cdata = imresize(mov(k).cdata,[256,256]);
imwrite(mov(k).cdata,['Frames\',num2str(k),'.jpg']);
end
  2 Comments
Marquel Dwi Putranto
Marquel Dwi Putranto on 18 Mar 2016
How Getsnapshot?
B.k Sumedha
B.k Sumedha on 18 Mar 2016
Edited: B.k Sumedha on 18 Mar 2016
What do you mean by snapshot?
Snapshot can be taken when your trying a Live Video.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!