How do make the guide?

2 vues (au cours des 30 derniers jours)
Marquel Dwi Putranto
Marquel Dwi Putranto le 18 Mar 2016
Modifié(e) : B.k Sumedha le 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?

Réponses (1)

B.k Sumedha
B.k Sumedha le 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 commentaires
Marquel Dwi Putranto
Marquel Dwi Putranto le 18 Mar 2016
How Getsnapshot?
B.k Sumedha
B.k Sumedha le 18 Mar 2016
Modifié(e) : B.k Sumedha le 18 Mar 2016
What do you mean by snapshot?
Snapshot can be taken when your trying a Live Video.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by