How can I overlay a timestamp onto an image?

6 views (last 30 days)
Jihun
Jihun on 19 Mar 2013
Thus far, I've tried creating a timestamp, making it into an image using code from http://www.mathworks.com/matlabcentral/fileexchange/25772 and overlaying it using the following code:
get timestamp
datetime = clock; % get date and time
imgName = [num2str(datetime(2),'%.02i') num2str(datetime(3),'%.02i') num2str(datetime(1)-2000,'%.02i')];
imgName = [imgName '_' num2str(datetime(4),'%.02i') '-' num2str(datetime(5),'%.02i') '-' num2str(datetime(6))];
%overlay timestamp onto image
obj = Other_MEM_Text2Im(imgName, 342, 20, [1 1 1]);
scene = img_out;
result = scene;
rowshift = 0;
colshift = 0;
result((1:size(obj,1))+rowshift, (1:size(obj,2))+colshift, :) = obj;
img_out = result;
However, whenever I run this code, the timestamp image doesn't show up at all. Is there any way to get the timestamp image to show up? Or another way to get the image with a timestamp on it? Thank you!

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!