0% found this document useful (0 votes)
55 views35 pages

Miniproject 2

Project based on digital image watermarking RI

Uploaded by

Xh A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views35 pages

Miniproject 2

Project based on digital image watermarking RI

Uploaded by

Xh A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

A Project Report On

AN OPTIMIZED IMAGE
WATERMARKING METHOD BASED
ON HD AND SVD IN DWT DOMAIN
Submitted by :
B.Durga prasad- (o170373)
Y.Vigneswari – (o170254)
V.Nani - (o170188)
K.Purnachandrachari – (o170602
B.Lakshman nayak -(o170529)

Submitted to :

Under the supervision of Mr. V.Prasannanjaneya reddy


IIIT ONGOLE

As a part of partial fulfilment of the degree of Bachelor of


Technology in Electronics and Communication Enginnering

Date : 27/04/2022
Certificate

This is to certify that the report entitled “INVISIBLE IMAGE


WATERMARKING USING DISCRETE WAVELET
TRANSFORM IN HSI COLOR SPACE” submitted by
B.Durga prasad (0170373) , Y.Vigneswari
(0170254) ,V.Nani (0170188) ,K.Purna chandrachari
(0170602), B.Lakshman nayak (0170529) in partial
fulfilment of therequirements for the award of Bachelor of
Technology in Electronics and Communication
Engineering is a bona fide work carried by them under my
supervision and guidance.

Head of the Department :


Mr. KVS SRIHARSHA
Project Internal Guide:
Mr. V.Prasannanjaneya
Reddy
IIIT ONGOLE.
Acknowledgement

I would like to express my sincere gratitude to Mr.


V.PRASANNANJANEYA REDDY sir , my project guide
for valuable suggestions and keen interest throughout the
progress of my course and research.

I am grateful to Mr. KVS HARSHA , HOD of Electronics


&Communication Engineering, for providing excellent
computing facilities and a congenial atmosphere for
progressingwith my project.

At the outset, I would like to thank Rajiv Gandhi University


of Knowledge Technologies, IIIT Ongole.
providing all the necessary resources for the successful
completion of my course work. At last, but not the least I
thankmy teammates and other students for their physical
and moral
support.

With Sincere Regards,


B.Durga prasad- (o170373)
Y.Vigneswari – (o170254)
V.Nani - (o170188)
K.Purnachandrachari – (o170602
B.Lakshman nayak -(o170529)
INDEX
DEDICATION
ABSTRACT
1. I INTRODUCTION
1.1PROJECT DEFINITION
1.2 EARLIER TECHNOLOGIES
1.3 ADVANTAGES & DISADVANTAGES
1.4 PROPOSED METHOD

2.WATERMARKING
2.1 DIGITAL IMAGE
2.2 DIGITAL WATERMARKING DEFINATION
2.3 WATERMARKING APPLICATIONS
2.4 WATERMARKING TYPES
2.5 DESIGN REQUIREMENTS OF WATERMARKING

3.DESCRETE WAVELET TRANSFORM


3.1 WAVELET DEFINITION
3.2 WAVELET TRANSFORM DEFINITION
3.3 DESCRETE WAVELET TRANSFORM
3.4 ADVANTAGES AND DISADVANTAGES OF DWT ON IMAGE
WATERMARKING

4.PROPOSED METHOD
4.1 EMBEDDING ALGORITHM
4.2 EMBEDDING FLOWCHART
4.3 EXTRACTION ALGORITHM
4.4 EXTRACTION FLOWCHART
4.5 REFERENCE
4.6 CONCLUSION

5. MATLAB

6.CODE

7.CONCLUSION

8.REFERENCE
AN OPTIMIZED IMAGE WATERMARKING METHOD BASED ON HD AND
SVD IN DWT DOMAIN

Submitted by : Signature of guide:

B.Durga prasad- (o170373) V.Prasannanjaneya


Y.Vigneswari – (o170254) reddy
V.Nani - (o170188)
K.Purnachandrachari – (o170602
B.Lakshman nayak -(o170529)
ABSTRACT

In this paper, a novel image watermarking method is proposed which is based


on discretewave transformation (DWT), Hessenberg decomposition (HD), ansingular
value decomposition (SVD).First, in the embedding process, the host image is
decomposed into a number of sub-bands through multi-level DWT, and the resulting
coefficients of which are then used as the input for HD. The watermarkis operated on
the SVD at the same time. The watermark is finally embedded into the host image by
the scaling factor. Fruit fly optimization algorithm, one of the natural-inspired
optimization algorithms is devoted to find the scaling factor through the proposed
objective evaluation function. The proposed methodis compared to other research
works under various spoof attacks, such as the filter, noise, JPEG compression,
JPEG2000 compression, and sharpening attacks. The experimental results show that
the proposed imagewatermarking method has a good trade-off between robustness
and invisibility even for the watermarks with multiple sizes.

1. Matlab Software:
MATLAB is a programming platform designed specifically for
engineers and scientists to analyze and design systems and products that
transform our world. The heart of MATLAB is the MATLAB language, a matrix-
based language allowing the most natural expression of computational
mathematics.

Uses of MATLAB:

• Analyze data
• Develop algorithms
• Create models and applications
MATLAB lets you take your ideas from research to production by deploying to
enterprise applications and embedded devices, as well as integrating with Simulink
and Model-Based Design

Keywords:Digital Image Watermarking, Discrete Wavelet Transform, HSI


conversion, Peak Signal to Noise Ratio(PSNR), Mean square error(MSE).
CHAPTER 1:
INTRODUCTION

The explosive growth of internet usage makes information dissemination become


increasingly easier than ever, leadingto serious copyright infringement problems,
such as unau-thorized copying [1], distribution [2], [3] and modificationof digitized
works [4], [5]. In order to improve the effectiveutilization of the network information,
the copyright pro-tection is becoming particularly important [1]. As one ofthe widely
used protection techniques, watermarking methodhas been applied in many fields of
multimedia copyright protection [1]–[5]. Watermarking is a common information
embedding technique to protect the image, video and audio information. It integrates
the key information into the modalities by invisibly modifying the data. Therefore,
invisibility and robustness are two major metrics for evaluating the effectiveness of
the watermarking techniques [1]. Based on these two metrics, watermarking
techniques can be broadly classified into three groups, i.e. the robust, fragile and
semi-fragile watermarking [1]. The robust watermarking is crucialfor the image data
protection because it does not significantly reduce the visual quality of the
watermarked image, and can withstand various attacks [2]. It is therefore widely used
for copyright protection and ownership verification. Fragile watermarking is only
used to ensure the completeness of the image rather than to verify actual ownership
[2]. Even though it can detect any unauthorized modification or any modifications of
the watermarked images, it also destroy the completeness of the watermark if any
change happens. Semi-fragile watermarking combines the advantages of fragile
watermarking and robust watermarking, with the aim to detect unauthorized
manipulations while keeping the robustness against authorized manipulations [2].
As for the robust watermarking method, the watermark information is often directly
embedded in the spatial domain, i.e. the watermark data is embedded into the host
image by modifying the pixels spatially [2]. This operation is easy to implement but it
is not robust enough against the geometric and image processing attacks [2]. In the
meantime,the embedding process can also be completed in the transformed domains,
e.g. the discrete cosine transform (DCT) [6]–[11], discrete Fourier transform (DFT)
[12]–[14], discrete wave transformation (DWT) [15]–[17], and singular value
decomposition (SVD).
The remaining parts of this work are organized as follows. In Section II, the
concepts about DWT, HD, SVD and FOA are provided. In Section III, the proposed
watermarking method based on DWT-HD-SVD and FOA is detailed.Experimental
results and performance analysis are given inSection IV. Section V gives the
conclusion.
.

1.2 EARLIER TECHNOLOGIES:

Before watermarking techniques there are two other techniques to hide


information or to send secrete message.That two techniques are
‘CRYPTOGRAPHY’ and ‘STEGANOGRAPHY’.

CRYPTOGRAPHY:
Cryptography is technique of securing information and communications
through use of codes so that only those person for whom the information is
intended can understand it and process it. Thus preventing unauthorized access to
information. The prefix “crypt” means “hidden” and suffix graphy means
“writing”.

In Cryptography the techniques which are use to protect information are


obtained from mathematical concepts and a set of rule based calculations known
as algorithms to convert messages in ways that make it hard to decode it. These
algorithms are used for cryptographic key generation, digital signing, verification to
protect data privacy, web browsing on internet and to protect confidential
transactions such as credit card and debit card transactions.
INVISIBLE IMAGE WATERMARKING USING WAVELET
TRANSFORM
BENFITS:

Cryptography is an essential information security tool. It provides the


four most basic Services of information security −

• Confidentiality − Encryption technique can guard the information and


communication from unauthorized revelation and access of information.
• Authentication − The cryptographic techniques such as MAC and digital
signatures can protect information against spoofing and forgeries.
• Data Integrity − The cryptographic hash functions are playing vital role in
assuring the users about the data integrity.
• Non-repudiation − The digital signature provides the non-repudiation service
to guard against the dispute that may arise due to denial of passing message by
the sender.
DRAWBACKS:

Apart from the four fundamental elements of information security, there


are other issues that affect the effective use of information −
• A strongly encrypted, authentic, and digitally signed information can be
difficult to access even for a legitimate user at a crucial time of decision-
making. The network or the computer system can be attacked and rendered
non-functional by an intruder.
• High availability, one of the fundamental aspects of information security,
cannot be ensured through the use of cryptography. Other methods are needed
to guard against the threats such as denial of service or complete breakdown of
information system.
• Another fundamental need of information security of selective access control
also cannot be realized through the use of cryptography. Administrative
controls and procedures are required to be exercised for the same.
• Cryptography does not guard against the vulnerabilities and threats that
emerge from the poor design of systems, protocols, and procedures. These
need to be fixed through proper design and setting up of a defensive
infrastructure.
INVISIBLE IMAGE WATERMARKING USING WAVELET TRANSFORM
• Cryptography comes at cost. The cost is in terms of time and money −
• Addition of cryptographic techniques in the information processing leads
to delay.
• The use of public key cryptography requires setting up and maintenance
of public key infrastructure requiring the handsome financial budget.
• The security of cryptographic technique is based on the computational
difficulty of mathematical problems. Any breakthrough in solving such
mathematical problems or increasing the computing power can render a
cryptographic technique vulnerable.
STEGANOGRAPHY:

STEGANOGRAPHY means hiding the information in other


information.The word steganography derived from greek words ‘STEGOS’ means
’cover’ and ‘GRAPFIA’ means ‘writing’ defining it as ‘cover writting’.Any one else
veiwing this message can fail to know it contents hidden/encrypted data.

TYPES OF STEGANOGRAPHY:

• Encoding secrete message in text


• Encoding secrete message in image
• Encoding secrete message in audio
• Encoding secrete message in vedio
ADVANTAGES:

• It is used in the way of hiding not the information but the password to
reach that information.
• Difficult to detect.Only receiver can detect
• can be applied differently in digital image,audio and vedio file.
• It can be done faster with the large number of softwares.

DISADVANTAGES:

• Huge number of data,huge file size,so someone can suspect about it


• If this technique is gone in the wrong handle like hackers,criminals
then this can be very much dangerous for all.
So to rectify above two techniques limitations digital image watermarking is
proposed.

1.4 PROPOSED METHOD:

Digital watermarking is an efficient technique to protect copyright and


ownership of digital information. This project is about digital image
watermarking based on wavelet transform in HSI color space. Initially, the one level
wavelet coeffiects are generated (LL, LH, HL, & HH) to the intensity component
of HSI color space cover image. This LL coefficient and gray watermark image are
undergoes 8*8 block processing. These each block entropies of both images are
compared and scaled with a scaling factor ‘α’ (Embedding Process). Finally the
watermarked image is inverse wavelet transform of above said embedded
coeffiects. At the receiver the inverse process is carried to extract the watermark
image. Experimental results show that, the proposed watermarking scheme is
robust to noise attacks. Experimental results show an improvement over existing
methods nterms of Peak Signal to Noise Ratio (PSNR) and Mean square error
(MSE) .

HSI COLOR SPACE:

HSI means Hue,Saturation and Intensity


when humans veiw a color object it is decribed by its hue,saturation and
intensity.

Hue:It is a color attribute that describes a pure color.(like yellow,orange,red) .


Saturation:It gives a measure of the degree to which a pure color is diluted by
white color.
Intensity:It depends upon color brightness.

CHAPTER:2 WATERMARKING

2.1 DIGITAL IMAGE :

What is an image?
An image is defined as a two-dimensional function,F(x,y), where x and y
are spatial coordinates, and the amplitude of F at any pair of coordinates (x,y) is
called the intensity of that image at that point. When x,y, and amplitude values of F
are finite, we call it a digital image.
In other words, an image can be defined by a two-dimensional array
specifically arranged in rows and columns.
Digital Image is composed of a finite number of elements, each of which
elements have a particular value at a particular location.These elements are referred
to as picture elements,image elements,and pixels.A Pixel is most widely used to
denote the elements of a Digital Image.

Types of an image

1. BINARY IMAGE– The binary image as its name suggests, contain only two
pixel elements i.e 0 & 1,where 0 refers to black and 1 refers to white. This
image is also known as Monochrome.
2. BLACK AND WHITE IMAGE– The image which consist of only black and
white color is called BLACK AND WHITE IMAGE.
3. 8 bit COLOR FORMAT– It is the most famous image format.It has 256
different shades of colors in it and commonly known as Grayscale Image. In
this format, 0 stands for Black, and 255 stands for white, and 127 stands for
gray.
4. 16 bit COLOR FORMAT– It is a color image format. It has 65,536 different
colors in it.It is also known as High Color Format. In this format the
distribution of color is not as same as Grayscale image.
A 16 bit format is actually divided into three further formats which are Red,
Green and Blue. That famous RGB format.

Image as a Matrix
As we know, images are represented in rows and columns we have the
following syntax in which images are represented:

The right side of this equation is digital image by definition. Every element of
this matrix is called image element , picture element , or pixel.
INVISIBLE IMAGE WATERMARKING USING WAVELET
TRANSFORM
DIGITAL IMAGE REPRESENTATION IN MATLAB:

In MATLAB the start index is from 1 instead of 0. Therefore, f(1,1) = f(0,0).


henceforth the two representation of image are identical, except for the shift in
origin.
In MATLAB, matrices are stored in a variable i.e X,x,input_image , and so on.
The variables must be a letter as same as other programming languages.

2.2 DIGITAL WATERMARKING DEFINITION:


Digital watermarking is the method of embedding data into digital
multimedia content. This is used to verify the credibility of the content or to
recognize the identity of the digital content's owner.

2.3 WATERMARKING APPLICATIONS:

Digital watermarking may be used for a wide range of applications, such as:
• Copyright protection
• Source tracking (different recipients get differently watermarked content)
• Broadcast monitoring (television news often contains watermarked video
from international agencies)
• Video authentication
• Software crippling on screencasting and video editing software programs, to
encourage users to purchase the full version to remove it.
• ID card security
• Fraud and Tamper detection.
• Content management on social networks [4]

2.4 WATERMARKING TYPES:

Types of Watermarks :
1. Visible Watermarks –
These watermarks are visible.
2. Invisible Watermarks –
These watermarks are embedded in the media and use steganography
technique. They are not visible by naked eyes.

INVISIBLE IMAGE WATERMARKING USING WAVELET


TRANSFORM
3. Public Watermarks –
These can be understood and modified by anyone using certain
algorithms. These are not secure.
4. Fragile Watermarks –
These watermarks are destroyed by data manipulation. There must be
a system which can detect all changes in the data if fragile
watermarks are to be used.

2.5 DESIGN REQUIREMENTS OF WATERMARKING

Digital image watermarking techniques add a watermark into multimedia


data to ensure authenticity and to protecting a copyright holder from the
unauthorized manipulation of their data. Hence, it is necessary to define the
requirements or characteristics of a watermarking system, which are listed in the
following subsections. Figure 2 illustrates the requirements of watermarking
techniques. Based on applications, these requirements evaluate the
performance of watermarking systems.
CHAPTER 3: DESCRETE WAVELET TRANSFORM

3.1 WAVELET DEFINITION:

A Wavelet is a wave-like oscillation that is localized in time, an example is


given below. Wavelets have two basic properties: scale and location. Scale (or
dilation) defines how “stretched” or “squished” a wavelet is. This property is related
to frequency as defined for waves. Location defines where the wavelet is
positioned in time (or space).

3.2 WAVELET TRANSFORM DEFINITION:

A major disadvantage of the Fourier Transform is it captures global


frequency information, meaning frequencies that persist over an entire signal. This
kind of signal decomposition may not serve all applications well, for example
Electrocardiography (ECG) where signals have short intervals of characteristic
oscillation. An alternative approach is the Wavelet Transform, which decomposes a
function into a set of wavelets.
There are two types of Wavelet Transforms: Continuous and Discrete.
Definitions of each type are given in the above figure. The key difference
between these two types is the Continuous Wavelet Transform (CWT) uses every
possible wavelet over a range of scales and locations i.e. an infinite number of scales
and locations. While the Discrete Wavelet Transform (DWT) uses a finite set of
wavelets i.e. defined at a particular set of scales and locations

3.3 ABOUT DWT:

In mathematics, a discrete wavelet transform (DWT) is any wavelet transform


that decomposes a signal into wavelets, rather than frequencies. In a DWT, the
wavelets are discretely sampled. The temporal resolution is one of the advantages of
DWT over Fourier transforms (i.e., DCT and DFT). This makes DWT a more
attractive research area, by capturing multiple information aspects, such as location in
time and frequency . A set of wavelets, which are mathematical functions, is used to
decompose the signal. The wavelet transform is useful in digital signal processing,
image compression, and in removing noise from the signal. The key idea in a wavelet
transform is the use of a set of basis functions (called wavelets) that offer localization
in the frequency domain. High frequency resolution can be obtained at low
frequencies, and high time resolution can be obtained at high frequencies when using
a wavelet transform.
The DWT of a signal x[n] is defined by the following equations :
Wϕ[ j0, k]=1 M−−√∑ nx[ n] ϕj0, k[ n]
Wψ[ j, k]=1 M−−√∑ nx[ n] ψj, k[ n], forj≥ j0
where Wϕ[ j0, k] are the approximation coefficients, Wψ[ j, k] are the detail
coefficients, and the inverse DWT is given by
x[ n]=1 M−−√∑ kWϕ[ j0, k] ϕj0, k[ n]+1 M−
−√∑ j= j0 J∑ kWψ[ j, k] ψj, k[ n]
with
n=0,1,2,…, M−1, j=0,1,2,…, J−1, k=0,1,2,…,2 j−1
where M is the number of samples to be transferred = 2J, J is the number of
transfer levels, { ϕj, k[ n]} and ψj, k[ n] are two basis functions, ϕ[n] denotes the
scaling function, and ψ[n] denotes the wavelet function.

3.4 ADVANTAGES AND DISADVANTAGES OF DWT ON IMAGE


WATERMARKING

Advantages of DWT :

1. Transformation of the whole image introduces inherent


Scaling.
2.Better identification of which data is relevant to human
Perception higher compression ratio.

INVISIBLE IMAGE WATERMARKING USING WAVELET


TRANSFORM

Disadvantages of DWT :
1. The cost of computing DWT as compared to DCT may be
higher.
2. The use of larger DWT basis functions or wavelet filters
produces blurring and noise near edge regions in images or
video frames
3. Longer compression time.

CHAPTER 4. PROPOSED METHOD


The digital image watermarking is one of important research fields to protect
the data in unauthorized persons.
The main specialty of image watermarking is to embed the data in host image
using scaling factor. The purpose of the proposed embedding algorithm is: not to
be perceptible and should have high robustness.

4.1 EMBEDDING ALGORITHM:

Step 1: Read the color cover image & gray level watermark image IN &W
respectively.

Step 2: The color cover image (RGB) is transformed into HSI image. This
decouples the intensity information from the Color, while hue & saturation
correspond to human Perception.

Step 3: Apply one-level DWT on I component of cover image IN. This is


decomposed into four sub-bands low frequency ( LL ) and high frequency
LH , HL , HH coefficients are denoted by
I---> ILL , ILH , IHL , IHH `
Step 4: To perform watermark embedding process the entropies of each 8*8
blocks of two images (LL coefficient of I component of cover image IN &
watermark image W) are compared and scaled with alpha (α)

I’LL=I LL ( i , j ) +( α * W ( i , j )) for E1>=E2

I LL ( i , j ) -( α * W ( i , j )) else
Where
E1, E2 are Entropy values of each block of LL coefficient of input image
and watermark image.
Where scaling factor (α) is defined as:
α=sigma i/(sigma)^2
Where sigma i is the standard deviation of each block of LL coefficient
of cover image.sigma is the total standard deviation of LL coefficient of cover image

Step 5: Apply Inverse DWT of I LL , I LH , I HL & I HH coefficients to obtain


new intensity image. Finally the new intensity coordinate of image is transformed
into RGB coordinates with original coordinates of Hue &Saturation to obtain
watermarked image (WD).
INVISIBLE IMAGE WATERMARKING USING WAVELET
TRANSFORM

4.2 EMBEDDING FLOW CHART:

4.3 EXTRACTION ALGORITHM


Steps involved in extraction process

Step 1: The watermarked image WD (RGB) is transformed into HSI color


space. This decouples the intensity information from the Color, while hue
& saturation correspond to human Perception.
Step 2: Apply one level DWT on the intensity component of watermarked
image to decompose into four sub bands low frequency ( IW LL ) and
high frequency ( IW LH , IW HL , IW HH ) coefficients.
Step 3: To perform watermark extraction process the 8*8 block entropies of LL
coefficient of watermarked image and LL coefficient of input
images are compared and divided with the scaling factor (α). Finally the
watermark is extracted.

IW’LL=(IWLL ( i , j ) - ILL ( i , j ))/α for E1>=E2

(IWLL ( i , j ) +ILL ( i , j ))/α else

4.4 EXTRACTION FLOWCHART

c
Chapter :4 MATLAB
What is MATLAB?
MATLAB is a software package for high-performance mathematical computation, visualization,
and programming environment. It provides an interactive environment with hundreds of built-in
functions for technical computing, graphics, and animations.
MATLAB stands for Matrix Laboratory. MATLAB was written initially to implement a simple
approach to matrix software developed by the LINPACK (Linear system package) and EISPACK
(Eigen system package) projects.
MATLAB is a modern programming language environment, and it has refined data structures,
includes built-in editing and debugging tools, and supports object-oriented programming.
MATLAB is Multi-paradigm. So, it can work with multiple types of programming approaches,
such as Functional, Object-Oriented, and Visual.

Besides an environment, MATLAB is also a programming language.


As its name contains the word Matrix, MATLAB does its' all computing based on mathematical
matrices and arrays. MATLAB's all types of variables hold data in the form of the array only, let it
be an integer type, character type or String type variable.
MATLAB is used in various disciplines of engineering, science, and economics.

MATLAB allows several types of tasks, such as manipulations with matrix, algorithm
implementation, data, and functions plotting, and can interact with programs written in other
programming languages.
MATLAB is a dynamic and weakly typed programming language.
MATLAB environment handles tasks of the declaration of the data type of the variables and
provision for an appropriate amount of storage for the variables.

History of MATLAB
The development of the MATLAB started in the late 1970s by Cleve Moler, the chairman of the
Computer Science department at the University of New Mexico. Cleve wanted to make his students
able to use LINPACK & EISPACK (software libraries for numerical computing, written in
FORTRAN), and without learning FORTRAN. In 1984, Cleve Moler with Jack Little & Steve
Bangert rewrote MATLAB in C and founded MathWorks. These libraries were known as
JACKPAC at that time, later these were revised in 2000 for matrix manipulation and named as
LAPACK.

Main Features and Capabilities of MATLAB


The diagram in the figure shows the main features and capabilities of MATLAB.
MATLAB's built-in functions provide excellent tools for linear algebra computations, data analysis,
signal processing, optimization, numerical solution of ordinary differential equations (ODEs),
quadrate, and many other types of scientific calculations.
Most of these functions use state-of-the-art algorithms. These are numerous functions for 2-D and
3-D graphics, as well as for animations.
MATLAB supports an external interface to run those programs from within MATLAB. The user is
not limited to the built-in functions; he can write his functions in the MATLAB language.
There are also various optional "toolboxes" available from the developers of MATLAB. These
toolboxes are a collection of functions written for primary applications such as symbolic
computations, image processing, statistics, control system design, and neural networks.
The necessary building components of MATLAB are the matrix. The fundamental data type is the
array. Vectors, scalars, real matrices, and complex matrices are all automatically handled as special
cases of the primary data type. MATLAB loves matrices and matrix functions. The built-in
functions are optimized for vector functions. Therefore, Vectorized commands or codes run much
faster in MATLAB.

MATLAB System
The MATLAB systems consist of five main elements:

Development Environment
This is the set of tools and facilities that help you use MATLAB operations and files. Many of these
tools are the graphical user interface. It involves the MATLAB desktop and command window, a
command history, an editor and debugger, and browsers for considering help, the workspace,
reports, and the search path.
MATLAB Mathematical Function Library
This is a vast compilation of computing design ranging from basic functions, like sum, sine, cosine,
and complex mathematic, to more sophisticated features like matrix inverse, matrix eigenvalues,
Bessel functions, and fast Fourier transforms.
MATLAB Language
This is a high level matrix/array language with control flow statement, function, data structure,
input/output, and object-oriented programming characteristics. It allows both "programming in the
small" to create quick and dirty throw-away programs rapidly and "programming in the large" to
create large and complex application functions.
Graphics
MATLAB has extensive facilities for displaying vector and matrices as graphs, as well as
annotating and printing these graphs. It contains high-level structures for two-dimensional and
three-dimensional data visualization, image processing, animation, and presentation graphics. It also
involves low-level structures that allow us to customize the display of graphics fully as well as to
build complete graphical user interfaces on our MATLAB applications.
MATLAB External Interfaces/API
This is a library that allows us to write C and FORTRAN programs that interact with MATLAB. It
contains facilities for calling routines from MATLAB (dynamic linking), calling MATLAB as a
computational engine, and for reading and writing MAT-files.

Chapter 5: CODE
%% Digital image watermarking
% Digital Image Watermarking method based on hybrid
DWT-HD-SVD Technique:
% Attacks, PSNR, SSIM, NC
%

%invisible image watermarking using dwt in hsi color


space
%% Intilize
clc
clear
close all
%% Import image
cover_image=imread('lena512.bmp');
watermark_logo=imread('cameraman.tif');
%% Plot cover image and watermark image
figure
subplot(1,2,1);
imshow(cover_image);
title('Cover image: 512 x 512');
subplot(1,2,2);
imshow(watermark_logo);
title('Watermark image: 256 x 256');

%% Example: watermark embedding and exraction


alpha=0.1 Attack: Sharpening
method = 'DWT-HD-SVD'; % Apply 'DWT-HD-SVD
Method
alpha = 0.1;
attack = 'Sharpening attack'; % You can choose other
attacks
param = 0.8; % attack parameter
[watermarked_image, extracted_watermark] =
watermark(cover_image,...
watermark_logo,method,alpha,attack,param);

% Plot results
figure;
subplot(2, 2, 1);
imshow(cover_image);
xlabel('a) Cover image');
subplot(2, 2, 2);
imshow(watermarked_image);
xlabel('b) Watermarked image');
subplot(2, 2, 3);
imshow(watermark_logo);
xlabel('c) Watermark logo');
subplot(2, 2, 4);
imshow(extracted_watermark);
xlabel('d) Extracted watermark');

sgtitle(['DWT-HD-SVD method \alpha = '+string(alpha)


attack]);

%% NC vs alpha DWT-HD-SVD figure 5


% Plot normalized correlation for different alpha
method = 'DWT-HD-SVD';
alpha =0.005:0.005:0.2;
attacks = {'No Attack'; 'Gaussian low-pass filter';
'Median';...
'Gaussian noise'; 'Salt and pepper noise';'Speckle noise';...
'JPEG compression'; 'JPEG2000 compression';
'Sharpening attack';...
'Histogram equalization'; 'Average filter'; 'Motion blur'};

% Attack papameters
params = [0; 3; 3; 0.001; 0; 0; 50; 12; 0.8; 0; 0; 0];
NC =
NC_alpha(cover_image,watermark_logo,method,alpha,atta
cks,params);
%% plot NC vs alpha figure 5
NC_plot(alpha,NC,attacks);

%% PSNR vs alpha DWT-HD-SVD


method = 'DWT-HD-SVD';
alpha =0.005:0.005:0.2;
attacks = {'No Attack'; 'Gaussian low-pass filter'; 'Median';
'Gaussian noise';...
'Salt and pepper noise';'Speckle noise'; 'JPEG
compression';...
'JPEG2000 compression'; 'Sharpening attack'; 'Histogram
equalization';...
'Average filter'; 'Motion blur'};
params = [0; 3; 3; 0.001; 0; 0; 50; 12; 0.8; 0; 0; 0];
PSNR =
PSNR_alpha(cover_image,watermark_logo,method,alpha,a
ttacks,params);

%% plot PSNR vs alpha


PSNR_plot(alpha,PSNR,attacks);

%% SSIM vs alpha DWT-HD-SVD figure 7 paper (see


README)
method = 'DWT-HD-SVD';
alpha =0.005:0.005:0.2;
attacks = {'No Attack'; 'Gaussian low-pass filter'; 'Median';
'Gaussian noise';...
'Salt and pepper noise';'Speckle noise'; 'JPEG
compression';...
'JPEG2000 compression'; 'Sharpening attack'; 'Histogram
equalization';...
'Average filter'; 'Motion blur'};
params = [0; 3; 3; 0.001; 0; 0; 50; 12; 0.8; 0; 0; 0];
SSIM =
SSIM_alpha(cover_image,watermark_logo,method,alpha,at
tacks,params);

%% plot SSIM vs alpha


SSIM_plot(alpha,SSIM,attacks);

%% FIGURE 8. Invisibility performance: Watermarked


images and corresponding extracted
% watermarks with various sizes and their corresponding
PSNRs, SSIMs and NCs.

method = 'DWT-HD-SVD';
alpha =0.05;
attack = 'No Attack';
param = 0;

figure
for i=1:3
watermark_logoi = imresize(watermark_logo,2^(-i+1));
[watermarked_image, extracted_watermark] =
watermark(cover_image,watermark_logoi,method,alpha,att
ack,param);
PSNR = psnr(watermarked_image, cover_image);
SSIM = ssim(watermarked_image, cover_image);
NC = nc(watermark_logoi,extracted_watermark);
subplot(2,3,i);
imshow(watermarked_image);
title(['watermarked image';'watermark size
'+string(length(watermark_logoi))
+'x'+string(length(watermark_logoi))]);
xlabel(['PSNR='+string(PSNR);'SSIM='+string(SSIM)]);
subplot(2,3,i+3);
imshow(extracted_watermark);
title('extracted watermark');
xlabel('NC='+string(NC));
end
sgtitle('DWT-HD-SVD: Invisibility performance:
watermarks with various sizes; alpha='+string(alpha)+'; No
Attack');

%% plot watermarked image for different attacks and


watermark sizes

method = 'DWT-HD-SVD';
alpha =0.05;
attacks = {'No Attack'; 'Gaussian low-pass filter'; 'Median';
'Gaussian noise';...
'Salt and pepper noise';'Speckle noise'; 'JPEG
compression';...
'JPEG2000 compression'; 'Sharpening attack'; 'Histogram
equalization';...
'Average filter'; 'Motion blur'};
params = [0; 3; 3; 0.001; 0; 0; 50; 12; 0.8; 0; 0; 0];
for i=3:-1:1
watermark_logoi = imresize(watermark_logo,2^(1-i));
figure
for j=1:length(attacks)

attack = string(attacks(j));
param = params(j);
[watermarked_image, extracted_watermark] =
watermark(cover_image,watermark_logoi,method,alpha,att
ack,param);
PSNR = psnr(watermarked_image, cover_image);
SSIM = ssim(watermarked_image, cover_image);
subplot(3,4,j);
imshow(watermarked_image);
xlabel(['PSNR='+string(PSNR);'SSIM='+string(SSIM)]);
title(attack);
end
sgtitle(['DWT-HD-SVD: Attacked watermarked image; Size
= '+string(length(watermark_logoi))
+'x'+string(length(watermark_logoi))+'; \alpha =
'+string(alpha)]);
end

%% FIGURE 10. Extracted watermarks from the attacked


watermarked images
% Evaluate robustness performance
method = 'DWT-HD-SVD';
alpha =0.05;
attacks = {'No Attack'; 'Gaussian low-pass filter'; 'Median';
'Gaussian noise';...
'Salt and pepper noise';'Speckle noise'; 'JPEG
compression';...
'JPEG2000 compression'; 'Sharpening attack'; 'Histogram
equalization';...
'Average filter'; 'Motion blur'};
params = [0; 3; 3; 0.001; 0; 0; 50; 12; 0.8; 0; 0; 0];
for i=3:-1:1
watermark_logoi = imresize(watermark_logo,2^(1-i));
figure

for j=1:length(attacks)
attack = string(attacks(j));
param = params(j);
[watermarked_image, extracted_watermark] =
watermark(cover_image,watermark_logoi,method,alpha,att
ack,param);
NC = nc(watermark_logoi,extracted_watermark);
subplot(3,4,j);
imshow(extracted_watermark);
xlabel([attack 'NC='+string(NC)]);
end
sgtitle(['DWT-HD-SVD: Extracted watermarks image from
the attacked watermarked images; Size =
'+string(length(watermark_logoi))
+'x'+string(length(watermark_logoi))+'; \alpha =
'+string(alpha)]);
end

%% FIGURE 11. NC values under different parameters


suffering various attacks
watermark_logo1 = watermark_logo;
watermark_logo2 = imresize(watermark_logo,0.5);
watermark_logo3 = imresize(watermark_logo,0.25);
method = 'DWT-HD-SVD';
alpha =0.1;
attacks = {'JPEG compression';'JPEG2000
compression';'Gaussian low-pass filter';...
'Median';'Gaussian noise';'Sharpening attack'};
figure
for j = 1:length(attacks)
attack = string(attacks(j));
params = 0;
switch attack
case 'JPEG compression'
params = 10:10:90;
y = [0.98 1];
x = [0 100];
ticks = string(params);
label = 'Quality Factor (QF)';
case 'JPEG2000 compression'
params = 4:4:36;
y = [0.98 1];
ticks = string(params);
label = 'Compression Ratio (CR)';
case 'Gaussian low-pass filter'
params = 0.5:0.5:4.5;
y = [0.9 1];
ticks = string(params);
label = 'sigma';
case 'Median'
params = 3:7;
y = [0.86 1];
ticks = {'3x3','4x4','5x5','6x6','7x7'};
label = 'Window size';
case 'Gaussian noise'
params = 0.001:0.002:0.009;
y = [0.88 1];
ticks = string(params);
label = 'Variance';
case 'Sharpening attack'
params = 0.1:0.1:0.9;
y = [0.96 1];
ticks = string(params);
label = 'Strength (1-Threshold)';
end
NC1 = 0;
NC2 = 0;
NC3 = 0;
for i = 1:length(params)
[watermarked_image1, extracted_watermark1] =
watermark(cover_image,watermark_logo1,method,alpha,att
ack,params(i));
[watermarked_image2, extracted_watermark2] =
watermark(cover_image,watermark_logo2,method,alpha,att
ack,params(i));
[watermarked_image3, extracted_watermark3] =
watermark(cover_image,watermark_logo3,method,alpha,att
ack,params(i));
NC1(i) = nc(watermark_logo1,extracted_watermark1);
NC2(i) = nc(watermark_logo2,extracted_watermark2);
NC3(i) = nc(watermark_logo3,extracted_watermark3);
end
subplot(3,2,j)
plot(params,NC1,'k<-');
hold on
plot(params,NC2,'rs-');
hold on
plot(params,NC3,'g^-');
hold off
grid on
ylim(y);
xticks(params);
xticklabels(ticks);
xlabel(label);
ylabel('NC(W,W^*)');
legend('256 x 256', '128 x 128', '64 x 64', 'Location',
'southwest');
title(attacks(j));
end
sgtitle('DWT-HD-SVD: NC values under different
parameters suffering various attacks.');

Chapter 6: CONCLUSION

This document gave an introduction about watermarking


and the meaning of hidingdata; also, the problem research
and the importance of watermarking in transmit the data
over the network, for that reason in this document we
propose a system to hiding and embedding the data inside
images. Also, it provided what is the purpose and objectives
of our project.

Chapter 7: REFERENCE
1.https://ieeexplore.ieee.org/document/8709684
2.https://www.researchgate.net/figure/Host-image-a-lena-b-
-Pepper-Watermark-images-c-e-256-128-64-64_fig4_332959660
3.https://github.com/Saied-jhn/Digital-Image-Watermarking
4:GeekforGeeks

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy