Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to obtain image frames from AVI file?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ross  
View profile  
 More options Nov 6 2007, 9:25 pm
Newsgroups: comp.soft-sys.matlab
From: "Ross " <ross.nospam.k...@yahoo.com>
Date: Wed, 7 Nov 2007 02:25:40 +0000 (UTC)
Local: Tues, Nov 6 2007 9:25 pm
Subject: How to obtain image frames from AVI file?
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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew  
View profile  
 More options Nov 6 2007, 11:05 pm
Newsgroups: comp.soft-sys.matlab
From: "Andrew " <awbsm...@itee.uq.edu.au>
Date: Wed, 7 Nov 2007 04:05:21 +0000 (UTC)
Local: Tues, Nov 6 2007 11:05 pm
Subject: Re: How to obtain image frames from AVI file?
You may have a problem since

a=aviread('movie.avi');

Should extract all of the frames.  If you look at the help
you can also add indexs for the frames you want, like

a = aviread('movie.avi', 1:5);

If the image colours aren't indexed you can convert them to
greyscale with rgb2gray (a.colormap will be empty)

Gray = rgb2gray(a(1).cdata);
figure; imagesc(Gray);
colormap(gray);

I haven't played with colour indexed images in Matlab
before though.

Cheers,
Andrew

"Ross " <ross.nospam.k...@yahoo.com> wrote in message

<fgr7n4$pg...@fred.mathworks.com>...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Haddad  
View profile  
 More options Nov 7 2007, 12:42 pm
Newsgroups: comp.soft-sys.matlab
From: Nick Haddad <nhad...@mathworks.com>
Date: Wed, 07 Nov 2007 12:42:48 -0500
Local: Wed, Nov 7 2007 12:42 pm
Subject: Re: How to obtain image frames from AVI file?
Ross,

If you are using MATLAB R2007a and later you can use the new mmreader
function to extract your frames and then convert the data to grayscale
using rgb2gray.  For example

% create an mmreader object
videoObject = mmreader('movie.avi');

% extract frames 1 through 5
imageData = read( videoObject, [1 5] );

% convert the data to grayscale
grayData = rgb2gray( imageData );

MMReader will also work on other video types, including mpeg-1 and
Windows Media video files.

-Nick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Tarkowski  
View profile  
 More options Nov 7 2007, 2:16 pm
Newsgroups: comp.soft-sys.matlab
From: Dave Tarkowski <dave.tarkow...@mathworks.com>
Date: Wed, 07 Nov 2007 14:16:50 -0500
Local: Wed, Nov 7 2007 2:16 pm
Subject: Re: How to obtain image frames from AVI file?

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ross  
View profile  
 More options Nov 8 2007, 9:29 pm
Newsgroups: comp.soft-sys.matlab
From: "Ross " <ross.nospam.k...@yahoo.com>
Date: Fri, 9 Nov 2007 02:29:30 +0000 (UTC)
Local: Thurs, Nov 8 2007 9:29 pm
Subject: Re: How to obtain image frames from AVI file?
Thank you all so much! That helps a lot.

I can now successfully extract and process frames for my
application.

Thanks again!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »