Error using frame2im Invalid movie: expected a structure

2 次查看(过去 30 天)
Hi all I have an avi movie. I use those code. What is wrong?
mov = VideoReader(videoname); frame = readFrame(mov); [img, ~] = frame2im(frame);
Error using frame2im Invalid movie: expected a structure
Thanks

回答(1 个)

Stephen23
Stephen23 2018-7-25
编辑:Stephen23 2018-7-25
As its documentation clearly states, the readframe function returns a numeric array already (i.e. an image), so you do not need frame2im at all. Remove frame2im from your code. frame2im is only required if you are using getframe (because it returns a structure).

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by