Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Loading & altering .avi file into Matlab

6 views
Skip to first unread message

David

unread,
Sep 2, 2010, 5:19:21 PM9/2/10
to
Hi,
I am new to Matlab and have been struggling for the last several days to load a movie into Matlab 2010a (Mac OSX) in order to convert it to grayscale and resize it.
I attempted to import the .avi file into Matlab, using: a = mmreader('filename.avi'). This seemed to work as the basic file data was displayed (e.g., number of frames, pixel w x h).
However, when trying to use the imresize() [e.g., imresize(a, 0.5)] or rgb2gray functions, I get an error stating that the file should be one of the following: double, single, uint8 ......
When opening the movie using implay() & examining 'Video Information', the data source of the movie is 'uint8' so I am not sure what the problem is.
This may be a simple fix, but as I said, I am new to Matlab. Any suggestions? Is this a problem with loading the movie initially? Do I have to convert it to another file type before using imresize or rgb2gray? I've looked through old posts and nothing is clicking, so thanks for the help!
Dave

Image Analyst

unread,
Sep 2, 2010, 10:15:07 PM9/2/10
to
David
You need to extract out each frame, convert it to monochrome with rgb2gray, then resize with imresize, then put the new frame back into a movie and write it out.

Govind Chowdhari

unread,
Feb 10, 2011, 8:34:04 AM2/10/11
to
"Image Analyst" wrote in message <i5plnb$q4n$1...@fred.mathworks.com>...

> David
> You need to extract out each frame, convert it to monochrome with rgb2gray, then resize with imresize, then put the new frame back into a movie and write it out.


But what about the audio component. I guess it is lost. How to retain the audio component?

0 new messages