dofullread.m

来自「Video IO toolbox for matlab. 用directsho」· M 代码 · 共 31 行

M
31
字号
function images = doFullRead(varargin)%IMAGES=DOFULLREAD(...)%  Reads in an entire video into a 3D array where only the red channel is %  retained (just to make it easier).%%  Any arguments given are passed directly to the videoReader constructor.%%Examples:%  imgs = doFullRead;%  imgs = doFullRead('ffmpegPopen2');  % linux & similar%  imgs = doFullRead('ffmpegDirect');  % ...if system's gcc is compatible w/ Matlab's%  imgs = doFullRead('DirectShow');    % Windows%%Copyright (c) 2006 Gerald Dalley%See "MIT.txt" in the installation directory for licensing details (especially%when using this library on GNU/Linux). ienter('>>> doFullRead(''%s'',...)', varargin{1});vr = videoReader(varargin{:});info = getinfo(vr);images = uint8(zeros(info.height,info.width,info.numFrames));i=1;while (next(vr))  img = getframe(vr);  images(:,:,i) = img(:,:,1);  %imshow(img); drawnow; pause(0.001);  i = i+1;endvr = close(vr);iexit('<<< doFullRead(''%s'',...)', varargin{1});

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?