필터 지우기
필터 지우기

How to make a video from two arrays?

조회 수: 2 (최근 30일)
TheBeginner
TheBeginner 2013년 6월 5일
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);

답변 (1개)

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

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by