Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Load avi files

Subject: Load avi files

From: Torvald Helmer

Date: 07 Feb, 2008 11:26:03

Message: 1 of 7

I load an avi-file into matlab and it gets saved, in this
case, in a 1x170 struct. Each block/cell inside the struct
contains a cdata-field with 175x260x3 uint8.

How can I get this in a variable of 175x260x170 double?

Subject: Re: Load avi files

From: Malcolm Lidierth

Date: 07 Feb, 2008 11:41:04

Message: 2 of 7

Try
x=double(structname.fieldname);

Subject: Re: Load avi files

From: Malcolm Lidierth

Date: 07 Feb, 2008 11:50:03

Message: 3 of 7

That should be
x=double(structname(index).fieldname);

"Malcolm Lidierth" <ku.ca.lck@htreidil.mloclam> wrote in
message <foeqog$27i$1@fred.mathworks.com>...
> Try
> x=double(structname.fieldname);
>

Subject: Re: Load avi files

From: Yumnam Kirani Singh

Date: 07 Feb, 2008 12:13:42

Message: 4 of 7

Do you mean you have 170x175x260x3 data, i.e, 170 image color frames of size 175x260?

Subject: Re: Load avi files

From: Torvald Helmer

Date: 07 Feb, 2008 12:37:02

Message: 5 of 7

Yumnam Kirani Singh <kirani.singh@gmail.com> wrote in
message
<28418001.1202386452430.JavaMail.jakarta@nitrogen.mathforum.org>...
> Do you mean you have 170x175x260x3 data, i.e, 170 image
color frames of size 175x260?


That is correct! I have a true color-video of 170 frames,
with size 175x260...

This will further on be converted to binary-image...

Subject: Re: Load avi files

From: nor ki

Date: 07 Feb, 2008 14:03:07

Message: 6 of 7

"Torvald Helmer" <torvald.helmer@mathworks.com> wrote in
message <foeu1e$nir$1@fred.mathworks.com>...
> Yumnam Kirani Singh <kirani.singh@gmail.com> wrote in
> message
>
<28418001.1202386452430.JavaMail.jakarta@nitrogen.mathforum.org>...
> > Do you mean you have 170x175x260x3 data, i.e, 170 image
> color frames of size 175x260?
>
>
> That is correct! I have a true color-video of 170 frames,
> with size 175x260...
>
> This will further on be converted to binary-image...

avidata = aviread(avifile);
newdatadouble = double(avidata.cdata);


Subject: Re: Load avi files

From: Vihang Patil

Date: 07 Feb, 2008 16:48:02

Message: 7 of 7

"Torvald Helmer" <torvald.helmer@mathworks.com> wrote in
message <foepsb$j2o$1@fred.mathworks.com>...
> I load an avi-file into matlab and it gets saved, in this
> case, in a 1x170 struct. Each block/cell inside the struct
> contains a cdata-field with 175x260x3 uint8.
>
> How can I get this in a variable of 175x260x170 double?

You cannot get a RGB image in the above said format. You can
get it in 4-D format

ex:
D(:,:,:,1) = mov(1,1).cdata;
D(:,:,:,2) = mov(1,2).cdata; so on and so forth

If you are going to convert the RGB image into grayscale or
binary then its possibe to have them stored in mxnxp format
as follows

D(:,:,:,1) = rgb2gray(mov(1,1).cdata);
D(:,:,:,2) = rgb2gray(mov(1,2).cdata);

and then use
D1 = squeeze(D);


HTH
VIhang

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics