Syllabus Description
Notes collected from MANE 6962: Experimental Mechanics, from the fall of 2018.
Summary from course catalog
warning('off','Images:initSize:adjustingMag')
frequency = 1000;
v = VideoReader('IMG_9235.mov');
video = read(v,1);
[z,rect] = imcrop(video);
filename = 'sampleD.gif';
%newimg = zeros(size(z,1),size(z,2),size(z,3),length(1:frequency:v.FrameRate*v.Duration));
h = figure;
for n = 1:frequency:v.FrameRate*v.Duration
video_frame = read(v,n);
video_frame = imcrop(video_frame,rect);
%newimg(:,:,:,i)= video_frame;
imshow(video_frame)
frame = getframe(h);
im = frame2im(frame);
[imind,cm] = rgb2ind(im,256);
% Write to the GIF File
if n == 1
imwrite(imind,cm,filename,'gif', 'Loopcount',inf);
else
imwrite(imind,cm,filename,'gif','WriteMode','append');
end
end







Last updated