www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/@mbcfoundation/@diskImageSeq/getFrame.m

    function [ framedata ] = getFrame( h, framenum )
%GETFRAME Retrieve a single frame from an image sequence
%
%  DATA = GETFRAME(H, FRAMENUM)
%

%  Copyright 2000-2008 The MathWorks, Inc. and Ford Global Technologies, Inc.



if (framenum <= h.numImages) && (framenum > 0)
    if ~isempty(h.imageRootLocation)
        fileloc = fullfile(h.imageRootLocation, h.imageFiles{framenum});
    else
        fileloc =  h.imageFiles{framenum};
    end
    if ~isempty(h.imageFormat)
        framedata = imread(fileloc, h.imageFormat);
    else 
        framedata = imread(fileloc);
    end
else
    framedata = [];
end