You are on page 1of 7

Volume-I, Issue-I (2012)

Implementation of Digital Watermarking Using MATLAB


Software
Karnpriya Vyas 1, Kirti Sethiya2, Sonu Jain 3
1

Dept. of Electronics & communication, RGPV


2
Dept. of Computer Engineering, GTU
3
Dept. of Computer science & Engineering, RGPV
1

kvyas1288@gmail.com, 2Sethiya.kirti@gmail.com, 3sonu.shine@gmail.com

Abstract: Digital watermarking holds significant promise as one of the keys to protecting proprietary digital content
in the coming years. It focuses on embedding information inside a digital object such that the embedded information
is in separable bound to the object. The proposed scheme has been implemented on MATLAB, as it is a high level
technical computing language and interactive environment for algorithm development, data visualization, data
analysis, and numerical computation. We wanted to know about how one can embed information in an image such
that he can later claim the ownership of that image by extracting back the embedded information. Hence, copyright
protection of images was our main motivation in starting this project. This paper includes, Implementation of
several watermarking algorithms and examines them in terms of how they meet the requirements of different
applications and general requirements of watermarking.
Keywords: MATLAB, Algorithms, Digital watermarking, Security

a process of embedding into a host signal a perceptually


transparent digital signature, carrying a message about the

I. INTRODUCTION
The advent of the Internet and the wide availability
of computers and printers make digital data exchange and
transmission a simple task. However, making digital data
accessible to others through networks also creates
opportunities for malicious parties to make salable copies
of copyrighted content without permission of the content
owner.
A digital watermark is an invisible signature embedded
inside an image to show authenticity and ownership. An
effective digital watermark should be perceptually invisible
to prevent obstruction of the original image. It should be
statistically invisible to prevent detection, and it should also
be robust to many image manipulations, such as filtering,
additive noise, and compression. Digital Watermarking is
the process of embedding information into digital
multimedia content such that the information (which we
call the watermark) can later be extracted or detected for a
variety of purposes including copy prevention and control.
Digital watermarking has been proposed as a new,
alternative method to enforce the intellectual property
rights and protect digital media from tampering. It involves

Signature is called the digital watermark. The digital


watermark contains data that can be used in various
applications, including digital rights management,
broadcast monitoring and tamper proofing. Although
perceptually transparent, the existence of the watermark is
indicated when watermarked media is passed through an
appropriate watermark detector. Figure 1.1 gives an
overview of the general watermarking system. A
watermark, which usually consists of a binary data
sequence, is inserted into the host signal in the watermark
embedder. Thus, a watermark embedder has two inputs;
one is the watermark message (usually accompanied by a
secret key) and the other is the host signal (e.g. image,
video clip, audio sequence etc.). The output of the
watermark embedder is the watermarked signal, which
cannot be perceptually discriminated from the host signal.
The watermarked signal is then usually recorded or
broadcasted and later presented to the watermark
detector. The detector determines whether the watermark
is present in the tested multimedia signal, and if so, what
1

COMPUSOFT, An international journal of advanced computer technology, 1 (1), 2012

2012, COMPUSOFT All Rights Reserved

message is encoded in it. The research area of


watermarking is closely related to the fields of information
hiding and steganography. The three fields have a
considerable overlap and many common technical
solutions. However, there are some fundamental
philosophical differences that influence the requirements
and therefore the design of a particular technical solution.
Information hiding (or data hiding) is a more general
area, encompassing a wider range of problems than the
watermarking. The term hiding refers to the process of
making the information imperceptible or keeping the
existence of the information secret. Steganography is a
word derived from the ancient Greek words steganos ,
which means covered and graphia, which in turn means
writing. It is an art of concealed communication. Therefore,
we can define watermarking systems as systems in which
the hidden message is related to the host signal and nonwatermarking systems in which the message is unrelated
to the host signal.

Each bit of the monochromatic watermark represents


embedding in each block as shown below if 0 is
encountered if
p(1,2)>p(2,1)
III. SOURCE CODE

Step 1:- Introduction window for watermarking. (Fig. 3.1)

Host Signal
Watermarked
Signal
Water
marker
Embedder

Detected Messege
Watermarker
Detector

Watermark Message

Digital watermarking has become an active and important


area of research, and development and commercialization
of watermarking techniques is being deemed essential to
help address some of the challenges faced by the rapid
proliferation of digital content.

Fig. 3.1

Fig. 3.2

function pushbutton1_Callback (hObject, eventdata, handles)

close main;
selectimage;

II. DESIGNING AND IMPLEMENTATION

Step 2:- Selection of image and convert image rgb to gray.


(Fig. 3.2)
2.1
ALGORITHM FOR COLORED IMAGES: We used
the middle band coefficient exchange algorithm as basis
for embedding and recovery of the watermark from colored
images.

function pushbutton2_Callback(hObject, eventdata, handles)

2.2
EMBEDDING ALGORTIHM: The watermark is
embedded separately in all color channels. A block of 8*8
is considered and frequency transformation (DCT) of each
block is done. For-loop for length of the watermark

function pushbutton3_Callback(hObject, eventdata, handles)

close selectimage;
rgbgray;
global img1;
[ans,pathname]=uigetfile(...%opens folder to select
input image

DCT for each block:


For red: p=dct2(image(j:j+blocksize-1,i:i+blocksize-1,1));
For green: p=dct2(image(j:j+blocksize-1,i:i+blocksize1,2));
For blue: p=dct2(image(j:j+blocksize-1,i:i+blocksize-1,3));

{'*.jpg';'*.jpeg'...
}, ...
'Select an IMAGE');
I=[pathname ans];
img1=imread([pathname ans]);
2

COMPUSOFT, An international journal of advanced computer technology, 1 (1), 2012

2012, COMPUSOFT All Rights Reserved

img1=imresize(img1,[160 160]);

close graybw;

imshow(img1)

finfface

function pushbutton4_Callback(hObject, eventdata, handles)

Step 4:- Crop image and provide binary co-ordinates.

global img1;

function pushbutton1_Callback(hObject, eventdata, handles)

clc

close finfface;

preview(vid) ;

cropimage;

pause
img=getsnapshot(vid);
camera

Step 5:- Show cropped image watermarking image to


watermark with another.

% acquiring of image from

function pushbutton1_Callback(hObject, eventdata, handles)

close cropimage;
step1;

Fig. 3.3
closepreview
delete(vid);
img1=imresize(img,[320 240]);

% size normalization

k=img1;
imshow(img1)
Step 3:- Convert image from gray scale to black and white.
function graybw_OpeningFcn(hObject, eventdata, handles,
varargin)
Fig. 3.6

global BW;

Fig. 3.7

global I;
BW=im2bw(I);

function pushbutton1_Callback(hObject,eventdata,handles)

imshow(BW)

close step1;
function pushbutton2_Callback(hObject, eventdata,
handles)
global img1;
[ans,pathname]=uigetfile( ...%opens folder to select
input image
{'*.jpg';'*.png';...
}, ...

Fig. 3.4

'Select an IMAGE');

Fig. 3.5

I=[pathname ans];

function pushbutton1_Callback(hObject, eventdata, handles)

img1=imread([pathname ans]);
3

COMPUSOFT, An international journal of advanced computer technology, 1 (1), 2012

2012, COMPUSOFT All Rights Reserved

imshow(img1)

Step 7: Selection to send either image or text.

Step 8:- Watermarked image and provide link to upload


image. (Fig. 3.9)

function step3_OpeningFcn(hObject, eventdata, handles,


varargin)

function pushbutton1_Callback(hObject, eventdata, handles)

close step5;

global img1;

web http://wikisend.com/

imshow(img1)
global ext_out

IV. SOURCE CODE FOR DEWATER MARKING

ext_out='bmp';

Step1:-Introduction window for de-watermarking.(Fig. 4.1)

function
pushbutton1_Callback(hObject,eventdata, handles)

Function pushbutton1_Callback(hObject, eventdata, handles)

close step3;

step1;

close main;

step5;
function
popupmenu1_Callback(hObject,eventdata, handles)
val = get(hObject,'Value');
str = get(hObject, 'String');
global img1;global img;global imgw;global ext_out;global I1;

ext_out='bmp';
switch str{val}
case 'TEXT'
case 'IMAGE'
watermark=I1;
[imgw]=watermark_img(img1,watermark) ;
imwrite(imgw,['watar_image' '.' ext_out],ext_out);

Fig. 4.1

Fig. 4.2

end
Step 2:- Image selection (Fig. 4.2)
function pushbutton1_Callback(hObject, eventdata, handles)

global img1;
[ans,pathname]=uigetfile( ...
{'*.bmp';...

}, ...

'Select an IMAGE');

I=[pathname ans];
img1=imread([pathname ans]);
imshow(img1
function pushbutton2_Callback(hObject, eventdata, handles)

close step1;
step3;
Step 3:- Extracting process. (Fig. 4.3)
function step3_OpeningFcn(hObject, eventdata, handles,
varargin)
Fig. 3.8

Fig. 3.9
4

COMPUSOFT, An international journal of advanced computer technology, 1 (1), 2012

2012, COMPUSOFT All Rights Reserved

global img1
axes(handles.axes1)
imshow (img1)
function
handles)

pushbutton1_Callback(hObject,

eventdata,

popupmenu1_Callback(hObject,

eventdata,

close step3;
step4;
function
handles)

Fig. 4.4

val = get(hObject,'Value');
str = get(hObject, 'String');

V. PROCESS STEPS FOR WATERMARKING

global img1;global img;global imgw;global ext_out;global I1;

Step 1:- Introduction window opens for watermarking.

switch str{val};
case 'TEXT'
st=dewatermark_k(img1);
set(handles.edit1,'visible','on')
set(handles.text2,'visible','on')
set(handles.edit1,'String',st)
case 'IMAGE'
img_logo=dewatermark_img(img1);
set(handles.axes2,'visible','on')
set(handles.text3,'visible','on')
axes(handles.axes2)
imshow(img_logo)
imwrite(img_logo,'hidden.jpg')
end

Fig. 5.1

Fig. 5.2

Step 2:- selection window opens and ask for select image
source. It has two options either from folder or camera. If
we select folder then open the folder of computer to select
the image. In second option Camera we can capture
image at a time from the web camera.

Step 3:- In this step next window opens which provide


gray scale image of original image. In this stage image
converts from 3D to 2D image.

Fig. 4.3
Step 4:- Dewatermarked image.

function pushbutton1_Callback(hObject, eventdata, handles)

Step 4:- In this step next window opens and convert


grayscale image to black & white image.
5

COMPUSOFT, An international journal of advanced computer technology, 1 (1), 2012

2012, COMPUSOFT All Rights Reserved

Step 7:- Provide next window to select another image from


the folder to watermark.

Fig. 5.7

Step: 8- Provide selection either for image or text to


watermark, and then watermarked both the images.
Embedded cropped image in to the image selected from
folder.

Fig. 5.3

Fig. 5.4

Step 5:- Find face in gray scale image and after cropping
located the area for crop.
Fig. 5.8

VI. PROCESS STEPS FOR DEWATER MARKING


Step 1:- Introduction window opens for dewatermarking.

Fig. 5.5
Step 6:- In this step window shows the finally cropped
image.
Fig. 6.1
Step 2:-Provide next window to select another image from
the folder to watermark.

Fig. 5.6
Fig. 6.2
6

COMPUSOFT, An international journal of advanced computer technology, 1 (1), 2012

2012, COMPUSOFT All Rights Reserved

VIII. REFERENCES
Step 3:- Provide next window to select another image from
the folder to watermark.

[1] Wang, Y., Alan Pearmain., 2004. Blind image data


hiding based on self reference. Pattern Recognition Letters
25, pp. 1681-1689.
[2] Barni, M., Bartolini, M., Piva, F.V., 2001. Improved
wavelet based watermarking through pixel-wise masking.
IEEE Transactions on Image Processing 10, pp. 783-791.
[3] Lee, C., Lee, H., 2005. Geometric attack resistant
watermarking in wavelet transforms domain, Optics
Express vol.13, no.4, and pp.1307-1321.
[4] Chandra Mohan B, Srinivas Kumar S, Chatterjee B.N.,
2006. Digital Image watermarking in dual domains at IET
Visual Information Engineering, VIE 2006 at Leela Palace,
Bangalore, 26-28th September 2006.

Fig. 6.3
Step 4:- final dewater marked image.

Fig. 6.4

VII. CONCLUSION
Digital watermarking holds significant promise as one of
the keys to protecting proprietary digital content in the
coming years. It focuses on embedding information inside a
digital object such that the embedded information is in
separable bound to the object. Tampering with the
watermark or otherwise altering a watermarked object
should always be detectable, and attempting to remove a
watermark from its object should cause to be that object
useless. Currently, watermarking suffers from several
drawbacks that prevent it from providing the creators of
digital content with a solid guarantee of copyright
protection.
The watermarking research is progressing very fast and
numerous researchers from various fields are focusing to
develop some workable scheme. Different companies also
working to get commercial products. We hope some
commercial and effective schemes will be available in
future.