Blind watermark adding method, blind watermark extracting method, blind watermark adding device, blind watermark extracting device and electronic equipment

By embedding watermark information in the frequency domain of the image and using singular value decomposition and frequency domain decomposition technology, the problem of anti-compression and extraction accuracy of blind watermarks in generated images by generating artificial intelligence is solved, achieving higher image security and Resistance to compression.

CN119107216APending Publication Date: 2024-12-10ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411041929.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The prior art is difficult to improve the anti-compression resistance and extraction accuracy of the blind watermark generated by generative artificial intelligence without affecting the original appearance of the image, especially to accurately detect and extract watermark information after image cropping and compression.

Method used

By obtaining the added string of watermark information to be added, and performing data transformation and singular value decomposition in the target frequency domain and other frequency domains of the image, embedding the watermark information, improving the image's anti-compression ability, and filling the pixels and Frequency domain decomposition extracts strings to compare targets to add strings to achieve the extraction of blind watermarks.

Benefits of technology

The anti-compression ability of blind watermark addition images is improved and the accuracy of blind watermark extraction of local images is improved, the security of images is enhanced, and the risk of false images being abused is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119107216A_ABST
    Figure CN119107216A_ABST
Patent Text Reader

Abstract

The invention discloses a blind watermark adding method, a blind watermark extracting method, a blind watermark adding device and electronic equipment. The adding method comprises the following steps: acquiring an adding character string corresponding to watermark information to be added, a first image of an image to be added in a target frequency domain and other frequency domain images outside the target frequency domain; determining at least one added block image according to the first image, and processing the added block image according to the added character string to obtain a second image; and according to the second image and other frequency domain images, determining an image after the blind watermark is added to the to-be-added image. According to the embodiment of the invention, the compression resistance of the blind watermark adding image and the blind watermark extraction accuracy can be improved, and the method can be widely applied to the technical field of watermark processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of watermark processing, and in particular to a blind watermark adding method, extraction method, device and electronic equipment. Background Art

[0002] Nowadays, artificial intelligence makes content creation easier and the generated images are often very realistic. Although AI (Artificial Intelligence) can be used for artistic expression or content production improvement, it can also lead to the proliferation of false images and be used for defamation, harassment and exploitation. Digital watermarking refers to embedding specific information into digital signals. The digital signals may be audio, pictures or videos. Digital watermarking is one of the important means to prevent piracy and abuse. Among them, blind watermarking is a watermarking method that is invisible to the naked eye. It can embed watermark information into digital signals without affecting the original appearance of the picture to protect the copyright of the resource.

[0003] Adding blind watermarks to generated images is one of the important means in the current AIGC (Artificial Intelligence Generated Content) field to reduce the proliferation of fake images and copyright infringement. Cropped images are easily compressed and stored in other formats, such as JPG format. Therefore, images with blind watermarks need to have good compression resistance. In addition, a large number of images with watermarks added will be cropped by users. Therefore, it is necessary to accurately detect and extract blind watermarks on the cropped local images without knowing the original image information. Summary of the invention

[0004] In view of this, in order to solve one of the above problems, the purpose of the embodiments of the present invention is to provide a blind watermark adding method, extraction method, device and electronic device to improve the compression resistance of the blind watermark added image and the accuracy of blind watermark extraction.

[0005] On the one hand, an embodiment of the present invention provides a blind watermark adding method, comprising the following steps:

[0006] Acquire an added character string corresponding to the watermark information to be added, a first image of the image to be added in a target frequency domain, and other frequency domain images outside the target frequency domain;

[0007] Determine at least one added block image according to the first image, and process the added block image according to the added character string to obtain a second image;

[0008] The image after the blind watermark is added to the image to be added is determined according to the second image and the other frequency domain images.

[0009] In an optional embodiment, the step of obtaining the added character string corresponding to the watermark information to be added includes:

[0010] Encoding the watermark information to be added to obtain an original character string;

[0011] The original character string is reset according to a preset random factor to obtain the added character string.

[0012] In an optional embodiment, the target frequency domain includes a low frequency domain, and acquiring a first image of the image to be added in the target frequency domain and other frequency domain images outside the target frequency domain includes:

[0013] In the case where the image to be added is an RGB image, performing color space conversion on the image to be added to obtain data of a Y channel;

[0014] The data of the Y channel is decomposed in the frequency domain to obtain a first image in the low frequency domain and other frequency domain images outside the low frequency domain.

[0015] In an optional embodiment, determining at least one added block image according to the first image, and processing the added block image according to the added character string to obtain the second image includes:

[0016] Determine at least one additional block image according to the first image, and perform data transformation and singular value decomposition on the additional block image to obtain a first singular value sequence;

[0017] A first coefficient matrix is ​​obtained according to the added character string and the first singular value sequence, and a second image corresponding to the first image is determined according to the first coefficient matrix.

[0018] In an optional embodiment, performing data transformation and singular value decomposition on the added block image to obtain a first singular value sequence includes:

[0019] Performing data transformation on the added block image to obtain a second coefficient matrix of the added block image;

[0020] Performing singular value decomposition on the second coefficient matrix to obtain a target singular value matrix;

[0021] The target singular value matrix is ​​sorted to obtain the first singular value sequence.

[0022] In an optional embodiment, obtaining a first coefficient matrix according to the added character string and the first singular value sequence includes:

[0023] Performing a first operation on the singular values ​​in the first singular value sequence to obtain a first sequence;

[0024] Performing a second operation on the characters in the added character string to obtain a second sequence;

[0025] Perform a third operation on the values ​​of the first sequence and the second sequence at associated positions to obtain a second singular value sequence;

[0026] Perform singular value merging on the second singular value sequence to obtain the first coefficient matrix.

[0027] In an optional embodiment, determining the second image corresponding to the first image according to the first coefficient matrix includes:

[0028] Performing data inverse transformation on the first coefficient matrix to obtain a third image corresponding to the added block image;

[0029] The third images are merged to obtain a second image corresponding to the first image.

[0030] In an optional embodiment, determining the image after adding a blind watermark to the image to be added according to the second image and the other frequency domain images includes:

[0031] Determine, according to the second image and the other frequency domain images, a fourth image after adding a blind watermark in a target channel; the target channel refers to a channel in a target color space where the first image is located;

[0032] Channels other than the target channel in the target color space are used as other channels, images of the image to be added in the other channels are obtained as other channel images, and the image after the blind watermark is added to the image to be added is determined according to the fourth image and the other channel images.

[0033] On the other hand, an embodiment of the present invention provides a blind watermark adding device, including:

[0034] The first module is used to obtain the added character string corresponding to the watermark information to be added, the first image of the image to be added in the target frequency domain, and other frequency domain images outside the target frequency domain;

[0035] A second module is used to determine at least one added block image according to the first image, and process the added block image according to the added character string to obtain a second image;

[0036] The third module is used to determine the image after the blind watermark is added to the image to be added according to the second image and the other frequency domain images.

[0037] In an optional embodiment, the first module is used to:

[0038] Encoding the watermark information to be added to obtain an original character string;

[0039] The original character string is reset according to a preset random factor to obtain the added character string.

[0040] In an optional embodiment, the first module is further used for:

[0041] In the case where the image to be added is an RGB image, performing color space conversion on the image to be added to obtain data of a Y channel;

[0042] The data of the Y channel is decomposed in the frequency domain to obtain a first image in the low frequency domain and other frequency domain images outside the low frequency domain.

[0043] In an optional embodiment, the second module is used to:

[0044] Determine at least one additional block image according to the first image, and perform data transformation and singular value decomposition on the additional block image to obtain a first singular value sequence;

[0045] A first coefficient matrix is ​​obtained according to the added character string and the first singular value sequence, and a second image corresponding to the first image is determined according to the first coefficient matrix.

[0046] In an optional embodiment, the second module is used to:

[0047] Performing data transformation on the added block image to obtain a second coefficient matrix of the added block image;

[0048] Performing singular value decomposition on the second coefficient matrix to obtain a target singular value matrix;

[0049] The target singular value matrix is ​​sorted to obtain the first singular value sequence.

[0050] In an optional embodiment, the second module is used to:

[0051] Performing a first operation on the singular values ​​in the first singular value sequence to obtain a first sequence;

[0052] Performing a second operation on the characters in the added character string to obtain a second sequence;

[0053] Perform a third operation on the values ​​of the first sequence and the second sequence at associated positions to obtain a second singular value sequence;

[0054] Perform singular value merging on the second singular value sequence to obtain the first coefficient matrix.

[0055] In an optional embodiment, the second module is further used for:

[0056] Performing data inverse transformation on the first coefficient matrix to obtain a third image corresponding to the added block image;

[0057] The third images are merged to obtain a second image corresponding to the first image.

[0058] In an optional embodiment, the third module is further used for:

[0059] Determine, according to the second image and the other frequency domain images, a fourth image after adding a blind watermark in a target channel; the target channel refers to a channel in a target color space where the first image is located;

[0060] Channels other than the target channel in the target color space are used as other channels, images of the image to be added in the other channels are obtained as other channel images, and the image after the blind watermark is added to the image to be added is determined according to the fourth image and the other channel images.

[0061] The implementation of the embodiments of the present invention includes the following beneficial effects: in the process of blind watermarking, first, the watermark information to be added is converted into an added character string, which can reduce the amount of calculation for adding the watermark information subsequently, obtain the first image of the image to be added in the target frequency domain and other frequency domain images except the target frequency domain, and improve the compression resistance of the image by adding the watermark information in the frequency domain of the image to be added, then, determine at least one added block image according to the first image, process the added block image according to the added character string to obtain the second image, add the watermark information to be added corresponding to the added character string to the image in the frequency domain, finally, determine the image after the blind watermark is added to the image to be added according to the second image and other frequency domain images, and restore the image after the watermark information is added in the frequency domain to the spatial domain; in the process of blind watermarking, process the image in the frequency domain, and add the watermark information to be added to the image to be added, thereby improving the compression resistance of the image to which the blind watermark is added, and then improving the accuracy of blind watermark extraction of local images.

[0062] On the other hand, an embodiment of the present invention provides a blind watermark extraction method, comprising the following steps:

[0063] Acquire at least one fifth image of the image to be extracted in the target frequency domain after the pixels are filled;

[0064] Determine an extracted block image according to the fifth image, and process the extracted block image to obtain an extracted character string;

[0065] The target blind watermark of the image to be extracted is obtained according to the extraction character string and the target addition character string.

[0066] In an optional embodiment, obtaining at least one fifth image of the image to be extracted in the target frequency domain after the pixels are filled includes: performing pixel filling processing on the image to be extracted, including:

[0067] In the image to be extracted, a first direction and a second direction perpendicular to each other are determined, a first number of pixels are filled in the first direction, and a second number of pixels are filled in the second direction; wherein the first number is updated by a first preset step size, and the second number is updated by a second preset step size.

[0068] In an optional embodiment, the step of processing the extracted block image to obtain the extracted character string includes:

[0069] Data transformation and singular value decomposition are performed on the extracted block image to obtain a third singular value sequence, and an extracted character string is obtained according to the third singular value sequence.

[0070] In an optional embodiment, determining the corresponding extraction character string according to the third singular value sequence includes:

[0071] performing a fourth operation on the singular values ​​in the third singular value sequence to obtain a third sequence;

[0072] Perform a fifth operation according to the third sequence to obtain a character string of the extracted block image;

[0073] The character strings extracted from the divided images are concatenated to obtain an extracted character string.

[0074] In an optional embodiment, obtaining the target blind watermark of the image to be extracted according to the extraction string and the target added string includes:

[0075] When there is only one extracted character string, similarity calculation is performed between the extracted character string and the target added character string to obtain a first similarity result;

[0076] The target blind watermark of the image to be extracted is obtained according to the difference between the first similarity result and a preset threshold.

[0077] In an optional embodiment, obtaining the target blind watermark of the image to be extracted according to the extraction string and the target added string includes:

[0078] When there are at least two extracted character strings, similarity calculation is performed between each of the extracted character strings and the target added character string to obtain at least two second similarity results;

[0079] Calculating an average similarity result according to at least two of the second similarity results;

[0080] The target blind watermark of the image to be extracted is obtained according to the difference between the average similarity result and a preset threshold.

[0081] On the other hand, an embodiment of the present invention provides a blind watermark extraction device, including:

[0082] A fourth module is used to obtain at least one fifth image of the image to be extracted in the target frequency domain;

[0083] A fifth module is used to determine an extracted block image according to the fifth image, and process the extracted block image to obtain an extracted character string;

[0084] The sixth module is used to obtain the target blind watermark of the image to be extracted according to the extraction character string and the target added character string.

[0085] In an optional embodiment, the fourth module is used to:

[0086] In the image to be extracted, a first direction and a second direction perpendicular to each other are determined, a first number of pixels are filled in the first direction, and a second number of pixels are filled in the second direction; wherein the first number is updated by a first preset step size, and the second number is updated by a second preset step size.

[0087] In an optional embodiment, the fifth module is used to:

[0088] Data transformation and singular value decomposition are performed on the extracted block image to obtain a third singular value sequence, and an extracted character string is obtained according to the third singular value sequence.

[0089] In an optional embodiment, the fifth module is used to:

[0090] performing a fourth operation on the singular values ​​in the third singular value sequence to obtain a third sequence;

[0091] Perform a fifth operation according to the third sequence to obtain a character string of the extracted block image;

[0092] The character string of at least one of the extracted block images is concatenated to obtain an extracted character string.

[0093] In an optional embodiment, the sixth module is used to:

[0094] When there is only one extracted character string, similarity calculation is performed between the extracted character string and the target added character string to obtain a first similarity result;

[0095] The target blind watermark of the image to be extracted is obtained according to the difference between the first similarity result and a preset threshold.

[0096] In an optional embodiment, the sixth module is further used for:

[0097] When there are at least two extracted character strings, similarity calculation is performed between each of the extracted character strings and the target added character string to obtain at least two second similarity results;

[0098] Calculating an average similarity result according to at least two of the second similarity results;

[0099] The target blind watermark of the image to be extracted is obtained according to the difference between the average similarity result and a preset threshold.

[0100] Implementation of the embodiments of the present invention includes the following beneficial effects: in the blind watermark extraction process, first, at least one fifth image of the image to be extracted after filling pixels in the target frequency domain is obtained, and by filling pixels in the spatial domain of the image to be extracted and then converting it to the frequency domain, the blind watermark is reduced in the extraction process. The blind watermark is then determined to be extracted based on each fifth image, and each extracted block image is processed to determine the corresponding extraction string, thereby obtaining the blind watermark information corresponding to the extraction string, and finally, the extraction string is compared with the target added string to obtain the target blind watermark contained in the image to be extracted, so as to realize blind watermark extraction of the cropped blind watermark added image, thereby improving the accuracy of blind watermark extraction, improving the security of image use, and reducing the abuse of false images.

[0101] In another aspect, an embodiment of the present invention provides an electronic device, including:

[0102] at least one processor;

[0103] at least one memory for storing at least one program;

[0104] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned blind watermark adding method or the above-mentioned blind watermark extracting method.

[0105] The electronic device can achieve the effect of the above-mentioned blind watermark adding method or blind watermark extracting method. BRIEF DESCRIPTION OF THE DRAWINGS

[0106] Figure 1 It is a schematic diagram of the steps of a blind watermark adding method provided by an embodiment of the present invention;

[0107] Figure 2 It is a before and after comparison diagram of frequency domain decomposition of an image provided by an embodiment of the present invention;

[0108] Figure 3It is a before and after comparison diagram of coefficient decomposition of an image provided by an embodiment of the present invention;

[0109] Figure 4 It is a before and after comparison diagram of performing matrix decomposition on an image provided by an embodiment of the present invention;

[0110] Figure 5 It is a before and after comparison diagram of matrix merging of images provided by an embodiment of the present invention;

[0111] Figure 6 It is a schematic diagram of the steps of another method for adding a blind watermark provided by an embodiment of the present invention;

[0112] Figure 7 It is a schematic diagram of the steps of a blind watermark extraction method provided by an embodiment of the present invention;

[0113] Figure 8 is a schematic diagram of image pixel filling provided by an embodiment of the present invention;

[0114] Fig. 9 It is a schematic diagram of the steps of another blind watermark extraction method provided by an embodiment of the present invention;

[0115] Fig.10 It is a structural block diagram of a blind watermark adding device provided by an embodiment of the present invention;

[0116] Fig.11 It is a structural block diagram of a blind watermark extraction device provided by an embodiment of the present invention;

[0117] Fig.12 This is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0118] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only provided for the convenience of explanation and description, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.

[0119] The meanings of some terms used in this embodiment are as follows:

[0120] Discrete Wavelet Transformation (DWT) discretizes the scale and translation of the basic wavelet. In image processing, binary wavelets are often used as wavelet transform functions, that is, they are divided using integer powers of 2. Discrete wavelet transform transforms the signal from the time domain to the frequency domain, decomposing the signal into low-frequency and high-frequency parts. The low-frequency part contains the trend information in the signal, and the high-frequency part contains the detail information in the signal. By continuously decomposing, low-frequency and high-frequency parts at different scales can be obtained, thereby realizing multi-scale representation of the signal.

[0121] Discrete Cosine Transform (DCT) is a transform related to Fourier Transform. It is similar to Discrete Fourier Transform (DFT), but only uses real numbers. DCT has better frequency domain energy concentration than DFT, and can directly cut off unimportant frequency domain regions and coefficients.

[0122] Singular Value Decomposition (SVD) is a method that decomposes a matrix into three special matrices. It can simplify data, remove noise and redundant data, and extract key information. It is suitable for decomposing any matrix.

[0123] Inverse Discrete Wavelet Transformation (IDWT) is the inverse transform of discrete wavelet transform, which reconstructs the new sequence into the original signal.

[0124] Inverse Discrete Cosine Transform (IDCT) is the inverse transform of discrete cosine transform, which can convert the image from time domain to frequency domain to obtain a series of frequency components.

[0125] like Figure 1 As shown, an embodiment of the present invention provides a blind watermark adding method, including steps S100 to S400.

[0126] S100: Acquire an added character string corresponding to the watermark information to be added, a first image of the image to be added in a target frequency domain, and other frequency domain images outside the target frequency domain.

[0127] The watermark information to be added refers to the information that needs to be added to the image to be added; the watermark information to be added includes but is not limited to language information, digital information or letter information, etc. The added character string corresponding to the watermark information to be added refers to the character string obtained by converting the watermark information to be added according to a certain method or rule. For example, the Chinese characters as the watermark information to be added are converted into a bit string as the added character string through binary encoding. The image to be added refers to the original image to be watermarked. The target frequency domain refers to the image frequency domain that is subsequently operated with the added character string. The number of other frequency domains except the target frequency domain is determined according to the actual application, and this embodiment does not make specific restrictions. The first image refers to the image corresponding to the target frequency domain of the image to be added. Other frequency domain images refer to the images corresponding to the image to be added in other frequency domains outside the target frequency domain. It should be noted that the image to be added can be an image in a different color space. If the image to be added is not an image in the target color space, the image to be added needs to be converted to the target color space. The target color space refers to the color space for frequency domain decomposition of the image to be added.

[0128] In a specific embodiment, a character string associated with the information to be added to the image to be added is obtained by converting the information to be added to the image to be added in a certain manner or rule; an image corresponding to the target frequency domain is obtained after the image to be added is decomposed in the target color space in the frequency domain; and images corresponding to other frequency domains outside the target frequency domain are obtained after the image to be added is decomposed in the target color space in the frequency domain.

[0129] S200: Determine at least one added block image according to the first image, and process the added block image according to the added character string to obtain a second image.

[0130] The added segmented image refers to an image obtained by segmenting the first image in a certain way. The number and size of the added segmented images are determined according to actual applications and are not specifically limited in this embodiment. The second image refers to an image obtained by merging the first image with the added character string.

[0131] In a specific embodiment, the first image is evenly divided into blocks to obtain a plurality of added block images, each added block image is processed according to an added character string to obtain an image after each added block image is fused with the added character string, and then at least one added block image is fused with the image after the added character string to obtain a second image.

[0132] S300, determining an image after a blind watermark is added to the image to be added according to the second image and other frequency domain images.

[0133] The image after the blind watermark is added to the image to be added is the image in the target color space after the blind watermark is added to the image to be added. If there is an actual need, the image after the blind watermark is added to the image to be added can be converted from the target color space to other color spaces. The target color space refers to the color space for frequency domain decomposition of the image to be added. For example, if the target color space is a YUV space, the image after the blind watermark is added to the image to be added can be converted from the YUV space to the RGB space.

[0134] In a specific embodiment, the second image with the added character string fused in the target frequency domain is merged with its frequency domain image in the frequency domain, and the images of different channels are merged in the channels to obtain the image to be added in the target color space after the blind watermark is added. If required by the actual application, the image to be added after the blind watermark is added can be further converted from the target color space to other color spaces.

[0135] The implementation of the embodiments of the present invention includes the following beneficial effects: in the process of blind watermarking, first, the watermark information to be added is converted into an added character string, which can reduce the amount of calculation for adding the watermark information subsequently, obtain the first image of the image to be added in the target frequency domain and other frequency domain images except the target frequency domain, and improve the compression resistance of the image by adding the watermark information in the frequency domain of the image to be added, then, determine at least one added block image according to the first image, process the added block image according to the added character string to obtain the second image, add the watermark information to be added corresponding to the added character string to the image in the frequency domain, finally, determine the image after the blind watermark is added to the image to be added according to the second image and other frequency domain images, and restore the image after the watermark information is added in the frequency domain to the spatial domain; in the process of blind watermarking, process the image in the frequency domain, and add the watermark information to be added to the image to be added, thereby improving the compression resistance of the image to which the blind watermark is added, and then improving the accuracy of blind watermark extraction of local images.

[0136] In an optional embodiment, obtaining the added character string corresponding to the watermark information to be added includes:

[0137] S111, encoding the watermark information to be added to obtain an original character string;

[0138] S112. Reset the original character string according to a preset random factor to obtain an added character string.

[0139] It should be noted that the encoding method is determined according to the actual application, and this embodiment does not make any specific restrictions, such as binary encoding or decimal encoding. The original string refers to the string directly obtained after the watermark information to be added is encoded. The preset random factor refers to a constant, and the value of the preset random factor is determined according to the actual application, and this embodiment does not make any specific restrictions. The reset method includes sequential reset, such as cyclic left movement or cyclic right movement.

[0140] In a specific embodiment, the watermark information to be added is binary-encoded to obtain a string of 01 original characters Q with a length of n, the preset random factor a is set to 4, the string of original characters Q is cyclically shifted to the right by a bit positions, the original string Q = "1010111010100000101001100", and the added string P after sequential resetting = "1100101011101010000010100".

[0141] Resetting the encoded original string to obtain the added string can improve the security of the blind watermark adding process.

[0142] In an optional embodiment, the target frequency domain includes a low frequency domain, and obtaining a first image of the image to be added in the target frequency domain and other frequency domain images outside the target frequency domain includes:

[0143] S121, when the image to be added is an RGB image, performing color space conversion on the image to be added to obtain data of a Y channel;

[0144] S122 . Decompose the data of the Y channel in the frequency domain to obtain a first image in the low frequency domain and other frequency domain images outside the low frequency domain.

[0145] The target frequency domain refers to the image frequency domain that will be subsequently used for string addition operations, and the low frequency domain refers to the slowly changing area in the image. Color space conversion refers to the operation of converting an image from one color space to another. Color space is also called a color model, and its purpose is to describe colors in a generally acceptable manner under certain standards. It should be noted that if the image to be added is an image in the YUV color space, there is no need to perform color space conversion. The YUV color space includes three channels: Y, U, and V. Before color space conversion, check whether the length and width of the image to be added are multiples of 2. If not, add a pixel so that the length and width of the image to be added are both multiples of 2. Frequency domain decomposition refers to decomposing an image into images of different frequencies. Frequency domain decomposition methods include but are not limited to discrete wavelet transforms (DWT).

[0146] In a specific embodiment, the low frequency domain is used as the target frequency domain, and the RGB image to be added with a length of w and a width of h is converted into a color space and converted into an image in a YUV space to obtain data of three channels of Y, U, and V; see Figure 2, the Y channel is decomposed in the frequency domain using discrete wavelet transform (DWT) to obtain a corresponding image representing the low frequency domain. The image consists of 4 transform domain regions of size (w / 2)*(h / 2), wherein the upper left corner of the image corresponds to the low frequency domain information of the image, the upper right corner corresponds to the vertical high frequency domain information of the image, the lower left corner corresponds to the horizontal high frequency domain information of the image, and the lower right corner corresponds to the diagonal high frequency domain information of the image, that is, the image corresponding to the upper left corner is the first image, and the images corresponding to the upper right corner, the lower left corner and the lower right corner are other frequency domain images outside the low frequency domain.

[0147] The image in the low-frequency domain changes slowly. Taking the low-frequency domain as the target frequency domain and adding the additional string corresponding to the watermark information to be added to the first image in the low-frequency domain can reduce the impact of the watermark information to be added on the image after the blind watermark is added.

[0148] In an optional embodiment, determining at least one added block image according to the first image, and processing the added block image according to the added character string to obtain the second image includes:

[0149] S210: Determine at least one added block image according to the first image, perform data transformation and singular value decomposition on the added block image, and obtain a first singular value sequence.

[0150] Adding a block image refers to an image obtained by dividing the first image into blocks in a certain way. The number and size of the added block images are determined according to the actual application, and this embodiment does not impose any specific restrictions. Data transformation refers to the operation of converting an image into a matrix, and singular value decomposition refers to the operation of decomposing a matrix to obtain a singular value sequence. The first singular value sequence refers to the singular value sequence corresponding to the added block image.

[0151] In a specific embodiment, the first image is uniformly divided into blocks to obtain a plurality of added block images, and each of the added block images is subjected to data transformation and singular value decomposition to obtain a first singular value sequence of each added block image. If there are a plurality of added block images, they correspond to a plurality of first singular value sequences respectively.

[0152] S220. Obtain a first coefficient matrix according to the added character string and the first singular value sequence, and determine a second image corresponding to the first image according to the first coefficient matrix.

[0153] The first coefficient matrix refers to the coefficient matrix corresponding to the added block image after the added character string is fused, and the second image refers to the image after the first image is fused with the added character string.

[0154] In a specific embodiment, the added character string and the first singular value sequence of multiple added block images are fused and the singular values ​​are merged to obtain the first coefficient matrices of multiple added block images, and the first coefficient matrices of multiple added block images are inversely transformed and merged to obtain the second image.

[0155] The first singular value sequence is obtained by performing data transformation and singular value decomposition on the added block image, and then the first coefficient matrix is ​​obtained according to the added character string and the first singular value sequence. The second image corresponding to the first image is determined according to the first coefficient matrix, and the image is converted into a numerical value. The numerical value and the added character string are used for calculation, and the calculation result is converted to the image, that is, the image is converted into a numerical value for calculation, thereby reducing the amount of calculation and saving computing resources.

[0156] In an optional embodiment, data transformation and singular value decomposition are performed on the added block image to obtain a first singular value sequence, including:

[0157] S211, performing data transformation on the added block image to obtain a second coefficient matrix of the added block image;

[0158] S212, performing singular value decomposition on the second coefficient matrix to obtain a target singular value matrix;

[0159] S213. Sort the target singular value matrix to obtain a first singular value sequence.

[0160] The data transformation includes but is not limited to discrete cosine transformation. The second coefficient matrix refers to the coefficient matrix obtained after adding the separated images for data transformation, and the target singular value matrix refers to the matrix including the main features of the added block images. Sorting includes but is not limited to sorting from large to small or from small to large.

[0161] In a specific embodiment, the upper left corner area of ​​the added block image with a size of (w / 2)*(h / 2) is evenly divided into blocks, and the size of each small block is set to m*m, and finally (w / 2 / m)*(h / 2 / m) small blocks can be obtained; see Figure 3 , take a small block T in order to perform DCT transformation, and obtain the second coefficient matrix G2 of m*m; refer to Figure 4 , perform SVD decomposition on the second coefficient matrix G2 to obtain three matrices U, Z, and V, among which the target singular value matrix Z of size m*1 stores the singular values. The target singular value matrix Z is arranged from large to small to obtain the first singular value sequence.

[0162] The added block image is transformed from the time domain to the frequency domain, and then the main features of the added block image are obtained through singular value decomposition, and the main features are sorted, thereby simplifying the data processing process and improving efficiency.

[0163] In an optional embodiment, the added character string is merged with the value of the first singular value sequence at the corresponding position to obtain a second singular value sequence, including:

[0164] S2211, performing a first operation on the singular values ​​in the first singular value sequence to obtain a first sequence;

[0165] S2212, performing a second operation on the characters in the added character string to obtain a second sequence;

[0166] S2213. Perform a third operation based on the values ​​of the first sequence and the second sequence at associated positions to obtain a second singular value sequence.

[0167] It should be noted that the operation modes of the first operation, the second operation and the third operation are determined according to the actual application, and this embodiment does not impose specific restrictions; for example, the operation mode of the second operation is determined according to the encoding mode of the added string, such as a division operation or a multiplication operation, and the operation mode of the first operation is determined according to the encoding mode of the added string and the numerical value of each singular value in the first singular value sequence, such as an integer division operation, and the operation mode of the third operation is determined according to the operation modes of the first operation and the second operation, such as a summation operation or a multiplication operation. In addition, the number of calculations of the first operation, the second operation and the third operation is determined according to the actual application, and this embodiment does not impose specific restrictions, such as one operation or multiple different operations. The first sequence refers to the sequence obtained by performing the first operation on the first singular value sequence, the second sequence refers to the sequence obtained by performing the second operation on the added string, and the second singular value sequence refers to the sequence obtained by performing the third operation on the first sequence and the second sequence. The associated position refers to the corresponding position determined by the first sequence and the second sequence according to a certain rule, such as taking the i-th position in the first sequence and the i-th position in the second sequence as the associated position. The associated position is determined according to the actual application, and this embodiment does not impose specific restrictions.

[0168] In a specific embodiment, first, each singular value in the first singular value sequence is divided by an integer operation to obtain a first sequence; then, each character in the added string is multiplied to obtain a second sequence; then, summation and multiplication operations are performed based on the values ​​of the first sequence and the second sequence at associated positions to obtain a second singular value sequence.

[0169] In an optional embodiment, the first operation includes an integer division operation, the second operation includes a division operation, and the expression of the second singular value sequence is:

[0170] z 2i =(z 1i / / d+1 / 4+f 1i / 2)*d (1)

[0171] Among them, z2i represents the i-th singular value in the second singular value sequence, / / represents integer division, / represents division, * represents multiplication, z 1i represents the i-th singular value in the first singular value sequence, d represents a constant, and f 1i Indicates adding the i-th character in the string.

[0172] The specific value of d is determined according to actual application and is not specifically limited in this embodiment, for example, d=24.

[0173] In a specific embodiment, the i-th character f in the added string P is sequentially taken. 1i and the i-th singular value z in the first singular value sequence Z1 1i According to the above formula (1), the fusion is performed to obtain the i-th singular value z in the second singular value sequence Z2 2i , z 2i Replace z in the first singular value sequence Z1 1i , that is, the second singular value sequence Z2 after embedding the watermark information is obtained.

[0174] A first operation is performed on the first singular value sequence to obtain a first sequence; a second operation is performed on the added character string to obtain a second sequence; and a third operation is performed on the first sequence and the second sequence to obtain a second singular value sequence; the operation process is simple, the computing resources are reduced, and the computing efficiency is improved.

[0175] In an optional embodiment, calculating the corresponding first coefficient matrix according to the added character string and the first singular value sequence includes:

[0176] S221, merging the added character string with the value of the first singular value sequence at the associated position to obtain a second singular value sequence;

[0177] S222. Perform singular value merging on the second singular value sequence to obtain a first coefficient matrix.

[0178] The second singular value sequence refers to the singular value sequence corresponding to the added block image after the fusion of the added character string. The fusion method is determined according to the actual application, and this embodiment does not make specific restrictions. The fusion method includes but is not limited to performing numerical calculations. Singular value merging refers to the inverse operation of singular value decomposition.

[0179] In a specific embodiment, see Figure 5 , merge the added string with the value of the first singular value sequence Z1 at the associated position in the above manner to obtain the second singular value sequence Z2, perform matrix multiplication of the second singular value sequence Z2 and the previous U and V, with U on the left, V on the right, and Z2 in the middle, and multiply the three matrices together to finally obtain the first coefficient matrix G1.

[0180] The added character string is merged with the value of the first singular value sequence at the associated position to obtain a second singular value sequence, thereby adding the added character string to the main feature of the added block image; the second singular value sequence is combined with singular values ​​to obtain the first coefficient matrix, thereby obtaining the information of the added block image in the frequency domain after the character string is added. The operation process is simple, reduces computing resources, and improves computing efficiency.

[0181] In an optional embodiment, determining the second image corresponding to the first image according to the first coefficient matrix includes:

[0182] S223, performing data inverse transformation on the first coefficient matrix to obtain a third image corresponding to the added block image;

[0183] S224: Merge the third image to obtain a second image corresponding to the first image.

[0184] The third image refers to the image after each added block image is fused with the added string. Inverse data transformation refers to the operation of converting a matrix into an image, and inverse data transformation includes but is not limited to inverse discrete cosine transformation. Merging refers to the operation of integrating multiple images into one image in a predetermined order.

[0185] In a specific embodiment, the first coefficient matrix G1 is subjected to an inverse discrete cosine transform (IDCT) to obtain a third image block T' of size m*m, and the third image T' is an image block after the watermark information is added to the added block image T. The added character string is added one by one to each added block image, and all the small blocks with the added character string are merged to obtain a second image of size (w / 2)*(h / 2). The number of complete watermarks that can be stored in the end is x=[w / (2*m)]*[h / (2*m)] / n.

[0186] Performing an inverse data transformation on the first coefficient matrix, obtaining a third image corresponding to the added block image, thereby obtaining a time-frequency image of the added block image after the character string is added; merging the third image to obtain a second image corresponding to the first image, thereby obtaining an image of the target frequency domain after the character string is added.

[0187] In an optional embodiment, determining the image after adding the blind watermark to the image to be added according to the second image and other frequency domain images includes:

[0188] S311, determining a fourth image after adding a blind watermark in a target channel according to the second image and other frequency domain images; the target channel refers to the channel where the first image is located in the target color space;

[0189] S312, using channels other than the target channel in the target color space as other channels, obtaining images of the image to be added in other channels as other channel images, and determining the image after the blind watermark is added to the image to be added according to the fourth image and the other channel images.

[0190] The target channel refers to the channel where the first image in the target color space is located, such as the Y channel of the YUV space; the color space where the first image of the target color space is located; if the target color space is the YUV space, the target channel is the Y channel, and other channels refer to the U channel and the V channel.

[0191] First, frequency domain merging is performed based on the second image and other frequency domain images to obtain a fourth image after blind watermarking is added to the target channel; then, channel merging is performed based on the fourth image and other channel images to obtain an image after blind watermarking is added to the image to be added. Frequency domain merging is determined according to actual applications and is not specifically limited in this embodiment. Frequency domain merging includes but is not limited to discrete wavelet transform.

[0192] In a specific embodiment, the low-frequency second image and the vertical high-frequency image, the horizontal high-frequency image and the diagonal high-frequency image are transformed by discrete wavelet transform (IDWT) to obtain a new image of size w*h, which corresponds to the Y channel image after the watermark information is added. The Y channel image after the watermark information is added is merged with the U and V channel images to obtain an image with a blind watermark added in the YUV space. If necessary, the image with a blind watermark added in the YUV space can be further converted to a color space to obtain an RGB image containing the blind watermark information.

[0193] The fourth image after adding the blind watermark to the target channel is determined by the second image after adding the string to the target frequency domain and other frequency domain images, thereby obtaining the image after adding the blind watermark to the target channel; the image after adding the blind watermark to the image to be added is determined according to the fourth image and other channel images, thereby obtaining the image after adding the blind watermark to the target color space.

[0194] See also Figure 6 The following is a specific example to illustrate the process of adding a blind watermark. Wherein, M represents the watermark information to be added, A represents the image to be added, and B represents the image after the watermark is added to the image to be added. The process of adding a blind watermark includes the following steps S1-S13.

[0195] S1: Binary encode the watermark information to be added to obtain a 01-bit string Q with a length of n;

[0196] S2: Sequentially reset the bit string Q according to a preset random factor to obtain a reset bit string P;

[0197] S3: The image A to be added is an RGB image with a length of w and a width of h respectively. The image A to be added is converted into a YUV space to obtain an image with three channels of Y, U, and V.

[0198] S4: Decompose the Y channel in the frequency domain using discrete wavelet transform to obtain a corresponding image representing the frequency domain. The image consists of four transform domain regions of size (w / 2)*(h / 2), where the upper left corner, upper right corner, lower left corner, and lower right corner of the image contain the low-frequency information, vertical high-frequency information, horizontal high-frequency information, and diagonal high-frequency information of the image, respectively.

[0199] S5: evenly divide the upper left corner area of ​​the image with a size of (w / 2)*(h / 2), and set the size of each small block to m*m, so that (w / 2 / m)*(h / 2 / m) small blocks can be obtained in the end;

[0200] S6: Take a small block T in order to perform DCT transformation, and obtain a DCT coefficient matrix G with a size of m*m;

[0201] S7: Perform SVD decomposition on the DCT coefficient matrix G to obtain three matrices U, Z, and V, where Z of size m*1 stores singular values;

[0202] S8: sequentially take a character f in the bit string P obtained in step S2 and merge it with the first value z1 in Z to obtain a new value z1';

[0203] S9: Z' is matrix multiplied with the previous U and V, with U on the left, V on the right, and Z' in the middle. The three matrices are multiplied together to finally obtain a new coefficient matrix G';

[0204] S10: Perform inverse discrete cosine transform on G' to obtain a new image block T' of size m*m, which is the block T in S6 with watermark information added;

[0205] S11: Repeat steps S6, S7, S8, S9, and S10 to add watermark information to the corresponding small blocks one by one. Finally, merge all the small blocks with watermark information to obtain an image of size (w / 2)*(h / 2), and use this image to replace the upper left corner area obtained in step S4. Therefore, the number of complete watermarks that can be stored in the end is x=[w / (2*m)]*[h / (2*m)] / n;

[0206] S12: Perform inverse discrete wavelet transform on the upper left corner area after adding the watermark information and the three areas of the upper right corner, lower left corner and lower right corner obtained in step S4 to obtain a new image of size w*h, which corresponds to the Y channel image after adding the watermark information;

[0207] S13: Perform color space conversion on the Y channel image after adding the watermark information and the U and V channels obtained in step S3 to obtain the final RGB image containing the blind watermark information.

[0208] The implementation of the embodiment of the present invention includes the following beneficial effects: in the process of blind watermarking, first, the watermark information to be added is converted into an added character string, which can reduce the amount of calculation for adding the watermark information subsequently, obtain the first image of the image to be added in the target frequency domain and other frequency domain images except the target frequency domain, and improve the compression resistance of the image by adding the watermark information in the frequency domain of the image to be added, then, determine at least one added block image according to the first image, perform data transformation and singular value decomposition on each added block image, and obtain the corresponding first singular value sequence, and further improve the compression resistance of the image by data transformation and singular value decomposition, and then, The first coefficient matrix corresponding to the added character string and the first singular value sequence is calculated, the second image corresponding to the first image is determined according to the first coefficient matrix, the watermark information to be added corresponding to the added character string is added to the image in the frequency domain, and finally, the image after the blind watermark is added to the image to be added is determined according to the second image and other frequency domain images, and the image after the watermark information is added in the frequency domain is restored to the spatial domain; in the process of adding blind watermark, the image in the frequency domain is subjected to data transformation and singular value decomposition, and then the watermark information to be added is added to the image to be added, thereby improving the compression resistance of the image to which the blind watermark is added, and further improving the accuracy of blind watermark extraction of local images.

[0209] like Figure 7 As shown, an embodiment of the present invention provides a blind watermark extraction method, including:

[0210] S400: Acquire at least one fifth image of the image to be extracted in the target frequency domain after filling pixels.

[0211] The fifth image represents the image after the image to be extracted is filled with pixels and converted to the target frequency domain. It should be noted that the specific method of filling pixels is determined according to the actual application, and this embodiment does not make any specific restrictions; for example, the same or different numbers of pixels are filled in different directions of the image to be extracted.

[0212] First, the image to be extracted is pixel-filled in a preset manner, and then the image of the image to be extracted in the target channel after the pixels are filled is extracted, and then the image of the target channel is decomposed in the frequency domain to obtain the fifth image. It can be understood by those skilled in the art that if the image to be extracted after the pixels are filled does not belong to the target color space where the target channel is located, the image to be extracted after the pixels are filled needs to be converted to the target color space. For example, the target channel is the Y channel of the YUV color space, and the image to be extracted belongs to the image of the RGB color space. After the pixels are filled, the image to be extracted after the pixels are filled is transferred to the YUV color space, and then the image of the Y channel is decomposed in the frequency domain. The number of the fifth image is determined according to the number of times the image to be extracted is filled with pixels.

[0213] S500: Determine an extracted block image according to the fifth image, and process the extracted block image to obtain an extracted character string.

[0214] The extracted block image refers to the block image of the blind watermark to be extracted. The extracted character string refers to the character string of the fifth image in the target frequency domain, and the extracted character string contains the information of the blind watermark in the image to be extracted.

[0215] Each fifth image is evenly divided to obtain a plurality of extracted block images; each extracted block image is processed to obtain a character string of each extracted block image, and then an extracted character string of the fifth image is obtained according to the character strings of the plurality of extracted block images.

[0216] S600: Obtain a target blind watermark of the image to be extracted according to the extraction character string and the target added character string.

[0217] The target added string refers to the string corresponding to the watermark information to be added during the blind watermarking process, and the target blind watermark refers to the blind watermark added to the image to be added. The number of extracted strings is determined according to the actual application. The more the number of extracted strings, the less the impact of accidental uncertain factors on the blind watermark extraction results, which is conducive to improving the accuracy of the blind watermark extraction results.

[0218] Compare at least one extracted string with the target added string to obtain at least one comparison result, and obtain the target blind watermark of the image to be extracted according to the at least one comparison result. The method of comparing the extracted string with the target added string is determined according to the actual application, such as similarity comparison or complete equality comparison.

[0219] Implementation of the embodiments of the present invention includes the following beneficial effects: in the blind watermark extraction process, first, at least one fifth image of the image to be extracted in the target frequency domain is obtained, and by filling pixels in the spatial domain of the image to be extracted and then converting it to the frequency domain, the blind watermark is reduced in the extraction process. The extraction block image is then determined based on each fifth image, and each extracted block image is subjected to data transformation and singular value decomposition to obtain a corresponding third singular value sequence, and a corresponding extraction string is determined based on the third singular value sequence, thereby obtaining blind watermark information corresponding to the extraction string. Finally, at least one extraction string is compared with a target added string to obtain a result of whether the image to be extracted contains a target blind watermark, so as to realize blind watermark extraction of the cropped blind watermark added image, improve the accuracy of blind watermark extraction, improve the security of image use, and reduce the abuse of false images.

[0220] In an optional embodiment, performing pixel filling processing on the image to be extracted includes:

[0221] S401. Determine a first direction and a second direction perpendicular to each other in the image to be extracted, fill a first number of pixels in the first direction, and fill a second number of pixels in the second direction; wherein the first number is updated by a first preset step size, and the second number is updated by a second preset step size.

[0222] It should be noted that the first number and the second number are determined according to actual applications, and the upper limit of the first number or the second number is the number of pixels contained in the image to be extracted in the respective directions. The values ​​of the first preset step size and the second preset step size are determined according to actual applications, such as the first preset step size and the second preset step size are both set to 1 or -1.

[0223] An origin is determined at the edge position of the image to be extracted, and a two-dimensional coordinate system is established. The first direction and the second direction can be understood as two directions perpendicular to each other in the two-dimensional coordinate system. First, a first number of pixels are filled in the first direction, and a second number of pixels are filled in the second direction to complete a pixel filling; then, the first number is updated according to the first preset step length, or the second number is updated according to the second preset step length to complete the next pixel filling, until the image to be extracted after the preset number of pixels are filled is obtained.

[0224] See also Figure 8 In a specific embodiment, the upper left edge point of the image to be extracted is determined as the origin, a two-dimensional coordinate system is established along the edge of the image, and the first direction and the second direction are determined. A pixels are supplemented along the first direction, and b pixels are supplemented along the second direction. The ranges of a and b are both [0, 2m-1]. Therefore, there are 2m*2m images that need to be extracted for watermarks.

[0225] The image to be extracted is filled with pixels. By filling pixels in the spatial domain and then converting it to the frequency domain, the blind watermark is less dependent on the original image information during the extraction process.

[0226] In an optional embodiment, the extracted block image is processed to obtain an extracted character string, including:

[0227] S510, determining to extract a block image according to the fifth image, performing data transformation and singular value decomposition on the extracted block image to obtain a third singular value sequence, and obtaining a corresponding extracted character string according to the third singular value sequence.

[0228] The extracted block image refers to the block image of the blind watermark to be extracted. The third singular value sequence refers to the sequence containing the main features of the extracted block image. The extracted character string refers to the character string of the fifth image in the target frequency domain, and the extracted character string contains the information of the blind watermark in the image to be extracted. Data transformation refers to the operation of converting an image into a matrix, and data transformation includes but is not limited to discrete cosine transformation. Singular value decomposition refers to the operation of decomposing a matrix to obtain a singular value sequence. The third singular value sequence refers to the singular value sequence corresponding to the extracted block image.

[0229] Each fifth image is evenly divided to obtain a plurality of extracted block images; data transformation is performed on each extracted block image to obtain a corresponding coefficient matrix, and singular value decomposition is performed on the coefficient matrix corresponding to each extracted block image to obtain a third singular value sequence corresponding to each extracted block image; string conversion and concatenation are performed on the plurality of third singular value sequences to extract an extracted string corresponding to the fifth image.

[0230] By performing data transformation and singular value decomposition on the extracted block image, a third singular value sequence is obtained, and the corresponding extracted character string is obtained according to the third singular value sequence, so that the image is converted into a numerical value, and then the numerical value is processed to obtain the extracted character string, thereby reducing the amount of calculation and saving computing resources.

[0231] In an optional embodiment, determining to extract a character string according to the third singular value sequence includes:

[0232] S511, performing a fourth operation on the singular values ​​in the third singular value sequence to obtain a third sequence;

[0233] S512, performing a fifth operation according to the third sequence to obtain a character string of extracted block images;

[0234] S513: concatenate the character strings extracted from the divided images to obtain an extracted character string.

[0235] It should be noted that the operation mode of the fourth operation and the fifth operation is determined according to the actual application, and this embodiment does not impose any specific restrictions; for example, the fourth operation is determined according to the size of the singular value in the third singular value sequence, such as a remainder operation or an integer division operation; the fifth operation is determined according to the result of the third sequence, such as a comparison or a value operation. The third sequence refers to the sequence obtained by performing the fourth operation on the third singular value sequence.

[0236] In a specific embodiment, first, a modulo operation is performed on each singular value in the third singular value sequence to obtain a third sequence; then, a value operation is performed on the third sequence to obtain a character string of each extracted block image; then, the character strings of multiple extracted block images are concatenated to obtain a character string of the fifth image in the target frequency domain.

[0237] In an optional embodiment, the fourth operation includes a remainder operation, and the calculation formula for extracting the character string is:

[0238] f 2i =((z 3i %d)>d / 2)*1 (2)

[0239] Among them, f 2i Indicates the extraction of the i-th character of the block image, % indicates the remainder operation, * indicates the multiplication operation, z 3i represents the i-th singular value in the third singular value sequence, and d represents a constant.

[0240] The specific value of d is determined according to actual application and is not specifically limited in this embodiment, for example, d=24.

[0241] The meaning of formula (2) is: take out the i-th value z in the third singular value sequence Z3 3i , then z 3i The modulo constant d is calculated. If the modulo result is greater than half of d, the corresponding character f 2i is 1, otherwise it is 0.

[0242] The fourth operation and the fifth operation are performed on the third singular value sequence to obtain the character string of the extracted block image, and then the character string of the extracted block image is spliced ​​to obtain the extracted character string, thereby obtaining the blind watermark information of the image to be extracted in the target frequency domain. The calculation process is simple and saves calculation resources.

[0243] In an optional embodiment, obtaining a target blind watermark of the image to be extracted according to the extraction string and the target added string includes:

[0244] S610A, when there is only one extracted character string, calculating the similarity between the extracted character string and the target added character string to obtain a first similarity result;

[0245] S620A: Obtain a target blind watermark of the image to be extracted according to the first similarity result and a preset threshold.

[0246] The similarity result refers to the similarity between the extracted string and the target added string, and the similarity refers to the ratio of the number of characters in the corresponding positions of the extracted string and the target added string to the total number of strings. It should be noted that the preset threshold is determined according to the actual application, such as the preset threshold is 0.9.

[0247] If the first similarity result is greater than or equal to the preset threshold, the target blind watermark result of the image to be extracted is extracted; if the first similarity result is less than the preset threshold, the target blind watermark of the image to be extracted is abandoned. In the case of extracting only one character string, the amount of calculation can be reduced and the operation efficiency can be improved.

[0248] In a specific embodiment, characters at the same position of an extracted string O and a target added string P are compared one by one. If the number of identical characters is r, the similarity of the extracted string O is r / n, i.e., d divided by n. For example, the target added string P with a length of 25 is "1100101011101010000010100", and the extracted string O to be compared is "0000101011101010000010100", where the number of identical symbols at the same position is 23, and the similarity is 23 / 25, i.e., 0.92. 0.92 is greater than the preset threshold of 0.9, and therefore, the target blind watermark contained in the image to be extracted is extracted.

[0249] In an optional embodiment, obtaining a target blind watermark of the image to be extracted according to the extraction string and the target added string includes:

[0250] S610B, when at least two character strings are extracted, calculating similarity between each extracted character string and the target added character string to obtain at least two second similarity results;

[0251] S620B, calculating an average similarity result according to at least two second similarity results;

[0252] S630B, obtaining a target blind watermark of the image to be extracted according to the average similarity result and a preset threshold.

[0253] First, the similarities between multiple extracted character strings and the target added character string are calculated respectively to obtain at least two second similarity results; then, the average similarity result is calculated for the multiple second similarity results; finally, the average similarity result is compared with a preset threshold value, and if the average similarity result is greater than or equal to the preset threshold value, the target blind watermark result of the image to be extracted is extracted; if the average similarity result is less than the preset threshold value, the target blind watermark of the image to be extracted is abandoned. In the case of extracting at least two character strings, the accuracy of the result can be improved.

[0254] See also Fig. 9 ,The process of blind watermark extraction is described below with a specific ,implementation.

[0255] Step S21: add a pixels and b pixels to the left and top of the image to be extracted respectively, and the range of a and b is [0, 2m-1]. Therefore, there are 2m*2m images that need to be watermarked. Among them, the image to be extracted is an RGB image.

[0256] Step S22: convert the image to be extracted into a color space from RGB space to YUV space to obtain three channels of Y, U, and V;

[0257] Step S23: Decompose the Y channel in the frequency domain using discrete wavelet transform, and obtain low-frequency information, vertical high-frequency information, horizontal high-frequency information, and diagonal high-frequency information of the image, which correspond to the upper left corner, upper right corner, lower left corner, and lower right corner of the frequency domain decomposition image, that is, four fixed transform domain regions of size (w / 2)*(h / 2);

[0258] Step S24: evenly divide the upper left corner area of ​​the image with a size of (w / 2)*(h / 2) into blocks, and set the size of each small block to m*m, so that (w / 2 / m)*(h / 2 / m) small blocks can be obtained in the end;

[0259] Step S25: taking a certain small block T in order to perform discrete cosine transform, and obtaining a third coefficient matrix G3 of size m*m;

[0260] Step S26: Perform singular value decomposition on the third coefficient matrix G3 to obtain three matrices U, Z, and V, wherein Z of size m*1 stores singular values, which are arranged from large to small, to obtain a third singular value sequence Z3;

[0261] Step S27: Take out the i-th singular value z in Z3 3i According to the string extraction operation method of formula (2), the i-th character f is obtained. 2i , combine all characters corresponding to the third singular value sequence Z3 to obtain a string L of a small block image;

[0262] Step S28: Repeat steps S25, S26, and S27 to extract all small pieces of watermark information, i.e., character f. Finally, W characters can be obtained, where W is equal to [w / (2*m)]*[h / (2*m)]. These characters are concatenated in sequence to obtain V complete watermark bit strings, where V = [w / (2*m)]*[h / (2*m)] / / n, where / / represents integer division operation.

[0263] Step S29: a and b take values ​​of 1, 2, 3, ..., m-1 in turn, and steps S21, S22, S23, S24, S25, S26, S27, and S28 are repeated. Finally, 2m*2m*V complete 01-bit strings can be obtained.

[0264] Step S30: Given the target added bit string P, the similarity calculation is performed on the 2m*2m*V 01 bit strings obtained in step S29 and the target added bit string P in turn, and finally 2m*2m*V similarity values ​​can be obtained, and the average value is C. If C is greater than or equal to the preset threshold T, it means that the image contains watermark information; if C is less than the preset threshold T, it means that the image does not contain watermark information.

[0265] Implementation of the embodiments of the present invention includes the following beneficial effects: in the blind watermark extraction process, first, at least one fifth image of the image to be extracted after filling pixels in the target frequency domain is obtained, and by filling pixels in the spatial domain of the image to be extracted and then converting it to the frequency domain, the blind watermark is reduced in the extraction process. The blind watermark is then determined to be extracted based on each fifth image, and each extracted block image is processed to determine the corresponding extraction string, thereby obtaining the blind watermark information corresponding to the extraction string, and finally, the extraction string is compared with the target added string to obtain the target blind watermark contained in the image to be extracted, so as to realize blind watermark extraction of the cropped blind watermark added image, thereby improving the accuracy of blind watermark extraction, improving the security of image use, and reducing the abuse of false images.

[0266] See also Fig.10 The embodiment of the present invention provides a blind watermark adding device, comprising:

[0267] The first module is used to obtain the added character string corresponding to the watermark information to be added, the first image of the image to be added in the target frequency domain, and other frequency domain images outside the target frequency domain;

[0268] A second module is used to determine at least one added block image according to the first image, and process the added block image according to the added character string to obtain a second image;

[0269] The third module is used to determine the image after the blind watermark is added to the image to be added according to the second image and other frequency domain images.

[0270] It can be seen that the contents of the above-mentioned blind watermark adding method embodiment are all applicable to the present blind watermark adding device embodiment. The functions specifically implemented by the present blind watermark adding device embodiment are the same as those of the above-mentioned blind watermark adding method embodiment, and the beneficial effects achieved are also the same as those achieved by the above-mentioned blind watermark adding method embodiment.

[0271] See also Fig.11 , an embodiment of the present invention provides a blind watermark extraction device, comprising:

[0272] A fourth module is used to obtain at least one fifth image of the image to be extracted in the target frequency domain;

[0273] A fifth module is used to determine an extracted block image according to the fifth image, and process the extracted block image to obtain an extracted character string;

[0274] The sixth module is used to obtain the target blind watermark of the image to be extracted according to the extraction character string and the target added character string.

[0275] It can be seen that the contents of the above-mentioned blind watermark extraction method embodiment are all applicable to the present blind watermark extraction device embodiment. The functions specifically implemented by the present blind watermark extraction device embodiment are the same as those of the above-mentioned blind watermark extraction method embodiment, and the beneficial effects achieved are also the same as those achieved by the above-mentioned blind watermark extraction method embodiment.

[0276] See also Fig.12 , an embodiment of the present invention provides an electronic device, including:

[0277] at least one processor;

[0278] at least one memory for storing at least one program;

[0279] When at least one program is executed by at least one processor, the at least one processor implements the above-mentioned blind watermark adding method or the above-mentioned blind watermark extracting method.

[0280] In this embodiment, the computer is programmed to execute Figure 1 or Figure 7 and storing such a computer program in a Fig.12 The computer program stored in the memory can be Fig.12 The processor in the processor reads it out and obtains the execution Figure 1 or Figure 7 The processor executes these instructions and can execute Figure 1 or Figure 7 Each step in the method is to perform a blind watermark adding or extracting method.

[0281] It should be noted that, unless otherwise specified, the singular forms of "a" and "the" used in this disclosure are also intended to include plural forms, unless the context clearly indicates other meanings. In addition, unless otherwise defined, all technical and scientific terms used in this embodiment have the same meaning as those generally understood by those skilled in the art. The terms used in the present embodiment specification are only for describing specific embodiments, not for limiting the present invention. The term "and / or" used in this embodiment includes any combination of one or more related listed items.

[0282] It should be understood that, although the term first, second, third etc. may be adopted to describe various elements in the present disclosure, these elements should not be limited to these terms. These terms are only used to distinguish the same type of elements from each other. For example, without departing from the scope of the present disclosure, the first element may also be referred to as the second element, and similarly, the second element may also be referred to as the first element. The use of any and all examples or exemplary language ("for example", "such as" etc.) provided by the present embodiment is only intended to better illustrate embodiments of the present invention, and unless otherwise required, the scope of the present invention will not be limited.

[0283] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method may be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program may be implemented in assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed dedicated integrated circuit for this purpose.

[0284] In addition, the operations of the process described in this embodiment may be performed in any suitable order, unless otherwise indicated in this embodiment or otherwise clearly contradicted by the context. The process described in this embodiment (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as a code (e.g., executable instructions, one or more computer programs, or one or more applications) executed on one or more processors in common, by hardware or a combination thereof. A computer program includes a plurality of instructions that may be executed by one or more processors.

[0285] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or part thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the above steps in conjunction with a microprocessor or other data processor, the invention of this embodiment includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention also includes the computer itself.

[0286] The above are only preferred embodiments of the present invention. The present invention is not limited to the above embodiments. As long as the technical effects of the present invention are achieved by the same means, any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention. Within the scope of protection of the present invention, its technical solutions and / or implementation methods may have various modifications and changes.

Claims

1. A blind watermark adding method, characterized in that: include: Acquire an added character string corresponding to the watermark information to be added, a first image of the image to be added in a target frequency domain, and other frequency domain images outside the target frequency domain; Determine at least one added block image according to the first image, and process the added block image according to the added character string to obtain a second image; The image after the blind watermark is added to the image to be added is determined according to the second image and the other frequency domain images.

2. The blind watermark adding method according to claim 1, characterized in that: The step of obtaining a character string corresponding to the watermark information to be added includes: Encoding the watermark information to be added to obtain an original character string; The original character string is reset according to a preset random factor to obtain the added character string.

3. The blind watermark adding method according to claim 1, characterized in that: The target frequency domain includes a low frequency domain, and obtaining a first image of the image to be added in the target frequency domain and other frequency domain images outside the target frequency domain includes: In the case where the image to be added is an RGB image, performing color space conversion on the image to be added to obtain data of a Y channel; The data of the Y channel is decomposed in the frequency domain to obtain a first image in the low frequency domain and other frequency domain images outside the low frequency domain.

4. The blind watermark adding method according to claim 1, characterized in that: The step of determining at least one added block image according to the first image, and processing the added block image according to the added character string to obtain a second image includes: Determine at least one additional block image according to the first image, and perform data transformation and singular value decomposition on the additional block image to obtain a first singular value sequence; A first coefficient matrix is ​​obtained according to the added character string and the first singular value sequence, and a second image corresponding to the first image is determined according to the first coefficient matrix.

5. The blind watermark adding method according to claim 4, characterized in that: The step of performing data transformation and singular value decomposition on the added block image to obtain a first singular value sequence includes: Performing data transformation on the added block image to obtain a second coefficient matrix of the added block image; Performing singular value decomposition on the second coefficient matrix to obtain a target singular value matrix; The target singular value matrix is ​​sorted to obtain the first singular value sequence.

6. The blind watermark adding method according to claim 4, characterized in that: The step of obtaining a first coefficient matrix according to the added character string and the first singular value sequence includes: Performing a first operation on the singular values ​​in the first singular value sequence to obtain a first sequence; Performing a second operation on the characters in the added character string to obtain a second sequence; Perform a third operation on the values ​​of the first sequence and the second sequence at associated positions to obtain a second singular value sequence; Perform singular value merging on the second singular value sequence to obtain the first coefficient matrix.

7. The blind watermark adding method according to claim 4, characterized in that: The determining, according to the first coefficient matrix, a second image corresponding to the first image comprises: Performing data inverse transformation on the first coefficient matrix to obtain a third image corresponding to the added block image; The third images are merged to obtain a second image corresponding to the first image.

8. The blind watermark adding method according to claim 1, characterized in that: The step of determining the image after adding the blind watermark to the image to be added according to the second image and the other frequency domain images includes: Determine, according to the second image and the other frequency domain images, a fourth image after adding a blind watermark in a target channel; the target channel refers to a channel in a target color space where the first image is located; Channels other than the target channel in the target color space are used as other channels, images of the image to be added in the other channels are obtained as other channel images, and the image after the blind watermark is added to the image to be added is determined according to the fourth image and the other channel images.

9. A blind watermark extraction method, characterized in that: include: Acquire at least one fifth image of the image to be extracted in the target frequency domain after the pixels are filled; Determine an extracted block image according to the fifth image, and process the extracted block image to obtain an extracted character string; The target blind watermark of the image to be extracted is obtained according to the extraction character string and the target addition character string.

10. The blind watermark extraction method according to claim 9, characterized in that: The step of obtaining at least one fifth image of the image to be extracted in the target frequency domain after the pixels are filled includes: Filling pixel processing is performed on the image to be extracted, including: In the image to be extracted, a first direction and a second direction perpendicular to each other are determined, a first number of pixels are filled in the first direction, and a second number of pixels are filled in the second direction; wherein the first number is updated by a first preset step size, and the second number is updated by a second preset step size.

11. The blind watermark extraction method according to claim 9, characterized in that: The step of processing the extracted block image to obtain an extracted character string includes: Data transformation and singular value decomposition are performed on the extracted block image to obtain a third singular value sequence, and an extracted character string is obtained according to the third singular value sequence.

12. The blind watermark extraction method according to claim 11, characterized in that: The step of obtaining an extracted character string according to the third singular value sequence comprises: performing a fourth operation on the singular values ​​in the third singular value sequence to obtain a third sequence; Perform a fifth operation according to the third sequence to obtain a character string of the extracted block image; The character strings extracted from the divided images are concatenated to obtain an extracted character string.

13. The blind watermark extraction method according to claim 9, characterized in that: The step of obtaining a target blind watermark of the image to be extracted according to the extraction character string and the target added character string comprises: When there is only one extracted character string, similarity calculation is performed between the extracted character string and the target added character string to obtain a first similarity result; The target blind watermark of the image to be extracted is obtained according to the difference between the first similarity result and a preset threshold.

14. The blind watermark extraction method according to claim 9, characterized in that: The step of obtaining a target blind watermark of the image to be extracted according to the extraction character string and the target added character string comprises: When there are at least two extracted character strings, similarity calculation is performed between each of the extracted character strings and the target added character string to obtain at least two second similarity results; Calculating an average similarity result according to at least two of the second similarity results; The target blind watermark of the image to be extracted is obtained according to the difference between the average similarity result and a preset threshold.

15. A blind watermark adding device, characterized in that: include: The first module is used to obtain the added character string corresponding to the watermark information to be added, the first image of the image to be added in the target frequency domain, and other frequency domain images outside the target frequency domain; A second module is used to determine at least one added block image according to the first image, and process the added block image according to the added character string to obtain a second image; The third module is used to determine the image after the blind watermark is added to the image to be added according to the second image and the other frequency domain images.

16. A blind watermark extraction device, characterized in that: include: A fourth module is used to obtain at least one fifth image of the image to be extracted in the target frequency domain; A fifth module is used to determine an extracted block image according to the fifth image, and process the extracted block image to obtain an extracted character string; The sixth module is used to obtain the target blind watermark of the image to be extracted according to the extraction character string and the target added character string.

17. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the blind watermark adding method as described in any one of claims 1 to 8 or implements the blind watermark extraction method as described in any one of claims 9 to 14.