How do make the guide?

1 回表示 (過去 30 日間)
Marquel Dwi Putranto
Marquel Dwi Putranto 2016 年 3 月 18 日
編集済み: B.k Sumedha 2016 年 3 月 18 日
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?

回答 (1 件)

B.k Sumedha
B.k Sumedha 2016 年 3 月 18 日
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 件のコメント
Marquel Dwi Putranto
Marquel Dwi Putranto 2016 年 3 月 18 日
How Getsnapshot?
B.k Sumedha
B.k Sumedha 2016 年 3 月 18 日
編集済み: B.k Sumedha 2016 年 3 月 18 日
What do you mean by snapshot?
Snapshot can be taken when your trying a Live Video.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by