Is it possible to add a timestamp watermark to my image in MATLAB 7.6 (R2008a) ?

9 views (last 30 days)
I would like to superpose a watermark of a timestamp onto my image matrix in MATLAB.
Using the TEXT command, which only works on Figures, does not work as well in my application because saving a figure adds unnecessary axis borders to my image. Rather, I would like to add the watermark directly in memory and then use IMWRITE to write a watermarked matrix to file.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The ability to add watermarks to images is not available in MATLAB.
To work around this issue, refer to a third-party application submitted on MathWorks File Exchange named 'text2im.m' in conjunction with the following example. The file can be located at:
<http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=19896>
The following is the example:
load clown
I = X;
imtext = text2im('foo bar',max(max(I))/2);
textImage = zeros(size(I));
imtextSize = size(imtext);
textImage(1:imtextSize(1),1:imtextSize(2)) = imtext;
I2 = I+textImage;
subplot(131),image(I),colormap(map),title('Original Image')
subplot(132),image(textImage),colormap(map),title('Watermark')
subplot(133),image(I2),colormap(map),title('Watermarked Image')
Note that MathWorks does not guarantee or warrant the use or content of these submissions. Any questions, issues, or complaints should be directed to the contributing author.

More Answers (0)

Products


Release

R2008a

Community Treasure Hunt

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

Start Hunting!