How can I convert a video frame into a data image knowing that using getframe is unnecessary?

4 views (last 30 days)
I'm using Matlab R2010a and I need to convert a video frame into an image for further treatment concerning the image but an error is always here:
??? Error using ==> frame2im
Argument must be a valid movie matrix from GETFRAME
In my case I don't need getframe. So how can I do? A part of the code is the following:
v= mmreader('news.avi');
framedata= read(v,1);
I1=frame2im(framedata);
I1=imresize(I1,[128 128]);
Please can someone help me thanks
  5 Comments
Geoff Hayes
Geoff Hayes on 29 Aug 2016
Sam - please clarify the data type and dimensions of framedata. Also, why doesn't your above code work? If you are observing an error, then please copy and paste the full error message to your question.
sam
sam on 29 Aug 2016
Framedata: type: a frame dimensions [512,512]
The error: ??? Error using ==> frame2im Argument must be a valid movie matrix from GETFRAME

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 29 Aug 2016
v = mmreader('news.avi');
framedata = read(v,1);
I1 = framedata;
I1 = imresize(I1,[128 128]);

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!