Digital Watermarking based on Canny Edge Detection and Texture Block in DWT

DOI : 10.17577/IJERTCONV3IS19207

Download Full-Text PDF Cite this Publication

Text Only Version

Digital Watermarking based on Canny Edge Detection and Texture Block in DWT

Mr.Sachin Y Chilkandi Mrs. Naseema Banu U M

Dept,of ECE Asst professor Dept of ECE

Manglore Institute of Technology and Engineering Manglore Institute of technology and Engineering Moodbidri,Manglore India Moodbidri,Manglore,India

Abstract Digital watermarking is a method to secure the digital data such as text, images, and videos. Watermarking is not only used for authentication, it is used for protecting the data. a new algorithm based on canny edge detection and texture block based on dwt has been proposed here. The main objective of this method to improve the robustness of the system and reliability. Canny Edge detection is performed first after that texture blocks are extracted. Watermark can be embedded in both sub-band high frequency and low frequency. The experiment results show the robustness of the system and ability to resist the attacks.

Keywords Digital image watermarking; texture block; edge detection; discrete wavelet transform


    The exponentially increasing demand of multimedia systems and the distribution of large variety of digital image data over the World Wide Web (www) create the need of copyright protection of digital image data. The purpose of digital watermarks is to provide copyright protection for intellectual property rights that is in digital format. Digital watermarking method must satisfy two basic requirements first it must be having perceptual invisibility or transparent for original image. Secondly the watermark must be highly resistant and robust to various attacks such as cropping, noise, compression, rotation, scaling, resizing and translation. Various methods have been developed to increase the transparency and robustness of the watermarking methods [1,3 7 and 9]. Watermarking techniques are broadly classified as visible and invisible watermarking as shown in Fig.1. In visible watermarking, the watermark is visible in the image or video frames.

    These watermarks are not robust and can be used as logos or overlay images in the field of image or video watermarking. But in invisible watermarking the information is hidden within the image. Based on domain which the watermark is applied the invisible watermarking can be further classified as transform domain or spatial Edge Detection method includes the detection of edges from image uses the edge detection algorithm. The edge detection methods mainly are Robert [2], Sobel [3][4], Prewitt[5], and Canny[6]. Here the author uses the Sobel Approach. In this approach the gradient is calculated for all pixel arrangement in the image and as a result, edge is returned for maximum gradient. Digital image watermarking algorithm based on canny edge detection and texture block in

    the discrete wavelet domain is proposed in order to balance between the invisibility and the robustness and improve the ability of resisting to geometric attacks of the digital image watermark. For the purpose, embed the digital watermark into the high-frequency and low frequency sub-brands in the discrete wavelet domain.


    1. Discrete Wavelet Transform

      The wavelet transform has been use in the application of image processing to understand the basic idea of the DWT we focus on one dimensional signal. A signal splits into two parts, usually high frequencies and low frequencies. This process is continuing until the signal has been entirely decomposed or stopped before by the application at hand. For compression and watermarking applications, generally no more than four decomposition steps are computing. Furthermore, from the DWT coefficients, the original signal can be reconstructing. The reconstruction process called the inverse DWT (IDWT).

    2. Digital Image Watermarking Based on canny Edge Detection

      An edge is characterized by an abrupt change in intensity indicating the boundary between two regions in an imait is a fundamental operation in computer vision and image processing. It concerns the detection of significant variations of a gray level image The commonly used methods of edge detection are: canny operator [9], second derivative zero crossing algorithm, gradient operator, Laplace operator, Sobel operator etc. The Canny edge detector is an edge detection operator that uses a multi-stage algorithm to detect a wide range of edges in image the canny edge detector first smoothes the image to eliminate and noise. It then finds the image gradient to highlight regions with high spatial derivatives. The algorithm then tracks along these regions and suppresses any pixel that is not at the maximum (non maximum suppression). The gradient array is now further reduced by hysteresis. Hysteresis is used to track along the remaining pixels that have not been suppressed. Hysteresis uses two thresholds and if the magnitude is below the first threshold, it is set to zero . If the magnitude is above the high threshold, it is made an edge. And if the magnitude is between the 2 thresholds, then it is set to zero unless there is a

      path from this pixel to a pixel with a gradient above T2 The canny detection algorithm is as follows:

      • In gaussian smoothing noise contained in image is smoothed by gaussian filter

      • Calculate the magnitude of the gradient M and the direction Q. The following template of 2 x 2 can be used as a first-order approximation of the partial differential in the x-direction and y-direction.

    P = 1 x[1 1] Q = 1 x[ 1 1]

    1. Canny Edge Detection

      Apply canny edge detection for the original image I to obtained binary image is B .

    2. Partition Blocks

      Partition the binary image B and the original image I into R blocks Bk and Ik ( k= I,2,.··,R), and both of the size are Lx L. Bk and Ik are corresponding. Calculate the number of edge points s in Bk . Let the threshold be T .

    3. Texture Blocks

      2 1 1

      2 1 1

      The texture blocks are extracted whose number of the edge

      Therefore, the magnitude of the gradient M and the direction Q can be calculated

      M(i,j) = 2(, ) + 2(, ) (1)

      (i,j) = arctan[ Q (i,j) P (i,j) ] (2)

      • non-maximum suppression: non-maximum suppression produces thin edges removing the non- maxima pixels along the normal direction

      • hysteresis thresholding: canny use two thresholds high and low if pixel gradient high threshold then edge is detected

        The watermark should be embedded into the high-frequency sub-bands and the low frequency sub-bands respectively with different embedding strength because if embedding the whole watermark into only the high-frequency sub-bands, the robustness of the watermark will decline. In addition, it will be difficult to resist to geometric attacks such as clipping attacks if embedding the watermark into the whole image. Hence, the watermark should be embedded into a plurality of localized positions of the image using the edge detection method. Therefore, a new digital image watermarking algorithm based on canny edge detection and texture block in the discrete wavelet domain is proposed.


    Using the method of partitioning blocks to extract the local religions with good texture properties as well as improve the efficiency of the algorithm. In the algorithm, regard the number of edge points as the parameter for classification because the edge points are the characterization of the image gray mutation and the more edge points in the block are, the stronger the textures are.

    Let theoriginal image I= {x(i,j),I :::: i :::: M,I :::: j :::: N} ,

    the binary watermark image W = f OJ (i,j ) ,1 :::: i :::: P,1 :::: j :::: Q} , where i and j represent the pixel values of the i-th row and the j-th column of the original image and the watermark image respectively. The watermark embedding algorithm flowchart is showed in Fig.l. The steps of embedding the

    watermark are as follows:

    points is more than T. Extract the original image blocks Ik corresponding to the texture blocks as the carrier of embedded watermark. The number of extracted blocks is U

    1. Watermark Arnold Scrambling

      Apply Arnold scrambling to the original watermark with the scrambling time K and then the first key K generates. The water image after scrambling is W'.

      Fig.1 Watermark Embedding Process

    2. Second Generation Discrete Wavelet

      Second generation discrete wavelet transform for the texture blocks Ie ( c= 1,2,.··,U). Embed the watermark of different strength into the low-frequency sub-band LLI and high-frequency sub-brands LHl, HLI and HHI. The formula of embedding the watermark is (1).

      Ie'(i,j)= Ie (i,j) x [1 + axW*(h)]

      C= 1,2,···,U; U= PxQ / 4

      i=1,2···,L/4; j=1,2···,L/4;

      h=1,2···PxQ (3)

      where Ie (i,j) is the coefficients of each sub-band after wavelet transform for the original texture blocks. a is the strength coefficient and W* (h) is the watermark component after scrambling. Ie' (i,j) is the wavelet coefficients of the modified texture blocks. The second key K2 generates which can be used in extracting the watermark information, namely the position of the extracted texture blockIe.

    3. Determination of the Intensity Factor

      a is divided into two kinds a, and a2 because the low frequency sub-brand and the high-frequency sub-brand have different visual masking properties and the robustness after embedding the watermark is also different. Choose a, in the low-frequency and choose a2 in the high-frequency sub-brand. Define a, and a2 as (2) according to the literature [1]:

    4. Second Generation Inverse Discrete Wavelet Transform

    Apply second generation inverse discrete wavelet transform to The image J which has the scrambling watermark.


The extraction and the embedding of the digital watermark are reciprocal process. The watermark extraction algorithm flowchart is showed in Fig.2.

Fig.2 Watermark Extraction Process

The specific process for the digital watermark extraction is as following according to the watermark embedding algorithm.

  1. Partition Block

    Partition the image to be detected J and the original image I into R blocks Jk and Ik (k= 1,2,' . ., R ), and both of the size are 32 x 32 . Jk and Ik are corresponding in position.

  2. Determination of Texture Blocks

    Determine texture block set U = { Uk' k = 1,2,.··, P x Q / 4} from the R blocks of the original image I according to the key K2 generated in the process of embedding watermark. Extract the corresponding blocks from J as the texture block set to be measured U' = {U'k' k = 1,2,.··, P x Q / 4} according to the position of the texture blocks set.

  3. Second Generation Discrete Wavelet Transform Second generation discrete wavelet transform for the extracted U'k and the corresponding Uk . Calculate the intensity factor a1 and a2 according to the method of embedding the watermark. Extract the watermark component according to (3) and (4). W' (h) = [U'k (i,j)/Uk (i,j)-I] / a (3)

    h= 1,2,.· ·,Px Q; i= 1,2,· ··,L/ 4; j= 1,2,···,L/ 4 (4)

    where U'k (i,j) is the coefficients of each frequency brand of the texture blocks to be measured after second generation discrete wavelet decomposition. Uk (i, j) is the coefficients of each frequency brand of the texture blocks of the original image after second generation discrete wavelet decomposition and is corresponding to U'k (i, j) . Judge the value of W* ( h ) . If it is more than 0, the watermark component exists and let the value be 1. If not, let the value be 0.

  4. Arnold Anti-scrambling

    Make the extracted water component W* ( h) Arnold anti- scrambling according to the key K1 and

    then the extracted watermark image W ' {w' (i,j), lsi s P,I sj s Q} can be obtained.

  5. Evaluation of the Watermark

Determine the degree of similarity between the extracted water image and the original water image. It is the most effective to use the subjective approach for meaningful watermark.


We used the Lena image of 256 x 256 and 256 gray scales as the original image and the binary text image of 32 x 32 as the original watermark to test the performance of the algorithm. The original image was divided into blocks of 8 x 8 . The effect of embedding watermark is showed in Fig.3 and Fig A. We can see that the watermarked image is so similar with the original image visually from Fig.3. The invisibility is

Fig 3. (A) Original Image. (B) Watermark. (C)Canny Edge

(D) Histogram Adjustment (E) Extracted Watermark


A new digital image watermarking algorithm based on canny edge detection and texture block in DWT is proposed. In the algorithm, A canny edge detection is applied to the original image after that the texture blocks are extracted and the watermark is embedded adaptively both in the low-frequency sub-band and the high-frequency sub-band in DWT. The result shows the method to improve the robustness of the system and reliability. It also has good ability of resisting to geometric attacks. In further study improve the robustness and enhance capacity of digital watermark.


[I] Yingli Wang, Xue Bai*, Shuang Van Digital Image Watermarking Based on Texture Block and Edge Detection in the Discrete Wavelet Domain, 2013 International Conference on Sensor Network Security Technology and Privacy Communication System (SNS & PCS)

  1. M. Celik et ai, "Analysis of feature-based geometry invariant watermarking," Proceedings of SPIE Conference on Sec. and Water. of Multimedia Contents, 2001, pp. 261-268.

  2. M. Kutter, S. Bhattachm:jee and T. Ebrahimi, "Towards second generation watermarking schemes," Proceedings of International Conference on Image Processing, 1999, pp: 320- 323.

  3. B. S. Kim et ai,"Robust digital image watermarking method against geometrical attacks," Real Time Imaging, 2003, 9(2), pp: 139-149.

  4. X. G. Xia, C. G. Boncelet, and G. R. Arce, "A multiresolution watermark for digital images," IEEE ICIP, California, USA: Santa Barbara, 1997, pp: 548-551.

  5. N. Kaewkamnerd and K. R. Rao, "Wavele based image adaptive watermarking scheme,"Electronics Letters, 2000, 36(2), pp: 312-313.

  6. Niu Xia-mu, Lu Zhe-ming, Sun Sheng-he,"Digital water marking of still images with gray-level digital Watermarks," IEEE Trans. On consumer Electronics, 2000,46(1), pp: 137- 145.

  7. 1. 1. Eggers, R. R. Bauml and B. Girod, "Digital Water marking facing attacks by amplitude scaling and additive white noise Proceedings of International ITG conference on source and channel coding 2002 pp:28-30

[9]. 1. 1. Cox, M. L. Miller and A. McKellips, "Watermarking as

communications with side information," Proceedings of the IEEE, 1999, 87(7), pp: 1127-1141.

  1. Canny. "A Computational Approch to Edge DetectionIEEE transactions on analysis and machine interlligence, 1986,8(6)


  2. Xiang De-sheng, Xiong Vue-shan, "Image adaptive gray- scalewatermarking embedding based on discrete wavelet transform," Computer Applications and Software, 2005, 22(5), pp: 19-21

Leave a Reply