MATLAB Answers

Tomer
0

Video with horizontal lines

Asked by Tomer
on 27 Aug 2019
Latest activity Commented on by darova
on 8 Sep 2019
I have 2000 TIF images and I want to create a video with these images. I want to draw three horizontal lines and write some text that appears in all the frames of the video. Any help on how to do this?

  0 Comments

Sign in to comment.

1 Answer

darova
Answer by darova
on 27 Aug 2019
 Accepted Answer

Look for VideoWriter

  8 Comments

Tomer
on 1 Sep 2019
clc;clear all;
Images=dir('M:\Fish_Video\cam1\*.tif');
outDirectory='M:\Fish_Video\cam1_horizontal lines\';
aviobj = VideoWriter('test.avi');
aviobj.FrameRate = 1; % frames per second (speed)
open(aviobj);
for i = 1 : 100
I = imread([num2str(i), 'F.tif']); % read image
imshow(I) % show image
M = getframe;
writeVideo(aviobj,M); % add frame to video
% pause(1);
end
% get(aviobj)
close(aviobj);
darova
on 1 Sep 2019
You said that your images are: F_001, F_002, .......F_2000
This line means: 1F.tif, 2F.tif, ... 100F.tif
I = imread([num2str(i), 'F.tif']); % read image
Use this line
s = sprintf('%04dF.tif',i);
I = imread(s);
Show the error occurs
darova
on 8 Sep 2019
How it is going. Did this help?

Sign in to comment.