⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resizetest.m

📁 Video IO toolbox for matlab. 用directshow做的
💻 M
字号:
function resizeTest(plugin)
%writeTests(plugin)
%  Checks to see if automatic resizing of images is working properly for a
%  given videoReader/videoWriter plugin using some quick heuristics.  
%
%Examples:
%  resizeTest
%  resizeTest ffmpegPopen2  % linux & similar
%  resizeTest ffmpegDirect  % ...if system's gcc is compatible w/ Matlab's
%  resizeTest DirectShow    % Windows

ienter

if nargin < 1, plugin = defaultVideoIOPlugin; end

W = 640;
H = 480;
fname = [tempname '.avi'];
try
  vw = videoWriter(fname, plugin, 'width',W, 'height',H);
  widths = 4:40:640;
  for i=1:length(widths)
    w = widths(i);
    frame = psychedelicFrame(w,w,i);
    addframe(vw, frame);
  end
  vw = close(vw);
  
  vr = videoReader(fname, plugin);
  info = getinfo(vr); %#ok<NASGU>
  vrassert W == info.width;
  vrassert H == info.height;
  vr = close(vr); %#ok<NASGU>
  
  delete(fname);
catch
  e = lasterror;
  try close(vw); catch end
  delete(fname);
  rethrow(e);
end

iexit

⌨️ 快捷键说明

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