Effacer les filtres
Effacer les filtres

How to make a video from two arrays?

2 vues (au cours des 30 derniers jours)
TheBeginner
TheBeginner le 5 Juin 2013
Hi,
I have two arrays, one "image" 200x200xN (N number of images) and a curve N x [x y], ie N times a point.
I want to make a video which is the sum of the two arrays.
I already know how to make a video using avifile and by displaying the picture on a figure. I have used this method for this particular case, by displaying the two arrays on the same figure and using "hold on"," hold off".
I would like to know if I could do this without having to display the arrays on a figure.
Here's my code :
aviobj = avifile('example.avi','compression','None');
fig = figure;
for i=1:size(image,3) %image = 200x200xN arrays
imagesc(image(:,:,i));
hold on;
%vect is a N*2 arrays
plot(vect(:,1),vect(:,2),'r*','LineStyle','none'), axis ij;
hold off
f = getframe(fig);
aviobj = addframe(aviobj,f);
end
aviobj = close(aviobj);

Réponses (1)

Image Analyst
Image Analyst le 5 Juin 2013
Yes, you can use im2frame(), as I show in my demo: http://www.mathworks.com/matlabcentral/answers/77594#answer_87271

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by