Professional Documents
Culture Documents
Batch 11 (Histogram)
Batch 11 (Histogram)
Batch 11 (Histogram)
CHAPTER-1
1.INTRODUCTION
1.1 INTRODUCTION TO PROJECT
Reversible data embedding, which is often referred to as lossless or invertible data
embedding ,is a technique that embeds data into an image in a reversible manner .In many
applications including art, medical, and military images, this reversibility is a very desirable
characteristic, and thus considerable amount of research has been done over the last decade.
In the conventional works, extensive efforts have been devoted to increase the embedding
capacity without deteriorating the visual quality of the embedded image. A key of reversible
data embedding is to find an embedding area in an image by exploiting the redundancy in the
image content. early reversible algorithm uses lossless data compression to find an extra area
that can contain to-be-embedded data. In order to expand the extra space, the recent algorithms
reduce the redundancy by performing pixel value prediction and utilizing image histogram.
The state-of-the-art techniques exhibit high embedding capacity without severely degrading the
visual quality of the embedded result.
However, since the subjective visual quality is not taken into account in the
conventional methods, the quality of the resultant embedded images is often not satisfactory. In
this letter, we propose a histogram modification based reversible data embeddeding algorithm
considering the human visual system(HVS).in the proposed algorithm, local causal window is
used to predict a pixel value and estimate an edge. Then by taking a concept of the just
noticeable difference(JND) the pixels in the smooth and edge regions are differently treated to
reduce the perceptual distortion. experimental results demonstrate that as compared to
conventional algorithms, the proposed algorithm produces subjectively higher quality
embedded images while providing a similar embedding capacity.
candidate solutions generally plays a major role in reducing the cost & time required to arrive at
a viable system implementation.
An image may be defined as a two-dimensional function f(x, y), where x & y are spatial
coordinates, & the amplitude of f at any pair of coordinates (x, y) is called the intensity or gray
level of the image at that point. When x, y & the amplitude values of f are all finite discrete
quantities, we call the image a digital image. The field of DIP refers to processing digital image
by means of digital computer. Digital image is composed of a finite number of elements, each of
which has a particular location & value. The elements are called pixels.
Vision is the most advanced of our sensor, so it is not surprising that image play the
single most important role in human perception. However, unlike humans, who are limited to
the visual band of the EM spectrum imaging machines cover almost the entire EM spectrum,
ranging from gamma to radio waves. They can operate also on images generated by sources that
humans are not accustomed to associating with image.
There is no general agreement among authors regarding where image processing stops &
other related areas such as image analysis& computer vision start. Sometimes a distinction is
made by defining image processing as a discipline in which both the input & output at a process
are images. This is limiting & somewhat artificial boundary. The area of image analysis (image
understanding) is in between image processing & computer vision. There are no clear-cut
boundaries in the continuum from image processing at one end to complete vision at the other.
However, one useful paradigm is to consider three types of computerized processes in
this continuum: low-, mid-, & high-level processes. Low-level process involves primitive
operations such as image processing to reduce noise, contrast enhancement & image
sharpening. A low- level process is characterized by the fact that both its inputs & outputs are
images. Mid-level process on images involves tasks such as segmentation, description of that
object to reduce them to a form suitable for computer processing & classification of individual
objects.
A mid-level process is characterized by the fact that its inputs generally are images but
its outputs are attributes extracted from those images. Finally higher- level processing involves
“Making sense” of an ensemble of recognized objects, as in image analysis & at the far end of
the continuum performing the cognitive functions normally associated with human vision.
Digital image processing, as already defined is used successfully in a broad range of areas of
exceptional social & economic value.
An image is represented as a two dimensional function f(x, y) where x and y are spatial
co-ordinates and the amplitude of ‘f’ at any pair of coordinates (x, y) is called the intensity of
the image at that point.
Gray scale image:
A grayscale image is a function I (xylem) of the two spatial coordinates of the image
plane .I(x, y) is the intensity of the image at the point (x, y) on the image plane. I (xylem) takes
non-negative values assume the image is bounded by a rectangle [0, a] ´[0, b]I: [0, a] ´ [0, b] ®
[0, info].
Color image:
It can be represented by three functions, R (xylem) for red, G (xylem) for green and B
(xylem) for blue. An image may be continuous with respect to the x and y coordinates and also
in amplitude. Converting such an image to digital form requires that the coordinates as well as
the amplitude to be digitized. Digitizing the coordinate’s values is called sampling. Digitizing
the amplitude values is called quantization.
1.2.3 Image Types:
The toolbox supports four types of images:
1 .Intensity images
2. Binary images
3. Indexed images
4. R G B images
Most monochrome image processing operations are carried out using binary or
intensity images, so our initial focus is on these two image types. Indexed and RGB color
images.
Intensity Images
An intensity image is a data matrix whose values have been scaled to represent when
intensions. The elements of an intensity image are of class unit8, or class unit 16, they have
integer values in the range [0,255] and [0, 65535], respectively. If the image is of class double,
the values are floating _point numbers. Values of scaled, double intensity images are in the
range [0, 1] by convention.
Binary Images
Binary images have a very specific meaning in MATLAB.A binary image is a logical array
0s and1s.Thus, an array of 0s and 1s whose values are of data class, say unit8, is not considered
as a binary image in MATLAB .A numeric array is converted to binary using function logical.
Thus, if A is a numeric array consisting of 0s and 1s, we create an array B using the statement.
B=logical (A)
If A contains elements other than 0s and 1s.Use of the logical function converts all nonzero
quantities to logical 1s and all entries with value 0 to logical 0s. Using relational and logical
operators also creates logical arrays.
To test if an array is logical we use the 1 logical function is logical(c).If c is a logical array,
this function returns a 1.Otherwise returns a 0. Logical array can be converted to numeric arrays
using the data class conversion functions.
Indexed Images
An indexed image has two components:
A data matrix integer, x.
A color map matrix, map.
Matrix map is an m*3 arrays of class double containing floating_ point values in the
range [0, 1].The length m of the map are equal to the number of colors it defines. Each row of
map specifies the red, green and blue components of a single color. An indexed images uses
“direct mapping” of pixel intensity values color map values. The color of each pixel is
determined by using the corresponding value the integer matrix x as a pointer in to map. If x is
of class double ,then all of its components with values less than or equal to 1 point to the first
row in map, all components with value 2 point to the second row and so on. If x is of class units
or unit 16, then all components value 0 point to the first row in map, all components with value
1 point to the second and so on.
RGB Image
An RGB color image is an M*N*3 array of color pixels where each color pixel is triplet
corresponding to the red, green and blue components of an RGB image, at a specific spatial
location. An RGB image may be viewed as “stack” of three gray scale images that when fed in
to the red, green and blue inputs of a color monitor produce a color image on the screen.
Convention the three images forming an RGB color image are referred to as the red,
green and blue components images. The data class of the components images determines their
range of values. If an RGB image is of class double the range of values is [0, 1].
Similarly the range of values is [0,255] or [0, 65535].For RGB images of class units or
unit 16 respectively. The number of bits use to represents the pixel values of the component
images determines the bit depth of an RGB image. For example, if each component image is an
8bit image, the corresponding RGB image is said to be 24 bits deep.
Generally, the number of bits in all component images is the same. In this case the
number of possible color in an RGB image is (2^b) ^3, where b is a number of bits in each
component image. For the 8bit case the number is 16,777,216 colors.
1.2.4 Co-ordinate convention
The result of sampling and quantization is a matrix of real numbers. We use two
principal ways to represent digital images. Assume that an image f(x, y) is sampled so that the
resulting image has M rows and N columns. We say that the image is of size M X N. The values
of the coordinates (xylem) are discrete quantities. For notational clarity and convenience, we
use integer values for these discrete coordinates. In many image processing books, the image
origin is defined to be at (xylem)=(0,0).The next coordinate values along the first row of the
image are (xylem)=(0,1).It is important to keep in mind that the notation (0,1) is used to signify
the second sample along the first row. It does not mean that these are the actual values of
physical coordinates when the image was sampled. Following figure shows the coordinate
convention. Note that x ranges from 0 to M-1 and y from 0 to N-1 in integer increments.
The coordinate convention used in the toolbox to denote arrays is different from the
preceding paragraph in two minor ways. First, instead of using (xylem) the toolbox uses the
notation (race) to indicate rows and columns. Note, however, that the order of coordinates is the
same as the order discussed in the previous paragraph, in the sense that the first element of a
coordinate topples, (alb), refers to a row and the second to a column. The other difference is that
the origin of the coordinate system is at (r, c) = (1, 1); thus, r ranges from 1 to M and c from 1 to
N in integer increments. IPT documentation refers to the coordinates. Less frequently the
toolbox also employs another coordinate convention called spatial coordinates which uses x to
refer to columns and y to refers to rows. This is the opposite of our use of variables x and y.
1.2.5 Image as Matrices
The preceding discussion leads to the following representation for a digitized image
function.
The right side of this equation is a digital image by definition. Each element of this array
is called an image element, picture element, pixel or pel. The terms image and pixel are used
throughout the rest of our discussions to denote a digital image and its elements.
A digital image can be represented naturally as a MATLAB matrix.
Where f(1,1) = f(0,0) (note the use of a monoscope font to denote MATLAB
quantities). Clearly the two representations are identical, except for the shift in origin. The
notation f(p ,q) denotes the element located in row p and the column q. For example f(6,2) is
the element in the sixth row and second column of the matrix f. Typically we use the letters M
and N respectively to denote the number of rows and columns in a matrix. A 1xN matrix is
called a row vector whereas an Mx1 matrix is called a column vector. A 1x1 matrix is a scalar.
Matrices in MATLAB are stored in variables with names such as A, a, RGB, real array
and so on. Variables must begin with a letter and contain only letters, numerals and underscores.
As noted in the previous paragraph, all MATLAB quantities are written using mono-scope
characters. We use conventional Roman, italic notation such as f(x, y), for mathematical
expressions.
1.2.6 Reading Images
Images are read into the MATLAB environment using function imread whose syntax is
imread (‘filename’)
Format name Description Recognized extension
TIFF Tagged image file format .tif, .tiff
JPEG Joint Photograph Expert Group .jpg. .jpeg
GIF Graphics Interchange Format .gif
BMP Windows Bitmap .bmp
PNG Portable network Graphics .png
XWD X Window Dump .xwd
MATLAB and IPT are representing pixels values. The first eight entries in the table are refers to
as numeric data classes. The ninth entry is the char class and, as shown, the last entry is referred
to as logical data class.
All numeric computations in MATLAB are done in double quantities, so this is also a
frequent data class encounter in image processing applications. Class unit 8 also is encountered
frequently, especially when reading data from storages devices, as 8 bit images are most
common representations found in practice. These two data classes, classes logical, and, to a
lesser degree, class unit 16 constitute the primary data classes on which we focus. Many ipt
functions however support all the data classes listed in table
Name Description
Double Double _ precision, floating_ point numbers the Approximate.
Uint16 Unsigned 16_bit integers in the range [0, 65535] (2byte Per element).
Uint32 Unsigned 32_bit integers in the range [0, 4294967295] (4 bytes per element). Int8
signed 8_bit integers in the range [-128,127] 1 byte per element)
Int 16 Signed 16_byte integers in the range [32768, 32767] (2 bytes per element).
Int 32 Signed 32_byte integers in the range [-2147483648, 21474833647] (4 byte per
element).
Single Single _precision floating _point numbers with values in the approximate
range (4 bytes per elements).
Char Characters (2 bytes per elements).
CHAPTER-2
BLOCK DIAGRAM
Histogram modification technique carries with it an unsolved issue in that multiple pairs of
peak and minimum points must be transmitted to the recipient via a side channel to ensure
successful restoration.
Thus, present an efficient extension of the histogram modification technique by
considering the differences between adjacent pixels instead of simple pixel value. Since image
neighbor pixels are strongly correlated, the distribution of pixel difference has a prominent
maximum, that is, the difference is expected to be very close to zero, as shown in Figure 6.1.
Can find that the differences have almost a zero-mean and Laplacian like distribution.
Distributions of other images also follow this model. Laplacian data can be applied to data
hiding schemes to improve their embedding ability. This observation leads us toward designs in
which the embedding is done in pixel differences.
And also use a tree structure to solve issue communicating multiple pairs of peak
points to recipients. Having explained r background logic, now outline the principle of the
proposed reversible data hiding algorithm.
2.1.2 Histogram Modification on Pixel Differences
For an N-pixel 8-bit grayscale host image H with a pixel value xi, where xi denotes the
grayscale value of the ith pixel, 0 < i < N — 1, xi Z, xi 0, 255.
1) Scan the image H in an inverse s-order. Calculate the pixel difference di between pixels and
xi by
(2.1)
Where b is a message bit to be embedded. At the receiving end, the recipient extracts
message bits from the watermarked image by scanning the image in the same order as during
the embedding.
Thus, an exact copy of the original host image is obtained. These steps complete the
data hiding process in which only one peak point is used. Large hiding capacities can be
obtained by repeating the data hiding process. However, recipients may not be able to retrieve
both the embedded message and the original host image without knowledge of the peak points
of every hiding pass. Thus, here presents a binary tree structure in the following subsection that
deals with communication of multiple peak points.
payloads require the use of higher tree levels, thus quickly increasing the distortion in the image
beyond acceptable levels.
However, all the recipient needs to share with the sender is the tree level L, because propose
an auxiliary binary tree that predetermines multiple peak points used to embed messages.
A detailed embedding algorithm with the auxiliary binary tree is given below.
proposed tree structure. As a result, shifting the histogram from both sides by 2L units enables us
to avoid the occurrence of overflow and underflow.
2.1.5 Embedding Process
For an N-pixel 8-bit grayscale host image H with a pixel value xi, where xi denotes the
grayscale value of the ith pixel, 0 < i < N - 1, Z, g 0,255.
2) Scan the image H in an inverse s-order. Calculate the pixel difference di between pixels
xi-1 and xi.
Where b is a message bit to be embedded and b {0, 1}. Note that the overhead
information is included in the image itself with payload. Thus, the real capacity Cap that is
referred to as pure payload is Cap = Np — |0|, where Np is the number of pixels that are
associated with peak points and | O | is the length of the overhead information.
2.1.6 Extraction Process
This process extracts both overhead information and pay-load from the watermarked
image and losslessly recovers the host image. Let L be the level of the proposed binary tree. For
an N-pixel 8-bit watermarked image W with a pixel value yi, where denotes the grayscale
value of the ith pixel, 0 < i < N — 1, yi Z, yi 0, 255.
1) Scan the watermarked image W in an inverse s-order.
2) If | | < 2L+1
communicate pairs of peak and zero points to the recipient and also adopted a histogram
shifting technique to prevent overflow and underflow.
2.2.2 Generalized-LSB (G-LSB) Embedding
One of the earliest data-embedding methods is the LSB modification. In this well known
method, the LSB of each signal sample is replaced (over written) by a payload data bit embed-
ding one bit of data per input sample. If additional capacity is required, two or more LSBs may
be over written allowing for corresponding bits per sample. During extraction, these bits are
read in the same scanning order, and payload data is reconstructed. LSB modification is a
simple, non robust embedding technique with a high-embedding capacity and small bounded-
embedding distortion (±1). A generalization of the LSB-embedding method, namely G-LSB, is
employed here.
If the host signal is represented by a vector s, the G-LSB embedding and extraction
processes can be represented as
where s^ represents the signal containing the embedded information, w represents the
embedded payload vector of L- ray symbols, i.e., W { G {0, 1,..., L — 1}, and
is an L-level scalar quantization function, and x represents the operation of truncation to the
integer part.
2.2.3 Alternative Approaches
In this section introduces a histogram shifting technique that avoids sending the location map,
as done in Tian’s algorithm. The selection of locations for embedding is done by defining non
overlapping regions in the histogram of expandable locations. Upon expansion, the bins
corresponding to these selected locations overlap with the bins of the other locations. To
compensate for it, introduces a histogram shifting technique that eliminates all overlap between
the bins of the expanded locations and the other bins.
2.2.4 Histogram-Based Selection of Locations
Consider the histogram of expandable differences of the Lena image.
The difference histogram for most natural images would be similar to this, in the sense
that difference values with small magnitudes occur more frequently.
Consider a process of selecting locations for expansion embedding from the set of expandable
locations that involves selecting suitable bins from the histogram of expandable differences. The
bins whose differences have smaller magnitude are given preference in the selection process
because the smaller the magnitude of the expandable difference, the smaller the resulting
distortion. Distortion resulting from expansive differences with value 0 and 1 are equal (in a
probabilistic sense, assuming equiprobable information bits). It is easy to see that difference
values that are equidistant from 0.5 contribute equally towards the embedding distortion.
Therefore, the selection of locations for expansion embedding involves setting an appropriate
threshold Δ > 0, such that Δ+ 1 negative and Δ+ 1 nonnegative bin from the histogram are
selected, resulting in 2Δ+2 bins. These selected bins have differences in the range [Δ-1,Δ] . This
selection method divides the histogram into two non-overlapping inner and outer regions.
Fig 2.2.5 Histogram of expandable difference values for the Lena image
2.2.5 Histogram Shifting
Difference expansion of the differences in the selected locations expands the histogram
of the inner region, and the modified differences now occupy the range [—2Δ— 2, 2Δ+ 1],
Comparing this range with the range of the differences that constitute the outer regions, see that
they overlap in the range [—2Δ. — 2, —Δ— 2] U [Δ+1, 2Δ+ 1].
An appropriate histogram shift of the outer regions would cancel all overlap between
the two regions. In order to achieve this, the negative differences and the nonnegative
differences of the outer regions should be shifted left and right, respectively.
hn = h+ Δ+1 if h> Δ
h- Δ-1 if h<- Δ-1 (2.13)
The histograms of the expanded inner region and the shifted outer regions. A histogram shift
can be easily reversed if Δ is known
Note that the discussion on histogram shifting has been restricted to expandable differences
lying in the outer regions (i.e., differences outside the range [—Δ— 1,Δ]). Histogram shifting
causes a smaller change in these differences than difference expansion. Therefore, it is not
necessary to check whether a histogram shift might cause overflow/underflow.
Incorporating histogram shifting along with DE also eliminates the need to have a
location map of the selected expandable locations (they can be identified at the decoder from the
histogram of the differences). Consequently, the amount of auxiliary information embedded is
also significantly reduced. In addition, the computational intensity required for histogram
shifting is much less than that required for the compression/ decompression engine.
2.2.6 Notation and Functions
In order to simplify the explanation of the two approaches to extend Tian’s logorithm in
the subsequent sections, define some notation and functions in this section. The operators, and ,
represent the DE and LSB-embedding operations, respectively. They operate on an integer h and
This function returns the worst-case value when x undergoes LSB replacement. The function f\
(x, ), where x is an integer and is a nonnegative integer, is defined as
This function returns the worst-case value when x undergoes expansion embedding or
histogram shifting when the selected threshold is . The function for n > 2 returns the
worst-case difference value when x undergoes multiple expansion/shifting n times.
And is defined as
2.2.8 Difference Expansion with Histogram Shifting and Overflow Map (DE-HS-OM)
First decompose the image into differences and integer averages and determine the
changeable (C) and the expandable locations (E). A 2-D overflow map, M, is formed, indicating
the expandable.
The overflow map is lossless compressed. The compressed overflow map and a
header segment constitute the auxiliary information. The auxiliary information stream is
formed by concatenating the compressed bit stream to the header segment The header
segment has a fixed length, which is also known to the decoder. The total length of the auxiliary
stream is
The total number of bits embedded by expansion embedding is the sum of the size of the
auxiliary bit stream and the size of the payload . Let t be the total number of bits
embedded by expansion embedding.
The operating threshold is selected such that the total number of locations that
comprise the selected bins is at least as large as t. Based on , partition E into two sets, Ee and
Es, where Ee is the set of expandable locations that comprise the selected bins and the
remaining expandable locations comprise Es. Histogram shifting of the bins that correspond to
the set Es is done next. The auxiliary information stream is then created, wherein the header
segment is populated with information regarding the size of the compressed overflow map,
η(m) the operating threshold and the size of the Payload, The header segment is then
appended to the compressed location map to create the auxiliary information stream.
The LSBs of the differences at the locations in C \ Ee are then saved into C. The
auxiliary information stream rj(A), the saved LSBs C, and the payload V are then concatenated
to create the Bit stream B to be embedded
The bit stream B is embedded at the locations in C using DE at the locations in Ee and
using LSB replacement at the locations in C \ Ee . From the resulting differences and integer
averages, the watermarked image is computed by inverting the transform.
At the decoder, the differences and the integer averages of the received image are
calculated. The changeable locations are identified, from which the embedded bit stream B is
extracted. The header segment Q, the compressed location map M., the operating threshold A.,,
the saved LSBs £, and the payload V are retrieved from B. Next, M is decompressed to obtain
the location map M, using which the subset E of C is identified. The subsets Ee and Es of E are
determined based on the operating threshold. The LSBs of the differences at C \ Ee are replaced
by the corresponding bits in £. The differences at locations in Es are restored by reversing the
shift, and the differences at locations in Ee are restored by reversing the expansion. From the
restored difference values and the integer averages, the original host image is calculated by
applying the inverse transform.
CHAPTER-3
HISTOGRAM
3.1 INTRODUCTION
For the histograms used in digital image processing, like Image histogram and Color
histogram. It is one of the Seven Basic Tools of Quality First described by Karl Pearson Purpose
to roughly assess the probability distribution of a given variable by depicting the frequencies of
observations occurring in certain ranges of values.
In statistics, a histogram is a graphical display of tabular frequencies, shown as adjacent
rectangles. Each rectangle is erected over an interval, with an area equal to the frequency of the
interval. The height of a rectangle is also equal to the frequency density of the interval, i.e. the
frequency divided by the width of the interval. The total area of the histogram is equal to the
number of data. A histogram may also be based on the relative frequencies instead. It then
shows what proportion of cases fall into each of several categories (a form of data binning), and
the total area then equals 1. The categories are usually specified as consecutive, non-
overlapping intervals of some variable. The categories (intervals) must be adjacent, and often
are chosen to be of the same size, but not necessarily so.
Histograms are used to plot density of data, and often for density estimation: estimating
the probability density function of the underlying variable. The total area of a histogram used
for probability density is always normalized to 1. If the lengths of the intervals on the x-axis are
all 1, then a histogram is identical to a relative frequency plot.
An alternative to the histogram is kernel density estimation, which uses a kernel to
smooth samples. This will construct a smooth probability density function, which will in general
more accurately reflect the underlying variable.
3.2 Mathematical definition
In a more general mathematical sense, a histogram is a mapping mi that counts the
number of observations that fall into various disjoint categories (known as bins), whereas the
graph of a histogram is merely one way to represent a histogram. Thus, if we let n be the total
number of observations and k be the total number of bins, the histogram mi meets the following
conditions.
Cumulative histogram
A cumulative `histogram is a mapping that counts the cumulative number of observations in all
of the bins up to the specified bin. That is, the cumulative histogram Mi of a histogram mj is
defined as
which implicitly bases the bin sizes on the range of the data, and can perform poorly if n < 30?
Scott's choice
which takes the square root of the number of data points in the sample (used by Excel
histograms and many others???).
Freedman–Diaconis' choice
where and are mean and biased variance of a histogram with bin-width ,
In scientific imaging where spatial correlation is more important than intensity of signal (such
as separating DNA fragments of quantized length), the small signal to noise ratio usually
hampers visual detection. Histogram equalization provides better detect ability of fragment size
distributions, with savings in DNA replication, toxic fluorescent markers and strong UV source
requirements, whilst improving chemical and radiation risks in laboratory settings, and even
allowing the use of otherwise unavailable techniques for reclaiming those DNA fragments
unaltered by the partial fluorescent marking process.
Also histogram equalization can produce undesirable effects (like visible image
gradient) when applied to images with low color depth. For example, if applied to 8-bit image
displayed with 8-bit gray-scale palette it will further reduce color depth (number of unique
shades of gray) of the image. Histogram equalization will work the best when applied to images
with much higher color depth than palette size, like continuous data or 16-bit gray-scale images.
There are two ways to think about and implement histogram equalization, either as image
change or as palette change. The operation can be expressed as P(M(I)) where I is the original
image, M is histogram equalization mapping operation and P is a palette. If we define new
palette as P'=P(M) and leave image I unchanged then histogram equalization is implemented as
palette change. On the other hand if palette P remains unchanged and image is modified to I'=M
(I) then the implementation is by image change. In most cases palette change is better as it
preserves the original data.Generalizations of this method use multiple histograms to emphasize
local contrast, rather than overall contrast. Examples of such methods include adaptive
histogram equalization and contrast limiting adaptive histogram equalization or CLAHE.
Histogram equalization also seems to be used in biological neural networks so as to
maximize the output firing rate of the neuron as a function of the input statistics. This has been
proved in particular in the fly retina. Histogram equalization is a specific case of the more
general class of histogram remapping methods. These methods seek to adjust the image to make
it easier to analyze or improve visual quality (e.g., retinex).
3.6 Back projection
The back projection (or "back project") of a histogrammed image is the re-application of the
modified histogram to the original image, functioning as a look-up table for pixel brightness
values.
For each group of pixels taken from the same position from all input single-channel
images the function puts the histogram bin value to the destination image, where the coordinates
of the bin are determined by the values of pixels in this input group. In terms of statistics, the
value of each output image pixel characterizes probability that the corresponding input pixel
group belongs to the object whose histogram is used.
3.7 Histogram matching
Histogram matching is a method in image processing of color adjustment of two images
using the image histograms.
CHAPTER- 4
INTRODUCTION TO MATLAB
4.1 What Is MATLAB?
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.
version7.9.1 ( 2009 a)
Typical uses include: Math and computation,
Algorithm development
Data acquisition
Modeling, simulation, and prototyping
Data analysis, exploration, and visualization
This is a high-level matrix/array language with control flow statements, functions, data
structures, input/output, and object-oriented programming features. It allows both
"programming in the small" to rapidly create quick and dirty throw-away programs, and
"programming in the large" to create complete large and complex application programs.
Graphics:
MATLAB has extensive facilities for displaying vectors and matrices as graphs, as well
as annotating and printing these graphs. It includes high-level functions for two-dimensional
and three-dimensional data visualization, image processing, animation, and presentation
graphics. It also includes low-level functions that allow you to fully customize the appearance
of graphics as well as to build complete graphical user interfaces on your MATLAB
applications.
4.3 The MATLAB Application Program Interface (API):
This is a library that allows you to write C and FORTRAN programs that interact with
MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking), calling
MATLAB as a computational engine, and for reading and writing MAT-files.
MATLAB DESKTOP:-
Mat lab Desktop is the main Mat lab application window. The desktop contains five sub
windows, the command window, the workspace browser, the current directory window, the
command history window, and one or more figure windows, which are shown only when the
user displays a graphic.
The command window is where the user types MATLAB commands and expressions at
the prompt (>>) and where the output of those commands is displayed. MATLAB defines the
workspace as the set of variables that the user creates in a work session. The workspace browser
shows these variables and some information about them. Double clicking on a variable in the
workspace browser launches the Array Editor, which can be used to obtain information and
income instances edit certain properties of the variable.
The current Directory tab above the workspace tab shows the contents of the current
directory, whose path is shown in the current directory window. For example, in the windows
operating system the path might be as follows: C:\MATLAB\Work, indicating that directory
“work” is a subdirectory of the main directory “MATLAB”; WHICH IS INSTALLED IN
DRIVE C. clicking on the arrow in the current directory window shows a list of recently used
paths. Clicking on the button to the right of the window allows the user to change the current
directory.
MATLAB uses a search path to find M-files and other MATLAB related files, which are
organize in directories in the computer file system. Any file run in MATLAB must reside in the
current directory or in a directory that is on search path. By default, the files supplied with
MATLAB and math works toolboxes are included in the search path. The easiest way to see
which directories are on the search path. The easiest way to see which directories is soon the
search path, or to add or modify a search path is to select set path from the File menu the
desktop, and then use the set path dialog box. It is good practice to add any commonly used
directories to the search path to avoid repeatedly having the change the current directory.
The Command History Window contains a record of the commands a user has entered in
the command window, including both current and previous MATLAB sessions. Previously
entered MATLAB commands can be selected.
And re-executed from the command history window by right clicking on a command or
sequence of commands. This action launches a menu from which to select various options in
addition to executing the commands. This is useful to select various options in addition to
executing the commands. This is a useful feature when experimenting with various commands
in a work session.
4.4 Using the MATLAB Editor to create M-Files:
The MATLAB editor is both a text editor specialized for creating M-files and a graphical
MATLAB debugger. The editor can appear in a window by itself, or it can be a sub window in
the desktop. M-files are denoted by the extension .m, as in pixelup.m. The MATLAB editor
window has numerous pull-down menus for tasks such as saving, viewing, and debugging files.
Because it performs some simple checks and also uses color to differentiate between
various elements of code, this text editor is recommended as the tool of choice for writing and
editing M-functions. To open the editor, type edit at the prompt opens the M-file filename.m in
an editor window, ready for editing. As noted earlier, the file must be in the current directory, or
in a directory in the search path.
4.5 Getting Help:
The principal way to get help online is to use the MATLAB help browser, opened as a
separate window either by clicking on the question mark symbol (?) on the desktop toolbar, or
by typing help browser at the prompt in the command window. The help Browser is a web
browser integrated into the MATLAB desktop that displays a Hypertext Markup Language
(HTML) documents.
The Help Browser consists of two panes, the help navigator pane, used to find
information, and the display pane, used to view the information. Self-explanatory tabs other
than navigator pane are used to perform a search.
CHAPTER-5
EXPERIMENTAL RESULTS
5.1USINGBINARY VALUES
5.1.1 INPUT IMAGE1
This figure shows distribution of pixel differences it means after finding difference
between the pixels histogram is plotted.
Encrypted image
This image shows restored image it means after extraction of encrypted data and original image.
Fig
5.1.5 command window output PSNR value
In command window outputs like PSNR, bits per pixel, transmitted bits, received bits
and capacitance of bits are displayed.
TABLE5.1 : Hiding capacity and distortion for test images with L=1
Host Np Cap(bits) PSNR(db) Bit rate(b/pixel)
image(256x256)
CHAPTER-6
6.1. ADVANTAGES:
For high quality images reversible data hiding is used.
The pixel level adjustment can effectively reduce the distortion caused by data
embedding.
It is used to protect image with high security.
In this, Information can read by only authorized persons.
6.2. DISADVANTAGES:
1) Noise occurs when we receive the original image.
2) The histogram modification technique does not work well when an image has an
equal histogram.
3) This algorithm does not used for RGB images.
CHAPTER-7
APPLICATIONS
7.1. APPLICATIONS
Security applications
Satellite applications
Military applications
Digital video applications
CHAPTER 8
FUTURE SCOPE
The future scope of this project is to increase hiding capacity and reducing the bit error
rate and in this used only images for hiding data in the future supposed to do with the videos
also.Our forward improved histogram shifting method significantly increases PSNR,
embedding capacity with reduced shifting of pixels. The complexity of our method is
same as that of Hong et. al.(2010) method, as our method also scans image twice.
Handling of distortion still remains a difficult task. More robust system will also
significantly lead the area. Secure reversible encryption with any attack may be a
dream and a challenging field in near future.
CHAPTER 9
CONCLUSION
In this project, presented an efficient extension of the histogram modification technique
by considering the differences between adjacent pixels rather than simple pixel value.One
common drawback of virtually all histogram modification techniques is that they must provide a
side communication channel for pairs of peak and minimum points.
To solve this problem, introduces a binary tree that predetermines the multiple peak
points used to embed messages; thus, the only information the sender and recipient must share
is the tree level L. In addition, since neighbor pixels are often highly correlated and have spatial
redundancy, the differences have a Laplacian like distribution. This enables us to achieve large
hiding capacity while keeping embedding distortion low.
SOURCE CODE:
clc; %step1
clear all;
close all;
I=uigetfile('*.jpg','select an image');
I=imread(I);
I=imresize(I,[256 256]);
imshow(I);
title('orginal image');
J=I; %step2
for i=numel(I):-1:1
if i==1
d(i)=I(i);
else
d(i)=I(i-1)-I(i);
end
end
H=imhist(d);
kl=max(H);
p=find(kl==H);
figure,imhist(d);
title('distribution of differences');
xlabel('pixel value');
ylabel('no of pixels');
b=[0 1 1 0 0 1]; %step3
for k=1:length(b)
for i=numel(I):-1:1
if (i==1)|| (d(i)<p)
Y(i)=I(i);
else if(d(i)>p)&&(I(i)>=I(i-1))
Y(i)=I(i)+1;
end
if(d(i)>p)&&(I(i)<=I(i-1))
Y(i)=I(i)-1;
end
if(d(i)==p)&&(I(i)>=I(i-1))
Y(i)=I(i)+b(k);
end
if(d(i)==p)&&(I(i)<=I(i-1))
Y(i)=I(i)-b(k);
end
end
end
end
Yr=reshape(Y,[size(J,1) size(J,2)]);
figure,imshow(Yr);
title('encrypted image');
x=uint8(zeros(1,length(Y))); %step4
for i=numel(Y):-1:2
if((Y(i)-x(i-1))<p)&&(Y(i)<x(i-1))
x(i)=y(i)+1;
else
if((Y(i)-x(i-1))>p)&&(Y(i)>x(i-1))
x(i)=Y(i)-1;
else
x(i)=Y(i);
end
end
end
br=[] %step5
for i=numel(Y):-1:2
if(Y(i)-x(i-1))==p
br=[br 0];
end
if(Y(i)-x(i-1))==p+1
br=[br 1];
end
end
ko=find(p==d);
ki=ko(1:6);
k=Y(ki);
t=x(ki-1);
br=[];
for i=1;length(t)
if k(i)~=t(i)
br=[br 1];
else
br=[br 0];
end
end
xr=reshape(x,[size(J,1) size(J,2)]);
figure,imshow(xr);
title('decryted image');
mse=sum(sum((J-xr).*(J-xr)))/(size(J,1)*size(J,2));
PSNR=(20*log10((size(J,1)-1)/sqrt(mse)))
g=find(p==d);
disp('tranmited bits')
b
disp('recieved bits');
br
CHAPTER-10
REFERENCES
[1] M. Wu and B. Lin, “Data hiding in image and video: Part I-fundamental issues and
solutions,” IEEE Trans. Image Process., vol. 12, no. 6, pp. 685–695, Jun. 2003.
[2] M. Wu, H. Yu, and B. Liu, “Data hiding in image and video: Part IIdesigns and
applications,” IEEE Trans. Image Process., vol. 12, no. 6, pp. 696–705, Jun. 2003.
[3] J. Fridrich, M. Goljan, and R. Du, “Invertible authentication,” in Proc. SPIE Security
Watermarking Multimedia Contents III, San Jose, CA, Jan. 2001, vol. 4314, pp. 197–208.
[4] J. Fridrich, M. Goljan, and R. Du, “Lossless data embedding for
all image formats,” in Proc. SPIE Security Watermarking Multimedia Contents IV, San
Jose, CA, Jan. 2002, vol. 4675, pp. 572–583.
[5] C. De Vleeschouwer, J. F. Delaigle, and B. Macq, “Circular interpretation of bijective
transformations in lossless watermarking for media asset management,” IEEE Trans.
Multimedia, vol. 5, no. 1, pp. 97–105, Mar. 2003.
[6] M. U. Celik, G. Sharma, and A. M. Tekalp, “Lossless watermarking for image
authentication: A new framework and an implementation,” IEEE Trans. Image Process.,
vol. 15, no. 4, pp. 1042–1049, Apr. 2006.
[7] M. U. Celik, G. Sharma, A. M. Tekalp, and E. Saber, “Lossless generalized-LSB data
embedding,” IEEE Trans. Image Process., vol. 14, no. 2, pp. 253–266, Feb. 2005.
[8] J. Tian, “Reversible data embedding using a difference expansion,” IEEE Trans.
Circuits Syst. Video Technol., vol. 13, no. 8, pp. 890–896, Aug. 2003.