How do I create a video from an image being rotated?
Show older comments
I am trying to create a video by combining an image that is being rotated. The code gives me an .avi file, but the image is not rotating.
FPS=24;
time=10;
theta=1;
degPerFrame=10;
movie=VideoWriter('spinspokes.avi'); %create new video file
open(movie);
for i=1:FPS*time
B=imread('spokes.tif'); %open image file
writeVideo(movie,B);
pause(0.01)
theta=theta+degPerFrame;
B=imrotate(B,theta,'bilinear','crop'); %rotate image
end
close(movie);
implay('spinspokes.avi')
Accepted Answer
More Answers (0)
Categories
Find more on Video Formats and Interfaces in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!