Вы находитесь на странице: 1из 8

Digital Watermarking Technique for Protecting Digital Images

Munesh Chandra", Shikha Pandel, Rama Chaudharl


aI.M.S, Ghaziabad, b R.K.G. I.T, Ghaziabad
a,bGhaziabad, India
munesh.trivedi@gmail.com

Abstract-Internet evolution, along with the advancement of How robust does it need to be?
digital multimedia tools have create a major impact in Why and when are digital watermarks necessary?
making the storage and distribution of multimedia content a
What can watermarks achieve or fail to achieve?
straightforward tasks. Thus security of multimedia contents
How should digital watermarks be used?
becomes a vital issue and there is a need in protecting the
How can we evaluate the technology?
digital content against counterfeiting, piracy and malicious
manipulations. Digital watermarking is an evolving field How useful are they, that is, what can they do for content
that requires continuous effort to find for the best possible protection in addition to or in conjunction with current
method in protecting multimedia content. copyright laws or the legal and judicial means used to
resolve copyright grievances?
In this paper, we describe overview of digital image
What are the business opportunities?
watermarking technique and proposed an algorithm for
What roles can digital watermarking play in the content
copy write protection of digital images in neT domain.
Digital watermarking can be defined as the process of protection infrastructure?
embedding a certain piece of information ,technically known In this paper we present algorithms for image
as watermark into multimedia content including text authentication and forgery prevention known as watermarks.
documents , images, audio or video streams, such that the Figure 1 shows the block diagram for watermarking digital
watermark can detected or extracted later to make an images.
assertion about the data. We have also implemented this
algorithm using MATLAB 7.x and code is also given in this
paper.

Keywords: Digital image watermarking, Spread-Spectrum Watermark


techniques, copy Write Protection

I. INTRODUCTION

The recent growth of networked multimedia systems Original Watermarked


has increased the need for the protection of digital media. Image Image
This is particularly important for the protection and
enforcement of intellectual property rights. Digital media
includes text, digital audio, images, video and software. Figure 1: Block Diagram of Watermarking Algorithm
Many approaches are available for protecting digital data;
these include encryption, authentication and time stamping.
One way to improve one's claim of ownership over an
image, for instance, is to place a low-level signal directly
into the image data. This signal, known as a digital A. Types ofDigital Watermarks
watermark, uniquely identifies the owner and can be Watermarks and watermarking techniques can be divided
easily extracted from the image. into various categories in various ways. The watermarks can
Digital watermarking technology is an emerging field be applied in spatial domain. An alternative to spatial domain
in computer science, cryptography, signal processing and watermarking is frequency domain watermarking. It has been
communications. Digital Watermarking [4, 5, 6] is pointed out that the frequency domain methods are more
intended by its developers as the solution robust than the spatial domain techniques. Different types of
to the need to provide value added protection on top of watermarks are shown in the Figure 2.
data encryption and scrambling for content protection.
Like other technology under development [7, 8], digital
watermarking raises a number of essential questions as
follows.
What is it?
How can a digital watermark be inserted or detected?

978-1-4244-5540-9/10/$26.00 2010 IEEE

226
Watermarking
I

r
According to According According to According to
Working to Type of Human APp cation
Document Perception

J
D main

---U
I I
Source Destination
Spatial Frequency
Based Based
Domain Domain
I
" r bI,
Text Image Audio Video

Dual
Robust Fragile

Figure 2: Types of watermarking techniques

From application point of view digital watermark could be


as below.
Watermarking techniques can be divided into four source based or
categories according to the type of document to be destination based.
watermarked as follows. Source-based watermark are desirable for ownership
Image Watermarking identification or authentication where a unique watermark
Video Watermarking identifying the owner is introduced to all the copies of a
Audio Watermarking particular image being distributed. A source-based
Text Watermarking watermark could be used for authentication and to determine
According to the human perception, the digital whether a received image or other electronic data has been
watermarks can be divided into three different types as tampered with. The watermark could also be destination
follows. based where each distributed copy gets a unique watermark
Visible watermark identifying the particular buyer. The destination -based
Invisible-Robust watermark watermark could be used to trace the buyer in the case of

illegal reselling.
Invisible-Fragile watermark
And one another type called Dual watermark
II. CURRENT STATE OF ART
Visible watermark is a secondary translucent overlaid
into the primary image. The watermark appears visible to a
casual viewer on a careful inspection. The invisible-robust Watermarking is the process that embeds data called a
watermark is embedded in such a way that alternations made watermark or digital signature or tag or label into a
to the pixel value are perceptually not noticed and it can be multimedia object such that watermark can be detected or
recovered only with appropriate decoding mechanism. The extracted later to make an assertion about the object. The
invisible-fragile watermark is embedded in such a way that object ay be an image or audio or video. A simple example
.
of a digItal watermark would be a visible" seal" placed over
any manipulation or modification of the image would alter
or destroy the watermark. Dual watermark is a combination an image to identify the copyright. However the watermark
of a visible and an invisible watermark [1]. In this type of might contain additional information including the identity
wateark an invisible watermark is used as a back up for of the purchaser of a particular copy of the material.
the vIsIble watermark as clear from the following diagram. In general, any watermarking scheme (algorithm) consists
of three parts.

1r
Visible The watermark.

I
Dual
Original Visible
Watermarked
Invisible
Watermarked The encoder (insertion algorithm).
Image Image (I') Image (I'')
Watermarking Watermarking
The decoder and comparator (verification or extraction
or detection algorithm).
Each owner has a unique watermark or an owner can
Figure 3: Schematic representation of dual watermarking
also put different watermarks in different objects the
marking algorithm incorporates the watermark into the

227
object. The verification algorithm authenticates the object
determining both the owner and the integrity of the object. Decoder Comparator

A. Embedding Process
Let us denote an image by I, a signature by S =s /, S2, ... Extracted

and the watermarked image by 1. E is an encoder function, it Test Image(J)


Signature(S')

takes an image I and a signature S, and it generates new


image which is called watermarked imagel, mathematically,
Original
(I, S) =1
E (1)
Signature(S)
It should be noted that the signature S may be dependent Original Image(l)
on image 1. In such cases, the encoding process described by
Eqn.l still holds. Following figure illustrates the encoding
process.

I
Figure 5: Decoder
Encoder
Comvarator

Watermarked
Original .I I
E x
Image (I)
I I Image (I') Extracted

i Signature(S')

Signature(S)
Original Signature(S)

Figure 4: Encoder

Figure 6: Comparator
B. Extraction Process
A decoder function D takes an image J (J can be a
watermarked or un-watermarked image, and possibly A watermark must be detectable or extractable to be
corrupted) whose ownership is to be determined and useful. Depending on the way the watermark is inserted and
recovers a signature S from the image. In this process an
I depending on the nature of the watermarking algorithm, the
additional image I can also be included which is often the method used can involve very distinct approaches. In some
original and un-watermarked version of J. This is due to the watermarking schemes, a watermark can be extracted in its
fact that some encoding schemes may make use of the exact form, a procedure we call watermark extraction. In
original images in the watermarking process to provide extra other cases, we can detect only whether a specific given
robustness against intentional and unintentional corruption watermarking signal is present in an image, a procedure we
of pixels. Mathematically, call watermark detection. It should be noted that watermark
D (J,I)=S' (2) extraction can prove ownership whereas watermark
The extracted signature S will then be compared with
I detection can only verifY ownership.
the owner signature sequence by a comparator function C"
and a binary output decision generated. It is 1 if there is c. C. A spread spectrum watermark embedded in

{ :ll l
match and 0 otherwise, which can be represented as follows. the OCT domain
":5 fJ, A frequency domain method for digital watermarking of
C/S',S)=
Il, tillIe rwiei (3) images proposed in [2] is also based on the idea of spread
Where C is the correlator, x= C,,(S', S). c is the spectrum communications. The technique is motivated by
correlation of two signatures and J is certain threshold. both perceptual transparency and watermark robustness. The
Without loss of generality, watermarking scheme can be published results show that the technique is very effective
treated as a three-tupple (E, D, C,,). Following figures both in terms of transparency, robustness to signal
demonstrate the decoder and the comparator. processing, and attempts to remove the watermark. The
types of image distortions to which technique is robust
include cropping, very low data rate JPEG compression,
printing and rescanning, as well as collusion with several
independently watermarked images. One of the significant
contributions in this work is the realization that the
watermark should be inserted in the perceptually significant
portion of the image in order to be robust.

228
The watermark W is a sequence of normally distributed, Another global method also modulates DCT coefficients,
zero-mean unit-variance random numbers. A DCT is but uses a one-dimensional bipolar binary sequence for W
performed on the entire image and W is inserted in a [3]. The DCT of the original image is fIrst obtained. The
predetermined range of low frequency components minus marking procedure consists of sorting the DCT coefficients
the DC component as follows. Let X be the original image, according to their absolute magnitude. The owner then
Y be the watermarked image, and XD and YD be the DCT defInes a percentage of total energy, P, and identifIes the
coefficients of X and Y respectively. The coefficients can be largest n coefficients that make up P percent of the total
ordered according to the zigzag pattern used in JPEG. Let energy. The watermark sequence is then added to all the AC
Xdi) and Ydi) be the ith DCT coefficient in XD and YD coefficients in this list. For all i such that XD(i) is one of the
respectively. W(i) is the ith element in the watermark selected coefficients,
sequence; a is a scale factor which prevents unreasonable YD(i) Xdi) + W (i)
= (7)
values for YD(i). The marking is then performed: A larger P increases the number of elements of W that
Ydi) XD(i)(1+aW)
= (4) can be embedded in X, but increases the chance that W will
Alternate equations that incorporate W into XD are listed be perceptible. W and the list of selected coefficients must

in [2]. Inversely transforming YD to form Y completes the be kept secret. The verifIcation procedure fIrst extracts W
marking procedure. Figure 7 shows an original image (upper from the marked coefficients in ZD:
left), marked with a = 0.1, 0.5 and 1.0 respectively. The w* (t) ZD(i) - XD(i)
= (8)
*
authors propose an empirically derived value of 0.1 for a. A procedure similar to [2] can then verify W . Note that
The fIrst step of the verifIcation procedure is to obtain a [2] and [3] both require X to extract the watermark. A
copy of W from a possibly forged image Z. ZD is the vector procedure similar to [2] can then verify W. Note that [2] and
[3] both require X to extract the watermark.
of Z's DCT coefficients. W is the extracted version o( W.
W(i) =
a
(D (i) -1]
XD (I) (5)
A measure of similarity betweerl W and W is computed as
follows:

W.lV
S \fW, w) = -- (6)
,,,w.w
If an image has not been watermarked with W, S is
distributed as a zero mean random variable. If W differs
only slightly from W (i.e. W is indeed present in Z, although
slightly altered), then E[S] O. A hypothesis test on S
determines if W is present in the image. This technique
accommodates multiple watermarks, and withstands a much
wider range of attacks than the transparency-only based
spatial techniques.
This algorithm is one of the earliest attempts at providing
some image adaptability in the watermark embedding
scheme. This is due to the fact that the watermark strength
depends on the intensity value of the DCT coefficients of
the original image. In this way, the watermark signal can be
quite strong in the DCT values with large intensity values,
Figure 7: Example of DCT-spread spectrum technique
and is attenuated in the areas with small DCT values. This
provides a watermark signal that is quite robust and for
III. PROPOSED WORK
most images, transparent. However, because the DCT
transform in this scheme is based on the whole image rather
Visible watermarking is a type of digital watermarking
than the usual block-based approach commonly found in
used for protection of publicly available images. In this
image and video compression schemes, the transform does
paper, I have described visible watermarking scheme in the
not allow for any local spatial control of the watermark DCT domain. A mathematical model has been developed for
insertion process. In other words, the addition of a that purpose. An algorithm based on DCT domain has been
watermark value to one DCT coefficient affects the entire proposed to make the watermark more robust.
image; there is no mechanism for local spatial control in The main task of this work has performed into following
this particular framework. This scheme may benefIt from a steps:
perceptual model that determines the optimal weights for At the fIrst step, the requirements, techniques and
the DCT coefficients, but the framework needs to be applications of digital watermarking for high-quality
modifIed in order to get fIner control of watermark images are addressed.
adaptability to image characteristics and the human visual
system.

229
Second, is to implement the algorithm using the tool
(i.e. Mat Lab) for embedding the watermark into
original image in DCT domain.
Then the extraction of watermark will also be
implemented. With this, the comparison of original
watermark and extracted watermark is also being
shown.
The measurement of quality of an image is also
concerned with this work.

A. Implementation of Work Figure 8: Original image of Lena


We proposed an algorithm with the application of DCT
based as described in II.C3, but the significant difference is
that here we consider the embedding of random PN
sequences into the mid-band components of the DCT-block.
This provides a watermark signal that is quite robust and for
most images, transparent. The watermark embedding steps
of this technique are as follows: MCK
Set gain factor (K) for embedding process.
Set the DCT block size.
Perform search to find highly uncorrelated PN Figure 9: Watermark image
sequences (T, F).
Defines the mid-band frequencies of an 8x8 DCT.
Determine size of original image.
Determine size of watermark image.
Reshape the message to a vector.
Pad the message out to the maximum message size
with 1 'so
Generate shell of watermarked image.
Generate PN sequences for "1" and 0 " "

Process the image in blocks.


Transform block using DCT.
If message bit contains zero then embed PN-sequence
Figure 10: Watermarked image of Lena
zero into the mid-band components of the DCT-block.
Otherwise, embed PN-sequence-one into the mid-band We applied the peak-signal to noise rate (PSNR) to
components ofDCT-block. measure the image quality of an attacked image. The
Transform block back into spatial domain. equation of PSNR is described as:
Move on to next block. At end of row move to next
row.
PSNR=lOloglO( : )dB (9)
Convert to uint8 and write the watermarked image out On the other hand, the mean square error (MSE) of an
image with H x W pixels is defined as
to a file
1 H w ( -2
MSE= }) (10)
HXlV L.i = lL.j=l aU -al
Display processing time.
Display watermarked image. Where <l;j is the original pixel value and aij is the
processed pixel value. Besides, we utilized the accuracy rate
B. Experimental Analysis and Results AR to evaluate the robustness of a copyright protection
In this section, we show some experimental results to scheme for a specific attack. The accuracy rate AR is
demonstrate the effectiveness and success of our digital defined as Cp
watermarking technique for the embedding and extraction of AR-
NP'
(11)
watermark image with the original (digital) image in DCT Where NP is the number of pixels of the watermark
domain. image and CP is the number of correct pixels in the
The standard 512 x 512-pixels grayscale image "Lena" watermark image that is retrieved from the attacked image.
is used as the sample of the test image, as shown in Figure 8. The experimental results are represented in the following,
The 64 x 64-pixels grayscale image "Dmg-l" is used as the respectively for watermarked image and extracted
sample of the watermark image, as shown in Figure 9. The
watermark image as shown in Figurel1 (i) and (ii), while
outcome of the watermarked image is shown in Figure 10.

230
taking the different values of gain factor K. And various I K=70 I 2.7813 100 I 84.2544 I
observations for experiment are depicted in table1.
1 C. MA T LAB Code for Proposed Algorithms
Code for Embedding Watermark in DCT domain
clear all;
start_time=cputime;
k=70;
blocksize=8;
pn_sequence_search='T';
midband=[ 0,0,0,1,1,1,1,0;
0,0,1,1,1,1,0,0;
0,1,1,1,1,0,0,0;
1,1,1,1,0,0,0,0;
1,1,1,0,0,0,0,0;
1,1,0,0,0,0,0,0;
1,0,0,0,0,0,0,0;
0,0,0,0,0,0,0,0 ];
sum(sum(midband));
[filename1,pathname]=uigetfile('*.*,,'select the image');
figure(1);
original_image=imread(num2str(filenamel));
imshow(original_image,[]);
title('Original Image')
H=size(original_image,1);
W=size(originaUmage,2);
length_o=H*Wl(blocksize/\2);
file_name='dmgl.tif;
message=double(imread(file_name));
Hw=size(message,I);
Ww=size(message,2);
message=round(reshape(message,Hw*Ww,I));
length_w=length(message);
if (length_w > length_0)
error('Message too large to fit in original Object')
end
message_vector=ones(1,length_0);
message_vector(1:length_w)=message;
length2=length(message _vector);
watermarked_image=originaUmage;
- --, pn_sequence_one=round(2*(rand(1,sum(sum(midband)))-
0.5));
pn_sequence_zero=round(2*(rand(1,sum(sum(midband)))-
lVICK 0.5));
if (pn_sequence_search=='T')
while(corr2(pn_sequence_one,pn_sequence_zero) > -0.55)
Figure 1 1: (i) Watermarked image, pn_sequence_one=round(2*(rand(1,sum(sum(midband)))-
(ii) Extracted watermark image 0.5));
pn_sequence_zero=round(2*(rand(1,sum(sum(midband)))-
TABLE 1 0.5));
The quality rates under various executions end end
Gain Execution Accuracy PSNR x=I;y=I;
Factor(K) Time Rate for (kk = 1:length2)
K=10 2.7344 78.1250 53.8851 dct_block=dct2(original_image(y:y+blocksize
K=20 2.7656 85.9375 55.5562 I,x:x+blocksize-l));
K=40 2.7969 98.4375 58.4224 1=1;
K=50 2.7500 98.7375 59.2029

231
if (message_vector(kk)==0) pn_sequence_zero=round(2*(rand(1,sum(sum(midband)))-
for i=l:blocksize 0.5));
for j=1:blocksize if (pn_sequence_search=='T')
if (midbandG,i)==1) while(corr2(pn_sequence_one,pn_sequence_zero) < -0.55)
dct_ blockG ,i)=dct_ blockG ,i)+k*pn _sequence _zero(1); pn_sequence_one=round(2*(rand(1,sum(sum(midband)))-
1=1+1; 0.5));
end end end pn_sequence_zero=round(2*(rand(1,sum(sum(midband)))-
else 0.5));
for i=1:blocksize end end
for j=1:blocksize
if (midbandG,i)==I) x=l;
dct_blockG,i)=dct_blockG,i)+k*pn_sequence_one(l); y=1;
1=1+1; for (kk = 1:max_message)
end end end end dct_block=dct2(watermarked_image(y:y+blocksize-
watermarked_image(y:y+blocksize-l,x:x+blocksize- 1,x:x+blocksize-l));
1)=idct2(dct_block); coeffcients
if (x+blocksize) >= W 1=1;
x=l; for i=1:blocksize
y=y+blocksize; for j=1:blocksize
else if (midbandG,i)==1)
x=x+blocksize; sequence(l)=dct_blockG,i); 1=1+1;
end end end end
end cor_one(kk)=corr2(pn_sequence_one,sequence);
watermarked_image_int=uint8(watermarked_image); cor_zero(kk)=corr2(pn_sequence_zero,sequence);
imwrite(watermarked_image_int,'dct2_watermarked_mod.j if cor_zero(kk) > cor_one(kk)
pg',Jpg'); message_vector(kk)=O;
elapsed_time=cputime-start_ time, else
figure(2); message_vector(kk)=1;
imshow(watermarked_image_int,[]); end
title(,Watermarked Image'); if (x+blocksize) >= W
x=l;
Code for watermark Extraction in DCT domain y=y+blocksize;
clear all; else
start_time=cputime; x=x+blocksize;
blocksize=8; end end
pn_sequence_search='T'; message=reshape(message_vector
midband=[O,O,O,I,I,I,I,O; (1:Mo*No),Mo,No);
0,0,1,1,1,1,0,0; elapsed_time=cputime-start_time,
0,1,1,1,1,0,0,0; figure(2)
1,1,1,1,0,0,0,0; imshow(message,[])
1,1,1,0,0,0,0,0; title('Recovered Message')
1,1,0,0,0,0,0,0; X=imread(' dmg1.tif);
1,0,0,0,0,0,0,0; Y=message;
0,0,0,0,0,0,0,0 ]; Acc_rate(X,Y);
file_name='dct2_watermarked_mod.jpg'; psnr=psnrl(X,Y,Mo,No);
watermarked_image=double(imread(file_name));
H=size(watermarked_image,1); Code for Accuracy Rate
W=size(watermarked _image,2); function [d]=AccJate(X,Y)
max_ message=H*W/(blocksizeI\2); X=double(X);
file_name='dmg1.tif; Y=double(Y);
orig_watermark=double(imread(file_name)); % X=imread('dmgl.tif);
Mo=size(orig_watermark,1); %Y=imread('message.jpg');
No=size(orig_watermark,2); Hl=size(X,I);
pn_sequence_one=round(2*(rand(1,sum(sum(midband)))- WI=size(X,2);
0.5)); H2=size(Y,I);

232
W2=size(Y,2); X=imread('lena.jpg');
np=O; Y= imread('dct2_watermarked_mod.jpg');
npl=O; I=corr2(X,Y)
np2=0; I1=std2(I)
np3=0;
count_0r=0; IV. CONCLUSION
count_Ex=O;
for i= I:HI We have described recent developments in the digital
if (X(i=I) watermarking of images in which the watermarking
np=np+l; technique is invisible and designed to exploit some aspects
else of the human visual system. Many of these techniques rely
np=np; either on transparency (low-amplitude) or frequency
end sensitivity to ensure the mark's invisibility. Watermarks that
for j = I:WI are image adaptive use visual models to locally maximize
if (XG=I) the amplitude of the embedded watermark, while
maintaining the watermark's imperceptibility. This type of
npl=npl+l;
algorithm has been shown to be more robust to many attacks
else
based on linear and nonlinear signal processing operations.
npl=npl;
The protection of intellectual property rights is perhaps one
end end end of the last major barriers to the " digital world." While the
count_Or=np+npI; techniques presented in this paper are not foolproof, they can
for i= I:H2 help validate claims of ownership that are required for
if (Y(i=l) intellectual property law enforcement.
np2=np2+1; REFERENCE
else
[1] S.P. Mohanty, et aI., "A Dual Watennarking Technique for Images",
np2=np2; Proc. 7th ACM International Multimedia Conference, ACM-MM'99,
end Part 2, pp. 49-51, Orlando, USA, Oct. 1999.
for j = I:W2 [2 ] I. Cox, J. Kilian, F. T. Leighton, and T. Shamoon, "Secure spread
if (YG=I) spectrum watennarking for multimedia," IEEE Transactions on
Image Processing, vol. 6, no. 12, December, 1997, pp. 1673-1687.
np3=np3+1;
else [3] F. M. Boland, J. J. K. 6 Ruanaidh and C. Dautzenberg,
"Watennarking digital images for copyright protection," Proceedings
np3=np3; of the International Conference on Image Processing and its
end Applications, Edinburgh, Scotland, July 1995, pp. 321-326.
end [4 ] R. B. Wolfgang and E. J. Delp, "Overview of image security
end techniques with applications in multimedia systems," Proceedings of
the SPIE International Conference on Multimedia Networks: Security,
count_Ex=np2+np3; Displays, Tenninals, and Gateways, November 4-5, 1997, Dallas,
AR=(count_Exlcount_Or)*100 Texas, vol. 3228, pp. 297-308.

[5 ] M. D. Swanson, M. Kobayashi, and A. H. Tewfik, "Multimedia data


Code for PSNRjunction embedding and watennarking technologies," to appear in
Proceedings of the IEEE, 1998.
function [B] = psnr(image,imagerime,M,N)
[6] I. J. Cox and M. L. Miller, "A review of watennarking and the
image=double(image);
importance of perceptual modeling," Proceedings of the SPIE
imagerime=double(imagerime); International Conference on Human Vision and Electronic Imaging II,
if ((sum(sum(image-imagerime))) == 0) Feb. 10-13, 1997, San Jose, CA, USA, pp. 92-99.
error('lnput vectors must not be identical') [7] M. Kutter and F. Hartung, "Image watennarking techniques," to
else appear in Proceedings of the IEEE, Special Issue on Identification
and Protection of Multimedia Infonnation, 1999.
psnr_num=M*N;
[8] I. J. Cox, "Spread-spectrum techniques for image watennarking," to
psnr_den=sum(sum((image-imagerime)."2));
appear in Proceedings of the IEEE, Special Issue on Identification
A=psnr_den/psnr_num; and Protection of Multimedia Infonnation, 1999.
B=IO*loglO(255."2/A); end [9) Yusnita Yusof and Othman O. Khalifa. "Digital Watennarking for
Return Digital Images Using Wavelet Transfonnation" appear in proceeding
of the IEEE pp.665-669, April -2007

Code for comparator

233

Вам также может понравиться