%testear.m
function [sim,Rsnr]=testear(W,original,marcada);
% testear(W, original, marcada) returns in sim the value of similarity
% between W and the extracted watermark (the original image is needed % to perform this process)
% Returns the SNR value between the original and watermarked image in 
% Rsnr
 
ti = cputime;

% Similarity between original and watermarked
sim=coxdetect(original, marcada, W, .01, 1000);

% Process time
TiempoFinalSegundos = (cputime - ti)

% We compare the sim between W and other random vectors
response = comparesim(W,sim);

% We plot the results
plot(response);
UIWAIT

% Signal Noise Ratio 
Rsnr = SNR(original, marcada);
