from
Region of interest - GUI
by Omry Blum
The GUI panel lets you review a full movie before cropping and saving its images to disk
|
| [mov,V,cV]=Loadvid()
|
function [mov,V,cV]=Loadvid()
[pname,path]=uigetfile({'*.avi';'*.mp4';'*.mpg'});
fname=[path pname];
disp(fname)
V = VideoReader(fname);
nFrames = V.NumberOfFrames;
cV.Height=V.Height;
cV.Width=V.Width;
mov(1:nFrames) = struct('cdata', zeros(V.Height, V.Width, 3, 'uint8'),'colormap', []); % Preallocate movie structure
h=waitbar(0,'Loading Movie','name','Loading...');
for k = 1 : nFrames
mov(k).cdata = read(V, k); % Read one frame at a time.
if mod(k,10)==0
waitbar(k/nFrames);
end
end
delete(h);
end
|
|
Contact us