Info

此问题已关闭。 请重新打开它进行编辑或回答。

can someone tell me how to fix this matlab code in frames

1 次查看(过去 30 天)
clear data
disp ('input video');% "input video"
avi = VideoReader('DSCN0928.avi');% avi: MATLAB movie structure
video = readFrame(avi);% CDATA: M x N x 3 matrix used to represent the true color image
for a = 1: length (video)% length (video) said the number of frames of this video
imshow (video {a})% in order of the number of frames to display image
DrawNow; end
the error i get is Cell contents reference from a non-cell array object.
Error in cdata2 (line 11) imshow (video {a})% in order of the number of frames to display image
i'm using matlab 2015a version.

回答(1 个)

Image Analyst
Image Analyst 2015-9-21
Try this:
videoObject = VideoReader(movieFullFileName)
% Extract the frame from the movie structure.
thisFrame = read(videoObject, frameNumber);
% Display it in the current axes.
imshow(thisFrame);

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by