How do I generate a video from images that I create on MATLAB?

조회 수: 6 (최근 30일)
Amulya Kallakuri
Amulya Kallakuri 2017년 6월 11일
댓글: Image Analyst 2019년 11월 17일
I am generating a missile simulation input for which I created a sequence of images using an iterative for loop. The code starts with a single aerial image using which I have generated a sequence of images that make it seem like the image is rotating. I used campan, camzoom, camva and drawnow to consecutively display the sequence of images when I run the code. It looks like a video of an aerial image rotating when I run the code. My problem is, that I need to extract a video from these generated images, and save it on my computer to use as input for the missile simulator. Please help.

채택된 답변

Image Analyst
Image Analyst 2017년 6월 11일
  댓글 수: 3
Amulya Kallakuri
Amulya Kallakuri 2017년 6월 13일
Sir, my apologies. Your demo seems to resemble what I'm looking for. I shall try it out and get back to you. Many thanks.
Amulya Kallakuri
Amulya Kallakuri 2017년 6월 13일
Sir, this is one portion of the code I have. Now, I need to generate a similar video with the resultant images. Please help? Thank you.
A = imread('aerial.jpg');
imshow(A, 'InitialMagnification', 'fit')
camtarget([3300 1500 0])
for i = 10:-0.1:9
for j = 4:8
camzoom(j)
camva(i)
campan(1, 0)
drawnow
% imsave
end
end

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Stalin Samuel
Stalin Samuel 2017년 6월 11일
  댓글 수: 5
Sumera Yamin
Sumera Yamin 2019년 11월 16일
hi, i saw the FAQ in the link mentioned in yor answer, but i have a question about your code. is their any way to control timing of the video/transition time of images? e.g i want to use a small number of images 5-10 to make a 5-10 seconds animation, when i used your code, it gave me an animation for only 1 second, which was not what i wanted. thanks in adance for your help
Image Analyst
Image Analyst 2019년 11월 17일
There is a property of the video object created by VideoWriter that is FrameRate. Set it to the rate you want.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Camera Views에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by