time stamp in video files (image to video file conversion)
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Turbulence Analysis
el 23 de En. de 2021
Comentada: Turbulence Analysis
el 23 de En. de 2021
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);
0 comentarios
Respuesta aceptada
Image Analyst
el 23 de En. de 2021
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.
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!