How can I remove this error?

TestVideo = mmreader('video\firel.mpeg');
img0 = read(TestVideo,855); %1455
figure, imshow (img0);
imgl = read(TestVideo,1056); %1456
figure, imgshow(imgl);
img2 = read(TestVideo,1157); %1457
figure, imshow(img2);
img3 = read(TestVideo,1358); %l458
figure, imshow(img3);
Error-
Undefined function or variable 'mmreader'.
Error in Untitled6 (line 5)
TestVideo = mmreader('video\firel.mpeg');

回答 (1 件)

Image Analyst
Image Analyst 2018 年 5 月 1 日

0 投票

Use VideoReader() instead of mmreader.

5 件のコメント

Anuradha Killedar
Anuradha Killedar 2018 年 5 月 1 日
then I'am getting this error-
Error using VideoReader/init (line 601) The filename specified was not found in the MATLAB path.
Error in VideoReader (line 171) obj.init(fileName);
Error in Untitled6 (line 5) TestVideo = VideoReader('video\firel.mpeg');
Guillaume
Guillaume 2018 年 5 月 1 日
Well, that error is very clear: The filename specified was not found in the MATLAB path.
Your video file was not found. The simplest way to solve that error is to give an absolute path rather than a relative one.
Walter Roberson
Walter Roberson 2018 年 5 月 3 日
Your video has fewer than 1456 frames
Guillaume
Guillaume 2018 年 5 月 3 日
編集済み: Guillaume 2018 年 5 月 3 日
Once again, the error message is very clear, matlab does not know a DetectFire function. Whether you've downloaded it or written it yourself, the function file needs to be in a folder visible by matlab (the current folder would do).
Debugging by forum is really not the most efficient way of doing this. Learn to understand what the error messages are telling you.
Guillaume
Guillaume 2018 年 5 月 3 日
For info and so some of the comments above make sense, Anuradha deleted several of his comments, one where he was showing an error that was clearly due to trying to access more frames than exist in the video, the other where he was showing an error stating unknown function or variable DetectFire.

サインインしてコメントする。

質問済み:

2018 年 5 月 1 日

コメント済み:

2018 年 5 月 3 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by