Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

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: 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: 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: 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

No tags are associated with this thread.

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.

Contact us