Image digital watermark embedding and extraction method and device

By performing DCT transformation and adaptive watermark embedding on the image, combined with bias correction template technology, the problems of traditional image hiding technology being sensitive to small image modifications and limited information capacity are solved, and efficient and secure image digital watermark embedding and extraction are achieved.

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

Patent Information

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

AI Technical Summary

Technical Problem

Traditional image hiding technology is very sensitive to minor modifications of images, resulting in the loss or damage of hidden information. The capacity of hidden information is usually limited, making it difficult to embed too much information without affecting the image quality. Complex steganography algorithms also require higher computing resources and time.

Method used

By performing DCT transformation on the carrier image, the watermark embedding intensity is adaptively adjusted according to the DCT coefficient and the preset template vector, an embedded watermark signal in the DCT frequency domain is generated, and an inverse DCT transformation is performed to obtain the embedded watermark signal in the airspace, which is added to the carrier image to form a watermark-containing image. At the same time, a bias correction signal is generated by a preset template matrix and added to the watermarked image to improve the security and stability of the watermark.

Benefits of technology

It effectively hides the watermark information, improves the security and stability of the watermark, and can resist attacks such as smear, rotation, shear, and superimpose noise. The watermark extraction accuracy is high and the error rate is low.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090698B_ABST
    Figure CN119090698B_ABST
Patent Text Reader

Abstract

The present invention provides an image digital watermark embedding and extraction method and device, the method comprising: embedding a digital watermark after performing DCT transformation on an image, and embedding an appropriate correction template, so as to effectively hide the watermark information and realize information hiding. The randomly generated template vector p1 improves the security of the watermark, and the watermark can only be effectively extracted when the template is known. The fixed matrix p2 provides an additional security layer, making it more difficult for an attacker to remove the watermark. Based on this embedding method, watermark extraction is performed accordingly, and the correction template is used to prevent the image 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 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.
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 DCT transformation on the carrier image to obtain DCT coefficients;

[0006] Adaptively adjust the watermark embedding strength according to the DCT coefficient and the preset template vector, and generate an embedded watermark signal in the DCT frequency domain according to the watermark data by using the preset template vector and the watermark embedding strength, and perform an inverse DCT transformation on the embedded watermark signal in the DCT frequency domain to obtain a corresponding embedded watermark signal in the spatial domain, and add the corresponding embedded watermark signal in the spatial domain to the carrier image to obtain a watermarked image;

[0007] A correction signal is generated according to a preset template matrix, and the correction signal is added to the watermarked image to obtain a corrected watermarked image.

[0008] Optionally, adaptively adjusting the watermark embedding strength according to the DCT coefficient and the preset template vector, generating an embedded watermark signal in the DCT frequency domain according to the watermark data by using the preset template vector and the watermark embedding strength, and performing an inverse DCT transform on the embedded watermark signal in the DCT frequency domain to obtain a corresponding embedded watermark signal in the spatial domain, and adding the corresponding embedded watermark signal in the spatial domain to the carrier image to obtain the watermarked image, including:

[0009] Sequentially extracting sub-DCT coefficients of a preset size from the DCT coefficients;

[0010] Initialize the watermark embedding strength to obtain the initial watermark embedding strength;

[0011] According to the watermark data, the initial watermark embedding strength and the preset template vector are used to generate the initial embedded watermark signal in the DCT frequency domain;

[0012] Calculating the correlation between each sub-DCT coefficient and a preset template vector, and adaptively adjusting the initial watermark embedding strength according to the correlation to obtain a target watermark embedding strength for each sub-DCT coefficient;

[0013] According to the watermark data, a target watermark embedding strength of each sub-DCT coefficient and a preset template vector are used to generate a target embedded watermark signal in the DCT frequency domain of each sub-DCT coefficient;

[0014] The target embedded watermark signal in the DCT frequency domain of all sub-DCT coefficients is formed into the target embedded watermark signal in the DCT frequency domain of the DCT coefficient;

[0015] Performing inverse DCT transformation on the target embedded watermark signal in the DCT frequency domain of the DCT coefficient to obtain the corresponding embedded watermark signal in the spatial domain;

[0016] The corresponding embedded watermark signal in the spatial domain is added to the carrier image to obtain a watermarked image.

[0017] Optionally, generating a correction signal according to a preset template matrix, adding the correction signal to the watermarked image, and obtaining the corrected watermarked image, comprises:

[0018] Calculate the correlation matrix of the preset template matrix;

[0019] For the first sub-block of a preset size in each matrix block with a preset template matrix size as a side length in the correlation matrix, a correction signal is generated according to an extreme value of a corresponding block in the correlation matrix;

[0020] Combining all generated correction signals into a correction signal matrix; the size of the correction signal matrix is ​​the same as the size of the watermarked image;

[0021] The correction signal matrix is ​​added to the watermarked image to obtain a corrected watermarked image.

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

[0023] A DCT transformation module, used to perform DCT transformation on the carrier image to obtain DCT coefficients;

[0024] A watermark embedding module is used to adaptively adjust the watermark embedding strength according to the DCT coefficient and the preset template vector, and generate an embedded watermark signal in the DCT frequency domain according to the watermark data by using the preset template vector and the watermark embedding strength, and perform an inverse DCT transformation on the embedded watermark signal in the DCT frequency domain to obtain a corresponding embedded watermark signal in the spatial domain, and add the corresponding embedded watermark signal in the spatial domain to the carrier image to obtain a watermarked image;

[0025] The correction template embedding module is used to generate a correction signal according to a preset template matrix, and add the correction signal to the watermarked image to obtain a corrected watermarked image.

[0026] Optionally, the watermark embedding module includes:

[0027] A DCT coefficient division submodule, used for sequentially extracting sub-DCT coefficients of a preset size from the DCT coefficients;

[0028] The embedding strength initialization submodule is used to initialize the watermark embedding strength and obtain the initial watermark embedding strength;

[0029] The watermark signal initialization submodule is used to generate an initial embedded watermark signal in the DCT frequency domain according to the watermark data, using the initial watermark embedding strength and the preset template vector;

[0030] The embedding strength adjustment submodule is used to calculate the correlation between each sub-DCT coefficient and the preset template vector, and adaptively adjust the initial watermark embedding strength according to the correlation to obtain the target watermark embedding strength of each sub-DCT coefficient;

[0031] The watermark signal adjustment submodule is used to generate a target embedded watermark signal in the DCT frequency domain of each sub-DCT coefficient according to the watermark data by using the target watermark embedding strength of each sub-DCT coefficient and a preset template vector;

[0032] A frequency domain watermark signal generating submodule, used for forming a target embedded watermark signal in the DCT frequency domain of a DCT coefficient by embedding the target watermark signal in the DCT frequency domain of all sub-DCT coefficients;

[0033] The spatial domain watermark signal generation submodule is used to perform inverse DCT transformation on the target embedded watermark signal in the DCT frequency domain of the DCT coefficient to obtain the corresponding embedded watermark signal in the spatial domain;

[0034] The watermarked image generation submodule is used to add the corresponding embedded watermark signal in the spatial domain to the carrier image to obtain the watermarked image.

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

[0036] A correlation matrix calculation submodule, used to calculate the correlation matrix of a preset template matrix;

[0037] A correction signal generating submodule, for generating a correction signal according to an extreme value of a corresponding block in the correlation matrix for the first subblock of a preset size in each matrix block with a preset template matrix size as a side length in the correlation matrix;

[0038] A correction signal matrix generation submodule, used for combining all generated correction signals into a correction signal matrix; the size of the correction signal matrix is ​​the same as the size of the watermarked image;

[0039] The deskew-corrected watermarked image generation submodule is used to add the deskew signal matrix to the watermarked image to obtain the deskew-corrected watermarked image.

[0040] The present invention also discloses a method for extracting a digital watermark of an image, the method comprising:

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

[0042] Extract watermark data from geometrically corrected watermarked images.

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

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

[0045] 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;

[0046] Calculating a perspective 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 perspective transformation on the received corrected watermarked image using an inverse transformation matrix of the perspective transformation matrix to obtain a watermarked image corrected by perspective transformation;

[0047] The black border in the watermarked image corrected by perspective 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.

[0048] Optionally, extracting watermark data from the geometrically corrected watermarked image comprises:

[0049] Performing inverse DCT transformation on the preset template vector to obtain a DCT transformed template vector;

[0050] The geometrically corrected watermarked image is divided into a plurality of pixel blocks of preset sizes, and watermark data is extracted from the pixel blocks not embedded in the preset template matrix according to the sign of the correlation between each pixel block and the DCT transformation template vector.

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

[0052] A geometric correction module, used for geometrically correcting the received corrected watermarked image to obtain a geometrically corrected watermarked image;

[0053] The watermark extraction module is used to extract watermark data from the geometrically corrected watermarked image.

[0054] Optionally, the geometric correction module includes:

[0055] 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;

[0056] 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;

[0057] a perspective transformation correction submodule, for calculating a perspective 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 perspective transformation on the received corrected watermarked image using an inverse transformation matrix of the perspective transformation matrix to obtain a watermarked image corrected by perspective transformation;

[0058] The micro-translation submodule is used to remove the black border in the watermarked image after perspective 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 a geometrically corrected watermarked image.

[0059] Optionally, the watermark extraction module includes:

[0060] An inverse DCT transformation submodule is used to perform an inverse DCT transformation on a preset template vector to obtain a DCT transformation template vector;

[0061] The watermark extraction submodule is used to divide the geometrically corrected watermarked image into a plurality of pixel blocks of preset size, and extract watermark data from the pixel blocks not embedded in the preset template matrix according to the sign of the correlation between each pixel block and the DCT transformation template vector.

[0062] The present invention includes the following advantages:

[0063] The image digital watermark embedding and extraction method of the present invention embeds the digital watermark after performing DCT transformation on the image, and embeds the digital watermark appropriately, so as to effectively hide the watermark information and realize information hiding. The randomly generated template vector p1 improves the security of the watermark, and the watermark can only be effectively extracted when the template is known. The fixed matrix p2 provides an additional security layer, making it more difficult for the watermark to be removed by an attacker. Based on this embedding method, watermark extraction is performed accordingly. The correction template is used to prevent the image 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 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

[0064] Figure 1 It is a framework diagram of an algorithm for embedding and extracting digital watermarks for images provided by an embodiment of the present invention;

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

[0066] Figure 3 is a schematic diagram of the shape of a preset template matrix provided in an embodiment of the present invention;

[0067] Figure 4 is a schematic diagram of the embedding position of the template vector and the template matrix provided in an embodiment of the present invention;

[0068] Figure 5 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;

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

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

[0071] 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.

[0072] The present invention embeds invisible watermarks on files, which have certain concealment and are highly robust against common attacks such as smearing, rotation, shearing, and superimposed noise. For example, PDF files, Ofd files, JPEG files, PNG files, etc. Figure 1 By using the embedding method and extraction method of the present invention in these files, watermark embedding and extraction can be achieved to transmit secret information.

[0073] Reference Figure 2 , 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:

[0074] Step 201, performing DCT transformation on the carrier image to obtain DCT coefficients;

[0075] Step 202, adaptively adjusting the watermark embedding strength according to the DCT coefficient and the preset template vector, and generating an embedded watermark signal in the DCT frequency domain according to the watermark data by using the preset template vector and the watermark embedding strength, and performing an inverse DCT transform on the embedded watermark signal in the DCT frequency domain to obtain a corresponding embedded watermark signal in the spatial domain, and adding the corresponding embedded watermark signal in the spatial domain to the carrier image to obtain a watermarked image;

[0076] Step 203: Generate a correction signal according to a preset template matrix, and add the correction signal to the watermarked image to obtain a corrected watermarked image.

[0077] In one embodiment of the present invention, the watermark embedding strength is adaptively adjusted according to the DCT coefficient and the preset template vector, and according to the watermark data, the preset template vector and the watermark embedding strength are used to generate an embedded watermark signal in the DCT frequency domain, and the embedded watermark signal in the DCT frequency domain is subjected to an inverse DCT transform to obtain a corresponding embedded watermark signal in the spatial domain, and the corresponding embedded watermark signal in the spatial domain is added to the carrier image to obtain a watermarked image, including:

[0078] Sequentially extracting sub-DCT coefficients of a preset size from the DCT coefficients;

[0079] Initialize the watermark embedding strength to obtain the initial watermark embedding strength;

[0080] According to the watermark data, the initial watermark embedding strength and the preset template vector are used to generate the initial embedded watermark signal in the DCT frequency domain;

[0081] Calculating the correlation between each sub-DCT coefficient and a preset template vector, and adaptively adjusting the initial watermark embedding strength according to the correlation to obtain a target watermark embedding strength for each sub-DCT coefficient;

[0082] According to the watermark data, a target watermark embedding strength of each sub-DCT coefficient and a preset template vector are used to generate a target embedded watermark signal in the DCT frequency domain of each sub-DCT coefficient;

[0083] The target embedded watermark signal in the DCT frequency domain of all sub-DCT coefficients is formed into the target embedded watermark signal in the DCT frequency domain of the DCT coefficient;

[0084] Performing inverse DCT transformation on the target embedded watermark signal in the DCT frequency domain of the DCT coefficient to obtain the corresponding embedded watermark signal in the spatial domain;

[0085] The corresponding embedded watermark signal in the spatial domain is added to the carrier image to obtain a watermarked image.

[0086] In one embodiment of the present invention, a correction signal is generated according to a preset template matrix, and the correction signal is added to a watermarked image to obtain a corrected watermarked image, including:

[0087] Calculate the correlation matrix of the preset template matrix;

[0088] For the first sub-block of a preset size in each matrix block with a preset template matrix size as a side length in the correlation matrix, a correction signal is generated according to an extreme value of a corresponding block in the correlation matrix;

[0089] Combining all generated correction signals into a correction signal matrix; the size of the correction signal matrix is ​​the same as the size of the watermarked image;

[0090] The correction signal matrix is ​​added to the watermarked image to obtain a corrected watermarked image.

[0091] The image digital watermark embedding method of the present invention will be described in detail below:

[0092]

Prepare in advance

[0093] 1. Randomly generate a template vector p1=[-1,1,1,-1,…] of size 16*16 and a random value of -1 or 1 to embed the watermark;

[0094] 2. Generate a fixed matrix p2 of size 16*16 to embed the correction information. The shape of p2 is as follows Figure 3 , where white represents 1 and black represents -1.

[0095]

DCT watermark embedding algorithm

[0096] Input: image data X, watermark data, watermark data with a length of 398 bits, template vector p1, template matrix p2;

[0097] Output: image data Y after embedding watermark;

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

[0099] Step 1: In each p2intv*p2intv matrix, except for the first 16*16 position, the other positions are used to embed messages. The message embedding method is:

[0100] (1.1) Perform 8*8 DCT transformation on the carrier image to obtain the coefficient X dct ;

[0101] (1.2) Take out the 16*16 size X one by one dct , denoted as x. According to x, the embedded watermark signal w in the DCT frequency domain is obtained, and the size of w is also 16*16. The calculation method is: initialize the watermark embedding strength to α1. If the embedded watermark message is 1, the watermark signal is initialized to α1p1, and if the embedded watermark message is 0, the watermark signal is initialized to -α1p1. Next, the embedding strength is adaptively adjusted according to the correlation s between the original carrier x and the watermark template p1. s is defined as:

[0102] s=sum(p1.*x)

[0103] If the sign of the initialized watermark signal is opposite to s, the embedding strength will continue to be enhanced according to the value of s. The formula is described as follows:

[0104]

[0105] All w are combined into a new matrix W1, which has the same size as the image.

[0106] (1.3) Set the first position of each 8*8 in W1 to 0

[0107] (1.4) Perform inverse DCT transform on W1 to obtain the corresponding embedded watermark signal inW in the spatial domain

[0108] Step 2: Get the embedded watermark image: Y = X + inW

[0109] Step 3: Embed the correction template

[0110] (3.1) Calculate the correlation matrix mout1 of p2

[0111]

[0112] (3.2) In each p2intv*p2intv matrix, the first 16*16 block generates a correction signal, and its strength is adaptively adjusted according to the extreme value in the p2intv*p2intv block corresponding to the correlation matrix mout1. This makes the correlation of the correction template embedding position greater than the extreme value. The specific operation is: add α2 times the absolute value of the extreme value correlation on the basis of the original absolute value of the correlation at the correction template embedding position. Then, if the original correlation is negative, flip the sign of the embedded correction signal. The corresponding formula is described as follows.

[0113] β = max (the matrix with side length p2intv centered at [i,j] taken from mout1)

[0114]

[0115] All w are combined into a new matrix W2, which has the same size as the image.

[0116] (3.3) Embed the p2 template into the image: Y = X + W2

[0117] Embedding can refer to Figure 4 , the black squares are directly embedded in p2, and the DCT coefficients of other squares are embedded in p1.

[0118] Among them, although adjusting the intensity factor α can reduce the impact of the watermark on the image, it may still cause a decrease in image quality in some cases, especially in the case of high compression ratio. Therefore, the intensity factor α can be adjusted based on the trade-off between the requirements for watermark invisibility and robustness.

[0119] Each 8*8 block can only embed a small amount of watermark information, and the watermark capacity is limited, which is suitable for embedding small-scale information. If large-scale information needs to be embedded, the block size can be adjusted according to the actual situation.

[0120] For some image formats (such as PNG, BMP), they need to be converted to formats such as JPEG that support DCT first, and corresponding processing steps can be added.

[0121] The image digital watermark embedding method of the present invention embeds the digital watermark after performing DCT transformation on the image, thereby effectively hiding the watermark information to achieve information hiding, and realizes: (1) Concealment: less loss in image and document quality. (2) Robustness: It has a certain robustness against smearing, rotation, shearing, superimposed noise, and can better resist attacks such as smearing, rotation, shearing, superimposed noise, etc. The randomly generated template vector p1 improves the security of the watermark, and the watermark can only be effectively extracted when the template is known. The fixed matrix p2 provides an additional security layer, making it more difficult for the watermark to be removed by an attacker. The correction template is embedded to prevent the image 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.

[0122] Reference Figure 5 , 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:

[0123] Step 501, geometrically correcting the received corrected watermarked image to obtain a geometrically corrected watermarked image;

[0124] Step 502: extracting watermark data from the geometrically corrected watermarked image.

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

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

[0127] 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;

[0128] Calculating a perspective 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 perspective transformation on the received corrected watermarked image using an inverse transformation matrix of the perspective transformation matrix to obtain a watermarked image corrected by perspective transformation;

[0129] The black border in the watermarked image corrected by perspective 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.

[0130] In one embodiment of the present invention, extracting watermark data from a geometrically corrected watermarked image includes:

[0131] Performing inverse DCT transformation on the preset template vector to obtain a DCT transformed template vector;

[0132] The geometrically corrected watermarked image is divided into a plurality of pixel blocks of preset sizes, and watermark data is extracted from the pixel blocks not embedded in the preset template matrix according to the sign of the correlation between each pixel block and the DCT transformation template vector.

[0133] The following is a detailed description of the image digital watermark extraction method of the present invention:

[0134]

DCT watermark extraction algorithm

[0135] Input: watermarked image data Y, template vector p1, template matrix p2, original image size im*in

[0136] Output: watermark data

[0137] Function: The steps to extract a watermark from an image are as follows:

[0138] Step 1: Geometric correction

[0139] (1.1) Calculate the positions of these p2 when there is no geometric transformation

[0140] y={i*p2intv,j*p2intv},i,j=1,2,…

[0141] (1.2) Estimate the current position of each p2 and calculate the correlation matrix first:

[0142]

[0143] Then, with each position in the original y as the center, the side length is In the window H, find the current maximum value

[0144] y′={argmax i,j (H)}, where the center of H∈y

[0145] (1.3) Use y and y′ to estimate the perspective transformation matrix, and perform the inverse perspective transformation to obtain the corrected image Y r ;

[0146] (1.4) Clear Y r The black border in the

[0147] (1.5) Re-estimate Y r In the figure, the first p2 position is [i1, j1]. At this position, slightly translate Yr , resize:

[0148] Y r The height starts from i1 and ends at i1+im-1, and the width starts from j1 and ends at j1+in-1.

[0149] Step 2: Extract watermark

[0150] (2.1) Perform inverse DCT transformation on p1 to generate the transformed template

[0151] (2.2) Y r Divide into 16*16 blocks, skip the p2 embedded block, and extract a watermark bit from each block. The extraction method is: according to the block and the transformed template The sign of the correlation, if the sign is positive, the extracted watermark bit is 1, if the sign is negative, the extracted watermark bit is 0. The formula is described as:

[0152]

[0153] 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.

[0154] 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.

[0155] Reference Figure 6 , 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:

[0156] DCT transformation module 601, used to perform DCT transformation on the carrier image to obtain DCT coefficients;

[0157] The watermark embedding module 602 is used to adaptively adjust the watermark embedding strength according to the DCT coefficient and the preset template vector, and generate an embedded watermark signal in the DCT frequency domain according to the watermark data by using the preset template vector and the watermark embedding strength, and perform an inverse DCT transformation on the embedded watermark signal in the DCT frequency domain to obtain a corresponding embedded watermark signal in the spatial domain, and add the corresponding embedded watermark signal in the spatial domain to the carrier image to obtain a watermarked image;

[0158] The correction template embedding module 603 is used to generate a correction signal according to a preset template matrix, and add the correction signal to the watermarked image to obtain a corrected watermarked image.

[0159] Optionally, the watermark embedding module includes:

[0160] A DCT coefficient division submodule, used for sequentially extracting sub-DCT coefficients of a preset size from the DCT coefficients;

[0161] The embedding strength initialization submodule is used to initialize the watermark embedding strength and obtain the initial watermark embedding strength;

[0162] The watermark signal initialization submodule is used to generate an initial embedded watermark signal in the DCT frequency domain according to the watermark data, using the initial watermark embedding strength and the preset template vector;

[0163] The embedding strength adjustment submodule is used to calculate the correlation between each sub-DCT coefficient and the preset template vector, and adaptively adjust the initial watermark embedding strength according to the correlation to obtain the target watermark embedding strength of each sub-DCT coefficient;

[0164] The watermark signal adjustment submodule is used to generate a target embedded watermark signal in the DCT frequency domain of each sub-DCT coefficient according to the watermark data by using the target watermark embedding strength of each sub-DCT coefficient and a preset template vector;

[0165] A frequency domain watermark signal generating submodule, used for forming a target embedded watermark signal in the DCT frequency domain of a DCT coefficient by embedding the target watermark signal in the DCT frequency domain of all sub-DCT coefficients;

[0166] The spatial domain watermark signal generation submodule is used to perform inverse DCT transformation on the target embedded watermark signal in the DCT frequency domain of the DCT coefficient to obtain the corresponding embedded watermark signal in the spatial domain;

[0167] The watermarked image generation submodule is used to add the corresponding embedded watermark signal in the spatial domain to the carrier image to obtain the watermarked image.

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

[0169] A correlation matrix calculation submodule, used to calculate the correlation matrix of a preset template matrix;

[0170] A correction signal generating submodule, for generating a correction signal according to an extreme value of a corresponding block in the correlation matrix for the first subblock of a preset size in each matrix block with a preset template matrix size as a side length in the correlation matrix;

[0171] A correction signal matrix generation submodule, used for combining all generated correction signals into a correction signal matrix; the size of the correction signal matrix is ​​the same as the size of the watermarked image;

[0172] The deskew-corrected watermarked image generation submodule is used to add the deskew signal matrix to the watermarked image to obtain the deskew-corrected watermarked image.

[0173] Reference Figure 7 , 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:

[0174] A geometric correction module 701 is used to perform geometric correction on the received corrected watermarked image to obtain a geometrically corrected watermarked image;

[0175] The watermark extraction module 702 is used to extract watermark data from the geometrically corrected watermarked image.

[0176] Optionally, the geometric correction module includes:

[0177] 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;

[0178] 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;

[0179] a perspective transformation correction submodule, for calculating a perspective 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 perspective transformation on the received corrected watermarked image using an inverse transformation matrix of the perspective transformation matrix to obtain a watermarked image corrected by perspective transformation;

[0180] The micro-translation submodule is used to remove the black border in the watermarked image after perspective 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 a geometrically corrected watermarked image.

[0181] Optionally, the watermark extraction module includes:

[0182] An inverse DCT transformation submodule is used to perform an inverse DCT transformation on a preset template vector to obtain a DCT transformation template vector;

[0183] The watermark extraction submodule is used to divide the geometrically corrected watermarked image into a plurality of pixel blocks of preset size, and extract watermark data from the pixel blocks not embedded in the preset template matrix according to the sign of the correlation between each pixel block and the DCT transformation template vector.

[0184] 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.

[0185] 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.

[0186] 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.

[0187] 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 DCT transformation on the carrier image to obtain DCT coefficients; Adaptively adjust the watermark embedding strength according to the DCT coefficient and the preset template vector, and generate an embedded watermark signal in the DCT frequency domain according to the watermark data by using the preset template vector and the watermark embedding strength, and perform an inverse DCT transformation on the embedded watermark signal in the DCT frequency domain to obtain a corresponding embedded watermark signal in the spatial domain, and add the corresponding embedded watermark signal in the spatial domain to the carrier image to obtain a watermarked image; A correction signal is generated according to a preset template matrix, and the correction signal is added to the watermarked image to obtain a corrected watermarked image.

2. The method according to claim 1, characterized in that Adaptively adjust the watermark embedding strength according to the DCT coefficient and the preset template vector, and generate an embedded watermark signal in the DCT frequency domain according to the watermark data by using the preset template vector and the watermark embedding strength, and perform an inverse DCT transformation on the embedded watermark signal in the DCT frequency domain to obtain a corresponding embedded watermark signal in the spatial domain, and add the corresponding embedded watermark signal in the spatial domain to the carrier image to obtain a watermarked image, including: Sequentially extracting sub-DCT coefficients of a preset size from the DCT coefficients; Initialize the watermark embedding strength to obtain the initial watermark embedding strength; According to the watermark data, the initial watermark embedding strength and the preset template vector are used to generate the initial embedded watermark signal in the DCT frequency domain; Calculating the correlation between each sub-DCT coefficient and a preset template vector, and adaptively adjusting the initial watermark embedding strength according to the correlation to obtain a target watermark embedding strength for each sub-DCT coefficient; According to the watermark data, a target watermark embedding strength of each sub-DCT coefficient and a preset template vector are used to generate a target embedded watermark signal in the DCT frequency domain of each sub-DCT coefficient; The target embedded watermark signal in the DCT frequency domain of all sub-DCT coefficients is formed into the target embedded watermark signal in the DCT frequency domain of the DCT coefficient; Performing inverse DCT transformation on the target embedded watermark signal in the DCT frequency domain of the DCT coefficient to obtain the corresponding embedded watermark signal in the spatial domain; The corresponding embedded watermark signal in the spatial domain is added to the carrier image to obtain a watermarked image.

3. The method according to claim 1, characterized in that Generating a correction signal according to a preset template matrix, adding the correction signal to the watermarked image, and obtaining a corrected watermarked image, including: Calculate the correlation matrix of the preset template matrix; For the first sub-block of a preset size in each matrix block with a preset template matrix size as a side length in the correlation matrix, a correction signal is generated according to an extreme value of a corresponding block in the correlation matrix; Combining all generated correction signals into a correction signal matrix; the size of the correction signal matrix is ​​the same as the size of the watermarked image; The correction signal matrix is ​​added to the watermarked image to obtain a corrected watermarked image.

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 the geometrically corrected watermarked image; Performing geometric correction on the received deflected 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 perspective 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 perspective transformation on the received corrected watermarked image using an inverse transformation matrix of the perspective transformation matrix to obtain a watermarked image corrected by perspective transformation; The black border in the watermarked image corrected by perspective 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 a geometrically corrected watermarked image includes: Performing inverse DCT transformation on the preset template vector to obtain a DCT transformed template vector; The geometrically corrected watermarked image is divided into a plurality of pixel blocks of preset sizes, and watermark data is extracted from the pixel blocks not embedded in the preset template matrix according to the sign of the correlation between each pixel block and the DCT transformation template vector.

6. An image digital watermark embedding device, characterized in that: The device comprises: A DCT transformation module, used to perform DCT transformation on the carrier image to obtain DCT coefficients; A watermark embedding module is used to adaptively adjust the watermark embedding strength according to the DCT coefficient and the preset template vector, and generate an embedded watermark signal in the DCT frequency domain according to the watermark data by using the preset template vector and the watermark embedding strength, and perform an inverse DCT transformation on the embedded watermark signal in the DCT frequency domain to obtain a corresponding embedded watermark signal in the spatial domain, and add the corresponding embedded watermark signal in the spatial domain to the carrier image to obtain a watermarked image; The correction template embedding module is used to generate a correction signal according to a preset template matrix, and add the correction signal to the watermarked image to obtain a corrected watermarked image.

7. The device according to claim 6, characterized in that The watermark embedding module comprises: A DCT coefficient division submodule, used for sequentially extracting sub-DCT coefficients of a preset size from the DCT coefficients; The embedding strength initialization submodule is used to initialize the watermark embedding strength and obtain the initial watermark embedding strength; The watermark signal initialization submodule is used to generate an initial embedded watermark signal in the DCT frequency domain according to the watermark data, using the initial watermark embedding strength and the preset template vector; The embedding strength adjustment submodule is used to calculate the correlation between each sub-DCT coefficient and the preset template vector, and adaptively adjust the initial watermark embedding strength according to the correlation to obtain the target watermark embedding strength of each sub-DCT coefficient; The watermark signal adjustment submodule is used to generate a target embedded watermark signal in the DCT frequency domain of each sub-DCT coefficient according to the watermark data by using the target watermark embedding strength of each sub-DCT coefficient and a preset template vector; A frequency domain watermark signal generating submodule, used for forming a target embedded watermark signal in the DCT frequency domain of a DCT coefficient by embedding the target watermark signal in the DCT frequency domain of all sub-DCT coefficients; The spatial domain watermark signal generation submodule is used to perform inverse DCT transformation on the target embedded watermark signal in the DCT frequency domain of the DCT coefficient to obtain the corresponding embedded watermark signal in the spatial domain; The watermarked image generation submodule is used to add the corresponding embedded watermark signal in the spatial domain to the carrier image to obtain the watermarked image.

8. The device according to claim 6, characterized in that The correction template embedding module comprises: A correlation matrix calculation submodule, used to calculate the correlation matrix of a preset template matrix; A correction signal generating submodule, for generating a correction signal according to an extreme value of a corresponding block in the correlation matrix for the first subblock of a preset size in each matrix block with a preset template matrix size as a side length in the correlation matrix; A correction signal matrix generation submodule, used for combining all generated correction signals into a correction signal matrix; the size of the correction signal matrix is ​​the same as the size of the watermarked image; The deskew-corrected watermarked image generation submodule is used to add the deskew signal matrix to the watermarked image to obtain the deskew-corrected watermarked image.

9. An image digital watermark extraction device, characterized in that: The device comprises: A geometric correction module, used for geometrically correcting the received corrected watermarked image to obtain a geometrically corrected watermarked image; A watermark extraction module, used for extracting watermark data from the geometrically corrected watermarked 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 perspective transformation correction submodule, for calculating a perspective 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 perspective transformation on the received corrected watermarked image using an inverse transformation matrix of the perspective transformation matrix to obtain a watermarked image corrected by perspective transformation; The micro-translation submodule is used to remove the black border in the watermarked image after perspective 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 a geometrically corrected watermarked image.

Citation Information

Patent Citations

  • Embedding and detecting method and system for image data watermark information

    CN101005615A