DIGITAL WATERMARKING
The present invention relates to digital watermarking, and in particular to the watermarking of digital images.
With the growth of digital imaging technology and applications, digital images, audio, and video are widely distributed via the internet or CD ROM. A main problem with digital data is that an unlimited number of copies of an "original" can be easily distributed and/or forged. This presents difficulties for the owner of copyright material .
Many approaches are available for protecting digital data, such as traditional methods including encryption, authentication, and time stamping. More recently digital watermarking has been developed, in particular for protecting digital images. A digital watermark is a signal that is invisibly embedded in digital data. The watermark can itself be in the form of a digital signal, which carries data or information and can therefore allow one to identify ownership of an image, identify a buyer or receiver of the image, or provide some additional information about the digital content of the image. Alternatively it can be in other forms such as a sequence of real numbers which can be embedded in the data representing the image, for example by varying the brightness of various pixels by an amount corresponding to the value of respective numbers in the watermark.
It is a problem with digital watermarking that the watermark can become corrupted, destroyed, removed or otherwise made unreadable by both unintentional and intentional attacks.
Unintentional attacks, which usually occur during the production and distribution process of the multimedia material, are not intended to destroy the watermark. These include filtering or smoothing, analogue to digital and digital to analogue conversion, translation, cropping, rotation, or scaling. On the other hand, intentional attacks are designed specifically to remove or weaken the watermark. These can include the addition of noise, insertion of multiple watermarks and averaging, and are generally carried out using specifically designed software.
One of the effective tools to attack the watermark is StirMark. This is a software tool which has been developed for use as a benchmark to assess the performance of watermarking schemes. This tool consists of several attacks including random geometric attack and bending, and has successfully defeated many watermarking methods. In this attack, the image is slightly stretched, sheared, shifted and / or rotated by an unnoticeable random amount, and then a slight deviation, which is greatest at the centre of the image, is applied to each pixel. These distortions do not remove the watermark per se, but they can prevent the watermark detector from finding it, thereby making it unusable.
The present invention therefore aims to provide robust methods of embedding and detecting digital watermarks in images, which can withstand at least some forms of attack.
According to a first aspect of the present invention there is provided a method of searching for a watermark in data representing a digital image, the method comprising the steps of measuring the texture of at least a part of the image and searching for a watermark in data representing the image wherein the searching is controlled in a manner which depends upon the measured level of texture in said part.
Because the watermark comprises data superimposed on the data defining the image, the ease with which the watermark can be detected can vary significantly with the amount of texture in the image. Similarly the visibility of a watermark to the human eye varies with the amount of texture in the image. Therefore taking into account the amount of texture in the image can enable optimization of the watermark detection process. For example it may be preferable to apply the watermark more strongly in higher texture areas than in low texture areas.
The texture can be measured in a variety of ways. One method is to measure the number, length and/or sharpness of edges in the image. If the image is monochrome then the variation in brightness or intensity give the image its texture and the edges to be measured are sharp changes in intensity. There are various ways of defining edges, but generally they include measuring the gradient, or rate of change, of the brightness within the image. For example an edge can be defined as any point where this gradient exceeds a predetermined limit, or as a local maximum in the gradient. In a colour image texture can be measured as changes in intensity or changes in colour. One way of doing this is to use the Y (luminance) component of YUN, YIQ or YCbCr type image as indicative of intensity and to measure changes in that component through the image. In these types of images the watermark is generally also applied to the Y component.
Preferably a plurality of areas are identified in the image, the texture of each of said areas is measured, and the searching in data representing each area is controlled in a manner which depends on the measured texture of the area. In the simplest case the image is simply divided into a number of equally sized and shaped areas, such as square bocks. However the areas can be chosen at random and can be of different sizes and shapes. Also they do not have to cover the whole image but can just make
up a part of it. The different areas can even overlap each other. The only disadvantage of using irregular areas is that they need to be identified to enable the watermark to be detected and therefore the more irregular they are, the more information will need to be included in the 'key' which identifies them and enables the detection process.
Preferably the texture of each of the areas is classified into one of a plurality of categories, and the searching in each of the areas is controlled in a manner determined by which of the categories that area is classified in.
The watermark may only be searched for in those areas in which the texture falls into a predetermined set of one or more of said categories .
Preferably the categories include a high texture category and a low texture category. In this case the watermark may only be searched for in areas classified in the low texture category, or it may only be searched for in areas classified in the high texture category, or it may be searched for in both, but using a different method in each.
Preferably in at least some areas of the image, most suitably the high texture areas, the image is analysed to measure distortion of the image, and the image is at least partially restored to compensate for the measured distortion before the watermark is searched for.
The distortion may be measured, for example, by comparing the image with a reference image such as an undistorted copy of the image being analysed. This undistorted copy may be the original un watermarked image, or it may be a watermarked copy. If it is a watermarked copy, the watermark does not necessarily need to be the same as that in the possibly attacked image; any watermarked copy may be suitable.
According to a second aspect of the present invention there is provided a method of embedding a watermark in a digital image comprising the steps of measuring the texture of at least a part of the image and embedding a watermark in data representing the image wherein the embedding of the watermark is controlled in a manner which depends upon the measured level of texture in said part.
Preferably a plurality of areas are identified in the image, the texture of each of said areas is measured, and the embedding of the watermark in data representing each area is controlled in a manner which depends on the measured texture of the area. This enables optimization of the watermarking process to take account of variations in the texture of the different areas of the image.
Preferably the texture of each of the areas is classified into one of a plurality of categories, and the embedding of the watermark in each of the areas is controlled in a manner which is determined by which of the categories that area is classified in.
The watermark may only be embedded in those areas in which the texture falls into a predetermined set of one or more of said categories.
The categories preferably include a high texture category and a low texture category. In this case the watermark may only be embedded in areas classified in the low texture category. Alternatively it may only be embedded in areas classified in the high texture category. In either case the embedding can be optimized for the texture of the relevant areas.
In some instances it is preferably to embed the watermark in data representing areas classified into more than one of said categories, for
example into both the high and low texture categories. In this case the watermark may be embedded more strongly in the higher texture areas than in the low texture areas. This helps to ensure that the watermark is strong enough to be detected in the high texture areas where it can easily be lost, but weak enough not to be visible to the human eye in the low texture areas. The same watermark may be embedded in the data representing the areas in each of said categories. This gives a degree of redundancy which can improve the chances of successful watermark detection. Alternatively different parts of a single watermark may be embedded in the data representing the areas in each of said categories. This gives a further degree of robustness in the watermarking.
According to a third aspect of the present invention there is provided a method of embedding a watermark in data representing an image, the method comprising the steps of dividing the image into a plurality of areas, carrying out a mathematical operation on data representing each of the areas to produce an indicator for each of the areas, sorting the indicators into groups and applying the watermark to one indicator in each group but not to one other indicator in each group.
Preferably there are two indicators in each group.
Preferably the groups are selected on the basis of similarity between the indicators, for example the groups may be sorted into a sequence on the basis of a characteristic and the groups are formed from adjacent indicators within the sequence.
Preferably the indicators in each group are adjusted so that they are all equal to a common value, which may be an average of the original values of the indicators within the group.
The method preferably further comprising producing a key identifying the groups of indicators. This key can then be used in detecting the watermark in a copy of the image. The key preferably indicates which indicators in each group have the watermark applied to them and which do not.
According to a fourth aspect of the present invention there is provided a method of searching for a watermark embedded according to the third aspect of the invention, the method of searching comprising the steps of dividing the image into a plurality of areas, carrying out a mathematical operation on data representing each of the areas to produce an indicator for each of the areas, sorting the indicators into groups identifying which of the indicators in each group has the watermark applied to it, and extracting the watermark.
Preferably the watermark is extracted by comparing the indicator in each group that carries the watermark with another indicator in the same group which does not.
Alternatively the watermark may be extracted by comparing the indicator in each group that carries the watermark with an indicator from a reference image.
Preferably the step of sorting the indicators into groups is at least partially carried out using the key. More preferably the step of identifying which of the indicators in each group has the watermark applied to it is also at least partially carried out using the key.
According to a fifth aspect of the invention there is provided apparatus for embedding a watermark in data representing an image, the apparatus
comprising a memory for storing data representing the image and processing means arranged to carry out the method of the invention.
According to a sixth aspect of the invention there is provided apparatus for searching for a watermark in data representing an image, the apparatus comprising a memory for storing data representing the image and processing means arranged to carry out the method of the invention.
According to a seventh aspect of the invention there is provided a method of measuring distortion in a digital image by comparison with a reference image, the method comprising the steps of identifying a part of one of the images and a plurality of possibly corresponding parts in the other of the images, identifying edges within said part and said possibly corresponding parts, and comparing the edges in said part with those in the possibly corresponding parts to determine which of the possibly corresponding parts corresponds most closely to said part.
Preferably the method includes the steps of forming an edge map of each of said parts indicating the presence or absence of an edge at a plurality of pixels of the part, and comparing the edge maps
Preferably the method includes producing a measure of similarity between said part and each of said possibly corresponding parts, and using said measure to determine which of the possibly corresponding parts corresponds most closely to said part.
Preferably the method includes producing a map of the value of said measure for the possibly corresponding parts and detecting a peak in the map to identify which of the possibly corresponding parts corresponds most closely to said part.
Preferably said measure is a cross correlation between said edge maps.
According to an eighth aspect of the invention there is provided a method of restoring a distorted digital image comprising the steps of measuring distortion of at least a part of the image using the method of the seventh aspect of the invention and modifying the image so as to counteract the measured distortion.
According to a ninth aspect of the invention there is provided a method of searching for a watermark in data representing a distorted image comprising restoring the image using the method of the eighth aspect, and searching for the watermark in the restored image.
According to a tenth aspect of the invention there is provided a computer readable medium carrying instructions arranged when run on a computer to cause the computer to perform the method of the invention.
Preferred embodiments of the present invention will now be described by way of example only with reference to the accompanying drawings in which:
Figure 1 is a schematic representation of an image to be watermarked
Figure 2 is a flowchart showing a method of embedding a watermark according to a first embodiment of the invention;
Figure 3 is a flowchart showing a method of detecting a watermark embedded according to the method of Figure 2;
Figure 4 is a flowchart showing a method of embedding a watermark according to a second embodiment of the invention;
Figure 5 is a flowchart showing a method of detecting a watermark embedded according to the method of Figure 4;
Figure 6 illustrates part of the detecting method of Figure 5;
Figure 7 is a flowchart showing a method of embedding a watermark according to a third embodiment of the invention;
Figure 8 is a flowchart showing a method of detecting a watermark embedded according to the method of Figure 7;
Figure 9 is a flowchart showing a method of embedding a watermark according to a fourth embodiment of the invention;
Figure 10 is a flowchart showing a method of detecting a watermark embedded according to the method of Figure 9;
Figure 11 is a flowchart showing a method of embedding a watermark according to a fifth embodiment of the invention;
Figure 12 is a flowchart showing a first method of detecting a watermark embedded according to the method of Figure 11 ;
Figure 13 is a flowchart showing a second method of detecting a watermark embedded according to the method of Figure 11;
Figure 14 is a diagrammatic view of a computer used to embed and detect watermarks in accordance with the invention;
Figure 15 is a graph showing the results of a watermark detection process as shown in Figure 12;
Figure 16 is a table showing the affects of various attacks on the detection methods of Figures 3, 5, 8 and 9; and
Figure 17 is a table showing the affects of various attacks on the detection methods of Figures 12 and 13.
Referring to Figure 1, an image 10 is divided into square blocks 12 of 8x8 pixels 14 giving 64 pixels in each block. It will be appreciated that the blocks shown in Figure 1 are schematic and that for a normal image of, for example, 512x512 pixels there will be 4096 blocks. These blocks 12 are then analysed to determine the level of texture in each of them. In this case the level of texture is measured by measuring the amount of edges in the block using the "Canny" detection method. The Canny method defines edges as local maxima in the gradient of the brightness of the image, where the gradient is calculated using the derivative of a Gaussian filter. This edge detection method is used in this example because it has a good signal to noise ratio, good locality, i.e. the edge is detected as being where it actually is, and small number of false alarms.
Referring to Figure 2, once the edges have been detected, the blocks are classified at step 201 into two categories: high texture and low texture. Low texture blocks are defined as those in which there are no edges, and high texture blocks are defined as those in which there are edges. Clearly this classification can be modified, for example low texture blocks being classified as those in which there is less than a predetermined non-zero amount of detected edge. In Figure 1 the low texture blocks are marked L, and the remaining blocks are classified as high texture.
In order to apply the watermark to the image a discrete cosine transform
(DCT) operation is carried out on each of the blocks at step 202 which produces a set of 63 AC coefficients and 1 DC coefficient. The coefficients relate to the content of the image at different points in the frequency domain, and the DC coefficient relates to the overall brightness of the block which can be considered as the zero frequency component.
The watermark X which consists of 999 bits is then encoded at step 203 using the Reed Solomon (RS) error correcting code, which adds parity bits to the watermark, and inserted at step 204 into DC coefficients N of a randomly selected group of the low texture blocks L to obtain the watermarked coefficients V , by using the following formula v; = v,(l + α *,) (1) where α is the scaling factor to control the watermark level, which in turn affects the watermark imperceptibility and x is the ith bit of the watermark. The positions of the randomly selected blocks is recorded as a key which will then be needed to detect the watermark.
The inverse DCT is then applied at step 205 to the coefficients to obtain the watermarked image.
Referring to Figure 3, in the detection process the possibly attacked watermarked image and the original image are each divided into 8x8 pixel blocks, and the DCT coefficients for the blocks of each image determined at steps 301 and 302. The watermark is then extracted from the possibly attacked watermarked image using the key and the original image, and the inverse of equation (1) at step 303. Then, the extracted watermark is RS decoded at step 304 and compared to a set of watermarks from which the embedded watermark was chosen at step 305, by using the similarity measurement:
y * y SIM{X, X*) =
JX*.X* (2)
The low texture blocks are chosen in this embodiment because any attacks on the image are less likely to obscure the watermark in the low texture areas. This is because the brightness of each pixel is similar to those close to it so the small scale movements of pixels does not have such a large effect on the watermark as in high texture areas where the brightness of individual pixels can be varied much more by the small scale movements.
Referring to Figure 4, in a second embodiment of the invention watermarking is only applied to the high texture parts of the image. The embedding process is therefore the same as that of Figure 2 except that the high texture blocks are used rather than the low texture blocks.
However in the detection process shown in Figure 5, a cross correlation searching method is used to estimate the distortion vectors for the various blocks. This process will be described with reference to Figures 5 and Figure 6. Assume that the original image includes an 8x8 block 600 which includes a pattern of detectable edges 602. Firstly at step 501 the edges in the possibly attacked image are identified and those in a reference image at step 502. The reference image is a copy of the original image, in this case without the watermark applied to it. However the watermarked image, or indeed any watermarked copy of the original image, can be used instead for this step. This is because the watermarks are arranged so as not to alter the image substantially and the position of the detected edges will generally be the same in the unwatermarked original as in the watermarked version. Then at step 503 the pattern of edges of the block 600 in the reference image is compared to the pattern of edges of every possible 8x8 pixel block 603 within a larger area 604 of the attacked watermarked image centred on the position of the block in
the reference image. In this case a 24x24 pixels block of the attacked watermarked image is used. The position of the block 606 in the attacked image corresponding to the block 600 in the reference image is estimated by plotting the two dimensional cross correlation of the pattern of edges in the reference image block and the pattern of edges in each of the possible corresponding blocks, as a function of possible distortion vectors, and searching for the maximum peak of this cross correlation. Then the position of the block 600 in the reference image and the position of the corresponding block 606 in the attacked image are compared and the difference between these positions is the distortion vector indicating the movement of the block during the distortion. This can include lateral displacement and rotation factors. Once the displacement vector has been estimated, the block in the attacked image can be moved back to its original position.
It will be appreciated that the distortion vectors can also be found by taking blocks of the possibly attacked image and using the cross correlation method to find the corresponding blocks in the reference image.
For attacks which are applied linearly to the entire image, such as rotation or lateral displacement, the attacked image can be amended by re-rotating or displacing with the inverse parameter. However, if the attack is randomly applied to each block or pixel, a general distortion vector cannot be defined for the whole image. In this case restoration will need to be carried out locally, with the distortion vector being determined for each of a number of small areas separately.
Then, after the actual position of the watermarked blocks in the attacked image have been approximated, the DCT is applied at step 504 to those blocks and to the corresponding blocks in the original image at step 505,
the watermark can be extracted at step 506, RS decoded at step 507 and finally it is compared to the set of watermarks using the similarity check at step 508.
Referring to Figures 7 and 8, a third embodiment of the invention comprises a combination of the first and second embodiments, the watermark being embedded in both the low and high texture blocks. Firstly at step 701 the original image is analysed to identify the low and high texture blocks in it, and the DCT is applied to all of the blocks at step 702. The watermark is RS encoded at step 703 and embedded in both the low and high texture blocks at steps 704 and 705. This introduces a degree of redundancy because the same whole watermark is embedded in both sets of blocks. The inverse DCT is then applied to the coefficients of all the blocks to obtain the watermarked image.
In the detecting process the DCT is applied to all the blocks of the possibly attacked image at step 801 and the original image at step 802. Then the watermark is detected in the low texture blocks at step 803 using a simple comparison as in the process of Figure 3, and in the high texture blocks at step 804 using the restoration process of Figure 6. Then for the high texture blocks the detected watermark is RS decoded at step 805 and compared with the set of possible watermarks at step 806, and likewise for the low texture blocks the detected watermark is RS decoded at step 807 and compared with the set of possible watermark at step 808. The similarity check used to compare the detected watermarks with the set of possible watermarks will produce a measure of the degree of similarity between the detected watermark and each watermark in the set. These measures of similarity for the low and high texture blocks are then compared at step 809 and the one giving the greatest similarity selected.
Referring to Figure 9, in a fourth embodiment of the invention both the low and high texture blocks are again identified at step 901 and used and the DCT applied to them at step 902. However in this case the watermark is RS encoded at step 903 and applied to the whole image. This results in the watermark being divided into two components or subsets 904, 905, one of which is embedded in the low texture blocks at step 906 and one of which is embedded in the high texture blocks at step 907. The inverse DCT is then applied to all of the blocks at step 908 which are combined to form the complete watermarked image. The watermark is therefore distributed through the whole image.
Referring to Figure 10, in the detection process the possibly attacked image and the original image are again divided into blocks which have the DCT applied to them at steps 1001 and 1002. The components of the watermark in the low texture blocks are then detected at step 1003 using the simple comparison method of Figure 3, and the components on the high texture blocks are detected at step 1004 using the distortion vector determination method of Figures 5 and 6. The components of the watermark are then combined at step 1005 to produce the whole watermark which is RS decoded at step 1006 and then compared with the set of possible watermarks using the similarity check at step 1007.
It will be appreciated that, for the methods of watermark detection described above, a copy of either the original image or the watermarked version of it is needed, together with the key, to detect the watermark in the possibly attacked image. This type of watermarking is referred to a non-oblivious watermarking. In oblivious watermarking systems, only the keys is needed in the detection process. This has the advantage that it is easier to prevent unauthorised copying of the original unwatermarked image because it does not need to be distributed to enable watermark
detection. An oblivious watermarking scheme according to the invention will now be described with reference to Figures 11 to 13.
Referring specifically to Figure 11 , before the watermark is embedded, the image is first pre-processed as follows. Firstly the image is divided into 8 x 8 pixel blocks and, assuming the watermark is to be embedded only in the low texture areas, the DCT coefficients for the low texture blocks are calculated at step 111. Then the DC coefficients of these blocks are sorted and grouped into pairs at step 112, each pair being made up of two coefficients which are closest together in value at step 113. The average of each pair is then taken and each coefficient in the pair modified to the average value, so that the modified coefficients are made up of a number of equal pairs cp cp. . The identity of all of the pairs of blocks of which the DC coefficients have been paired together is then recorded as a key at step 114 which will be required for detection the watermark in the image.
The watermark is embedded in only one of each selected pair of DC coefficients cp, using equation (1) at step 115, the other of the pair cp. being left at its modified value. The inverse DCT is then performed on all of the DCT coefficients at step 116 to produce the watermarked image.
Referring to Figure 12, in a first detection method of the watermark embedded using the process of Figure 11, firstly the DCT is applied to the low texture blocks as identified by the key and the coefficients determined at step 121. Then using the key to identify the pairs of coefficients cp cp. the watermark is extracted at step 122 by comparing the values of the pairs of coefficients cp cp., specifically by subtracting the coefficient cp of each pair without the watermark added from the coefficient cp. of the same pair with the watermark added, by using the
inverse of equation (1) . The watermark is then compared with a set of possible watermarks at step 123 to check whether any of them is present.
Referring to Figure 13 in a second detection method of the watermark embedded using the process of Figure 11, a copy of the original watermarked image, i.e. a copy which is known not to have been attacked, is used as the reference image to extract the watermark. Firstly the watermarked blocks in the possibly attacked image are identified using the key, and the DCT coefficients of these blocks determined at step 131 , and the watermarked coefficients cp identified using the key. Then unwatermarked blocks from the selected pairs, as identified by the key, are selected from the reference image and the unwatermarked coefficients cp. determined. Then the watermark is extracted from the watermarked coefficients cp at step 133 using the un-watermarked coefficients cp.. Finally the extracted watermark is compared at step 134 with the set of possible watermarks using a similarity check to determine whether any of them is present.
The embedding method of Figure 11 and the detection method of Figures 12 and 13 have been described as using watermarking only in low texture blocks. However the oblivious watermarking method described can also be used with watermarking in only the high texture blocks, or with watermarking in any blocks regardless of texture.
Referring to Figure 14, any of the methods described above can be carried out on a conventional computer 140 which includes a processor 142, a memory 144 for storing images and sets of watermarks, and an output device 145 such as a NDU for outputting the results of the watermark detection and viewing the images. The computer also comprises a floppy disc drive 146 and a CD ROM drive 147 by means of which the computer can be programmed from a floppy disc 148 or CD
ROM 149 to carry out the methods of the invention, and images can be input to the computer.
The robustness of the various embodiments of the invention described above was tested by using a simulation which was carried out in MATLAB. A series of 1000 watermarks made up of binary (-1,1) data with length of 999 bits each were supplied and RS encoded to produce encoded watermarks of 999 data bits and 1035 parity bits, i.e. 2034 bits in total each. Then, one of them was applied to watermark a 512x512 pixels test image.
With the intention of making the watermark imperceptible, the watermark strength level for the low texture blocks αL and high texture blocks αH were set to 0.008 and 0.015 respectively. Since the human visual system is less sensitive in the high texture image, the watermark strength in these blocks can be set higher than that the low texture blocks. These parameter level settings produced a combine watermark peak signal to noise ratio (PSNR) of 44.41 dB.
Next, the StirMark was utilized to attack the watermarked image. Finally, the watermark was extracted from the attacked watermarked image and detected by using the similarity measurement in equation (2) . An example of the successful watermark detection from an attacked image is shown in Figure 15, where the SIM of the extracted watermark, which has a data index of 500, can be clearly distinguished from the SIMs of all other watermarks provided.
The results for non-oblivious watermarking of the three approaches of
Figures 2 and 3, Figures 4 and 5, and Figures 9 and 10 are shown in Figure 16. These results are also applicable to the approach of Figures 7 and 8 which simply takes the best results of the first two approaches. It
should be noted that in the high texture block detection, the search and match strategy is only applied to the watermarked images attacked by StirMark random geometric and bending. It can be seen that for many attacks, the SIM value of the combined approach is in between the values of the low and high texture approaches. However, for random geometric and bending attacks, the combined approach tends to be superior.
Figure 17 shows the results for oblivious watermarking of the combined approach by using the suspect image itself for the detection (scenario 1) and by using any watermarked copy of the same image, in which a watermark is embedded in the same locations in the image, for the detection (scenario 2). It can be seen that the second scenario offers better performance because the unwatermarked cp» coefficients will be uncorrupted by any attack, and the watermark from random geometric attacked images can only be detected by using this scenario 2.
The description of the embodiments above relates to watermarking of a single still image. However watermarking can equally be applied to video images. In this case it is generally desirable for the watermark to be applied to each frame of the video. This is because, if it is only applied to some of the frames, those frames can in some circumstances be omitted from the unauthorized copy of the video without significant loss of quality.