Image digital watermark embedding and extraction method and device

By performing DWT transformation on the image and embedding watermarks and deviation correction templates in specific frequency band subbands, the problems of traditional image hiding technology being sensitive to small image modifications and limited information capacity are solved, and efficient and stable watermark hiding and extraction are achieved.

CN119067827BActive Publication Date: 2025-04-29BLOCKCHAIN NEW TECHNOLOGY (GUANGZHOU) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411297419.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-04-29
Estimated Expiration
2044-09-18

AI Technical Summary

Technical Problem

Traditional image hiding technology is very sensitive to slight modifications of images, resulting in the loss or damage of hidden information. The capacity of hidden information is limited and easy to be detected. Complex steganography algorithms require high computing resources and time.

Method used

The image is processed by DWT transformation, the target frequency band subband data is selected for watermark embedding, and a deviation correction template is inserted into other frequency band subband data, and the watermark information is hidden through spread spectrum quantization algorithm and quantized index modulation technology.

Benefits of technology

Effectively hide watermark information, improve the image's anti-compression, rotation and tailoring ability, improve the accuracy and accuracy of watermark extraction, and reduce the error rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119067827B_ABST
    Figure CN119067827B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for embedding and extracting digital watermarks from images. The method comprises: using a DWT algorithm to first perform DWT transformation on an image, then selecting a frequency band for watermark embedding, and embedding other frequency bands with appropriate correction templates, effectively hiding watermark information to achieve information hiding, effectively embedding and protecting watermark information and improving the accuracy during extraction, improving the image's ability to resist compression, rotation, and cropping, and contributing to the security technology of protecting images. Based on this embedding method, watermark extraction is performed accordingly. Through the correction template, the image is prevented from being unable to be restored to its original state after the size is changed during the transformation process. An algorithm can be used to verify whether the image undergoes geometric transformation. If so, an inverse geometric transformation is performed, and then watermark extraction is performed. The watermark extraction accuracy is extremely high, and can basically be controlled within an 8% error rate. Regardless of which color channel the colored image is embedded in, a high watermark extraction accuracy rate can be guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image digital watermarking, and in particular to an image digital watermark embedding method, an image digital watermark embedding device, an image digital watermark extraction method and an image digital watermark extraction device. Background Art

[0002] Traditional image hiding technology is very sensitive to slight modifications to the image (such as compression, cropping, rotation, etc.), which leads to loss or damage of hidden information. At the same time, the capacity of hidden information is usually limited, especially without affecting the image quality. Too much information causes the image to be obviously deformed and easy to detect. Complex steganographic algorithms may require high computing resources and time, which is unrealistic in some application scenarios. Summary of the invention

[0003] In view of the above problems, the present invention is proposed to provide an image digital watermark embedding method and a corresponding image digital watermark embedding device, an image digital watermark extraction method and an image digital watermark extraction device that overcome the above problems or at least partially solve the above problems.

[0004] The present invention discloses a method for embedding a digital watermark in an image, the method comprising:

[0005] Perform DWT transformation on the image to obtain multiple frequency band sub-band data;

[0006] Selecting target frequency band sub-band data from the plurality of frequency band sub-band data, and embedding watermark data into the target frequency band sub-band data by using a spread spectrum quantization algorithm to obtain watermark-embedded frequency band sub-band data;

[0007] Selecting secondary target frequency band sub-band data from frequency band sub-band data other than target frequency band sub-band data, inserting a correction template into the secondary target frequency band sub-band data, and obtaining correction enhanced frequency band sub-band data;

[0008] The unmodified frequency band sub-band data, the watermark embedded frequency band sub-band data and the correction enhanced frequency band sub-band data are subjected to inverse DWT transformation to generate a corrected watermarked image.

[0009] Optionally, the target frequency band sub-band data is LL frequency band sub-band data; and the secondary target frequency band sub-band data is HL frequency band sub-band data.

[0010] Optionally, selecting target frequency band sub-band data from the plurality of frequency band sub-band data, and embedding watermark data into the target frequency band sub-band data using a spread spectrum quantization algorithm to obtain watermark-embedded frequency band sub-band data, comprises:

[0011] Get the preset template vector;

[0012] Dividing the target frequency band subband data into a plurality of coefficient blocks having the same size as the preset template vector, and performing an operation on each coefficient block and the preset template vector to project the coefficient block into a scalar space;

[0013] Quantization index modulation is used to select the corresponding grid point set according to the scalar of the watermark information to quantize the scalar of the coefficient block, and the quantized scalar is quantized and compensated, and the compensated scalar is mapped back to the coefficient block space and added to the coefficient block to obtain the watermark embedded frequency band subband data.

[0014] Optionally, selecting secondary target frequency band subband data from frequency band subband data other than the target frequency band subband data, inserting a correction template into the secondary target frequency band subband data, and obtaining correction-enhanced frequency band subband data includes:

[0015] Get the preset template matrix;

[0016] Calculate the correlation matrix of the preset template matrix, and calculate the correction template using the preset template matrix, the embedding factor, and the correlation matrix of the preset template matrix;

[0017] The correction template is embedded into the sub-target frequency band sub-band data at the four vertex positions of a preset rectangular area in the image to obtain correction enhanced frequency band sub-band data; the preset rectangular area maintains a preset distance from the edge of the image.

[0018] The present invention also discloses an image digital watermark embedding device, the device comprising:

[0019] DWT transformation module, used to perform DWT transformation on the image to obtain multiple frequency band sub-band data;

[0020] A watermark embedding module, configured to select target frequency band sub-band data from the plurality of frequency band sub-band data, and embed the watermark data into the target frequency band sub-band data by using a spread spectrum quantization algorithm to obtain watermark embedded frequency band sub-band data;

[0021] A correction template embedding module is used to select secondary target frequency band sub-band data from frequency band sub-band data other than target frequency band sub-band data, insert the correction template into the secondary target frequency band sub-band data, and obtain correction enhanced frequency band sub-band data;

[0022] The inverse DWT transformation module is used to perform inverse DWT transformation on the unmodified frequency band subband data, the watermark embedded frequency band subband data and the correction enhanced frequency band subband data to generate a corrected watermarked image.

[0023] Optionally, the target frequency band sub-band data is LL frequency band sub-band data; and the secondary target frequency band sub-band data is HL frequency band sub-band data.

[0024] Optionally, the watermark embedding module includes:

[0025] A template vector acquisition submodule is used to acquire a preset template vector;

[0026] A coefficient block projection mapping submodule, used for dividing the target frequency band subband data into a plurality of coefficient blocks of the same size as the preset template vector, and performing an operation on each coefficient block and the preset template vector to project the coefficient block into a scalar space;

[0027] The watermark embedding submodule is used to adopt quantization index modulation to select the corresponding grid point set according to the scalar of the watermark information to quantize the scalar of the coefficient block, perform quantization compensation on the quantized scalar, and map the compensated scalar back to the coefficient block space and add it to the coefficient block to obtain the watermark embedded frequency band subband data.

[0028] Optionally, the correction template embedding module includes:

[0029] The template matrix acquisition submodule is used to obtain a preset template matrix;

[0030] A correction template generation submodule is used to calculate a correlation matrix of a preset template matrix, and calculate a correction template using the preset template matrix, an embedding factor, and a correlation matrix of the preset template matrix;

[0031] The correction template embedding submodule is used to embed the correction template into the secondary target frequency band subband data at the four vertex positions of a preset rectangular area in the image to obtain correction enhanced frequency band subband data; the preset rectangular area maintains a preset distance from the edge of the image.

[0032] The present invention also discloses a method for extracting digital watermarks from images, the method comprising:

[0033] Performing geometric correction on the received corrected watermarked image to obtain a geometrically corrected watermarked image;

[0034] The watermark data is extracted from the watermark embedding frequency band subband data of the geometrically corrected watermarked image.

[0035] Optionally, geometrically correcting the received corrected watermarked image to obtain a geometrically corrected watermarked image includes:

[0036] Calculating the correlation between the preset template matrix and each position in the received corrected watermarked image to obtain a correlation matrix;

[0037] In a window centered at each preset template matrix position of the original corrected watermarked image, searching for a maximum value in the correlation matrix, and taking the position corresponding to the maximum value as the preset template matrix position corresponding to the received corrected watermarked image;

[0038] Calculating a rigid body transformation matrix according to each preset template matrix position of the original corrected watermarked image and the preset template matrix position corresponding to the received corrected watermarked image, and performing an inverse transformation of the rigid body transformation on the received corrected watermarked image using an inverse transformation matrix of the rigid body transformation matrix to obtain a watermarked image corrected by the rigid body transformation;

[0039] The black border in the watermarked image corrected by the rigid body transformation is cleared, and the first position of the preset template matrix in the image after the black border is cleared is re-determined, and the image after the black border is cleared is slightly translated based on the first position to obtain a geometrically corrected watermarked image.

[0040] Optionally, extracting watermark data from watermark embedding frequency band subband data of the geometrically corrected watermarked image comprises:

[0041] Performing DWT transformation on the geometrically corrected watermarked image to obtain watermark embedded frequency band subband data;

[0042] Dividing the watermark embedding frequency band subband data into a plurality of coefficient blocks of the same size as the preset template vector, and performing an operation on each coefficient block and the preset template vector to project the coefficient block into a scalar space;

[0043] The distance between the coefficient block scalar obtained by each projection and each watermark information quantization grid point set is calculated respectively; each watermark information quantization grid point set represents different watermark information;

[0044] Compare the distance between the coefficient block scalar obtained by each projection and each watermark information quantization grid point set, and determine the watermark information corresponding to the coefficient block scalar obtained by each projection;

[0045] The watermark information corresponding to all coefficient block scalars is combined to obtain the watermark data.

[0046] The present invention also discloses an image digital watermark extraction device, the device comprising:

[0047] A geometric correction module, used for performing geometric correction on the received corrected watermarked image to obtain a geometrically corrected watermarked image;

[0048] The watermark extraction module is used to extract watermark data from the watermark embedding frequency band sub-band data of the geometrically corrected watermark-containing image.

[0049] Optionally, the geometric correction module includes:

[0050] A correlation matrix calculation submodule is used to calculate the correlation between the preset template matrix and each position in the received corrected watermarked image to obtain a correlation matrix;

[0051] A preset template matrix position determination submodule is used to search for the maximum value in the correlation matrix in a window centered on each preset template matrix position of the original corrected watermarked image, and use the position corresponding to the maximum value as the preset template matrix position corresponding to the received corrected watermarked image;

[0052] A rigid body transformation correction submodule is used to calculate a rigid body transformation matrix according to each preset template matrix position of the original corrected watermarked image and the preset template matrix position corresponding to the received corrected watermarked image, and perform an inverse transformation of the rigid body transformation on the received corrected watermarked image using an inverse transformation matrix of the rigid body transformation matrix to obtain a watermarked image corrected by the rigid body transformation;

[0053] The micro-translation submodule is used to remove the black border in the watermarked image after the rigid body transformation correction, and to re-determine the first position of the preset template matrix in the image after the black border is removed, and to perform micro-translation on the image after the black border is removed based on the first position to obtain the watermarked image after geometric correction.

[0054] Optionally, the watermark extraction module includes:

[0055] A DWT transformation submodule, used for performing DWT transformation on the geometrically corrected watermarked image to obtain watermark embedded frequency band subband data;

[0056] A coefficient block projection mapping submodule, used for dividing the watermark embedding frequency band subband data into a plurality of coefficient blocks of the same size as the preset template vector, and performing an operation on each coefficient block and the preset template vector to project the coefficient block into a scalar space;

[0057] The quantization distance calculation submodule is used to respectively calculate the distance between the coefficient block scalar obtained by each projection and each watermark information quantization grid point set; each watermark information quantization grid point set represents different watermark information;

[0058] A watermark information determination submodule, used to compare the distance between the coefficient block scalar obtained by each projection and each watermark information quantization grid point set, and determine the watermark information corresponding to the coefficient block scalar obtained by each projection;

[0059] The watermark data generation submodule is used to combine the watermark information corresponding to all coefficient block scalars to obtain watermark data.

[0060] The present invention includes the following advantages:

[0061] The image digital watermark embedding and extraction method of the present invention adopts the DWT algorithm to first perform DWT transformation on the image, and then selects the frequency band for watermark embedding, and embeds the other frequency bands with appropriate correction templates, which effectively hides the watermark information to achieve information hiding, effectively embeds and protects the watermark information and improves the accuracy during extraction, improves the image's ability to resist compression, rotation, and cropping, and contributes to the security technology of protecting images. Based on this embedding method, watermark extraction is performed accordingly. Through the correction template, the image is prevented from being unable to restore its original state after the size is changed during the transformation process. The algorithm can be used to verify whether the image undergoes geometric transformation. If so, an inverse geometric transformation is performed, and then the watermark is extracted. The watermark extraction accuracy is extremely high, and can basically be controlled within an error rate of 8%. Regardless of which color channel the colored image is embedded in, a high watermark extraction accuracy can be guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a flowchart of the steps of an image digital watermark embedding method provided by an embodiment of the present invention;

[0063] Figure 2 is a watermark embedding flow chart provided by an embodiment of the present invention;

[0064] Figure 3 is a graphical example diagram of a preset template vector provided by an embodiment of the present invention;

[0065] Figure 4 It is a flowchart of the steps of a method for extracting digital watermarks from an image provided by an embodiment of the present invention;

[0066] Figure 5 is a flow chart of watermark extraction provided by an embodiment of the present invention;

[0067] Figure 6 is a schematic diagram of a convolution result provided by an embodiment of the present invention;

[0068] Figure 7 It is a structural block diagram of an image digital watermark embedding device provided by an embodiment of the present invention;

[0069] Figure 8 It is a structural block diagram of an image digital watermark extraction device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0070] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0071] Reference Figure 1 , shows a flowchart of a method for embedding a digital watermark in an image provided in an embodiment of the present invention, which may specifically include the following steps:

[0072] Step 101, performing DWT transformation on the image to obtain multiple frequency band sub-band data;

[0073] Step 102, selecting target frequency band sub-band data from the plurality of frequency band sub-band data, and embedding watermark data into the target frequency band sub-band data using a spread spectrum quantization algorithm to obtain watermark-embedded frequency band sub-band data;

[0074] Step 103, selecting secondary target frequency band sub-band data from the frequency band sub-band data other than the target frequency band sub-band data, inserting a correction template into the secondary target frequency band sub-band data, and obtaining correction-enhanced frequency band sub-band data;

[0075] Step 104: Perform inverse DWT transformation on the unmodified frequency band sub-band data, the watermark embedded frequency band sub-band data and the correction enhanced frequency band sub-band data to generate a corrected watermarked image.

[0076] In an embodiment of the present invention, the target frequency band sub-band data is LL frequency band sub-band data; and the secondary target frequency band sub-band data is HL frequency band sub-band data.

[0077] In one embodiment of the present invention, target frequency band sub-band data is selected from the plurality of frequency band sub-band data, and watermark data is embedded into the target frequency band sub-band data using a spread spectrum quantization algorithm to obtain watermark-embedded frequency band sub-band data, including:

[0078] Get the preset template vector;

[0079] Dividing the target frequency band subband data into a plurality of coefficient blocks having the same size as the preset template vector, and performing an operation on each coefficient block and the preset template vector to project the coefficient block into a scalar space;

[0080] Quantization index modulation is used to select the corresponding grid point set according to the scalar of the watermark information to quantize the scalar of the coefficient block, and the quantized scalar is quantized and compensated, and the compensated scalar is mapped back to the coefficient block space and added to the coefficient block to obtain the watermark embedded frequency band subband data.

[0081] In one embodiment of the present invention, selecting secondary target frequency band subband data from frequency band subband data other than target frequency band subband data, inserting a correction template into the secondary target frequency band subband data, and obtaining correction enhanced frequency band subband data, comprises:

[0082] Get the preset template matrix;

[0083] Calculate the correlation matrix of the preset template matrix, and calculate the correction template using the preset template matrix, the embedding factor, and the correlation matrix of the preset template matrix;

[0084] The correction template is embedded into the sub-target frequency band sub-band data at the four vertex positions of a preset rectangular area in the image to obtain correction enhanced frequency band sub-band data; the preset rectangular area maintains a preset distance from the edge of the image.

[0085] The image digital watermark embedding method of the present invention can embed watermarks and correction templates into any frequency band where watermarks and correction templates are desired to be embedded. Of course, the image quality obtained by selecting different frequency bands may be different, and the corresponding frequency band can be selected according to the control requirements of these differences in actual situations.

[0086] As an embodiment of the present invention, the LL frequency band is selected as the watermark embedding frequency band, and the HL frequency band is selected as the correction template embedding frequency band. Figure 2 The following will introduce the image digital watermark embedding method of the present invention through this embodiment:

[0087]

Prepare in advance

[0088] 1. Generate a fixed template vector of size 10*10

[0089]

[0090] Used to embed watermarks, examples of graphics in the shape of p1 are as follows Figure 3 .

[0091] 2. Randomly generate a 16*16 template matrix with random values ​​of -1 or 1

[0092]

DWT watermark embedding algorithm

[0093] Input: image data, watermark data, watermark data with a length of 400 bits, template vector p 1 , template matrix p 2 ;

[0094] Output: image data after embedding watermark;

[0095] Function: Implement watermark embedding. The general steps are as follows:

[0096] Step 1: Image DWT transformation; DWT decomposes the image into four main sub-bands: LL (low frequency-low frequency), HL (high frequency-low frequency), LH (low frequency-high frequency), and HH (high frequency-high frequency). The LL band sub-band contains the main energy and low-frequency information of the image, while the HL, LH and HH band sub-bands contain the high-frequency information of the image in the horizontal, vertical and diagonal directions respectively.

[0097] Step 2: Use the spread spectrum quantization algorithm to embed the watermark into the DWT LL frequency band. The image embedded in the LL frequency band has the strongest robustness.

[0098] 2.1 Take out the 10*10 coefficient blocks x in LL one by one, and use ∑x*p 1 Project x to scalar space. Where ∑x*p 1 For x and p 1 Multiply element by element and then sum. Then use quantization index modulation to quantize the scalar embedded with secret message 0 and the scalar embedded with secret message 1 to different grid point sets. The quantization index modulation formula is as follows:

[0099]

[0100] Among them, Q 1 (v) is used to quantize the scalar v to the grid point set representing the secret message 1, Q 0 (v) is used to quantize the scalar v to the set of grid points representing the secret message 0. 1 is a factor, controlling its size can enhance robustness. 1 =100. Then the quantized scalar is quantized and compensated to reduce the embedded disturbance. The formula is described as:

[0101]

[0102] Finally, the compensated scalar is remapped back to the space of x and added to x. The formula is described as

[0103]

[0104] Step 3: embed the correction template in the high frequency band to avoid interference with the watermark message embedded in the LL band. One implementation method is to embed the correction template in the HL band, and the steps are as follows:

[0105] 3.1 Preset the 4 vertex positions of a rectangular area in the image as the embedding position of the correction template. As an example, a selection of a rectangular area is y = {(50,50), (height-50,50), (50, width-50), (height-50, width-50)}, that is, select 4 vertices of an internal rectangular area 50 pixels away from each of the four edges.

[0106] 3.2 Calculate the correlation matrix of p2

[0107]

[0108] β=max(mout1)

[0109] 3.3 Embedding p2

[0110] HL(yi [1]:y i [1]+15,y i [2]:y i [2]+15)=HL(y i [1]:y i [1]+15,y i [2]:y i [2]+15)+α 2 β×p 2

[0111] Among them, α 2 is a factor, controlling its size can enhance robustness. 2 =20.

[0112] Step 4: Inverse DWT transformation to generate a watermarked image.

[0113] The image digital watermark embedding method of the present invention first performs DWT transformation on the image, and embedding its LL frequency band can ensure that its quality is not greatly affected, thereby achieving the effect of invisible watermark. Embedding a correction template prevents the image from being unable to restore its original state after the size is changed during the transformation process, and an algorithm can be used to verify whether the image undergoes geometric transformation, and if so, an inverse geometric transformation is performed. The problem of improving the robustness of the image and making the information embedded in the image undetectable is solved, and it can also be used as a watermark to add encryption to PDF documents.

[0114] Reference Figure 4 , shows a flowchart of a method for extracting digital watermarks from an image provided in an embodiment of the present invention, which may specifically include the following steps:

[0115] Step 401, geometrically correcting the received corrected watermarked image to obtain a geometrically corrected watermarked image;

[0116] Step 402: extracting watermark data from the watermark embedding frequency sub-band data of the geometrically corrected watermarked image.

[0117] In one embodiment of the present invention, geometrically correcting the received corrected watermarked image to obtain a geometrically corrected watermarked image includes:

[0118] Calculating the correlation between the preset template matrix and each position in the received corrected watermarked image to obtain a correlation matrix;

[0119] In a window centered at each preset template matrix position of the original corrected watermarked image, searching for a maximum value in the correlation matrix, and taking the position corresponding to the maximum value as the preset template matrix position corresponding to the received corrected watermarked image;

[0120] Calculating a rigid body transformation matrix according to each preset template matrix position of the original corrected watermarked image and the preset template matrix position corresponding to the received corrected watermarked image, and performing an inverse transformation of the rigid body transformation on the received corrected watermarked image using an inverse transformation matrix of the rigid body transformation matrix to obtain a watermarked image corrected by the rigid body transformation;

[0121] The black border in the watermarked image corrected by the rigid body transformation is cleared, and the first position of the preset template matrix in the image after the black border is cleared is re-determined, and the image after the black border is cleared is slightly translated based on the first position to obtain a geometrically corrected watermarked image.

[0122] In one embodiment of the present invention, extracting watermark data from watermark embedding frequency band subband data of a geometrically corrected watermarked image comprises:

[0123] Performing DWT transformation on the geometrically corrected watermarked image to obtain watermark embedded frequency band subband data;

[0124] Dividing the watermark embedding frequency band subband data into a plurality of coefficient blocks of the same size as the preset template vector, and performing an operation on each coefficient block and the preset template vector to project the coefficient block into a scalar space;

[0125] The distance between the coefficient block scalar obtained by each projection and each watermark information quantization grid point set is calculated respectively; each watermark information quantization grid point set represents different watermark information;

[0126] Compare the distance between the coefficient block scalar obtained by each projection and each watermark information quantization grid point set, and determine the watermark information corresponding to the coefficient block scalar obtained by each projection;

[0127] The watermark information corresponding to all coefficient block scalars is combined to obtain the watermark data.

[0128] The image digital watermark extraction method of the present invention can also extract watermarks from any frequency band where watermarks are to be extracted. Of course, the quality of watermark data extracted from different frequency bands may be different, and the corresponding frequency band can be selected based on the control requirements of these differences in actual situations.

[0129] As an embodiment of the present invention, when the LL frequency band is selected as the watermark embedding frequency band and the HL frequency band is selected as the correction template embedding frequency band, the watermark can be extracted from the LL frequency band accordingly. Figure 5 The following will introduce the image digital watermark extraction method of the present invention through this embodiment:

[0130]

DWT watermark extraction algorithm

[0131] Input: watermarked image data, template vector p1 , template matrix p 2 , the size of the original image is im*in

[0132] Output: watermark data

[0133] Function: Extract watermark from image. The general steps are as follows:

[0134] Step 1: Geometric correction

[0135] 1.1 Set the reference. When there is no geometric transformation, the position of p2 is y = {(50,50), (height-50,50), (50, width-50), (height-50, width-50)}

[0136] 1.2 Estimate the current position of p2 from the received image. First, calculate the template

[0137] P 2 =iDWT2(LL=0,HL=p2,LH=0,HH=0)

[0138] 1.3 Calculate the correlation matrix of the template matrix p2

[0139]

[0140] 1.4 Find the 4 maximum values ​​from the correlation matrix as the current position of p2

[0141] y′ 1 ,y′ 2 ,y′ 3 .y′ 4 ={argmax i (mout1)}

[0142] Note that each time a maximum value is found, the value in the 32*32 window centered on the maximum value position in mout1 is set to 0 to prevent the two maximum values ​​found from being too close.

[0143] 1.5 Inverse geometric transformation, the principle is as follows:

[0144] 1.5.1 Using the template vector p 1 And LH convolution, the result after convolution is referenced Figure 6 :

[0145] Take four maximum points, d1 (coordinate is (x 1 ,y 1 )), d2 (coordinate is (x 2 ,y 2 )), d3 (coordinate is (x 3 ,y 3 )), d4 (coordinate is (x4 ,y 4 )).

[0146] 1.5.2 If no rigid body transformation occurs, the four points should be near (50, 50), (height-50, 50), (50, width-50), (height-50, width-50), and still form a square. If a rigid body transformation occurs, the formula for the rigid body transformation is as follows:

[0147]

[0148] Therefore, we can use the original coordinates: (50, 50), (height-50, 50), (50, width-50), (height-50, width-50) and the coordinates after rigid body transformation: (x 1 ,y 1 )、(x 2 ,y 2 )、(x 3 ,y 3 )、(x 4 ,y 4 ) to estimate the transformation matrix F.

[0149] 1.5.3 Use the inverse matrix of matrix F to perform a rigid body transformation on the image, and the original image can be restored.

[0150] 1.6 After geometrically correcting the image, delete the black border, then find the first p2 position again and fine-tune the image. 1 ,j 1 ], at this position, slightly translate Y r , resize:

[0151] Y r Gao Congi 1 Start, to i 1 +im-1 ends, width from j 1 Start, to j 1 +in-1 ends.

[0152] Step 2: Take out the DWT LL band of the restored image and extract the watermark

[0153] The extraction method is: take out the coefficient block x of size 10*10 in LL in turn, and use p 1 Reproject it to the scalar space and calculate whether it is closer to the grid point set representing the secret message 1 or the grid point set representing the secret message 0. If it is closer to the grid point set representing the secret message 1, the extracted secret message is 1, otherwise it is 0. The formula is described as follows:

[0154]

[0155] The image digital watermark extraction method of the present invention can verify whether the image undergoes geometric transformation based on the correction template by using an algorithm. If so, the inverse geometric transformation is performed before watermark extraction. The watermark extraction accuracy is extremely high and can be basically controlled within an error rate of 8%. Regardless of which color channel the colored image is embedded in, a high watermark extraction accuracy can be guaranteed.

[0156] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0157] Reference Figure 7 , shows a structural block diagram of an image digital watermark embedding device provided in an embodiment of the present invention, which may specifically include the following modules:

[0158] DWT transformation module 701, used to perform DWT transformation on the image to obtain multiple frequency band sub-band data;

[0159] The watermark embedding module 702 is used to select target frequency band sub-band data from the multiple frequency band sub-band data, and embed the watermark data into the target frequency band sub-band data by using a spread spectrum quantization algorithm to obtain the watermark embedded frequency band sub-band data;

[0160] The correction template embedding module 703 is used to select secondary target frequency band sub-band data from the frequency band sub-band data other than the target frequency band sub-band data, insert the correction template into the secondary target frequency band sub-band data, and obtain correction enhanced frequency band sub-band data;

[0161] The inverse DWT transformation module 704 is used to perform inverse DWT transformation on the unmodified frequency band sub-band data, the watermark embedded frequency band sub-band data and the correction enhanced frequency band sub-band data to generate a corrected watermarked image.

[0162] Optionally, the target frequency band sub-band data is LL frequency band sub-band data; and the secondary target frequency band sub-band data is HL frequency band sub-band data.

[0163] Optionally, the watermark embedding module includes:

[0164] A template vector acquisition submodule is used to acquire a preset template vector;

[0165] A coefficient block projection mapping submodule, used for dividing the target frequency band subband data into a plurality of coefficient blocks of the same size as the preset template vector, and performing an operation on each coefficient block and the preset template vector to project the coefficient block into a scalar space;

[0166] The watermark embedding submodule is used to adopt quantization index modulation to select the corresponding grid point set according to the scalar of the watermark information to quantize the scalar of the coefficient block, perform quantization compensation on the quantized scalar, and map the compensated scalar back to the coefficient block space and add it to the coefficient block to obtain the watermark embedded frequency band subband data.

[0167] Optionally, the correction template embedding module includes:

[0168] The template matrix acquisition submodule is used to obtain a preset template matrix;

[0169] A correction template generation submodule is used to calculate a correlation matrix of a preset template matrix, and calculate a correction template using the preset template matrix, an embedding factor, and a correlation matrix of the preset template matrix;

[0170] The correction template embedding submodule is used to embed the correction template into the secondary target frequency band subband data at the four vertex positions of a preset rectangular area in the image to obtain correction enhanced frequency band subband data; the preset rectangular area maintains a preset distance from the edge of the image.

[0171] Reference Figure 8 , shows a structural block diagram of an image digital watermark extraction device provided in an embodiment of the present invention, which may specifically include the following modules:

[0172] The geometric correction module 801 is used to perform geometric correction on the received corrected watermarked image to obtain a geometrically corrected watermarked image;

[0173] The watermark extraction module 802 is used to extract watermark data from the watermark embedding frequency band sub-band data of the geometrically corrected watermark-containing image.

[0174] Optionally, the geometric correction module includes:

[0175] A correlation matrix calculation submodule is used to calculate the correlation between the preset template matrix and each position in the received corrected watermarked image to obtain a correlation matrix;

[0176] A preset template matrix position determination submodule is used to search for the maximum value in the correlation matrix in a window centered on each preset template matrix position of the original corrected watermarked image, and use the position corresponding to the maximum value as the preset template matrix position corresponding to the received corrected watermarked image;

[0177] A rigid body transformation correction submodule is used to calculate a rigid body transformation matrix according to each preset template matrix position of the original corrected watermarked image and the preset template matrix position corresponding to the received corrected watermarked image, and perform an inverse transformation of the rigid body transformation on the received corrected watermarked image using an inverse transformation matrix of the rigid body transformation matrix to obtain a watermarked image corrected by the rigid body transformation;

[0178] The micro-translation submodule is used to remove the black border in the watermarked image after the rigid body transformation correction, and to re-determine the first position of the preset template matrix in the image after the black border is removed, and to perform micro-translation on the image after the black border is removed based on the first position to obtain the watermarked image after geometric correction.

[0179] Optionally, the watermark extraction module includes:

[0180] A DWT transformation submodule, used for performing DWT transformation on the geometrically corrected watermarked image to obtain watermark embedded frequency band subband data;

[0181] A coefficient block projection mapping submodule, used for dividing the watermark embedding frequency band subband data into a plurality of coefficient blocks of the same size as the preset template vector, and performing an operation on each coefficient block and the preset template vector to project the coefficient block into a scalar space;

[0182] The quantization distance calculation submodule is used to respectively calculate the distance between the coefficient block scalar obtained by each projection and each watermark information quantization grid point set; each watermark information quantization grid point set represents different watermark information;

[0183] A watermark information determination submodule, used to compare the distance between the coefficient block scalar obtained by each projection and each watermark information quantization grid point set, and determine the watermark information corresponding to the coefficient block scalar obtained by each projection;

[0184] The watermark data generation submodule is used to combine the watermark information corresponding to all coefficient block scalars to obtain watermark data.

[0185] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0186] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0187] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0188] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for embedding digital watermark in an image, characterized in that: The method comprises: Perform DWT transformation on the image to obtain multiple frequency band sub-band data; Selecting target frequency band sub-band data from the plurality of frequency band sub-band data, and embedding watermark data into the target frequency band sub-band data by using a spread spectrum quantization algorithm to obtain watermark-embedded frequency band sub-band data; Selecting secondary target frequency band sub-band data from frequency band sub-band data other than target frequency band sub-band data, inserting a correction template into the secondary target frequency band sub-band data, and obtaining correction enhanced frequency band sub-band data; Performing inverse DWT transformation on the unmodified frequency band subband data, the watermark embedded frequency band subband data and the correction enhanced frequency band subband data to generate a corrected watermarked image; Selecting secondary target frequency band sub-band data from frequency band sub-band data other than target frequency band sub-band data, inserting a correction template into the secondary target frequency band sub-band data, and obtaining correction enhanced frequency band sub-band data, including: Get the preset template matrix; Calculate the correlation matrix of the preset template matrix, and calculate the correction template using the preset template matrix, the embedding factor, and the correlation matrix of the preset template matrix; The correction template is embedded into the sub-target frequency band sub-band data at the four vertex positions of a preset rectangular area in the image to obtain correction enhanced frequency band sub-band data; the preset rectangular area maintains a preset distance from the edge of the image.

2. The method according to claim 1, characterized in that The target frequency band sub-band data is LL frequency band sub-band data; and the secondary target frequency band sub-band data is HL frequency band sub-band data.

3. The method according to claim 1, characterized in that: Selecting target frequency band sub-band data from the plurality of frequency band sub-band data, and embedding watermark data into the target frequency band sub-band data using a spread spectrum quantization algorithm to obtain watermark-embedded frequency band sub-band data, comprising: Get the preset template vector; Dividing the target frequency band subband data into a plurality of coefficient blocks having the same size as the preset template vector, and performing an operation on each coefficient block and the preset template vector to project the coefficient block into a scalar space; Quantization index modulation is used to select the corresponding grid point set according to the scalar of the watermark information to quantize the scalar of the coefficient block, and the quantized scalar is quantized and compensated, and the compensated scalar is mapped back to the coefficient block space and added to the coefficient block to obtain the watermark embedded frequency band subband data.

4. A method for extracting digital watermark from an image, characterized in that: The method comprises: Performing geometric correction on the received corrected watermarked image to obtain a geometrically corrected watermarked image; Extracting watermark data from watermark embedding frequency band subband data of the geometrically corrected watermarked image; Performing geometric correction on the received corrected watermarked image to obtain a geometrically corrected watermarked image, including: Calculating the correlation between the preset template matrix and each position in the received corrected watermarked image to obtain a correlation matrix; In a window centered at each preset template matrix position of the original corrected watermarked image, searching for a maximum value in the correlation matrix, and taking the position corresponding to the maximum value as the preset template matrix position corresponding to the received corrected watermarked image; Calculating a rigid body transformation matrix according to each preset template matrix position of the original corrected watermarked image and the preset template matrix position corresponding to the received corrected watermarked image, and performing an inverse transformation of the rigid body transformation on the received corrected watermarked image using an inverse transformation matrix of the rigid body transformation matrix to obtain a watermarked image corrected by the rigid body transformation; The black border in the watermarked image corrected by the rigid body transformation is cleared, and the first position of the preset template matrix in the image after the black border is cleared is re-determined, and the image after the black border is cleared is slightly translated based on the first position to obtain a geometrically corrected watermarked image.

5. The method according to claim 4, characterized in that Extracting watermark data from watermark embedding frequency band subband data of the geometrically corrected watermarked image, including: Performing DWT transformation on the geometrically corrected watermarked image to obtain watermark embedded frequency band subband data; Dividing the watermark embedding frequency band subband data into a plurality of coefficient blocks of the same size as a preset template vector, and performing an operation on each coefficient block and the preset template vector to project the coefficient block into a scalar space; The distance between the coefficient block scalar obtained by each projection and each watermark information quantization grid point set is calculated respectively; each watermark information quantization grid point set represents different watermark information; Compare the distance between the coefficient block scalar obtained by each projection and each watermark information quantization grid point set, and determine the watermark information corresponding to the coefficient block scalar obtained by each projection; The watermark information corresponding to all coefficient block scalars is combined to obtain the watermark data.

6. An image digital watermark embedding device, characterized in that: The device comprises: DWT transformation module, used to perform DWT transformation on the image to obtain multiple frequency band sub-band data; A watermark embedding module, configured to select target frequency band sub-band data from the plurality of frequency band sub-band data, and embed the watermark data into the target frequency band sub-band data by using a spread spectrum quantization algorithm to obtain watermark embedded frequency band sub-band data; A correction template embedding module is used to select secondary target frequency band sub-band data from frequency band sub-band data other than target frequency band sub-band data, insert the correction template into the secondary target frequency band sub-band data, and obtain correction enhanced frequency band sub-band data; An inverse DWT transformation module is used to perform an inverse DWT transformation on the unmodified frequency band subband data, the watermark embedded frequency band subband data and the correction enhanced frequency band subband data to generate a corrected watermarked image; The correction template embedding module includes: The template matrix acquisition submodule is used to obtain a preset template matrix; A correction template generation submodule is used to calculate a correlation matrix of a preset template matrix, and calculate a correction template using the preset template matrix, an embedding factor, and a correlation matrix of the preset template matrix; The correction template embedding submodule is used to embed the correction template into the secondary target frequency band subband data at the four vertex positions of a preset rectangular area in the image to obtain correction enhanced frequency band subband data; the preset rectangular area maintains a preset distance from the edge of the image.

7. The device according to claim 6, characterized in that The target frequency band sub-band data is LL frequency band sub-band data; and the secondary target frequency band sub-band data is HL frequency band sub-band data.

8. An image digital watermark extraction device, characterized in that: The device comprises: A geometric correction module, used for performing geometric correction on the received corrected watermarked image to obtain a geometrically corrected watermarked image; A watermark extraction module, used for extracting watermark data from the watermark embedding frequency band sub-band data of the geometrically corrected watermark-containing image; The geometric correction module comprises: A correlation matrix calculation submodule is used to calculate the correlation between the preset template matrix and each position in the received corrected watermarked image to obtain a correlation matrix; A preset template matrix position determination submodule is used to search for the maximum value in the correlation matrix in a window centered on each preset template matrix position of the original corrected watermarked image, and use the position corresponding to the maximum value as the preset template matrix position corresponding to the received corrected watermarked image; A rigid body transformation correction submodule is used to calculate a rigid body transformation matrix according to each preset template matrix position of the original corrected watermarked image and the preset template matrix position corresponding to the received corrected watermarked image, and perform an inverse transformation of the rigid body transformation on the received corrected watermarked image using an inverse transformation matrix of the rigid body transformation matrix to obtain a watermarked image corrected by the rigid body transformation; The micro-translation submodule is used to remove the black border in the watermarked image after the rigid body transformation correction, and to re-determine the first position of the preset template matrix in the image after the black border is removed, and to perform micro-translation on the image after the black border is removed based on the first position to obtain the watermarked image after geometric correction.

Citation Information

Patent Citations

  • DWT-SVD robust blind watermark method based on Zernike moments

    CN103955880A