% marcar.m
% marcar calls CoxWmk function to insert a watermark (saved
% as marcaW.mat) 
% marcaW is an enviroment variable where W is defined
load marcaW
n=size(W,2);
alpha = 0.01;

t = cputime;

% Name of the image to be watermarked
nomI='chasque1.jpg'
% Name of the watermarked image
nomImarcada='imach1cox2.bmp';

% Read the original image
[I,MAP]=imread(nomI);

% Watermark the image
J=coxwmk(I,alpha,n,W);

% Save the image
if (isrgb(I))
    imwrite(J,nomImarcada);
else
    imwrite(J,MAP,nomImarcada);
end

% Process time
TiempoFinalSegundos = (cputime - t)
