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

Thread Subject: Efficient method to make a movie from a set of images

Subject: Efficient method to make a movie from a set of images

From: Raj

Date: 22 Dec, 2007 05:37:48

Message: 1 of 4

Hi!

Could somebody tell me what is the efficient way to make a movie from
a set of images in Matlab?

Thanks,

Raj

Subject: Re: Efficient method to make a movie from a set of images

From: Scott

Date: 22 Dec, 2007 18:15:58

Message: 2 of 4

Raj <rajanikanth@gmail.com> wrote in message <c9e5a834-8d3c-
4b14-8df2-9fb2be9927bc@v4g2000hsf.googlegroups.com>...
> Hi!
>
> Could somebody tell me what is the efficient way to make
a movie from
> a set of images in Matlab?
>
> Thanks,
>
> Raj

Raj,

Here is a short movie creation demo. It requires
mpgwrite.dll which is available in the file exchange. Just
drop mgpwrite.dll into the directory where you are creating
movies:

% create some image data
[X Y Z] = sphere(25);
sz = size(Z);
C = rand(sz(1),sz(2),3);

% stitch data to wrap color around sphere
C(:,end,:) = C(:,1,:);

% render an image
figure('color',[0 0 0]);
sp = surf(X,Y,Z,C,'FaceColor','interp',...
    'FaceLighting','phong');
material shiny
axis off vis3d
cl = camlight('right');
camzoom(1.5)
set(sp,'edgecolor','none');
drawnow

% setup the rotation vector for the movie
view_vect_yaw = [-180:3:180];
sz_vect = size(view_vect_yaw);

% "lights, camera, action!"
for f = 1:sz_vect(2)
    % set the view, reset light position and render
    view([view_vect_yaw(f) 15]);
    camlight(cl,'right')
    drawnow
    % grab a frame
    m(f) = getframe(gcf);
end
% format frames as mpeg and write to file
mpgwrite(m,C,'my_movie.mpg',...
    [1, 0, 1, 0, 10, 1, 1, 1]);
% end of code

hth,
Scott

Subject: Re: Efficient method to make a movie from a set of images

From: Vihang Patil

Date: 25 Dec, 2007 06:44:01

Message: 3 of 4

Raj <rajanikanth@gmail.com> wrote in message
<c9e5a834-8d3c-4b14-8df2-9fb2be9927bc@v4g2000hsf.googlegroups.com>...
> Hi!
>
> Could somebody tell me what is the efficient way to make a
movie from
> a set of images in Matlab?
>
> Thanks,
>
> Raj


doc im2frame
and
doc movie2avi

HTH
Vihang

Subject: Re: Efficient method to make a movie from a set of images

From: Raj

Date: 27 Dec, 2007 01:56:21

Message: 4 of 4

Thanks for your replies. I need to make each figure(frame) in the
movie with discrete data and I need the points with different colors.
For example:

hold on;
        [m, n] = find(manipu == 0);
            plot(m,n,'.w');
       [m,n] = find(manipu == 45);
                plot(m,n,'.y');

However, the problem with this is that the second plot command is over-
writing the previous color. Is there anyway to make this work?

Thanks,
Raj

On Dec 24, 11:44 pm, "Vihang Patil" <vihang_pa...@yahoo.com> wrote:
> Raj<rajanika...@gmail.com> wrote in message
>
> <c9e5a834-8d3c-4b14-8df2-9fb2be992...@v4g2000hsf.googlegroups.com>...
>
> > Hi!
>
> > Could somebody tell me what is the efficient way to make a
> movie from
> > a set of images in Matlab?
>
> > Thanks,
>
> >Raj
>
> doc im2frame
> and
> doc movie2avi
>
> 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