time stamp in video files (image to video file conversion)

11 ビュー (過去 30 日間)
Turbulence Analysis
Turbulence Analysis 2021 年 1 月 23 日
Hi,
I a making video file from set of 500 .bmp image files, the time gap between each image is 0.0002 sec. Here, I would like to add time stamp in my video, please help me with this.. I am using the below standard code for image to video conversion
myFolder = 'Y:\Processing\';
if ~isdir(myFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder);
uiwait(warndlg(errorMessage));
return;
end
filePattern = fullfile(myFolder, '*.bmp');
Files = dir(filePattern);
writerObj = VideoWriter('video1');
writerObj.FrameRate = 5;
open(writerObj);
for frameNumber = 1 : length(Files)
baseFileName = pngFiles(frameNumber).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
thisimage = imread(fullFileName);
imshow(thisimage);
drawnow;
writeVideo(writerObj, thisimage);
end
close(writerObj);

採用された回答

Image Analyst
Image Analyst 2021 年 1 月 23 日
If you have the Computer Vision Toolbox, use insertText().
If not, you have to use text() and then getframe() but the image size will be changed (since it's a screenshot) so then you need to follow that by imresize() to resize it back to the original size.

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by