Ross wrote:
> I'm trying to extract a certain set of image frames from a
> movie file.
> So far, I know how to use aviread to read the avi file into
> matlab memory. I also know how to use frame2im to obtain a
> single desired frame from the matlab file and then convert
> it into a grayscale image.
> However, I don't how to obtain a range of frames.
> After I run
> a=aviread('movie.avi')
> Is there any function/code that will let me extract either
> all the image frames from the movie or a section of the
> image frames?
> Also, I need the image frames to be grayscale.
> Thanks
You can read a range of frames using aviread. To read frames 10 through
93 you would use:
a = aviread('movie.avi', 10:93);
You can then convert the data into image data and convert those images
into grayscale images.
If you are using R2007b on Windows, you can also use the new MMREADER
functionality:
mov = mmreader('movie.avi');
data = read(mov, [10 93]);
would do the same as the AVIREAD command above except that you do not
need to use frame2im with the output of MMREADER. Also, MMREADER is
more robust and can read a larger variety of file types than AVIREAD.
-Dave Tarkowski