Chapter 1 INTRODUCTION Watermarking has been considered to be a promising solution that can protect the copyright of multimedia data through Trans coding, because the embedded message is always included in the data. However, today, there is no evidence that watermarking techniques can achieve the ultimate goal to retrieve the right owner information from the received data after all kinds of content-preserving manipulations. Because of the fidelity constraint, watermarks can only be embedded in a limited space in the multimedia data. There is always a biased advantage for the attacker whose target is only to get rid of the watermarks by exploiting various manipulations in the finite watermarking embedding space. Now a day the availability of the digital data such as images, audio and video etc. to the public exponentially increases through the internet. At the same time, it is becoming a challenge to provide the ownership for the creators from the unauthorized persons who are duplicating their data or work. Hence we have to design the methods for digital data to provide copyright protection, content authentication, proof of ownership, etc. There are many solutions that have been proposed like Cryptography, Steganography and Watermarking. The watermarking 1
122
Embed
High Performance Digital Image Watermarking Scheme Using DCT - TheSIS 1
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Chapter 1
INTRODUCTION
Watermarking has been considered to be a promising solution that can protect the copyright
of multimedia data through Trans coding, because the embedded message is always included in
the data. However, today, there is no evidence that watermarking techniques can achieve the
ultimate goal to retrieve the right owner information from the received data after all kinds of
content-preserving manipulations. Because of the fidelity constraint, watermarks can only be
embedded in a limited space in the multimedia data. There is always a biased advantage for the
attacker whose target is only to get rid of the watermarks by exploiting various manipulations in
the finite watermarking embedding space.
Now a day the availability of the digital data such as images, audio and video etc. to the
public exponentially increases through the internet. At the same time, it is becoming a challenge
to provide the ownership for the creators from the unauthorized persons who are duplicating their
data or work. Hence we have to design the methods for digital data to provide copyright
protection, content authentication, proof of ownership, etc.
There are many solutions that have been proposed like Cryptography, Steganography and
Watermarking. The watermarking technique provides one of the best solutions among them. This
technique embeds information so that it is not easily perceptible to the others. The embedded
watermark should not degrade the quality of the image and should be perceptually invisible to
maintain its protective secrecy.
In this project we have implemented the watermarking technique which involves the steps of
hiding one image (watermark image) into another image (cover image) based on Discrete
Wavelet Transform, Discrete Cosine Transform and Singular Value Decomposition respectively.
Further the attacks are inserted on the watermarked image to show different types of noisy
effects on it and then in the final step the watermark image is extracted back from this attacked
watermarked image and quality of extracted watermark image is compared with the original
watermark image.
1.1 Need of Project
1
We are in need of getting the good quality of extracted watermark image. The images
extracted using previous techniques were not enough to fulfill our desired quality standards
requirement and also the techniques were not fully robust to attacks. So, here we are designing
this project which will be robust to all different types of attacks and also the watermark image
extracted using this method will be helpful to achieve that standard of quality which is required.
This technique is really helpful in security applications where focus is on hiding the image inside
image.
1.2 Existing System
Protection of digital contents has relied for a long time on encryption though it is evident that
encryption alone is not sufficient to protect digital data. In fact, when a digital content is
decrypted to be eventually presented to the consumer, the protection offered by encryption no
longer exists and a user may duplicate or manipulate the content. Digital watermarking has
consequently been introduced as a complementary mean to enforce intellectual property rights.
The watermark is a digital code irremovably, robustly, and imperceptibly embedded in the host
data and typically contains information about origin, status, or destination of the data. The role of
the embedded information can be manifold.
For copyright protection, the watermark information can refer to the rights holder. If this
information is detected, it can prevent illicit usage of the content or can be used as a proof of
ownership. Another option is to use the watermark as a fingerprint. Using a watermarking
scheme, a fingerprint identifying the buyer is embedded in every sold copy. If an illegal is found
copy appears, the watermark permits to trace back to the guilty buyer.
Distortion occurs in both the pixel values and the geometric boundary of the rescanned
image. The distortion of pixel values is caused by (1) the luminance, contrast, gamma correction
and chrominance variations, and (2) the blurring of adjacent pixels. These are typical effects of
the printer and scanner, and cause perceptible visual quality changes to a rescanned image.
To design a watermarking scheme that can survive geometric distortion as well as pixel value
distortion is important. There has been much emphasis on the robustness of watermarks to pixel
value distortions such as compression and signal filtering. However, recently it has become clear
that even very small geometric distortions may break the watermarking method. This problem is
2
most severe when the original un-watermarked image is unavailable to the detector. Conversely,
if the original image is available to the detector, then the watermarked image can often be
registered to the original and the geometric distortion thereby inverted.
However, public watermarking requires that detection of the watermark be performed
without access to the original un-watermarked image. As such, it is not possible to invert the
geometric distortion based on registration of the watermarked and original images. Before
proceeding further, it is important to define what we mean by geometric distortions. Specifically,
we are interested in the situation in which a watermarked image undergoes an unknown rotation,
scale and/or translation prior to the detection of the watermark. The detector should detect the
watermark if it is present. This definition is somewhat obvious, so it may be more useful to
describe what we are not interested in. In particular, some watermark algorithms claim
robustness to scale changes by first embedding a watermark at a canonical scale, then changing
the size of the image and finally, at the detector, scaling the image back to the canonical size
prior to correlation. In our opinion, the detector does not see a scale change. Rather, the process
is more closely approximated by a low pass filtering operation that occurs when the image is
reduced in size. Similarly, tests that rotate an image by some number of degrees and
subsequently rotate the image by the same amount in the opposite direction are not adequate tests
of robustness to rotation. The same is true for translation.
These all existing techniques were having some drawbacks like –
False positive problem
Diagonal line problem
Less value of PSNR
High value of Mean Square Error
Less value of Correlation coefficient
1.3 Proposed System
The proposed Watermarking scheme is implemented as in two phases first watermarking and
then extraction. First on image we will apply Haar wavelet transform and will get four sub band
images. On sub band we are applying first DCT and on that DCT matrix we are going to apply
SVD in all values. Then the watermarking step is performed by scaling down the pixel values of
3
watermark and then embedding those values into the cover image. After this the watermarked
image is obtained on which various attacks are applied in order to achieve the robustness in
watermarking. Then we follow the extraction phase where we apply again the Haar wavelet
transform, DCT and SVD and extract the watermark under attacks. Finally the correlation is
determined between the watermark extracted and original watermark as a measure of comparison
of quality of image. This proposed techniques has tried to overcome all issues occurring in
existing models and providing the better quality of image after extraction phase.
1.4 Problem Description
The main motive to implement this project is to solve the problems arising like False
Positive problem and Diagonal Line problem. Also, the problem of less PSNR and less
correlation coefficient after extraction phase is to be resolved here. Keeping these things in mind
only we are implementing this project so that we can be able to extract the image having a good
quality of pixels and also if any type of attack is also inserted in channel then also the effect of
this attack should be nullified.
1.5 Project Limitations
This technique is only applicable to the images having resolution of even size as we are here
first splitting the image into sub-bands which requires bands to get split in one fourth resolution
of original one. Also the resolution of watermark image should be less than the resolution of
cover image and again it also should be in even size. Again, the extracted watermark image here
is not having 100% same quality as of original rather it is limited to some 91-99%.
1.6 Project Methodologies
To implement the proposed technique we are using basically the following methods in both
embedding section and also in extraction phase. These techniques have been further discussed in
detail in subsequent chapters.
Discrete Wavelet Transform (DWT)
Discrete Cosine Transform (DCT)
Singular Value Decomposition (SVD)
4
1.7 Software Specifications
This project has been implemented in MATLAB software package using simple MATLAB
scripting. For designing our project the requirements are as follow –
Minimum Hardware Requirement specification:
1. Intel Pentium IV Processor,
2. 1 GB RAM
3. 20 GB HDD
Minimum Software Requirement Specification:
1. Operating System: Windows XP SP-3, Windows 7
2. MATLAB 2011a
MATLAB (MATrix LABoratory) is a numerical computing environment and fourth-
generation programming language. Developed by Math Works, MATLAB allows matrix
manipulations, plotting of functions and data, implementation of algorithms, creation of user
interfaces, and interfacing with programs written in other languages, including C, C++, Java, and
FORTRAN.
MATLAB is an interactive system for doing numerical computations. A numerical analyst
called Cleve Moler wrote the first version of MATLAB in the 1970s. It has since evolved into a
successful commercial software package. MATLAB relieves you of a lot of the mundane tasks
associated with solving problems numerically. This allows you to spend more time thinking, and
encourages you to experiment. MATLAB makes use of highly respected algorithms and hence
you can be confident about your results. Powerful operations can be performed using just one or
two commands. You can build up your own set of functions for a particular application.
Excellent graphics facilities are available, and the pictures can be inserted into LATEX and
Word documents.
Jack Little joined Cleve and Steve Bangert to found the Math Works in 1984 and a developed
C rewrite of MATLAB. MATLAB was first adopted by control design engineers, Little's
specialty, but quickly spread to many other domains. It is now also used in education, in
particular the teaching of linear algebra and numerical analysis, and is popular amongst scientists
involved with image processing. MATLAB began with 80 functions – simple matrix calculator,
5
portable machine graphic. Now it has over 8000 functions. MATLAB engines incorporated the
LAPACK and BLAS libraries, embedding the state of the art software for matrix computation.
MATLAB is an interactive system whose basic data element is an array that does not require
dimensioning. This allows you to solve many technical computing problems, especially those
with matrix and vector formulations, in a fraction of the time it would take to write a program in
a scalar non interactive language such as C or FORTRAN.
MATLAB has evolved over a period of years with input from many users. In university
environments, it is the standard instructional tool for introductory and advanced courses in
mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high
productivity research, development, and analysis.
MATLAB is an interactive environment and programming language for numeric scientific
computation. One of its distinguishing features is the use of matrices as the only data type. In
MATLAB, a matrix is a rectangular array of real or complex numbers. All quantities, even loop
variables and character strings, are represented as matrices, although matrices with only one row,
or one column, or one element are sometimes treated specially.
MATLAB is a high-performance language for technical computing. It integrates
computation, visualization, and programming in an easy-to-use environment where problems and
solutions are expressed in familiar mathematical notation. Typical uses include –
Math and computation
Algorithm development
Data acquisition
Modeling, simulation, and prototyping
Data analysis, exploration, and visualization
Scientific and engineering graphics
Application development, including graphical user interface building
MATLAB features a family of add-on application specific solutions called toolboxes. Very
important to most users of MATLAB, toolboxes allow you to learn and apply specialized
technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that
6
extend the MATLAB environment to solve particular classes of problems. Areas in which
toolboxes are available include signal processing, control systems, neural networks, fuzzy logic,
wavelets, simulation, and many others.
This is the set of tools and facilities that help you use MATLAB functions and files.
Many of these tools are graphical user interfaces. It includes the MATLAB desktop and
Command Window, a command history, an editor and debugger, a code analyzer and other
reports, and browsers for viewing help, the workspace, files, and the search path.
Fig 1.1: Layout of MATLAB Window
7
MATLAB includes lots of toolboxes (like libraries in C or Java). We are mainly going to use
Image Processing toolboxes, Wavelet toolboxes and mathematical toolboxes for implementing
our project.
Wavelet Toolbox provides functions and an app for developing wavelet-based algorithms for
the analysis, synthesis, denoising, and compression of signals and images. The toolbox lets us
explore wavelet properties and applications such as speech and audio processing, image and
video processing, biomedical imaging, and 1-D and 2-D applications in communications and
geophysics.
Image Processing Toolbox provides a comprehensive set of reference-standard algorithms,
functions, and apps for image processing, analysis, visualization, and algorithm development.
You can perform image enhancement, image deblurring, feature detection, noise reduction,
image segmentation, geometric transformations, and image registration. Many toolbox functions
are multithreaded to take advantage of multicore and multiprocessor computers.
Image Processing Toolbox supports a diverse set of image types, including high dynamic
range, gigapixel resolution, embedded ICC profile, and tomographic. Visualization functions let
you explore an image, examine a region of pixels, adjust the contrast, create contours or
histograms, and manipulate regions of interest (ROIs). With toolbox algorithms you can restore
degraded images, detect and measure features, analyze shapes and textures, and adjust color
balance.
Math Toolbox provides functions for solving and manipulating symbolic math expressions
and performing variable-precision arithmetic. You can analytically perform differentiation,
integration, simplification, transforms, and equation solving. You can also generate code for
MATLAB, Simulink, and Simscape from symbolic math expressions.
Symbolic Math Toolbox includes the MuPAD language, which is optimized for handling and
operating on symbolic math expressions. It provides libraries of MuPAD functions in common
mathematical areas such as calculus and linear algebra and in specialized areas such as number
theory and combinatorics. You can also write custom symbolic functions and libraries in the
MuPAD language. The MuPAD Notebook app lets you document symbolic math derivations
with embedded text, graphics, and typeset math.
8
1.8 Watermarking Applications One application of digital watermarking is source tracking. A watermark is
embedded into a digital signal at each point of distribution. If a copy of the work is
found later, then the watermark may be retrieved from the copy and the source of the
distribution is known. This technique reportedly has been used to detect the source
of illegally copied movies.
Another very important application is owner identification. Being able to identify the
owner of a specific digital work of art, such as a video or image can be quite
difficult.
Transaction tracking is another interesting application of watermarking. In this case
the watermark embedded in a digital work can be used to record one or more
transactions taking place in the history of a copy of this work.
Copy control is a very promising application for watermarking. In this application,
watermarking can be used to prevent the illegal copying of songs, images of movies,
by embedding a watermark in them.
1.9 Structure of Report
The outline of the thesis is as follows: Chapter 2 discusses literature survey on different
watermarking techniques. Chapter 3 describes about Discrete Wavelet Transform. In Chapter 4,
Discrete Cosine Transform is described. Chapter 5 presents Singular Value Decomposition
technique. In Chapter 6, watermarking and its applications have been discussed. In Chapter 7,
Implementation of our proposed watermarking technique in MATLAB is discussed. Chapter 8
presents the results and evaluations of the approach discussed. In Chapter 9, conclusions are
drawn and future work is outlined.
9
Chapter 2
Literature Survey
The task of watermarking and extraction has attracted much attention both from security
applications designers and from computer vision scientists. This chapter gives a literature survey
on state of the art watermarking algorithms. The following research papers focus on variety of
issues.
1.) Y. Shantikumar Singh, B. Pushpa Devi and Kh. Manglem Singh proposed “A review of
different techniques on Digital Image Watermarking Scheme”, IJER, 2013.
Digital Watermarking technique is becoming more important in the developing society of
Internet. It is being used as a key solution to make the data transferring secure from illegal and
unauthorized access. In this paper, the two main domains of watermarking have been discussed
viz. Spatial (pixel) and Transform (frequency) Domains. In spatial (pixel) domain, the watermark
is inserted in the cover image changing pixels or image characteristics. The robustness against
unauthorized alteration of a single bit in every consecutive 8-bits of length is enhanced by the
incorporation of parity checking. Watermark message is cut into numerous pieces and each piece
of message is inserted at different spots, hence, if a piece of message is lost in one spot, the error
correct decoding can be employed to possibly retrieve the same information from other spots.
Compared to spatial domain, frequency domain techniques are more applied. The objective of
this technique is to insert the watermarks in the spectral coefficients of the image. Most
commonly used transforms are the Discrete Cosine Transform (DCT), Discrete Fourier
Transform (DFT), and Discrete Wavelet Transform (DWT). The Discrete Wavelet Transforms
(DWT) and the Discrete Cosine Transforms (DCT). Now days these are being used with the
combination of SVD, which al together provides robustness.
In this paper, some of the recent watermarking algorithms have been reviewed and a
classification is proposed based on their intrinsic features, inserting methods and extraction
forms. Discrete Cosine Transform (DCT) is like Discrete Fourier Transform (DFT) technique
used for converting a signal into frequency components. The 2D-DCT of a given matrix gives
the frequency coefficient in the form of another matrix. Watermarking with DCT techniques are
10
robust as compared to spatial domain techniques. Such algorithms are robust on image
processing operation like low pass filtering, brightness and contrast adjustment, blurring etc. On
the other hand Discrete Wavelet Transform (DWT) is a mathematical tool used for decomposing
any image. Wavelet transform provides both frequency and spatial description of an image. The
wavelet transform decompose the image in four channels (LL, HL, LH and HH) with the same
bandwidth thus creating a multi-resolution perspective. Due to this advantage the watermark can
embed in any of the frequency bands and on inverse transform the watermark will be distributed
throughout the low and high frequencies as well as in the spatial domain. Singular Value
Decomposition (SVD) is numerical analysis tool in linear algebra, which is being used in many
applications of signal processing. It decomposes a matrix with a little error. It is used to provide
robustness characteristics to the image.
2.) Yashovardhan Kelkar, Heena Shaikh and Mohd. Imran Khan proposed “Analysis of
robustness of hybrid digital image watermarking technique under various attacks”,
IJCSMC, 2013.
This paper analyzed the robustness of hybrid digital image watermarking as compared to
DCT, DWT, SVD methods watermarking. Imperceptibility means that the perceived quality of
the host image should not be distorted by the presence of watermark. Peak Signal to Noise Ratio
(PSNR, calculated in dB) which is based on Mean Square Error (MSE) is typically used to
calculate imperceptibility. PSNR properties does not take into account image properties such as
flat and textured regions. If, the watermark is embedded in textured regions and into edges, the
PSNR is inadequate to measure its quality in this case. So, the weighted PSNR (wPSNR) has
been defined as an extension to PSNR. Hybrid watermarking method satisfies all requisites of an
ideal watermarking scheme i.e., imperceptibility, robustness and good capacity along with robust
against different kind of attacks such as Gaussian noise, salt & pepper attacks, JPEG
compression, rotation through an angle etc. The DCT-SVD based method is very time
consuming because it offers better capacity and imperceptibility. DWT-SVD method is also
similar to DCT-SVD scheme except that the process was fast.
3.) Sabyasachi Padhihary proposed “Digital watermarking Based on Redundant Discrete
Wavelet Transform and Singular Value Decomposition, IJARCSSE, 2013.
11
The ownership problem of digital multimedia content is a major problem of concern today.
The high speed of Internet allows a person to transfer the multimedia content like image, audio,
video very easily, but the transferred data is vulnerable as any hacker can easily modify it.
Watermarking is the proposed solution to this problem in which we embed a signal normally
known as watermark in the original data to protect it from the hackers and the watermark can be
detected whenever required. Some of the requirements which a watermarking technique has to
satisfy are Undeletable, Perceptually Invisible, Unambiguous, Non-Inevitability. SVD is widely
used because singular values shows good stability to different attacks but implementing SVD
alone is very costly, as a result hybrid watermarking schemes are proposed. In most of the SVD
based watermarking techniques there exists a drawback i.e. The False Positive Problem. In all
these techniques only the singular value of the watermark image was embedded. To avoid this
problem Jain et al. proposed the concept of principal component. According to this algorithm the
left singular vectors (U) and the right singular vectors (V) also contain significant information.
The principal component of the watermark can be calculated by multiplying the left singular
vectors and the singular vectors obtained after doing SVD on watermark image.
In this paper, RDWT-SVD scheme of watermarking has been proposed which overcomes the
drawbacks of DWT based watermarking scheme (which is a most commonly used watermarking
technique). RDWT method eliminates the down-sampling and up-sampling coefficients as a
result the redundancy is achieved. Thus RDWT based watermarking schemes are more robust
than DWT based watermarking scheme. The redundancy in DWT provides robustness to the
watermark image. As the embedding of watermark image occurs in all sub-bands, the principle
components of the watermark image are embedded into the host image so that the false positive
problem can be avoided and more information can be transferred. The proposed RDWT-SVD
scheme satisfies the capacity, robustness and imperceptibility. To evaluate the quality of
watermarked image Peak Signal to Noise Ratio (PSNR) is calculated and to evaluate robustness
of the watermarked image Normalized Cross-Correlation (NC) can be calculated.
4.) G. Sudheer and G. V. Sridhar proposed “Implementation of robust watermarking
technique using SVD algorithm with GUI representation”, IJARCSMS-2014.
12
This paper proposed invisible image watermarking algorithm based on Singular Value
Decomposition (SVD) to prevent the copy or hostilely modification of the products. An effective
watermarking algorithm should have certain characteristics such as robustness, security,
invisibility, adequate capacity of information etc. In spatial domain watermarks, the pixel value
of the image is modified such as LSB while in transform domain the image is first translated
using DCT or DWT and then watermark is embedded in any of these transforms. Singular Value
Transform (SVD) is an effective numerical analysis tool used for matrices and is used in image
processing.
5.) Ruizhen Liu and Tieniu Tan proposed “A SVD-BASED WATERMARKING SCHEME
FOR PROTECTING RIGHTFUL OWNERSHIP”, IEEE, 2002.
Digital watermarking has been proposed as a solution to the problem of copyright protection
of multimedia documents in networked environments. There are two important issues that
watermarking algorithms need to address. Firstly, watermarking schemes are required to provide
trustworthy evidence for protecting rightful ownership; Secondly, good watermarking schemes
should satisfy the requirement of robustness and resist distortions due to common image
manipulations (such as filtering, compression, etc.). In this paper, we propose a novel
watermarking algorithm based on singular value decomposition (SVD). Analysis and
experimental results show that the new watermarking method performs well in both security and
robustness.
In this paper, a new watermarking method for digital images has been presented. The
watermark is added to the SVD domain of the original image. The mathematical background of
this method is very clear, and the error between the original image and the watermarked image
can be estimated. As a result, important questions such as how to determine the location of the
watermark and how much energy to be inserted can be answered easily. Unlike some other
unitary transformations which adopt fixed orthogonal bases (such as discrete Fourier transform,
discrete cosine transform etc.), SVD uses non-fixed orthogonal bases. It is a one-way, non-
symmetrical decomposition. These properties lead to the good performance of the novel
algorithm in both security and robustness. Furthermore, the algorithm does not require
encryption to resolve rightful ownership and can provide more powerful security for rightful
ownership if combined with encryption. Extensive experiments and comparisons with the Cox
13
method have been made. Results show that the new method is very robust against image
distortion and is considerably more robust than the Cox method.
6.) Yasunori Ishikawa, Kazutake Uehira, and Kazuhisa Yanaka proposed “Optimization of
Size of Pixel Blocks for Orthogonal Transform in Optical Watermarking Technique”
IEEE, 2012.
They previously proposed a novel technology with which the images of real objects with no
copyright protection could contain invisible digital watermarking, using spatially modulated
illumination. In this “optical watermarking” technology, we used orthogonal transforms, such as
a discrete cosine transform (DCT) or a Walsh-Hadamard transform (WHT), to produce
watermarked images, where 1-b binary information was embedded into each pixel block. In this
paper, we propose an optimal condition for a technique of robust optical watermarking that
varies the size of pixel blocks by using a trade-off in the efficiency of embedded watermarking.
We conducted experiments where 4 x 4, 8 x 8, and 16 x 16 pixels were used in one block. A
detection accuracy of 100% was obtained by using a block with 16 x 16 pixels when embedded
watermarking was extremely weak, although the accuracy did not necessarily reach 100% by
using blocks with 4 x 4 or 8 x 8 pixels under the same embedding conditions. We also examined
the effectiveness of using a Haar discrete wavelet transform (Haar DWT) as an orthogonal
transform under the same experimental condition, and the results showed that the accuracy of
detection was slightly inferior to DCT and WHT under very weak embedding conditions. The
results from experiments revealed the effectiveness of our new proposal.
They proposed an optimal condition for the size of pixel blocks of an orthogonal transform
that was used for a technique of robust optical watermarking. The experimental results proved
that it was practical and that the accuracy of detection of data embedded with optical
watermarking could be improved with more pixels in each block. They revealed that under
conditions of very weak embedded watermarking, the accuracy of detection using a block with
16 x 16 pixels reached 100%, except when Haar DWT was used to produce watermarked images
and a complicated structured image was used as an object image. They also clarified that
robustness against various disturbances became a trade-off in optimizing embedded
watermarking data, as the volume of information using blocks with 16 x 16 pixels that could be
embedded into data for the watermarked image was lower than that using blocks with 4 x 4 or 8
14
x 8 pixels. As a result, we concluded that the maximum volume of embedded bits per unit block
size under conditions of 100% accuracy of detection could be determined in optical
watermarking.
7.) Baisa L. Gunjal, R. R. Manthalkar, proposed “An Overview of Transform Domain
Robust Digital Image Watermarking Algorithms”, CIS Journal, 2011.
Internet and Multimedia technologies have become our daily needs. Hence it has become a
common practice to create copy, transmit and distribute digital data. Obviously, it leads to
unauthorized replication problem. Digital image watermarking provides copyright protection to
image by hiding appropriate information in original image to declare rightful ownership. Aim of
this paper is to provide complete overview of Digital Image watermarking. The study focuses on
quality factors essential for good quality watermarking, Performance evaluation metrics (PSNR
and Correlation Factors) and possible attacks. Overview of several methods with spatial and
Transform Domain watermarking is done with detail mathematical formulae, their
implementations, strengths and weaknesses. The generalized algorithms are presented for DWT,
CDMA based, DCT-DWT combined approach. The Ridgelet Transform is also introduced.
Comparative results of Digital Image Watermarking using LSB, DCT and DWT are also
presented. The paper recommends DWT based techniques for achieving Robustness in Digital
Image Watermarking.
LSB based watermarking in spatial domain is the straightforward method, but once
algorithm is discovered, watermark will be no more secured. An improvement on LSB
substitution is to use pseudo random generator to determine pixels to be used for embedding,
based on given seed or key. Security can be improved but algorithm is not still such techniques
are not completely secured.
This paper provides complete overview of Digital Image Watermarking techniques in Spatial
as well as transform domain. The Transform domain watermarking techniques are recommended
to achieve robustness. As per ISO Norms, JPEG2000 has replaced DCT by DWT. Hence more
researchers are focusing on DWT.
8.) L. Robert and T.Shanmugapriya proposed “A Study on Digital Watermarking
Techniques” IJRTE, 2009.
15
With the widespread use of networks, intellectual properties can be obtained and reproduced
easily. This creates a high demand for content protection technique like watermarking, which is
one of the most efficient ways to protect the digital properties in recent years. This paper reviews
several aspects and techniques about digital watermarking.
The amount of data that can be embedded into audio is considerably low than amount that
can be hidden in images, as audio signal has a dimension less than two-dimensional image files.
Embedding additional information into audio sequence is a more tedious than images, due to
dynamic supremacy of HAS than HVS.
Least Significant Bit Coding
This simple approach in watermarking audio sequences is to embed watermark data by
altering certain LSBs of the digital audio stream with low amplitude.
Phase coding
The basic idea is to split the original audio stream into blocks and embed the whole
watermark data sequence into the phase spectrum of the first block.
Quantization Method
A scalar quantization scheme quantizes a sample value x and assign new value to the sample
x based on the quantized sample value.
This paper reviews various techniques for watermarking data files like text, image, audio and
video. According to the paper, we can conclude that watermarking is a potential approach for
protection of ownership rights on digital properties. According to different applications, there are
different requirements of the watermarking system. However, it is hard to satisfy all the
requirements at the same time. So, benchmark is used to evaluate and compare the performance
of different watermarking systems.
9.) G. Bhatnagar and B. Raman, proposed “A new robust reference watermarking scheme
based on DWT-SVD.’’ Computer Standards Interfaces, 2009.
16
This paper presents a new semi-blind reference watermarking scheme based on discrete
wavelet transform (DWT) and singular value decomposition (SVD) for copyright protection and
authenticity. We are using a gray scale logo image as watermark instead of randomly generated
Gaussian noise type watermark. For watermark embedding, the original image is transformed
into wavelet domain and a reference sub-image is formed using directive contrast and wavelet
coefficients. We embed watermark into reference image by modifying the singular values of
reference image using the singular values of the watermark. A reliable watermark extraction
scheme is developed for the extraction of watermark from distorted image. Experimental
evaluation demonstrates that the proposed scheme is able to withstand a variety of attacks. We
show that the proposed scheme also stands with the ambiguity attack also.
Watermarking techniques can be broadly classified into two categories: Spatial and
Transform domain methods. Spatial domain methods are less complex and not robust against
various attacks as no transform is used in them. Transform domain methods are robust as
compared to spatial domain methods. This is due to the fact that when image is inverse
transformed, watermark is distributed irregularly over the image, making the attacker difficult to
read or modify. Due to the fact of localization in both spatial and frequency domain, wavelet
transform is the most preferable transform among all other transforms.
The proposed method embeds watermark by decomposing the host image by the means of
Discrete Wavelet Transform. The watermark used for embedding is a gray scale image. First, the
reference image is formed and is used for watermark embedding. Also, we save this reference
image for the extraction process. For embedding, SVD is applied on both reference and
watermark images and the singular values of reference image is modified with the help of
singular values of watermark image. Inverse wavelet transform is performed to reconstruct the
watermarked image. The block diagram of the proposed watermarking technique is shown.
Original image is not required for the extraction. Reference image is used for the watermark
extraction. The objective of this semi blind watermark extraction is to obtain the estimate of the
original watermark. For watermark extraction from watermarked image, original image is not
required. Hence this extraction is called semi-blind.
10.) Jain, C., Arora, S., & Panigrahi, P. K. proposed “A reliable SVD based
watermarking scheme.” Adsabs, 2008.
17
This proposes a novel scheme for watermarking of digital images based on singular value
decomposition (SVD), which makes use of the fact that the SVD subspace preserves significant
amount of information of an image, as compared to its singular value matrix, Zhang and Li
(2005). The principal components of the watermark are embedded in the original image, leaving
the detector with a complimentary set of singular vectors for watermark extraction. The above
step invariably ensures that watermark extraction from the embedded watermark image, using a
modified matrix, is not possible, thereby removing a major drawback of an earlier proposed
algorithm by Liu and Tan (2002).
Recently, a SVD based watermarking scheme has been proposed by Liu and Tan (2002),
which tries to take advantage of the optimal image decomposition property of SVD for
embedding a watermark in an image. It was however argued by Zhang and Li (2005), that by
taking recourse to the reference matrices of the watermark, the same can be extracted from a
possibly distorted watermarked image. The fact that SVD subspace can preserve major
information of an image, leads to the above-mentioned flaw, in which any reference watermark
that is being searched for in an arbitrary image can be found.
In this paper we have presented a singular value based watermarking scheme, where we
embed the principal components of the watermark in the original image rather than just the
singular values. The fact that the principal components have been added to the singular values of
original image achieves two useful purposes. Firstly, the information about the entire watermark
is not available without a prior knowledge of the original watermark. This is of significance for
the security of the watermark. Secondly, the method avoids the pitfall encountered by Liu and
Tan, where the watermark was modified only along the diagonals, leading to the extraction of a
reference watermark that is being searched using an arbitrary image. Hence, our method utilizes
the property of SVD based watermarking algorithms and ensures rightful ownership of the
digital watermark image.
11.) Roman Rykaczewski proposed “Comments on “An SVD-Based Watermarking
Scheme for Protecting Rightful Ownership.” IEEE, 2007.
This comment demonstrates that this watermarking algorithm is fundamentally flawed in that
the extracted watermark is not the embedded watermark but determined by the reference
18
watermark. The reference watermark generates the pair of SVD matrices employed in the
watermark detector. In the watermark detection stage, the fact that the employed SVD matrices
depend on the reference watermark biases the false positive detection rate such that it has a
probability of one. Hence, any reference watermark that is being searched for in an arbitrary
image can be found. Both theoretical analysis and experimental results are given to support our
conclusion.
In short, the problem has to do with the fact that their detection stage makes use of
information that is dependent on the watermark. The watermark-dependent information is so
improperly used such that it does not guarantee an objective detection outcome and creates a
false positive detection rate of one in the above example. We also note that such type of
problems has been independently addressed in a slightly different way in a recent paper.
Then the watermarked digital signal is transmitted or stored, usually transmitted to another
person. If this person makes a modification, this is called an attack. While the modification may
not be malicious, the term attack arises from copyright protection application, where pirates
attempt to remove the digital watermark through modification. There are many possible
modifications, for example, lossy compression of the data (in which resolution is diminished),
cropping an image or video or intentionally adding noise.
Detection (often called extraction) is an algorithm which is applied to the attacked signal to
attempt to extract the watermark from it. If the signal was unmodified during transmission, then
the watermark still is present and it may be extracted. In robust digital watermarking
applications, the extraction algorithm should be able to produce the watermark correctly, even if
the modifications were strong. In fragile digital watermarking, the extraction algorithm should
fail if any change is made to the signal.
A digital watermark is called robust with respect to transformations if the embedded
information may be detected reliably from the marked signal, even if degraded by any number of
transformations. Typical image degradations are JPEG compression, rotation, cropping, additive
noise, and quantization. For video content, temporal modifications and MPEG compression often
are added to this list. A digital watermark is called imperceptible if the watermarked content is
perceptually equivalent to the original, un-watermarked content. In general, it is easy to create
robust watermarks or imperceptible watermarks, but the creation of robust and imperceptible
watermarks has proven to be quite challenging. Robust imperceptible watermarks have been
proposed as tool for the protection of digital content, for example as an embedded no-copy-
allowed flag in professional video content. Digital watermarking techniques may be classified in
several ways.
A digital watermark is called fragile if it fails to be detectable after the slightest modification.
Fragile watermarks are commonly used for tamper detection (integrity proof). Modifications to
an original work that clearly are noticeable commonly are not referred to as watermarks, but as
generalized barcodes. A digital watermark is called semi-fragile if it resists benign
transformations, but fails detection after malignant transformations. Semi-fragile watermarks
commonly are used to detect malignant transformations.
50
A digital watermark is called robust if it resists a designated class of transformations. Robust
watermarks may be used in copy protection applications to carry copy and no access control
information. To form correct order and get the digital water marking
A digital watermark is called imperceptible if the original cover signal and the marked signal
are perceptually indistinguishable. A digital watermark is called perceptible if its presence in the
marked signal is noticeable.
The length of the embedded message determines two different main classes of digital
watermarking schemes:
The message is conceptually zero-bit long and the system is designed in order to detect
the presence or the absence of the watermark in the marked object. This kind of
watermarking scheme is usually referred to as zero-bit or presence watermarking
schemes. Sometimes, this type of watermarking scheme is called 1-bit watermark,
because a 1 denotes the presence (and a 0 the absence) of a watermark.
The message is a n-bit-long stream ( , with ) or
and is modulated in the watermark. These kinds of schemes usually are
referred to as multiple-bit watermarking or non-zero-bit watermarking schemes.
A digital watermarking method is referred to as spread-spectrum if the marked signal is
obtained by an additive modification. Spread-spectrum watermarks are known to be modestly
robust, but also to have a low information capacity due to host interference.
A digital watermarking method is said to be of quantization type if the marked signal is
obtained by quantization. Quantization watermarks suffer from low robustness, but have a high
information capacity due to rejection of host interference.
A digital watermarking method is referred to as amplitude modulation if the marked signal is
embedded by additive modification which is similar to spread spectrum method, but is
particularly embedded in the spatial domain.
Watermarking has been used extensively to protect digital media from illegal copying and
reproduction. However, this is equally threatened by attackers who use a variety of attacks to
51
remove or to render the watermark useless. These attacks can be roughly grouped into signal
processing attacks or geometric attacks. Geometric attacks are difficult to deal with as they
involve displacement of pixels thereby inducing synchronization errors between the original and
extracted watermarks during detection process.
Fig 6.2: Process of watermarking
The watermark should also be imperceptible and should not degrade the quality of the image. In
order to attain this, the watermark can be embedded in a domain such as the Discrete Cosine
Transform (DCT), using the mid frequencies which do not contain visually important features of
the image and hence largely unaffected by filtering and noise attacks. The DCT is sufficiently
robust to signal processing attacks but very fragile to geometric attacks. There are a few
geometric-distortion focused watermarking schemes; they can be roughly grouped into: moment-
based, template-based, invariant domain-based and feature-point-based schemes.
The important requirements to be satisfied by any digital watermarking scheme are as
follows.
Fidelity: This is about the perceptual similarity between the original image and the
watermarked image. The watermark should be imperceptible and no visual effect should
be perceived by the end user. The watermark may degrade the quality of the content, but
52
in some applications a little degradation may accepted to have higher robustness or lower
cost.
Robustness: Even though an unauthorized person performs some modifications to the
watermarked image through some common signal processing attacks and compression
attacks etc. But the watermark can still be extracted. The scheme should resist the various
attacks from hackers.
Non-inevitability: If we are unable to generate the same watermarked image with the
help of different combinations of host and watermark images then it is called as Non-
invertible watermarking scheme. This provides copyright protection.
The evaluation of digital watermarking schemes may provide detailed information for a
watermark designer or for end-users, therefore, different evaluation strategies exist. Often used
by a watermark designer is the evaluation of single properties to show, for example, an
improvement. Mostly, end-users are not interested in detailed information. They want to know if
a given digital watermarking algorithm may be used for their application scenario, and if so,
which parameter sets seems to be the best.
Reversible data hiding is a technique which enables images to be authenticated and then
restored to their original form by removing the digital watermark and replacing the image data
that had been overwritten. This would make the images acceptable for legal purposes. The U.S.
Army also is interested in this technique for authentication of reconnaissance images.
Digital watermarking for relational databases emerged as a candidate solution to provide
copyright protection, tamper detection, traitor tracing, and maintaining integrity of relational
data. Many watermarking techniques have been proposed in the literature to address these
purposes. A survey of the current state-of-the-art and a classification of the different techniques
according to their intent, the way they express the watermark, the cover type, the granularity
level, and their verifiability, can be found in jucs.org.
6.4 Global geometric distortions
A geometric transformation can be defined by a mapping function that relates the points
in the input image to the corresponding points in the output image. The mapping function of a
global geometric transformation is defined by a set of operational parameters and applied to all
53
the image pixels; that is, the same operation, under the same parameters, affects all the image
pixels. In this section a brief description of some commons geometric distortions is provided,
using concepts from the analytical geometry. An isometry is a transformation of the plane that
preserves distances. Translations, rotations and reflections are the three basic isometries. The simplest isometry is translation, where all pixel positions are modified by a fixed offset in the
horizontal direction Dh and a fixed offset in the vertical direction Dv. A clockwise rotation by an
angle of µ radians can be expressed as:
[ x '
y ']=[ cosθ sinθ−sinθ cosθ] [ x
y ]6.5 Local geometric distortions
Local distortions refer to transformations affecting in different ways the position of the
pixels of the same image or affecting only a subset of the image. The space of all possible local
geometric distortions that is possible to apply to an image (that is, all possible combinations of
the basic transformations applied individually to each subset) has a much higher dimension than
the space of all possible global distortions. Stated in another way, the number of parameters
necessary to describe the modifications resulting from a set of localized distortions in an image is
by far larger than the number of parameters necessary to characterize a global geometric
distortion.
A possible way to model local geometric transformations is to define a series of global
distortions applied to non-overlapping image subsets under distinct parameters. Another way to
think about local geometric distortions is by letting a random set of parameters distortions to be
applied at each individual sampling grid location. This class of distortions is called Random
Bending distortions and it dramatically increases the distortions parameter space's
dimensionality. Random Bending is very common in digital watermarking.
6.6 PSNR (Peak Signal to Noise Ratio)
How do we determine the quality of a digital image? Human eyes perception is the fastest
approach. However, although this criterion is effective in general, the results may differ from
54
person to person. To establish an objective criterion for digital image quality, a parameter named
PSNR (Peak Signal to Noise Ratio) is defined as follows:
PSNR=10 log1025 52
MSE
Where MSE (Mean Square Error) stands for the mean-squared difference between the cover
image and the watermarked image. The mathematical definition for MSE is:
MSE=( 1M × N )∑
i=1
M
∑j=1
N
( aij−bij )2
In Equation above, a ijmeans the pixel value at position (i, j) in the cover-image and b ijmeans the
pixel value at the same position in the corresponding watermarked image. The calculated PSNR
usually adopts dB value for quality judgment. The larger PSNR is, the higher the image quality is
(which means there is only little difference between the cover-image and the watermarked
image). On the contrary, a small dB value of PSNR means there is great distortion between the
cover-image and the watermarked image.
Chapter 7
55
Simulation & Results
7.1 Algorithm
The proposed Watermarking scheme is characterized as follows:
A. Watermark Embedding:
Apply one-level Haar DWT to decompose the host image A, into four subbands i.e., A¿,
AHL, ALH, and AHH.
Consider AHL and perform 2D DCT and using zig-zag sequence, map the DCT
coefficients of AHL into four quadrants:B1,B2, B3 and B4.
Apply SVD to all four quadrants, Bk =U k Sk V kT, where k=1, 2, 3 and 4.
Apply the SVD on the watermark image and calculate the principal components of the
watermark.
W = UW SW V WT , P = UW∗SW (7.1)
Divide the principal components P, into four quadrants: P1, P2, P3 and P4.
Modify the singular values of the DCT coefficients of the cover image with the principal
components of watermark image i.e.,
SWk=Sk+Φ. Pk, k = 1, 2, 3 and 4. (7.2)
Perform, BWk =U k Swk V kT , where k = 1, 2, 3and4.
Map the coefficients of BWk back to their original positions and apply DCT to produce the
modified HL band, AHLW .
Perform the inverse DWT by using modified and non-modified coefficients to get the
watermarked image, AW .
B. Watermark Extraction:
Apply one-level Haar DWT to decompose the watermarked (possibly attacked) image
Aw into four subbands: A¿¿, AHL
¿ , ALH¿ , and AHH
¿ .
Apply DCT on AHL¿ and using zig-zag scan arrange the DCT coefficients of AHL
¿ into four
quadrantsB1¿, B2
¿, B3¿ and B4
¿.
56
Subtract each quadrant with the original transformed quadrants: C k= Bk¿-Bk , where k=1,
2, 3, and 4.
Compute the distorted principal component parts
EPCk =(U k∗C k∗V kT)/Φ (7.3)
Construct the distorted principal component from their parts i.e.
Epc=(Epc1 Epc
2
Epc3 Epc
4 ) (7.4)
Obtain the extracted watermark.
EW=Epc∗V WT (7.5)
7.2 Flowchart
The process of embedding and extraction of watermark has been shown below in the form of a
flowchart, where after starting the process, is prompted for the cover image to be inserted. After
that it prompts for the image to be watermarked. Haar Wavelet Transform is applied to the cover
image, so that its frequency bands can be detected and the image can be inserted in High Level
(HL) band. After that DCT (Discrete Cosine Transform) is applied to the image followed with
SVD (Singular Value Decomposition). Watermarking is done after all these above defines
processes. Now, when data travels through a channel, is affected by many types of attacks. To
show these types of attacks are applied (e.g. Gaussian Noise attack etc). On the other hand, in the
extraction phase, reverse of the above steps have to be followed. Haar Wavelet Transform is
applied on the attacked watermarked image. Due to the watermarking process, the integrity of
the images remains intact. After that I-DCT (Inverse - Discrete Cosine Transform) is applied
followed I-DWT (Inverse – Discrete Wavelet Transform). After that the image is extracted from
the watermarked image. Peak Signal to noise Ratio (PSNR), Correlation Coefficient, Normalized
Coefficient and Mean Square Error values are then calculated from the results hence obtained
from the observations to check for imperceptibility and robustness of the image.
57
Fig 7.1: Embedding Phase
58
Fig 7.2: Extraction Phase
59
Initially, we have to open The Matlab Simulation Software in which we have made the whole
code and saved as a m file. Now, we have to add the path of the new m file which has the code.
After clicking on run it will produce an output as shown in the second window.
Fig 7.3: MATLAB Window
First we call the designed GUI with the help of its MATLAB script function file. This functional
GUI shows different options like Input Cover Image, Input Watermark Image, and Apply DWT
on Cover Image, Apply DCT on Cover Image, Apply SVD on Cover Image etc.
Fig 7.4: Designed GUI for proposed Implementation
60
After clicking on “COVER IMAGE” button, it will prompt you for the path of the cover image
to be inserted. After giving the path it will show you the cover image in the box under the
dimensions.
Fig 7.5: Image after Input Cover Image
Now, when the cover image has been inserted, after clicking on the “WATERMARK IMAGE”
button will prompt you for the path of the watermark image to be inserted. After giving the path,
it will show you the image in the box specified under the dimensions.
Fig 7.6: Image after Input Watermark Image
61
DWT (Discrete Wavelet Transform) is now applied to the cover image by clicking on the button
“APPLY DWT ON COVER IMAGE”, which in turn will give you the HL (High Level) Band
image, in which watermark image is to be embedded.
Fig 7.7: LL Band Image after performing DWT on Cover Image
Now, when the HL Band image has been detected, next step is to apply DCT (Discrete Cosine
Transform) on the cover image by clicking on the button “APPLY DCT ON COVER IMAGE”,
which in turn will give you a DCT applied cover image looking like a distorted one.
Fig 7.8: Image after performing DCT on LL Band Cover Image
62
SVD (Singular Value Decomposition) is now to be applied to decompose the image into
matrices. It is done by clicking on the button “APPLY SVD ON COVER IMAGE” and will
produce an image decomposed into matrix components.
Fig 7.9: Image after performing SVD on LL Band DCT Cover Image
Here, comes the step of watermarking. The watermark image is inserted into the High Level
Band of the cover image in the embedding process by clicking on the button “PERFORM
WATERMARKING”.
Fig 7.10: Image after performing Watermarking on Cover Image with Watermark Image
63
In Attacks Inserting option we have different types of attacks like Gaussian Noise, Poisson
Noise, Speckle Noise, Salt & Pepper Noise, and Rotation at an angle, Geometrical Cropping,
Scaling of Pixel Values, Histogram Equalization, JPEG Compression, Best Contrast, High Pass
Filtering and Low Pass Filtering.
Fig 7.11: Image after performing Gaussian Noise Attack on Watermarked Image
In the detection process, the DWT is again applied on the received attacked image, by clicking
on the button “WATERMARKED DWT IMAGE”.
Fig 7.12: LL Band Image after performing DWT on Attacked Watermarked Image
64
Again, DCT transform is applied on the attacked watermarked image received by clicking on the
button “WATERMARKED DCT IMAGE”. It will produce a distorted type of image which will
be shown in the GUI box.
Fig 7.13: Image after performing DCT on LL Band of Attacked Watermarked Image
Fig 7.14: Extracted Watermark Image After Extraction on Attacked Watermarked Image
65
Fig 7.15: MATLAB Window Showing Values for MSE, PSNR, NC and CC Parameters
These all the steps with proper choice of attack are performed step by step. After execution of all
the steps we see the values of PSNR, MSE, Normalized Correlation Coefficient, Correlation
Coefficient values in MATLAB Command Window. For different images the values of PSNR &
MSE changes. The different values of PSNR & MSE for different images are listed in Table-8.1.
Also for different attacks the values of Normalized Correlation Coefficient and Correlation
Coefficient also changes. The different values of Normalized Correlation Coefficient and
Correlation Coefficient for different attacks have been listed in Table-8.2.
Image PSNR (in dB) MSE
Lena 46.0068 1.6308
House 45.7364 1.6416
Girl 45.9573 1.6495
Boat 45.9804 1.6407
Table – 7.1: Different values of PSNR and MSE for different images
66
Type of Attack NC (Normalized
Correlation coefficient)
CC (Correlation
Coefficient)
Histogram equalize 0.949 0.918
Speckle noise 0.982 0.989
Gaussian noise 0.961 0.969
Rotate by +45 degree 0.992 0.998
Best contrast 0.94 0.918
Salt n pepper noise 0.946 0.894
Poisson noise 0.944 0.939
JPEG Compression 0.987 0.993
Low Pass Filter 0.982 0.991
High Pass Filter 0.982 0.991
Table – 7.2: Different values of NC and CC for different attacks on Lena Image
67
Chapter 8
Conclusion
Here we have taken different cover images like Lena, Girl, Boat and House for comparing
the difference between PSNR and MSE values. In all the cases the value of PSNR is well above
20dB which shows the good quality of embedding algorithm in comparison of other techniques
like DWT watermarking or DCT watermarking of DWT SVD watermarking where we get PSNR
value limited up to 20-30dB along with diagonal line problems or false positive problems.
By embedding the principle components of the watermark into the DCT of horizontal sub
band of DWT decomposition of host image, we can provide better imperceptibility as well as
reliability. By doing this, we can avoid the false positive problem and hence we can provide the
copyright protection. From the extracted watermarks we have proved that there is no diagonal
line problem. We also got a suitable scaling factor for any watermark which is image dependent.
Thus we can get the robustness and transparency of the scheme for any watermark.
The performance of the proposed method is tested by applying different compression and
image processing attacks like different type of noises, image rotations and pixel values
transformations and we have got the values of correlation coefficients all are above 0.75 which
are acceptable. Thus proposed method is robust as well as reliable watermarking technique. The
scheme has been tested with success on various test images on a MATLAB simulation platform.
8.1 Future Scope and Enhancement
This project further can be extended with multilevel DWT or two levels DCT or two levels
SVD to enhance PSNR and Normalized Correlation Coefficient values. Also the method can be
tried to analyze watermarking for RGB or color images with embedding in all 3 channels and
extraction also from all the three channels. Also, instead of hiding image inside image the project
can be extended for hiding a text message inside the image. This technique can also be analyzed
for audio watermarking or video watermarking.
68
Appendix A
function varargout = DCT_DWT_SVD_Watermarking(varargin)% DCT_DWT_SVD_WATERMARKING MATLAB code for DCT_DWT_SVD_Watermarking.fig% DCT_DWT_SVD_WATERMARKING, by itself, creates a new DCT_DWT_SVD_WATERMARKING or raises the existing% singleton*.%% H = DCT_DWT_SVD_WATERMARKING returns the handle to a new DCT_DWT_SVD_WATERMARKING or the handle to% the existing singleton*.%% DCT_DWT_SVD_WATERMARKING('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in DCT_DWT_SVD_WATERMARKING.M with the given input arguments.%% DCT_DWT_SVD_WATERMARKING('Property','Value',...) creates a new DCT_DWT_SVD_WATERMARKING or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before DCT_DWT_SVD_Watermarking_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to DCT_DWT_SVD_Watermarking_OpeningFcn via varargin.%% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one% instance to run (singleton)".%% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help DCT_DWT_SVD_Watermarking
% Last Modified by GUIDE v2.5 11-Mar-2014 13:22:44
if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});else gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT
% --- Executes just before DCT_DWT_SVD_Watermarking is made visible.function DCT_DWT_SVD_Watermarking_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.
69
% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to DCT_DWT_SVD_Watermarking (see VARARGIN)
% Choose default command line output for DCT_DWT_SVD_Watermarkinghandles.output = hObject;
% UIWAIT makes DCT_DWT_SVD_Watermarking wait for user response (see UIRESUME)% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.function varargout = DCT_DWT_SVD_Watermarking_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structurevarargout{1} = handles.output;
% --- Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject handle to pushbutton1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton2.function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject handle to pushbutton3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB
70
% handles structure with handles and user data (see GUIDATA)
global B1;global B2;global B3;global B4;global Param_Data;
% --- Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject handle to pushbutton4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)% hObject handle to pushbutton5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global B_DCT;
[U S V]=svd(B_DCT);axes(handles.axes5);imshow(U);
global U;global S;global V;
% --- Executes on button press in pushbutton6.
71
function pushbutton6_Callback(hObject, eventdata, handles)% hObject handle to pushbutton6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global W;global I;global U;global S;global V;global B1;global B2;global B3;global Value1;
W1=double(W);
if (Value1<2015) [Bw1 Bw2 Bw3 Bw4] = dwt2(W1,'haar');
global Watermarked_Img;global Bw1;global Bw2;global Bw3;
72
% --- Executes on button press in pushbutton7.function pushbutton7_Callback(hObject, eventdata, handles)% hObject handle to pushbutton7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton8.function pushbutton8_Callback(hObject, eventdata, handles)% hObject handle to pushbutton8 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton9.function pushbutton9_Callback(hObject, eventdata, handles)% hObject handle to pushbutton9 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global BB4;
BB_DCT=dct2(BB4);
axes(handles.axes9);imshow(BB_DCT);
global BB_DCT;
75
% --- Executes on button press in pushbutton10.function pushbutton10_Callback(hObject, eventdata, handles)% hObject handle to pushbutton10 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global BB_DCT;global S;global W;global Bw1;global Bw2;global Bw3;
% --- Executes on button press in pushbutton11.function pushbutton11_Callback(hObject, eventdata, handles)% hObject handle to pushbutton11 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
global I;global W;global Watermarked_Img;global Watermark_Recover;
% --- Executes on button press in pushbutton12.function pushbutton12_Callback(hObject, eventdata, handles)% hObject handle to pushbutton12 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB
76
% handles structure with handles and user data (see GUIDATA)
close allclear allclc
% --- Executes on selection change in popupmenu1.function popupmenu1_Callback(hObject, eventdata, handles)% hObject handle to popupmenu1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array% contents{get(hObject,'Value')} returns selected item from popupmenu1
% --- Executes during object creation, after setting all properties.function popupmenu1_CreateFcn(hObject, eventdata, handles)% hObject handle to popupmenu1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end
77
Appendix B
Basic Commands Description
We used MATLAB for implementation of the project. MATLAB stands for Matrix
Laboratory. MATLAB is a high-level language and interactive environment that enables us to
perform computationally intensive tasks faster than with traditional programming languages such
as C, C++, and FORTRAN. Some of the important functions that we have used are:
uigetfile( ): It enables us to select the input source file. For this command we need to
pass type of file we want to read. If .* specified as file format then it indicates the any
file format.
imread( ): reads a grayscale or color image from the file specified by the string filename.
If the file is not in the current folder, or in a folder on the MATLAB path, specify the full
pathname.
imshow( ): It displays the input image.
rgb2gray( ): It converts the true color image RGB to the grayscale intensity image I.
rgb2gray converts RGB images to grayscale by eliminating the hue and saturation
information while retaining the luminance.
imhist( ): It displays a histogram for the image. The number of bins in the histogram is
specified by the image type. If I is a grayscale image, imhist uses a default value of 256
bins. If I is a binary image, imhist uses two bins.
dwt2( ):The dwt2 command performs a single-level two-dimensional wavelet
decomposition with respect to either a particular wavelet.
dct2( ): returns the two-dimensional discrete cosine transform of A. The matrix B is the
same size as A and contains the discrete cosine transform coefficients B.
svd( ): produces a diagonal matrix S of the same dimension as X, with nonnegative
diagonal elements in decreasing order, and unitary matrices U and V so that X = U*S*V'.
78
idct2( ): returns the two-dimensional inverse discrete cosine transform (DCT) of A.
idwt ( ): performs a single-level two-dimensional wavelet reconstruction with respect to
either a particular wavelet.
Guide Toolbox
GUIDE toolbox is used for creating the GUI. Guide initiates the GUI design environment
(GUIDE) tools that allow you to create or edit GUIs interactively. Guide opens the GUIDE
Quick Start dialog where you can choose to open a previously created GUI or create a new one
using one of the provided templates.
Using the GUIDE layout editor, we can populate a GUI by clicking and dragging GUI
components—such as axes, panels, buttons, text fields, sliders, and so on—into the layout area.
We can also create menus and context menus for the GUI. From the Layout Editor, you can
resize the GUI, modify component look and feel, align components, set tab order, view a
hierarchical list of the component objects, and set GUI options.
We can change Tag properties to give a component's callbacks more meaningful names, e.g.,
you might change the Tag property from pushbutton1 to closebutton. If possible, change the Tag
property before saving the GUI, then GUIDE automatically uses the new value when it names
the callbacks. However, if you change the Tag property after saving the GUI, GUIDE updates
the following items according to the new Tag, provided that all components have distinct tags:
the component's callback functions in the M-file. The value of the component's callback
properties, which you can view in the Property Inspector References in the M-file to the field of
the handles structure that contains the component's handle.
GUIDE automatically generates an M-file that controls how the GUI operates. This M-file
provides code to initialize the GUI and contains a framework for the GUI callbacks—the
routines that execute when a user interacts with a GUI component. Using the M-file editor, we
can add code to the callbacks to perform the functions you want.
A callback is a function that you write and associate with a specific GUI component or with
the GUI figure. It controls GUI or component behavior by performing some action in response to
an event for its component. This kind of programming is often called event-driven programming.
79
When an event occurs for a component, MATLAB software invokes the component's
callback that is triggered by that event. As an example, suppose a GUI has a button that triggers
the plotting of some data. When the user clicks the button, the software calls the callback you
associated with clicking that button, and the callback, which you have programmed, then gets the
data and plots it.
A component can be any control device such as a push button, list box, or slider. For
purposes of programming, it can also be a menu or a container such as a panel or button group.
The GUI figure and each type of component has specific kinds of callbacks with which it can be
associated. The callbacks that are available for each component are defined as properties of that
component. For example, a push button has five callback properties: ButtonDownFcn, Callback,
CreateFcn, DeleteFcn, and KeyPressFcn. A panel has four callback properties: ButtonDownFcn,
CreateFcn, DeleteFcn, and ResizeFcn. We can, but are not required to, create a callback function
for each of these properties. The GUI itself, which is a figure, also has certain kinds of callbacks
with which it can be associated.
Each kind of callback has a triggering mechanism or event that causes it to be called. Some
Callback properties are:
Callback: Component action will be Executes, for example, when a user clicks a push
button or selects a menu item. Components are: Context menu, menu, user interface
controls.
CreateFcn: Component creation. It can be use to initialize the component when it is
created. It executes after the component or figure is created, but before it is displayed.