我嘗試使用MATLAB 2016a讀取AVI視頻,但我得到以下問題:未定義的函數或變量「mmreader」
未定義功能可按或變量「mmreader」; 的代碼如下:
clc;
clear;
%% this to read avi by using mmread to get every frame
video = mmreader('D:\My Documents\MATLAB\My\fire.avi');
nFrames = video.NumberOfFrames;
H = video.Height;
W = video.Width;
Rate = video.FrameRate;
% Preallocate movie structure.
mov(1:nFrames) = struct('cdata',zeros(H,W,3,'uint8'),'colormap',[]);
%read one frame every time
for i = 1:nFrames
mov(i).cdata = read(video,i);
P = mov(i).cdata;
disp('current frame number:'),disp(i);
imshow(P),title('original picture');
% P2=rgb2gray(P);
end
爲什麼?任何人都可以幫我嗎?提前致謝。
如果您以英文發佈代碼和錯誤消息,您將更有可能獲得幫助 –