Required a robust watermarking code which against resizing
Show older comments
Hi everyone, i am final year student in computer science. Doing a watermarking project,embed a watermark - extract d watermark - and prevent it from attacks (just resize). I've found many algorithm, but many watermark embedded has lost after i resize it smaller or bigger.
here's my coding: Embed part
clear all; close all; clc;
[filename1]=uigetfile('*.bmp','Select the host image');
image1=imread(num2str(filename1));
imshow(image1); title('Original image');% orginal image for watermarking
[ori_row,ori_col]=size(image1);
host_length=ori_row*ori_col;
i=1;
j=1;
k=1;
[filename2,pathname]=uigetfile('*.*','Select the watermark image');
wmimage=imread(num2str(filename2));
[wm_row,wm_col] = size(wmimage);
imshow(wmimage); title('Watermark image');
wm=dec2bin(wmimage);
wm_length=wm_row*wm_col*8;
host=dec2bin(image1);
counter=0;
while i < host_length
counter=counter+1;
if counter > wm_length
break;
end
host(i,8)=wm(j,k);
k=k+1;
if k>8
k=1;
j=j+1;
end
i=i+1;
end
key1=wm_row;
key2=wm_col;
im1=bin2dec(host);
im1=reshape(im1,ori_row,ori_col);
image1(1:ori_row,1:ori_col)=im1(1:ori_row,1:ori_col);
display 'After embed';
imwrite(image1,'watermarked.bmp'); % saves the watermarked image as a bmp file
imshow(image1);title('Watermarked image');
*any recommended extraction code which still able to extract the watermark after i resize the watermarked image? Please~ *
Accepted Answer
More Answers (0)
Categories
Find more on Watermarking in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!