Professional Documents
Culture Documents
Chapters Project
Chapters Project
CHAPTER 1
INTRODUCTION
region, and the other for the nonwatermark- covered region. The data hiding technique
reversibly hides the payload in the image region not covered by the visible watermark.
1.3 DEFINITIONS
Watermarking
Water line: a line marking the level reached by a body of water.
Digital watermarking
A process of possibly irreversibly embedding information into a digital signal.
The signal may be audio, pictures or video, for example. If the signal is copied, then the
information is also carried in the copy
Visible watermarking
The information is visible in the picture or video. Typically the information
is text or a logo which identifies the owner of the media.
Invisible watermarking
Information is added as digital data to audio, picture or video, but it cannot
be perceived as such. An important application of invisible watermarking is to copyright
protection systems, which are intended to prevent the unauthorized copying of digital
media.
4
Purpose
The purpose of this document is to elaborate the requirements to be
implemented as part of the project. This documentation will be used by the following
audience.
a. The Student:
To make the requirements/problem clear.
To present the requirements to the university project committee.
To keep track of the requirements (for future phases of the project)
b. Project Committee:
To understand the requirements of this project.
Scope
Following is the scope of the project
A new technique for digital embedding using invisible watermarking is
proposed. The purpose of this technique is to embed a handwritten signature into
a color image, so that a composite image is generated. From this composite
image, the handwritten signature will be extracted.
This technique will accept a color image and a handwritten signature as input and
provide the signature as output which is extracted from the watermarked image.
A significant issue here is to embed bytes without causing visual degradation to
the host image.
5
exceeds the maximum.Allowable size that can be hidden, the extra information is
truncated. The size of hidden object that can be stored in a carrier file depends on the
carrier file size and type. The screen resolution should be set to 1027x768 or higher to get
the complete view of the implementation. In case of lower resolution screen the
implementation not only looks awkward but also not completely visible.
Chapter 3 System Design: This chapter defines the overall design of the
system, the data flow diagrams and the module diagram.
Chapter 5 Conclusion and Results: This chapter shows out the results of
the project. Conclusion and future enhancements is given out.
10
CHAPTER 2
SYSTEM DESIGN
2.1 INTRODUCTION
This chapter deals with the block diagram, the dataflow diagram and the
module diagram. Hybrid digital embedding algorithm and digital extraction algorithm
will be discussed in detail.
Host image is the cover image. Signature is the bi-color image. The signature is encoded
using public key. Then from the starting point of the encoded byte, the embedding starts,
which gives a composite image that is the watermarked image. Here the Significant issue
is to embed bytes without causing visual degradation to the host image. From the
composite image decoding is done using private key. Then from the starting point of the
decoded byte, the signature image is extracted.
Host
Source image image
Invisible signature
Watermarking Target image
Bi -color
signature
image
image Composite
Host Starting image(water
image point of marked
1 encoding 2 image)
Encoding Embedding
3
Signature Bi-color
image Decoding
bi-color image
Extracted 4
image
Extraction Decoded
Bi-color byte position
image
2.4.1. Embedding
Embedding information into image, which could survive attacks on the untrusted
network. A significant issue here is to embed bytes without causing visual degradation to
the host image. Some secret information is embedded into the host image. Starting point
(byte) of encoding Signature Image (bi-color) file to Host Image (color) file is calculated.
This byte position is a value and that is converted to binary number. For every bit
position the weight is taken and in the super increasing order in combination, denoted as
easy key or private key. Public key is extracted from this private key, using Knapsack
Algorithm. By this public key the computed byte position is encoded and stored in the 4-
byte of the Host Image file
In this module the watermarked image and the original host image is compared and the
psnr value is calculated for the difference.
2.4.2. Extracting
Decoding is done by private key or easy key. Creation of Recovery Image
file starts from decoded byte position of the Composite Image file and end at the end of
Composite Image file.
Here the psnr value is calculated.Which gives the difference between the original
signature and the extracted signature. If the value is more than 35, then visually the
difference is not seen.
2.5 ALGORITHM
There are two algorithms .They are as follows
1. One is hybrid digital-embedding algorithm at source.
2. Handwritten Signature Extraction Algorithm from Hybrid
Composite Image file at target.
15
Input
Host image and signature image.
Parameters
size1=size of host image.
size2=size of signature image.
size=difference between size1 and size2.
byte1=host mage file is read and its bytes are stored in byte1.
byte2=signature mage file is read and its bytes are stored in byte2.
Output
Composite image file is returned, in which the signature image file is
embedded.
The host image file and the signature image file is opened in input mode.
The target image file is opened in output mode.
Initialize the variables.
Find the size of host image and signature image and store the values in size1
and size2.
Compute the difference between size1 and size 2.
Size = ((size1-size2)-1).
17
This size is calculated to check whether the size of host image is greater then the size of
signature image.
From the first byte of host image, while loop will start reading the bytes.
Read bytes from host image and signature image then store the values in byte1 and byte2.
Write byte 2 to the target image file.
Then write byte 1 to the target image file.
Close the host file, signature file and the target image file.
Input
Composite image file, private keys
Parameters
byte1=read byte from composite image file and store it in byte1.
18
Output
Recovered image file.
Example:
4* 31mod(110)=14;
10* 31mod(110)=90;
20
20* 31mod(110)=70;
40* 31mod(110)=30;
So the public key is: {31, 62, 14, 90, 70, 30} and the private key is {1, 2, 4, 10,
20.40}.Let's try to send a message that is in binary code: 100100111100101110.
The knapsack contains six weights so we need to split the message into groups of six:
100100111100101110.
100100 = 31 + 90 = 121
111100=31+62+14+90=197
101110=1+14+90+70=205.
So the coded message is 121 197 205.
Now the receiver has to decode the message...The person decoding must know the two
numbers 110 and 31 (the modulus and the multiplier). Let's call the modulus "m" and the
number we multiply by "n".We need n1, which is a multiplicative inverse of n mod m,
i.e. n (n1) = 1 mod m
21
In this case I have calculated n1 to be 71. All we then have to do is multiply each of the
codes 71 mod 110 to find the total in the knapsack which contains {1, 2, 4, 10, 20, 40}
and hence to decode the message.
205* 71
mod (110) =35=101110. The decoded message is: 100100111100101110.
.CHAPTER 3
3.1 INTRODUCTION
3.1.1 Purpose
Details about the implementation of hybrid digital embedding and hybrid digital
extraction algorithm.
3.1.2 Scope
The following segments provide the sample code, and the results of running the
code for hybrid digital embedding algorithm.
3.1.3 References
23
3.1.4 Overview
CHAPTER 4
4.1 ANALYSIS
Data hiding can be defined as the process by which a message
signals or image is imperceptibly embedded into a host or cover to get a composite
signal. A significant issue here is to embed bytes without causing visual degradation to
the host image. This requires embedding data in such a way that adapts with the local
characteristics of an image. Next, a hybrid digital embedding technique is proposed for
hiding an image into another image in such a way that the quality of the recovered image
improves significantly.
4.2FINAL RESULTS
The final output of this project is that the extraction of the signature
image from the composite image, in which the signature is embedded in the host image.
Figure 4.1 Final result
24
4.3 INFERENCE
Inference is the act or process of deriving a logical consequence
conclusion from premises. An efficient watermarking technique is is proposed to embed
signatures in images to attest the owner identification and discourage the unauthorized
copying. The proposed technique is based on embedding without causing any visual
degradation to the original image. Encoding and decoding is done by using the public key
and private key. These keys are generated by knapsack algorithm. Various attacks are
implemented and extracted watermark images are demonstrated. Attacks that are
performed in this project are salt and pepper noise and speckle noise. Results show that
the watermarking scheme is robust against the attacks.
4.4 CONCLUSION
Since ancient times, there has been an effort to hide information within
seemingly harmless information to avoid unwanted attention. The science of concealing
information was later to be known as steganography and the current technology of
Digital Watermarking has taken its root from it. The term watermark in terms of
digital data was taken from the concept of watermarks used to prevent faking of currency
notes. Watermarking deals with embedding information like name of the creator, status,
recipient, etc. into the host data in such a way that it remains transparent or undetectable.
The watermark information should be embedded in such a way that this should not
be detectable and removable even after many spurious or innocuous attempts.
Watermarking can be done for any form of digital data text, image, audio, or video
where copyright needs to be protected. Digital Watermarking is emerging as a favorite
technique over traditional encryption for digital rights management (DRM). A lot of
research is still going on and new methods are emerging. A new technique is proposed of
invisible watermarking. Extracted image at the target shows excellent visual quality as
well.
25
In this project, knapsack algorithm is used to generate public key and private key
some super increasing sequence is taken to generate the keys. But some other way or
some other algorithm can be tried to generate the keys in future.
For speckle noise the psnr value is very low, which shows the visibility
of the embedded signature, also the extraction is not proper when this noise is attacked.
So some work has to be done in improving the quality of the image in the case of
speckle noise attack.
Furthermore, multi-watermark can be developed from our watermarking
strategy as long as watermark image blocks are similar to host image ones. It is
believed that the watermarking algorithm can be further developed. We will explore the
algorithm and experiment in the future.
26
APPENDIX 1
SOURCE CODING
To calculate Peak Signal to Noise Ratio value (PSNR):
function [psn] = psnr (original, target)
target=double (target);
[row col] = size (target);
original=double(original);
err = 0;
for i = 1: row
for j = 1: col
err = err + (original (i, j) - target(i,j))^2;
end
end
fprintf ('\nerr = %f \nrc = %f', err,row*col);
mse = double (err) / double ((row*col));
mse=double (mse);
psn = 10*log10 (65025/mse);
return;
psnr is a function whose parameters are the original image and the target image.
row and col will have the value of number of rows and number of columns in the target
image.
This is the absolute error. Then calculate the mean square error (mse)
27
mse=double (err)/double((row*col))
psn will give the value which should be greater than 35. if not the visually watermarking
is seen.
return ;
end.
Working of d2b:
Deb is the function name, whose input is a and output variable is x.a, x is a byte value.
Initialize the 8 bits of x to be 0 and pos be a variable whose value is also initialized to be
8.calculate x (pos) =mod (a, 2).then decrement pos by 1.
Working of b2d:
b2d is the function name whose input variable is x and output variable is n.
Initialize sum to be 0.
There is function called numel, which will return the number of elements in the given
variable.
Calculate n=numel(x);
for i=1:n
sum=sum+(x(i)*(2^(n-i)));
end
n=sum;
Embed function:
function [out] = embed(input,sec)
pri = [1 2 4 10 20 40];
m=31;
n=110;
for i=1:size(pri,2)
pub(i) = mod(pri(i)*m,n);
end
k=1;
29
for i=1:size(input,2)
x = d2b (input (i));
for j=1:8
in(k) = x(j);
k=k+1;
end
end
in;
for i=1:size(pub,2)
if i==4
pub(i) = pub(i)+4; end
in(pub(i)) = sec(i);
end
%%% reconstruct %%%
k=1;
for i=1:size(input,2)
for j=1:8
x(j) = in(k);
k=k+1;
end
out (i) = b2d(x);
end.
Extract function:
function [ext] = extract(out,pri)
m=31;
n=110;
for i=1:size(pri,2)
pub(i) = mod(pri(i)*m,n);
end
k=1;
30
for i=1:size(out,2)
x = d2b(out(i));
for j=1:8
ou(k) = x(j);
k=k+1;
end
end
for i=1:size(pub,2)
if i==4
pub(i) = pub(i)+4;
end
ext(i) = ou(pub(i));
end
31
.
32
When we click the browse button, we will be getting this dialog box to choose the
host image.
The signature image file name is entered in the text area that is available in the
gui.Then click watermark button. So that the watermarking starts.
Composite image is displayed. PSNR value is the difference between the cover
image and the watermarked image.
.
36
.
37
If no attack is choosed, then while extracting the signature, the original signature
is extracted properly.
.
38
After selecting the type of attack. In the attacked image axis, the attacked image is
displayed
.
39
When we click the watermark extraction button. The extracted image is displayed
in another figure. The difference between the original image and the extracted signature
is shown by using the psnr value.
If we select salt and pepper noise. The following will be the output.
After the salt and pepper noise is selected, the attacked image will be displayed as
shown in the figure
.
42
This figure shows the extracted image from the attacked watermarked image.
When the speckle noise is selected. The attacked image will look like this figure.
After the speckle noise id attacked on the composite image. The extracted
signature will look like the above figure.
.
47
REFERENCES
[1] Min Wu, Member, IEEE, and Bede Liu, Fellow, IEEE, Data Hiding in Binary Image
for Authentication and Annotation, IEEE Trans. Image Processing, vol. 12, pp. 696705,
June 2003.
[2] Bartolini.F, Tefas.A, Barni.M and Pitas.I, Image Authentication Techniques for
Surveillance Applications, IEEE Proceedings, Vol.89, No. 10, October 2001.
1. Yusuk Lim, Changsheng Xu and David Dagan Feng, Web based Image
Authentication Using Invisible Fragile Watermark, 2001, Pan-Sydney Area
Workshop on Visual Information Processing (VIP2001), Sydney, Australia.
2. Wen Chung Kuo, Chin Chih Lin and Jiin Chiou Cheng, Design a Data Hiding
Scheme using RSA, IEEE Int. Workshop VLSI Design & Video Tech. Suzhou,
China, May 28-30, 2005.
3. Haiyong Liao and Ruisong Ye A Novel Digital Image Watermarking Approach
Based on Image Blocks Similarity 2008 Congress on Image and Signal
Processing
49