Abstract:
An image authentication method by embedding digital watermarks into images, comprising: providing an original image and a watermark image; applying pseudo-random permutations to the watermark image for generating a dispersed watermark image; applying block-based permutations to the original image and the dispersed watermark image in order to form a plurality of original image blocks with each of the watermark blocks dispersed over the corresponding image block only; applying FDCT (Forward Discrete Cosine Transform) on each of the original image blocks independently so that each of the original image blocks is transformed into a DCT coefficient block that corresponds to different frequency ranges; embedding said watermark image blocks into said DCT coefficient blocks, in order to form a plurality of combined DCT coefficient blocks; applying IDCT (Inverse Discrete Cosine Transform) to the combined DCT coefficient blocks to form an embedded watermark image.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a digital watermark; more specifically, the invention relates to a method of providing hidden digital watermarks in images. 
     2. Description of Related Art 
     Due to the rapid and extensive growth of electronic publishing industry, issues regarding protection of copyright have become increasingly important, in a large part because digital data in media form is easily copied and manipulated. One potential solution for claiming the ownership of a digital image is to use electronic stamps or so-called watermarks, which are embedded into the images, wherein the watermarks containing the copyright information should be added to the original digital image data without being perceptually visible to the viewers. 
     In order to achieve the above objects, conventional technologies provide an image authentication technique by embedding digital watermarks into original images. Details regarding technologies of this sort, which are still being developed, are disclosed in “Electronic marking and identification techniques to discourage document copying” by J. T. Brassil, S. Low, N. F. Maxemchuk, and L. O&#39;Gorman, pp. 1495-1504, IEEE J. Select. Areas Commum., vol. 13, October 1995; there different encoding methods are mentioned in the document to conceal digital markings in a document. Furthermore, related publications including “Applying signatures on digital images” by I. Pitas and T. H. Kaskalis, pp. 460-463, in Proc. IEEE Nonlinear Signal and Image Processing, June 1995; “Spatial method for copyright labeling of digital images” by O. Bruyndonckx, J. J. Quisquater, and B. Macq, pp. 456-459, in Proc. IEEE Nonlinear Signal and Image Processing, June 1995; “Image authentication for a slippery new age” by S. Walton, pp. 18-26, Dr. Dobb&#39;s Journal, April 1995; and “Techniques for data hiding” by W. Bender, D. Gruhl, and N. Morimoto, p. 40, Proc. SPIE, vol. 2420, February 1995 are conventional technologies to provide digital watermarks in spatial domain. 
     However, while technologies for concealing added information in digital data are readily available, it is difficult to make sure that the digital watermarks survive common digital image processing operations such as image compression (as in JPEG format), change of geometry (for example, image cropping, ornamental change, etc.), D/A-A/D converting (for example, scanning on a printout), noise interference, and so forth, with the biggest challenge of all being maintaining the watermark on a reduced image after a lossy data compression that eliminates secondary information. A technology for providing digital watermarks in a frequency domain, which superimposes a copyright code and its random sequence of locations for embedding on the image based on a JPEG model, is also readily available, as disclosed in “Toward robust and hidden image copyright labeling” by E. Koch and J. Zhao, pp. 452-455, in Proc. IEEE Nonlinear Signal and Image Processing, June 1995, “Secure spread spectrum watermarking for multimedia” by I. J. Cox, J. Kilian, T. Leighton, and T. Shammoon, in Tech. Rep. 95-10, NEC Res. Inst., Princeton, N.J., 1995, and “Transparent robust image watermarking” by M. D. Swanson, B. Zhu, and A. H. Tewfik, pp. 211-214, in Proc. ICIP &#39;96, etc. 
     However, the above-mentioned conventional technologies do not take into consideration the embedding of the digital watermarks with visible recognizable patterns such as signatures in the forms of Chinese characters and personal seals. 
     SUMMARY OF THE INVENTION 
     In order to improve on the aforementioned technical shortcomings and inadequacies, the present invention is related to a method of providing hidden digital watermarks in images, comprising: providing an original image and a watermark image; applying pseudo-random permutations to the watermark image for generating a dispersed watermark image; applying block-based permutations to the original image and the dispersed watermark image in order to form a plurality of original image blocks with each of the watermark blocks dispersed over the corresponding image block only; applying FDCT (Forward Discrete Cosine Transform) on each of the original image blocks independently so that each of the original image blocks is transformed into a DCT coefficient block that corresponds to different frequency ranges; embedding said watermark image blocks into said DCT coefficient blocks, which are the original image blocks of specified frequency range, in order to form a plurality of combined DCT coefficient blocks; applying IDCT (Inverse Discrete Cosine Transform) to the combined DCT coefficient blocks to form an embedded watermark image. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     Other objects, features, and advantages of the present invention will become apparent from the following detailed description of the preferred but non-limiting embodiment. The description is made with reference to the accompanying drawings in which: 
     FIG. 1A shows a watermark image with a seal in Chinese; 
     FIG. 1B shows a dispersed image of a digital water mark; 
     FIG. 2 is a schematic drawing of a 14-bit linear sequence generator; 
     FIG. 3 shows the corresponding relationship between original image blocks and watermark blocks according to an embodiment of the present invention; 
     FIG.  4 A and FIG. 4B show an example of defining the middle-frequency coefficients whereby DCT coefficients are embedded into the original image blocks according to an embodiment of the present invention; 
     FIG.  5 A and FIG. 5B illustrate the steps of embedding the watermark into the original image according to an embodiment of the present invention; 
     FIG.  6 A and FIG. 6B illustrate the steps of detecting the watermark from a suspected image according to another embodiment of the present invention; 
     FIG. 7 shows a schematic drawing of a 2-D residual mask according an embodiment of the present invention; 
     FIG.  8 A and FIG. 8B shows samples of JPEG quantization table. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     It is an object of the present invention to provide a method of embedding hidden digital watermarks in images. First of all, the watermark is generated as a binary pattern, and then permuted to disperse the spatial relationship and to increase the invisibility based on the characteristics of images, whereas the watermark is embedded into the middle-frequency range of the original image to invisibly embed the watermark that can survive the lossy data compression. Further, watermarks are embedded by modifying the middle-frequency coefficients within each image block of the original image in considering the effect of quantization. The following is a detailed watermark embedding steps. 
     (1). Watermark Embedding Steps 
     Referring to FIG.  5 A and FIG. 5B, in this embodiment, digital watermark data generated are binary image data with visually recognizable patterns embedded into the original images, which have meaning to the viewers. The seal in Chinese, of FIG. 1A, and the watermark image, of FIG. 5B are both examples of such watermark data. In most of the previous arts, the watermark is a symbol or a random number comprising a sequence of bits, which are visually unidentifiable. The digital watermarks according to the present invention are more intuitive for representing one&#39;s identity than a sequence of random numbers is in the prior art. This feature is especially useful for people in the Asian countries who are used to stamps and personal seals to represent one&#39;s identity, a feature not provided by previous digital watermarking technologies developed elsewhere. 
     Furthermore, in this embodiment, each original image X and each watermark image W are transformed into blocks; that is, each watermark block is embedded into the middle-frequency range of each image block using block-transform instead of full-frame transform. Therefore, each watermark block will only be dispersed over its corresponding image block, instead of the entire spatial image. 
     The original copyrighted images X and the digital watermark images W for identification can be input to an image processor for processing through a scanner, where X is the original gray-level image of size N 1 ×N 2 , and the digital watermark W is a binary image of size M 1 ×M 2 . In the watermark, the marked pixels are valued as one&#39;s, and the others are zero&#39;s. Since only the middle-frequency range of the host image will be processed during the watermark embedding, the resolution of a watermark image W is assumed to be smaller that of the original image X. For example, for each 8×8 image block, only        (     64   ×         M   1     ×     M   2           N   1     ×     N   2           )                          
     coefficients will be used for the watermark embedding, The ratio of (M 1 ×M 2 ) and (N 1 ×N 2 ) determines the amount of information to be embedded into the original image. The original image X and digital watermark W are represented as: 
     
       
           X={x ( i, j ), 0 ≦i&lt;N   1 , 0 ≦j≦N   2 } 
       
     
     where x(i, j)ε{0, . . . , 2 L −1} is the intensity of pixel (i, j) 
     and L is the number of bits used in each pixel; 
       W={w ( i, j ), 0 ≦i&lt;M   1 , 0 ≦j&lt;M   2 } 
     where w(i, j)ε{0,1}. 
     In X, there are            N   1     8     ×       N   2     8                            
     image blocks with size 8×8. To obtain the same number            N   1     8     ×       N   2     8                            
     of blocks as the image X, the watermark W is decomposed into several blocks with size          (       M   1     ×     8     N   1         )     ×       (       M   2     ×     8     N   2         )     .                            
     For example, if M 1 =N 1 /2 and M 2 =N 2 /2, the block size of the watermark block is 4×4, and if M 1 =N 1 /4 and M 2 =N 2 /4, the block size of the watermark block is 2×2. The extra columns and rows might be added to complete each image and watermark block. 
     Step S 10 : Pseudo-Random Permutation of the Watermark: 
     Referring to FIG.  2  and FIG. 3 now, in order to avoid the influence of the watermark on the original image due to the spatial relationship, and to increase the invisibility based on the characteristics of the original images, the watermarks are permuted before being embedded to the original images to disperse the spatial relationship through the use of a pseudo-random number generator comprised in a shift register. The permutation is implemented as the following: 
     (a) number each pixel from zero to (M 1 ×M 2 ); 
     (b) generate each number in random order; 
     (c) generate the coordinate pairs by mapping the random sequence number into a 2-D sequence. 
     And the formula is represented as: 
     
       
           W   p =Permute( W ) 
       
     
     
       
           W   p   ={w   p ( i, j )= w ( i′, j ′), 0 ≦i, i′&lt;M   1  and 0 ≦j, j′&lt;M   2 }′ 
       
     
     where pixel (i′, j′) is permuted to pixel (i, j) in a pseudo-random order. 
     For example, for a digital watermark of size 128×128, use a “linear feedback shift register” [ 11 ] to generate a random sequence from 1 to 16383. Then, for each sequence element number M, compute (N div 128) and (M mod 128) as the permuted vertical and horizontal coordinates. 
     Step S 20 : Block-Based Image-Dependent Permutation of the Watermark: 
     In order to improve the perceptual invisibility, the characteristics of the original image should be considered. For example, the modifications of high frequencies or high luminance regions are less perceptible; thus, such image-dependent properties can be used to shuffle the pseudo-random permuted watermark to fit the sensitivity of human eyes. 
     For example, as shown by Table One, for each image block of size 8×8, the variances (which is used as a measure of invisibility under watermark embedding) are computed and sorted; then as shown by Table Two, for each watermark block of size            (       M   1     ×     8     N   1         )     ×     (       M   2     ×     8     N   2         )       ,                          
     the amount of information (i.e. the number of signed pixels) are sorted also. Then, shuffle each watermark block into the spatial position according to the corresponding sorting order of the image block, i.e., W b =Permute(W p ); in which                W   p     =                {         w   p          (         k   ×     (       M   1     ×     8     N   1         )       +   i     ,       l   ×     (       M   2     ×     8     N   2         )       +   j       )       ,                                  0   ≤   k   &lt;       N   1     8       ,     0   ≤   l   &lt;       N   2     8       ,     0   ≤   i   &lt;     (       M   1     ×     8     N   1         )       ,     0   ≤   j   &lt;                                (       M   2     ×     8     N   2         )     }                                
     and                W   b     =                {       w   b          (         k   ×     (       M   1     ×     8     N   1         )       +   i     ,       l   ×     (       M   2     ×     8     N   2         )       +   j       )                       =                  w   p          (           k   ′     ×     (       M   1     ×     8     N   1         )       +   i     ,         l   ′     ×     (       M   2     ×     8     N   2         )       +   j       )         ,                              0   ≤   k     ,       k   ′     &lt;       N   1     8       ,     0   ≤   l     ,       l   ′     &lt;       N   2     8       ,     0   ≤   i   &lt;     (       M   1     ×     8     N   1         )       ,     0   ≤   j   &lt;                                  (       M   2     ×     8     N   2         )     }     ,                                
     where block (k′,l′) is shuffled to block (k,l) by the block-based permutation. 
     
       
         
               
               
               
             
               
               
               
             
           
               
                   
                 TABLE ONE 
               
               
                   
                   
               
               
                   
                 Index of 
                   
               
               
                   
                 Image 
               
               
                   
                 Block 
                 Variances 
               
               
                   
                   
               
             
             
               
                   
               
             
          
           
               
                   
                 4 
                 33.2 
               
               
                   
                 0 
                 30.5 
               
               
                   
                 3 
                 22.2 
               
               
                   
                 1 
                 16.7 
               
               
                   
                 2 
                 8.2 
               
               
                   
                   
               
             
          
         
       
     
     
       
         
               
               
               
             
               
               
               
             
           
               
                   
                 TABLE TWO 
               
               
                   
                   
               
               
                   
                 Index of 
                 Signed 
               
               
                   
                 Watermark 
                 Pixels 
               
               
                   
                 Block 
                 No. 
               
               
                   
                   
               
             
             
               
                   
               
             
          
           
               
                   
                 2 
                 10 
               
               
                   
                 3 
                 8 
               
               
                   
                 1 
                 7 
               
               
                   
                 0 
                 3 
               
               
                   
                 4 
                 2 
               
               
                   
                   
               
             
          
         
       
     
     Step S 30 : FDCT Transformation: 
     Since the DCT used by JPEG is performed on blocks of 8×8, the input image X is divided into blocks of 8×8, and each block is DCT transformed independently. That is, 
     
       
           Y=FDCT ( X ), 
       
     
     where FDCT denotes the operation of forward DCT. 
     Choice of Middle-Frequency Coefficients: 
     The human eyes are more sensitive to noise in lower frequency components than in higher frequency ones. However, the energy of most natural image is concentrated on the lower frequency range, and the information hidden in the higher frequency components might be discarded after the quantization operation of lossy compression. In order to invisibly embed the watermark which can survive lossy data compressions, a reasonable trade-off is to embed the watermark into the middle-frequency range of the image. To this end, for each 8×8 image block, only        (     64   ×         M   1     ×     M   2           N   1     ×     N   2           )                          
     coefficients are selected out of the 64 DCT coefficients. Those selected coefficients are then mapped into a reduced image block of size          (       M   1     ×     8     N   1         )     ×       (       M   2     ×     8     N   2         )     .                            
     That is, the middle-frequency coefficients selected from the image of size (N 1 ×N 2 ) are collected to compose a reduced image of size (M 1 ×M 2 ), which has the same resolution with the binary watermark. 
     
       
           Y   r =Reduce ( Y ), 
       
     
     where        Y   =     {       y        (         k   ×   8     +   i     ,       l   ×   8     +   j       )       ,     0   ≤   k   &lt;       N   1     8       ,     0   ≤   l   &lt;       N   2     8       ,     0   ≤   i   &lt;   8     ,     0   ≤   j   &lt;   8       }                            
     and                W   r     =                {         y   r          (         k   ×     (       M   1     ×     8     N   1         )       +     i   ′       ,       l   ×     (       M   2     ×     8     N   2         )       +     j   ′         )       ,                                  0   ≤   k   &lt;       N   1     8       ,     0   ≤   l   &lt;       N   2     8       ,     0   ≤     i   ′     &lt;     (       M   1     ×     8     N   1         )       ,     0   ≤     j   ′     &lt;                                  (       M   2     ×     8     N   2         )     }     .                                
     For example, and referring to FIG.  4 A and FIG. 4B, if M 1 =N 1 /2 and M 2 =N 2 /2, only 16 DCT coefficients are processed during the watermark embedding, and the other 48 DCT coefficients are left unchanged. FIG. 45 exemplifies our definition of the middle-frequency coefficients which are mapped into a reduced block of size 4×4. 
     Step S 40 : Embedding: 
     Next, a permuted digital watermark and a reduced image (which contains only the middle-frequency components of the original image) both with size (M 1 ×M 2 ) are obtained. For each watermark block of size            (       M   1     ×     8     N   1         )     ×     (       M   2     ×     8     N   2         )       ,                          
     the reduced image block of size          (       M   1     ×     8     N   1         )     ×     (       M   2     ×     8     N   2         )                            
     at the corresponding spatial position will be modified adequately to embed the watermarked pixels. 
     (a) Embedding Into the Relationship Between Neighboring Blocks: 
     As shown by FIG. 7, a 2-D residual mask is used to compute the polarity of the chosen middle-frequency coefficients between neighboring blocks. For example, in FIG. 7, if a=b=c=0, d=−1, e=1, then the polarity is a binary pattern (0 or 1) which represents the coefficients at the position of 30 the current reduced-block is larger (polarity=1) or less (polarity=0) than the coefficient at the corresponding position of the previous reduced-block. That is, 
     
       
           P =Polarity ( Y   r ) 
       
     
     
       
         
           
             
               
                 
                   P 
                   = 
                   
                       
                   
                    
                   
                     { 
                     
                       
                         p 
                          
                         
                           ( 
                           
                             
                               
                                 k 
                                 × 
                                 
                                   ( 
                                   
                                     
                                       M 
                                       1 
                                     
                                     × 
                                     
                                       8 
                                       
                                         N 
                                         1 
                                       
                                     
                                   
                                   ) 
                                 
                               
                               + 
                               i 
                             
                             , 
                             
                               
                                 l 
                                 × 
                                 
                                   ( 
                                   
                                     
                                       M 
                                       2 
                                     
                                     × 
                                     
                                       8 
                                       
                                         N 
                                         2 
                                       
                                     
                                   
                                   ) 
                                 
                               
                               + 
                               j 
                             
                           
                           ) 
                         
                       
                       , 
                     
                   
                 
               
             
             
               
                 
                   
                       
                   
                    
                   
                     
                       0 
                       ≤ 
                       k 
                       &lt; 
                       
                         
                           N 
                           1 
                         
                         8 
                       
                     
                     , 
                     
                       0 
                       ≤ 
                       l 
                       &lt; 
                       
                         
                           N 
                           2 
                         
                         8 
                       
                     
                     , 
                     
                       0 
                       ≤ 
                       i 
                       &lt; 
                       
                         ( 
                         
                           
                             M 
                             1 
                           
                           × 
                           
                             8 
                             
                               N 
                               1 
                             
                           
                         
                         ) 
                       
                     
                     , 
                     
                       0 
                       ≤ 
                       j 
                       &lt; 
                     
                   
                 
               
             
             
               
                 
                   
                     
                         
                     
                      
                     
                       ( 
                       
                         
                           M 
                           2 
                         
                         × 
                         
                           8 
                           
                             N 
                             2 
                           
                         
                       
                       ) 
                     
                     } 
                   
                   ′ 
                 
               
             
           
         
                 
         
             
         
      
     
     where          p        (         k   ×     (       M   1     ×     8     N   1         )       +   i     ,       l   ×     (       M   2     ×     8     N   2         )       +   j       )       =     {             1   ,             if                     y   r          (         k   ×     (       M   1     ×     8     N   1         )       +   i     ,       l   ×     (       M   2     ×     8     N   2         )       +   j       )         &gt;                             y   r          (           (     k   -   1     )     ×     (       M   1     ×     8     N   1         )       +   i     ,         (     l   -   1     )     ×     (       M   2     ×     8     N   2         )       +   j       )                 0   ,         otherwise         .                              
     After the binary polary polarity pattern is obtained, for each marked pixel of the permuted watermark, modify the DCT coefficients according the residual mask to reverse the corresponding polarity. That is, 
     
       
           {circumflex over (P)}=   XOP ( P,W   b ) 
       
     
     
       
           {circumflex over (P)}={   {circumflex over (p)}(   i,j ), 0≦ i&lt;M   1  and 0≦ j&lt;M   2 }, 
       
     
     where            p   ^          (     i   ,   j     )       =     {               1   -     p        (     i   ,   j     )         ,       if                     w   b          (     i   ,   j     )         =   1                   p        (     i   ,   j     )       ,       if                     w   b          (     i   ,   j     )         =   0             =       p        (     i   ,   j     )       ⊕         w   b          (     i   ,   j     )       .                                  
     Then, construct  Ŷ{circumflex over (Y r )} from    {circumflex over (P)} such that the differences between    Ŷ{circumflex over (Y r )} and    Ŷ{circumflex over (Y r )} are minimized or smaller than a user specified threshold:   
     
       
         
           Ŷ{circumflex over (Y r )}=Expand( 
           {circumflex over (P)}) 
         
       
     
     
       
         
           
             
               s 
               . 
               t 
               . 
               
                   
               
                
               
                 
                   ∑ 
                   
                     i 
                     , 
                     j 
                   
                 
                  
                 
                   
                     ( 
                     
                       
                         
                           y 
                           r 
                         
                          
                         
                           ( 
                           
                             i 
                             , 
                             j 
                           
                           ) 
                         
                       
                       - 
                       
                         
                           
                             y 
                             ^ 
                           
                           r 
                         
                          
                         
                           ( 
                           
                             i 
                             , 
                             j 
                           
                           ) 
                         
                       
                     
                     ) 
                   
                   2 
                 
               
             
             &lt; 
             
               threshold 
               . 
             
           
         
                 
         
             
         
      
     
     Note that, the “Expand” operation constructs Ŷ, based on polarity {circumflex over (P)}. For example, assign the initial coefficient ŷ r (i 0 , j 0 )=y r (i 0 , j 0 ), and add (or subtract) the coefficients of neighboring blocks according to the residual mask in order to match the corresponding polarity {circumflex over (p)}(i 0 , j 0 ). Then, proceed to successive coefficients by modifying only those which will not affect the polarities of the previous-processed coefficients. 
     In order to improve the invisibility, the polarity should be computed for absolute value of the coefficients so that the sign (plus and minus signs) of the coefficients are preserved to reduce the changes introduced by modification. Further, in order to survive JPEG lossy compression, the quantization effect utilized in the JPEG codec must be considered. FIG.  8 A and FIG. 8B shows the suggested luminance quantization table for the JPEG standard, which usually causes perceptible artifacts when viewed on high-quality displays. FIG. 8B shows another quantization table used in most JPEG software such as the one used by Image Alchemy, Handmade Software, Inc. The values are almost half of the corresponding JPEG suggested quantization values. Based on a referenced quantization table, the polarities are computed from coefficients after quantization and then dequantization. Therefore, in case of quantization attack, the correct marked pixel should be extracted. That is, the polarity should be          p        (         k   ×     (       M   1     ×     8     N   1         )       +   i     ,       l   ×     (       M   2     ×     8     N   2         )       +   j       )       =     {           1   ,             if                   ⌊              y   r          (         k   ×     (       M   1     ×     8     N   1         )       +   i     ,       l   ×     (       M   2     ×     8     N   2         )       +   j       )              Q        (     i   ,   j     )         ⌋          Q        (     i   ,   j     )         &gt;                             ⌊              y   r          (           (     k   -   1     )     ×     (       M   1     ×     8     N   1         )       +   i     ,         (     l   -   1     )     ×     (       M   2     ×     8     N   2         )       +   j       )              Q        (     i   ,   j     )         ⌋          Q        (     i   ,   j     )                   0   ,           otherwise   ,                                    
     where Q(i, j) is the quantization value at the corresponding position (i, j). 
     (b) Embedding Into the Relationship Within Each Block: 
     In order to overcome the technical challenges addressed above, while not propagating the modifications into the neighboring blocks (so as to improve the invisibility), the relatively more reliable DC coefficient (instead of the middle-frequency coefficients of neighboring blocks) is used as a reference value for each block. That is, 
     
       
           P =Polarity ( Y   r ) 
       
     
     
       
         
           
             
               
                 
                   
                     
                       
                         P 
                         = 
                         
                             
                         
                          
                         
                           { 
                           
                             
                               p 
                                
                               
                                 ( 
                                 
                                   
                                     
                                       k 
                                       × 
                                       
                                         ( 
                                         
                                           
                                             M 
                                             1 
                                           
                                           × 
                                           
                                             8 
                                             
                                               N 
                                               1 
                                             
                                           
                                         
                                         ) 
                                       
                                     
                                     + 
                                     i 
                                   
                                   , 
                                   
                                     
                                       l 
                                       × 
                                       
                                         ( 
                                         
                                           
                                             M 
                                             2 
                                           
                                           × 
                                           
                                             8 
                                             
                                               N 
                                               2 
                                             
                                           
                                         
                                         ) 
                                       
                                     
                                     + 
                                     j 
                                   
                                 
                                 ) 
                               
                             
                             , 
                           
                         
                       
                     
                   
                   
                     
                       
                         
                             
                         
                          
                         
                           
                             0 
                             ≤ 
                             k 
                             &lt; 
                             
                               
                                 N 
                                 i 
                               
                               8 
                             
                           
                           , 
                           
                             0 
                             ≤ 
                             l 
                             &lt; 
                             
                               
                                 N 
                                 2 
                               
                               8 
                             
                           
                           , 
                           
                             0 
                             ≤ 
                             i 
                             &lt; 
                             
                               ( 
                               
                                 
                                   M 
                                   1 
                                 
                                 × 
                                 
                                   8 
                                   
                                     N 
                                     1 
                                   
                                 
                               
                               ) 
                             
                           
                           , 
                           
                             0 
                             ≤ 
                             j 
                             &lt; 
                           
                         
                       
                     
                   
                   
                     
                       
                         
                             
                         
                          
                         
                           ( 
                           
                             
                               M 
                               2 
                             
                             × 
                             
                               8 
                               
                                 N 
                                 2 
                               
                             
                           
                           ) 
                         
                         } 
                       
                     
                   
                 
               
               
                 
                   ( 
                   14 
                   ) 
                 
               
             
           
         
                 
         
             
         
      
     
     where                p        (         k   ×     (       M   1     ×     8     N   1         )       +   i     ,       l   ×     (       M   2     ×     8     N   2         )       +   j       )       =     {           1   ,             if                   ⌊              y   r          (         k   ×     (       M   1     ×     8     N   1         )       +   i     ,       l   ×     (       M   2     ×     8     N   2         )       +   j       )              Q        (     i   ,   j     )         ⌋          Q        (     i   ,   j     )         &gt;                             ⌊            y        (       k   ×   8     ,     l   ×   8       )              scale_factor   ×     Q        (     0   ,   0     )           ⌋          Q        (     0   ,   0     )                   0   ,           otherwise   .                     (   15   )                                
     For each marked pixel, add (or subtract) the corresponding coefficient so that the modified coefficients Ŷ r  will have the reverse polarity {circumflex over (P)}. 
     Step S 50 : IDCT Transformation: 
     Finally, map the modified middle-frequency coefficients Ŷ r  into Y to get Ŷ. Then, inverse DCT (IDCT) of the associated result to obtain the watermarked image. 
     
       
           {circumflex over (X)}=IDCT ( Ŷ ) 
       
     
     (2). Watermark Extracting Steps Shown in FIG.  6 A and FIG.  6 B 
     Accordingly, it is another object of the present invention to provide a method of extracting hidden digital watermarks in images. In this embodiment, as shown in FIG.  6 A and FIG. 6B, the extraction of watermark requires the original image, the watermarked image, and either the watermark or the permutation mapping used in image-dependent permutation during the embedding steps. The extraction steps are described as follows. 
     Step S 60 /S 70 : FDCT Transformation: 
     Block Transformation: 
     Both the original image X and the image in question {circumflex over (X)} are DCT transformed. 
     
       
           Y=FDCT ( X ) 
       
     
     
       
           {tilde over (Y)}=FDCT ( {tilde over (X)} ) 
       
     
     Generation of Polarity Patterns: 
     Generate the reduced images which contain only the middle-frequency coefficients and then use these middle-frequency DCT coefficients to produce the polarity patterns. That is, 
     
       
           Y   r =Reduce( Y ), 
       
     
     
       
           {tilde over (Y)} =Reduce( {tilde over (Y)} ), 
       
     
     and then 
     
       
           P =Polarity( Y   r ) 
       
     
     
       
           {tilde over (P)} =Polarity( Ŷ   r ). 
       
     
     Step S 80 : Extract the Permuted Data: 
     Perform exclusive-or (XOR) operation on these two polarity patterns to obtain a permuted binary data, i. e., 
     
       
           {tilde over (W)}   b   =XOR ( P, {tilde over (P)} ) 
       
     
     where {tilde over (w)} b (i, j)=p(i, j)⊕{tilde over (p)}(i, j). 
     Step S 90 : Reverse Block-Based Image-Dependent Permutation: 
     The image-dependent permutation mapping could be obtained either by saving as a file during the embedding steps or re-computed from the original image and the watermark. Based on the mapping, reverse permute {tilde over (W)} b  to get {tilde over (W)} p    
     Step S 100 : Reverse Pseudo-Random Permutation: 
     Reverse-permute {tilde over (W)} p  to get the watermark {tilde over (W)}, 
     
       
           {tilde over (w)} ( i, j )= {tilde over (w)}   p ( i′, j ′) 
       
     
     where (i′, j′) is reverse-permuted to (i, j) according to the predefined pseudo-random order. 
     (3). Similarity Measurement 
     In this embodiment, the extracted watermark is an visually recognizable pattern. The viewer can compare the results with the referenced watermark subjectively. However, the subjective measurement is dependent on factors such as the expertise of the viewers, the experimental conditions, etc. Therefore, a quantitative measurement is needed to provide objective judgment of the extracting fidelity. We define the similarity measurement between the referenced watermark W and extracted watermark {tilde over (W)} as:            Normalized                 Correlation                   (   NC   )       =         ∑   i            ∑   j            W        (     i   ,   j     )              W   ~          (     i   ,   j     )                 ∑   i            ∑   j            [     W        (     i   ,   j     )       ]     2             ,                          
     which is the cross-correlation normalized by the reference watermark energy to give unity as the peak correlation. 
     Accordingly, the advantages of embedding the digital watermarks into the original images of the present invention are listed as follows: 
     (a) resistant to image manipulation and processing operation, e.g., cut-and-paste, filtering, etc; 
     (b) perceptually invisible, i.e., the watermark does not render visible artifact; 
     (c) statistically undetectable; 
     (d) extracted digital watermarks as visually recognizable patterns for quick identification; 
     (e) adjustable image quality with the trade-off of watermark processing efficiency depending on the needs of the user. 
     (f) A “user key” providing as a secret key that can be used to serve various embedding processes by using the same embedding technology while being treated as a parameter during the extracting steps; wherein, the “user key” defines a seed of the pseudo-random number generator that in turn defines the initial position of an pseudo-random permutation, choice of middle-frequency coefficients, and mapping of the chosen coefficients into a reduced block. 
     Although the present invention has been explained by the embodiments shown in the drawings described above, it should be understood to the ordinary skilled person in the art that the invention is not limited to the embodiments, but rather that various changes or modifications thereof are possible without departing from the spirit of the invention. Accordingly, the scope of the invention shall be determined only by the appended claims and their equivalents.