# Behavior Of Spatial And Frequency Domain Techniques Computer Science Essay

**Published:** **Last Edited:**

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Data hiding is an age-old technique used to hide data in an image. Several attacks are prevalent to hack the data hidden inside the image. Considerable researches are going on in this area to protect the hidden data from unauthorized access. The current work is focused towards studying the behavior of Spatial and Frequency Domain Multiple data embedding techniques towards noise prone channels enabling the user to select an optimal embedding technique. The Performance of the above techniques is also focussed towards multiple embedded data inside a single cover image. The robustness of the watermark is tested by incorporating several attacks and testing the watermark strength.

A Digital Watermark may be a data, image or any secret piece of information embedded inside a host image or a video sequence to provide the content of the cover image or video with rightful ownership in order to prevent further misuse of the image or video. In addition to this, a Digital data embedding process can also be used for secret transmission and reception of data inside a cover image involving Steganographic applications. The current work is directed towards an analysis over the applications involving information hiding rather than copyright protections therefore demanding an invisible approach. Any Data Embedding procedures are tested in terms of three main factors namely perceptual imperceptibility, robustness and embedding capacity. Here we have given importance to the first two factors. Since, our applications are incorporated into data hiding, invisibility is an important criterion and its resistance towards various attacks termed as robustness also plays a key role.

A digital embedding system consists of three main elements namely the Embedder, Transmission channel and the Extractor. The Embedder inserts the data to be hidden on the cover image and sent through the communication channel and the extractor retrieves the embedded data back from the host image. A general data embedding system is shown in Fig 1. Usually the Embedded data when propagating through the transmission channel is subjected to various attacks [2] such as noise, intentional tampering of the watermarked image to retrieve or manipulate the hidden data etc., An optimal watermarking strategy should render the watermark robust towards all these kinds of attacks. The above attacks are simulated by introducing random noise, rotation, Gaussian noise, Compression etc., Most of the Data Hiding Techniques focus on embedding the data over the entire image irrespective of the content of the image.

## Rotation

## Data

## Retrieval

## Data Embedding

## Compression

## White Noise

Figure 1: General Data Embedding System

In this paper we use both Spatial Domain and Frequency Domain Approach and compare the robustness of the above techniques tested against various attacks. In the Spatial Domain the Watermarks are embedded in the region of high Luminance Values [1]. In Frequency Domain, we make use transforms such as DCT and DWT, where we embed the data in the regions underlying the edge blocks.

DWT has been used in digital watermarking more frequently than other transforms due to its excellent spatial localization [7], frequency spread and multi-resolution characteristics. Wavelets are special functions which, in a form analogous to sins and cosines in Fourier analysis, are used as basal functions for representing signals. For 2-D images, applying DWT corresponds to processing the image by 2-D filters in each dimension. The filters divide the input image into four non-overlapping multi-resolution subbands LL1, LH1, HL1 and HH1. The LL1 sub-band represents the coarse-scale DWT coefficients while the LH1, HL1 and HH1 sub-bands represent the fine-scale DWT coefficients. To obtain the next coarser scale of wavelet coefficients, the LL1 sub-band is further processed until some final scale N is reached. When N is reached, we will have 3N+1 sub-bands consisting of the multi-resolution sub-bands LLN and LHx, HLx and HHx where x ranges from 1 until N [10]. Fig. 2 shows the wavelet decomposition when the scale N equals to 3.

Due to its excellent spatial-frequency localization properties [8], the DWT is very suitable to identify areas in the host image where a watermark can be embedded effectively. In general, most of the image energy is concentrated at the lower frequency sub-bands LLx and therefore embedding watermarks in these sub-bands may degrade the image significantly. Embedding in the low frequency sub-bands, however, could increase robustness significantly. On the other hand, the high frequency sub-bands HHx include the edges and textures of the image, for which the human eye is not generally sensitive to changes in such sub-bands. This allows the watermark to be embedded without being perceived by the human eye. The compromise adopted by many DWT-based watermarking algorithm, is to embed the watermark in the middle frequency subbands LHx and HLx where acceptable performance of imperceptibility and robustness could be achieved [10].

## Figure 2: 3 Level DWT Decomposition

## II. Methodology

This work is focused on establishing a comparative analysis of frequency domain techniques over spatial domain techniques for Multiple Data Hiding. Any Data Hiding technique involves three basic steps namely Identification of Embedding Location, Data Embedding procedures and finally the Extraction process. The strength of the embedding process is determined by exposing the watermarked image to various attacks which may be addition of noise, compressing the image, rotation, scaling etc. The correlation coefficient is a number between 0 and 1. If there is no relationship between the predicted values and the actual values the correlation coefficient is 0 or very low (the predicted values are no better than random numbers). As the strength of the relationship between the predicted values and actual values increases so does the correlation coefficient. A perfect fit gives a coefficient of 1.0. Thus, higher the correlation coefficient, the better the extracted watermark. In this work, the correlation coefficient is used to establish the relationship between the extracted watermark and the original watermark. After various attacks have been imposed on the watermark, a correlation coefficient of 1 indicates a good watermarking strategy and a 0 indicates poor strength of the watermarking algorithm.

## Figure 3: Cover Images used

## Figure 4: Watermarks used

A discrete cosine transform (DCT) expresses a sequence of finitely many data points in terms of a sum of Cosine functions oscillating at different frequency. DCTs are important to numerous applications in science and engineering. The entire process for spatial and frequency domain methods is shown below

## Embedding in Spatial domain

Spatial Domain Watermarking can

be achieved using color separation. Hence, the watermark appears in only one of the color bands. This makes the watermark detection under normal viewing very difficult. However, on separation of the colors [3] the watermark is visible thus causing an essential drawback when imperceptibility is an important criterion in the watermarking process. The data hiding process illustrated here is based on selecting the embedding blocks based on luminance criterion [1]. The steps are given below.

Step 1: The host image is taken from the available database. It is converted into NTSC image containing the Luminance Component.

Step 2: The blocks containing the highest values are calculated to determine the embedding location.

Step 3: The watermarks to be embedded is taken from the available database and embedded into the luminance components and the image reconverted back to obtain the original watermarks.

## Retrieval in Spatial domain

Step 1: For watermark extraction, the original image is required in extracting watermarks.

Step 2: The coefficients of the watermarked image and the original image are compared to retrieve the encrypted water mark coefficients. The watermark-embedding locations are obtained from the original image.

## Figure 5. Original and Watermarked Images in Spatial Domain

## Embedding in DCT Domain

A discrete cosine transform (DCT) expresses a sequence of finitely many data points in terms of a sum of cosine functions oscillating at different frequencies. DCTs are important to numerous applications in science and engineering, from lossy compression of audio and images to spectral methods for the numerical solution of partial differential equations. Embedding is achieved by inserting the watermark into a selected set of DCT coefficients [4] [5]. After embedding, the watermark is adapted to the image by exploiting the masking characteristics of the human visual system, thus ensuring the watermark invisibility. Experimental results demonstrate that the watermark is considerably robust to several signal processing techniques, including JPEG compression, addition of Gaussian noise, rotation, and random noise.

Step 1: The host image is taken from the available database. If it is an RGB image, it is converted to a gray scale image.

Step 2: The watermarks to be embedded is taken from the available database. If it is an RGB image, it is converted to a grey scale image.

Step 3: The DCT coefficients of the image and watermarks are obtained using DCT through Block Processing wherein each matrix is divided into cells of required dimensions. The resulting matrix is called as Block Matrix. Here DCT is taken separately for each cell.

Step 4: The edge blocks are identified using Sobel operator.

Step 5: Based on the type of the blocks and watermarks, the scaling factor and embedding factor are calculated.

Step6: The Coefficients of the watermarked image are modified as

Modi_C{i,j}= Î²*C{i,j}+ Î± *W{i,j} (1)

where Î² is the scaling factor and Î± is the embedding factor

Step 7: The inverse DCT is applied to obtain the watermarked image.

## Figure 6. Original and Watermarked Images in the DCT Domain

## Retrieval in DCT Domain

Step 1: For watermark extraction, the original image is required in extracting watermarks. Such an extraction is classified as non-blind watermarking. The same DCT decomposition is applied to both the original and embedded images.

Step 2: The coefficients of the watermarked image and the original image are compared to retrieve the watermark coefficients. The watermark-embedding locations are obtained from the original image.

Step 3: By taking inverse Discrete Cosine transform we can view the embedded watermarks.

## Embedding using DWT

Step 1: The host image is taken from the available database. If it is an RGB image, it is converted to a gray scale image.

Step 2: The watermarks to be embedded is taken from the available database. If it is an RGB image, it is converted to a gray scale image.

Step 3: A 3 level DWT is performed on the cover image and the LH or HL bands are chosen for the embedding location. The DWT coefficients of the data to be hidden are then embedded into these sub bands using the following modification.

Modi_C{i,j}= C{i,j}+ Î± *W{i,j} (2)

Where C{i,j} are the host image coefficients

W{i,j} are the watermark coefficients

Î± is the embedding factor which is chosen as 3 to provide a tradeoff between invisibility and robustness.

## Figure 7. Original and Watermarked Images in the DCT Domain

## Retrieval in DWT Domain

Step 1: For watermark extraction, the original image is required in extracting watermarks. Such an extraction is classified as non-blind watermarking. The same 3 Level wavelet decomposition is applied to both the original and embedded images.

Step 2: The coefficients of the watermarked image and the original image are compared to retrieve the watermark coefficients. The watermark-embedding locations are obtained from the original image.

Step 3: By taking inverse Discrete Wavelet transform we can view the embedded watermarks.

## III. Results and Discussion

To begin with 4 standard images of size 256 x 256 were taken which include the Lena, Cameraman, Baboon etc., and subject to embedding in the spatial as well as frequency domain processing as illustrated previously using more than one number of watermarks. The performance of the watermark towards geometric attacks over the transmission channel is analyzed. The Geometric attacks are introduced in the form of noise, rotation, scaling, compression etc., and its Similarity measure between the extracted and the original watermark is obtained. Fig 8a, 8b, 8c & 8d illustrate the spatial domain watermarked image being subjected to noise, rotation and compression attacks. It can be seen that a Spatial Domain watermarked image fails totally when exposed to random noise which is very much prevalent in a common transmission channel. On the other hand, a frequency domain watermarked image exhibits good robustness towards noise which can be seen from the visual results depicted in 9a.

## Figure 8. a. Random Noise b.White Noise c. Rotation d. Compression

## Figure 9: a. Random Noise b. White Noise c. Rotation d. Compression

As depicted earlier, this work investigated the performance of 4 different types of standard images like the Lena, Baboon, House and Peppers image when exposed to various attacks like noise, rotation and compression to various degrees. The behavior is depicted and tabulated in Table1 for spatial domain watermarking method and Table 2 for Frequency domain watermarking method.

## Table1: Behavior of Spatial Domain embedding towards various attacks

## Table2: Behavior of Frequency Domain embedding towards various attacks

We have then turned our attention to a specific analysis of how the watermarked image behaves towards a noisy transmission channel with more of white noise present with zero mean. Table 3 illustrates the performance of a spatial domain watermarked image under a zero noise and noisy condition for the above mentioned 4 standard images. It is evident that all of the images show poor tolerance towards noise exposure in the spatial domain.

## Table 3 Performance of Spatial Domain Watermarked Lena Image towards White Noise

## Table 4 Performance of DCT Domain Watermarked Lena Image towards White Noise

## Table 3 Performance of Wavelet Domain Watermarked Lena Image towards White Noise

## Figure 10: Performance of Spatial, DCT and DWT Domain Watermarks towards noisy channel

From the above work, we conclude the robustness of the watermark varies with various transformations. It is evident that Frequency domain watermarking methods have a significant edge over spatial domain methods in terms of their robustness towards noise and compression attacks. Figure 8 shows the superior performance of both the extracted watermarks in frequency domain to robust towards external random noise than their spatial domain counterparts. Tables 1 and 2 illustrate the behavior of various kinds of host images used in this experiment when exposed to various attacks in terms of the similarity measure determined as the correlation coefficient. Thus this work provides a qualitative analysis between the conventional data hiding technique in Spatial Domain and Frequency based advancements in the field of data hiding in terms of Similarity measure which would provide an effective platform upon which further advancements can be made depending upon the application. Now we are investigating the possibility of use of text embedding inside a medical image to aid in telemedicine.