Miniproject 2
Miniproject 2
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 :
Date : 27/04/2022
Certificate
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
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
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
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”.
TYPES OF STEGANOGRAPHY:
• 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:
CHAPTER:2 WATERMARKING
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:
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]
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.
Advantages of DWT :
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.
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.
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
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.
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.
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
%
% 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');
% 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);
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');
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
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
Chapter 6: CONCLUSION
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