-1

I have a problem extracting watermark using SVD.

Here is my code:

clc
close all;
a=0.0010
I=imread('citra.jpg'); %Image Host
I=rgb2gray(I);
II=im2double(I);
[U,S,V]=svd(II);
M=imread('logoUPN.jpg'); %Image Watermark
M=rgb2gray(M)
W=im2double(M);
%Embedding St = S + a * W;
AW = U * St * V';
imwrite(AW,'watermarked.jpg');
%Extract IW =imread('watermarked.jpg'); WW = im2double(IW);
ST=U' * WW * V;
Ww=(ST-Siga)/a;
figure,imshow(AW);
figure,imshow(Ww);

Extracting image is blurry and not clear. I want to make two menu embedding and extraction.

Matt
  • 14,906
  • 27
  • 99
  • 149
Ghora
  • 1

2 Answers2

0

For extracting watermark use [UT ST VT] = svd(WW) instead of ST=U' * WW * V and then use this ST value to extract watermark.

Nikesh Patel
  • 521
  • 1
  • 5
  • 13
0

Here S is an diagonal matrix and other two are the respective left and right singular vectors which follows the rule USV'. To get the S value we can't apply the reverse multiplication. So need to write [U S V]=SVD(WW) in place of expression.