A method and device for processing and extracting image watermark information

By embedding digital watermarks by segmenting the image and adjusting the coefficient matrix of transformation, the problems of watermark robustness and visual effects in the prior art are solved, and more efficient watermark capacity and stability are achieved.

CN118379177BActive Publication Date: 2025-05-02BEIJING GUOYIN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410557908.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2025-05-02
Estimated Expiration
2044-05-08

AI Technical Summary

Technical Problem

Existing digital watermarking algorithms are difficult to ensure robustness when facing print scanning attacks, and may affect the visual effect of images, and are less effective when weighing concealment and robustness.

Method used

By segmenting the target embedding channel image block in the image to be processed, the corresponding transformation coefficient matrix is ​​determined, and the coefficients at specific positions in the transformation coefficient matrix are adjusted according to the digital watermark information in the watermark template matrix to embed the watermark information.

Benefits of technology

It improves the capacity and stability of digital watermarks embedded in images, enhances the robustness and aggressiveness of watermarks, and reduces the complexity of watermark information embedding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118379177B_ABST
    Figure CN118379177B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for processing and extracting image watermark information, which relates to the field of information processing technology, wherein the processing method comprises the following steps: obtaining an image to be processed and a watermark template matrix; segmenting a target embedded channel image block in the image to be processed to obtain a plurality of first sub-image blocks of the target embedded channel image block; determining a first transformation coefficient matrix corresponding to each first sub-image block in the plurality of first sub-image blocks; adjusting the first transformation coefficients on the target row and column position area in the first transformation coefficient matrix according to the digital watermark information in the watermark template matrix to obtain a first target transformation coefficient matrix corresponding to each first sub-image block; and obtaining a target image after embedding watermark information according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix. The solution provided by the present invention can improve the capacity and stability of embedding digital watermarks in images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing technology, and in particular to a method and device for processing and extracting image watermark information. Background Art

[0002] Digital watermarking technology is a technology widely used in the fields of digital copyright management, information security and privacy protection. In practical applications, digital watermarking technology often faces various attacks and threats, such as print scanning attacks, image processing attacks, cropping attacks, etc. Among them, print scanning attacks are one of the more common and challenging attack methods.

[0003] Existing digital watermark algorithms can be divided into two categories: transform domain-based and spatial domain-based. Among them, the spatial domain-based method embeds digital watermarks by changing the brightness and color of pixels. This method is relatively easy to implement, but it is difficult to ensure good robustness due to the possible color difference and brightness interference of the device during printing and scanning. At the same time, directly modifying the brightness and color may affect the visual effect of the image after embedding the watermark;

[0004] The transform domain-based method converts the original image into the frequency domain or wavelet domain, and then embeds the digital watermark in the high-frequency subband. The key to this type of method is how to balance the relationship between embedding concealment and algorithm robustness. Too much embedded content will reduce embedding concealment, and too little embedded content will reduce algorithm robustness. The current method has a poor embedding effect on images. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method and device for processing and extracting image watermark information, so as to improve the capacity and stability of image embedded digital watermark.

[0006] In order to solve the above technical problems, an embodiment of the present invention provides an image watermark information processing method, comprising:

[0007] Obtaining an image to be processed and a watermark template matrix, wherein each element in the watermark template matrix corresponds to a digital watermark information;

[0008] Segmenting the target embedded channel image block in the image to be processed to obtain a plurality of first sub-image blocks of the target embedded channel image block;

[0009] Determine a first transformation coefficient matrix corresponding to each first sub-image block in a plurality of first sub-image blocks, wherein each element in the first transformation coefficient matrix corresponds to a first transformation coefficient;

[0010] According to the digital watermark information in the watermark template matrix, adjusting the first transform coefficients in the target row and column position area in the first transform coefficient matrix to obtain a first target transform coefficient matrix corresponding to each first sub-image block;

[0011] A target image after embedding watermark information is obtained according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix.

[0012] Optionally, obtain the watermark template matrix, including:

[0013] The watermark information to be embedded is processed according to the preset coding information and the first preset sequence to obtain the watermark template matrix.

[0014] Optionally, the watermark information to be embedded is processed according to the preset coding information and the first preset sequence to obtain the watermark template matrix, including:

[0015] Encoding the watermark information according to a preset coding word length and information bit number to obtain an encoded watermark information sequence;

[0016] The watermark template matrix is ​​obtained according to the first preset sequence and the watermark information sequence, and the length of the first preset sequence is the same as the length of the watermark information sequence.

[0017] Optionally, determining a first transform coefficient matrix corresponding to each first sub-image block in a plurality of first sub-image blocks includes:

[0018] A discrete cosine transform is performed on each of the plurality of first sub-image blocks obtained after segmentation to obtain a first transform coefficient matrix corresponding to each first sub-image block.

[0019] Optionally, adjusting the first transform coefficients in the target row and column position area in the first transform coefficient matrix according to the digital watermark information in the watermark template matrix to obtain a first target transform coefficient matrix corresponding to each first sub-image block includes:

[0020] Traversing the watermark template matrix, each time traversing, if the digital watermark information on the current row and column is the first digital information, then increasing the first transform coefficient on the target row and column position area in the first transform coefficient matrix of the first sub-image block corresponding to the digital watermark information on the current row and column according to the first preset embedding strength, and obtaining a first target transform coefficient matrix corresponding to the first sub-image block;

[0021] If the digital watermark information element on the current row and column is the second digital information, then according to the second preset embedding strength, the first transform coefficient in the target row and column position area in the first transform coefficient matrix of the first sub-image block corresponding to the digital watermark information on the current row and column is reduced to obtain the first target transform coefficient matrix corresponding to the first sub-image block.

[0022] Optionally, the image watermark information processing method further includes:

[0023] Obtaining a second transformation coefficient matrix corresponding to each second sub-image block in a plurality of second sub-image blocks of a target channel image block in a target image;

[0024] Determining target watermark information embedded in each second sub-image block according to the similarity between a preset detection matrix and the second transformation coefficient matrix;

[0025] Obtaining a target watermark information matrix of the target channel image block according to the target watermark information embedded in each second sub-image block;

[0026] The target watermark information matrix is ​​processed according to the second preset sequence and the preset decoding information to obtain embedded original target watermark information.

[0027] An embodiment of the present invention further provides an image watermark information processing device, comprising:

[0028] A first acquisition module is used to acquire the image to be processed and a watermark template matrix, wherein each element in the watermark template matrix corresponds to a digital watermark information;

[0029] The first processing module is used to segment the target embedded channel image block in the image to be processed to obtain multiple first sub-image blocks of the target embedded channel image block; determine the first transformation coefficient matrix corresponding to each first sub-image block in the multiple first sub-image blocks, each element in the first transformation coefficient matrix corresponds to a first transformation coefficient; according to the digital watermark information in the watermark template matrix, adjust the first transformation coefficients in the target row and column position area in the first transformation coefficient matrix to obtain the first target transformation coefficient matrix corresponding to each first sub-image block; according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix, obtain the target image after embedding the watermark information.

[0030] An embodiment of the present invention further provides a method for extracting image watermark information, comprising:

[0031] Acquire a second transformation coefficient matrix corresponding to each second sub-image block in a plurality of second sub-image blocks of a target channel image block in a target image; watermark information is embedded in the target channel image block in the target image;

[0032] Determining target watermark information embedded in each second sub-image block according to the similarity between a preset detection matrix and the second transformation coefficient matrix;

[0033] Obtaining a target watermark information matrix of the target channel image block according to the target watermark information embedded in each second sub-image block;

[0034] The target watermark information matrix is ​​processed according to the second preset sequence and the preset decoding information to obtain embedded original target watermark information.

[0035] Optionally, the preset detection matrix includes: a first detection matrix for embedding first digital information in a first target row and column area and a second detection matrix for embedding second digital information in a second target row and column area, and the first detection matrix, the second detection matrix and the second transformation coefficient matrix have the same number of rows and columns.

[0036] An embodiment of the present invention further provides a device for extracting image watermark information, comprising:

[0037] A second acquisition module is used to acquire a second transformation coefficient matrix corresponding to each second sub-image block in a plurality of second sub-image blocks of a target channel image block in a target image; the target channel image block in the target image is embedded with watermark information;

[0038] The second processing module is used to obtain the similarity between the preset detection matrix and the second transformation coefficient matrix according to the elements in the preset detection matrix and the elements in the second transformation coefficient matrix; determine the target watermark information embedded in each second sub-image block according to the similarity; obtain the target watermark information matrix of the target channel image block according to the target watermark information embedded in each second sub-image block; and process the target watermark information matrix according to a second preset sequence and preset decoding information to obtain the embedded original target watermark information.

[0039] The above solution of the present invention includes at least the following beneficial effects:

[0040] In the image watermark information processing method provided by the embodiment of the present invention, a target embedded channel image block in the acquired image to be processed is segmented to obtain multiple first sub-image blocks of the target embedded channel image block; a first transformation coefficient matrix corresponding to each first sub-image block in the multiple first sub-image blocks is determined, and each element in the first transformation coefficient matrix corresponds to a first transformation coefficient; according to the digital watermark information in the acquired watermark template matrix, the first transformation coefficients in the target row and column position area in the first transformation coefficient matrix are adjusted to obtain a first target transformation coefficient matrix corresponding to each first sub-image block; according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix, a target image after embedding watermark information is obtained, thereby improving the capacity and stability of image embedding digital watermark. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a schematic diagram of the process of a method for processing image watermark information provided by an embodiment of the present invention;

[0042] Figure 2 is a schematic diagram of encoding watermark information provided by an optional embodiment of the present invention;

[0043] Figure 3 is a schematic diagram of generating a watermark template matrix provided by an optional embodiment of the present invention;

[0044] Figure 4 is a schematic diagram of a first transform coefficient matrix corresponding to any first sub-image block and a target row and column position area of ​​the first transform coefficient to be modified therein provided by an optional embodiment of the present invention;

[0045] Figure 5 It is a block diagram of a module of a device for processing image watermark information provided by an embodiment of the present invention;

[0046] Figure 6 It is a schematic diagram of the process of extracting image watermark information provided by an embodiment of the present invention;

[0047] Figure 7 is a schematic diagram of a first detection matrix provided by an optional embodiment of the present invention;

[0048] Figure 8 is a schematic diagram of a second detection matrix provided by an optional embodiment of the present invention;

[0049] Fig. 9 It is a block diagram of a module of an image watermark information extraction device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0051] like Figure 1 As shown, an embodiment of the present invention provides a method for processing image watermark information, comprising:

[0052] Step 11, obtaining the image to be processed and the watermark template matrix, wherein each element in the watermark template matrix corresponds to a digital watermark information;

[0053] Step 12, segmenting the target embedded channel image block in the image to be processed to obtain a plurality of first sub-image blocks of the target embedded channel image block;

[0054] Step 13, determining a first transformation coefficient matrix corresponding to each first sub-image block in a plurality of first sub-image blocks, wherein each element in the first transformation coefficient matrix corresponds to a first transformation coefficient;

[0055] Step 14, adjusting the first transform coefficients in the target row and column position area in the first transform coefficient matrix according to the digital watermark information in the watermark template matrix, to obtain a first target transform coefficient matrix corresponding to each first sub-image block;

[0056] Step 15: Obtain a target image after embedding watermark information according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix.

[0057] In this embodiment, the watermark template matrix is ​​generated according to the watermark information to be embedded, providing a basis for the subsequent embedding of watermark information. Each element in the watermark template matrix corresponds to a digital watermark information, and the watermark information may be copyright information.

[0058] The target embedded channel image block in the image to be processed is the image block corresponding to the G channel in the RGB three channels of the image. By selecting the image block corresponding to the G channel as the embedded target, it can be ensured that the target image after the watermark is embedded has good transparency and anti-attack properties. Further, the target embedded channel image block is segmented to obtain a plurality of first sub-image blocks corresponding thereto. After segmentation, the plurality of first sub-image blocks can be arranged in row and column order according to the row and column order at the time of segmentation and the number of segmented first sub-image blocks to obtain a first sub-image block matrix, wherein each element in the first sub-image block matrix corresponds to a first sub-image block. Taking a target embedded channel image block of 512×512 as an example, it can be segmented into 64×64 8×8 first sub-image blocks, then 64×64 8×8 first sub-image blocks can form a first sub-image block matrix with 64 rows and columns (in the following embodiments, the sub-image blocks mentioned can be considered as 8×8 sub-image blocks); here, the number of rows and columns of the watermark template matrix is ​​the same as the number of rows and columns of the first sub-image block matrix, and the watermark template matrix is ​​also a matrix with 64 rows and columns, and the digital watermark information at the corresponding row and column positions in the watermark template matrix corresponds to the first sub-image blocks at the corresponding row and column positions in the first sub-image block matrix, so as to facilitate the subsequent adjustment of each sub-image block according to the watermark template matrix to ensure the integrity and completeness of the watermark information embedded in the target embedded channel image block;

[0059] Furthermore, the first sub-image block at the corresponding row and column position in the first sub-image block matrix is ​​adjusted according to the digital watermark information at the corresponding row and column position in the watermark template matrix, specifically: according to the digital watermark information at the current row and column position in the watermark template matrix, the first transform coefficient at the target row and column position area in the first transform coefficient matrix of the first sub-image block corresponding to the digital watermark information at the current row and column position is adjusted to obtain the corresponding first target transform coefficient matrix after adjustment of each first sub-image block; here, the target row and column position area contains multiple first transform coefficients, the target row and column position area is a position area that satisfies the oblique texture direction, and the multiple first transform coefficients in the target row and column position area are all medium and high frequency first transform coefficients, such as Figure 4 The figure shows a first sub-image block of 8×8 size. The first transform coefficients corresponding to the positions 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10 in the figure are the first transform coefficients contained in the target row and column position area and need to be adjusted. Furthermore, according to the first target transform coefficient matrix and the first sub-image block corresponding thereto, the target image after embedding the watermark information can be obtained.

[0060] Here, multiple first transform coefficients in the first transform coefficient matrix of the first sub-image block are adjusted according to the digital watermark information in the watermark template matrix, and the target image after the watermark information is embedded is obtained according to the adjusted first sub-image block, which is equivalent to directly modifying the original first sub-image block, and does not require complex operations such as integrating the watermark information with the image, thereby reducing the difficulty of embedding the watermark information into the image; at the same time, multiple first transform coefficients in the target row and column position area are adjusted, which can improve the robustness of watermark embedding and the anti-attack capability of the target image after the watermark information is embedded.

[0061] In an optional embodiment of the present invention, in the above step 11, obtaining the watermark template matrix may include:

[0062] Step 111: Process the watermark information to be embedded according to the preset coding information and the first preset sequence to obtain the watermark template matrix.

[0063] In this embodiment, before the watermark information to be embedded is processed according to the preset coding information and the first preset sequence; preferably, the watermark information may be firstly converted into binary to obtain the watermark information after binary conversion, so as to reduce the complexity of the subsequent adjustment of the first transform coefficient of the first sub-image block according to the watermark template matrix;

[0064] Here, the preset coding information may include a preset coding word length and a preset information bit number, and the preset coding word length and the information bit number may be set according to the specific bit number of the watermark information after binary conversion; the first preset sequence may be a random sequence obtained according to a random number generation algorithm, and the size of the first preset sequence may be set according to the specific bit number of the watermark information after binary conversion, or may be set according to the size of the target embedded channel image block;

[0065] Furthermore, the above step 111 may include:

[0066] Step 1111, encoding the watermark information according to a preset encoding word length and information bit number to obtain an encoded watermark information sequence;

[0067] Step 1112: obtaining the watermark template matrix according to the first preset sequence and the watermark information sequence, wherein the length of the first preset sequence is the same as the length of the watermark information sequence.

[0068] In this embodiment, the watermark information after binary processing is encoded by the preset coding word length and the information bit number to ensure the stability and reliability of watermark information embedding; here, before encoding, the original watermark information to be embedded can be firstly binary processed to reduce the difficulty of adjusting the first transform coefficient of the first sub-image block; further, the watermark information sequence is spread spectrum processed by the first preset sequence to obtain the watermark template matrix, thereby increasing the embedding amount of watermark information, thereby ensuring the robustness and invisibility of the subsequent embedded watermark information; when the watermark information sequence is spread spectrum processed, it is necessary to set a first preset sequence that matches the size of the target embedded channel image block, and the length of the first preset sequence is the same as the length of the watermark information sequence, so as to ensure that the watermark template matrix with the same rows and columns as the first sub-image block matrix formed by the first sub-image block is obtained, thereby ensuring the efficiency of embedding watermark information and the utilization rate of the target embedded channel image block;

[0069] Taking the 36-bit watermark information obtained after binary processing, the preset coding word length of 63, and the preset information bit number of 36 as an example, the above encoding process is explained: the 36-bit watermark information is represented as an information vector m with a length of 36, where each bit is a binary information bit, and the information vector m is multiplied by a preset generator matrix (the preset generator matrix is ​​a 63×63 matrix, the first 36 columns of which can be the unit matrix, and the last 27 columns can be the coefficients of the generator polynomial that meets the BCH encoding requirements), then a coding vector with a length of 63 is obtained, and a preset number of preset error correction codes are added to the coding vector with a length of 63 to obtain a 63-bit BCH code including the 36-bit watermark information and the preset error correction code, as shown in FIG. Figure 2 As shown; further, an additional 0 is added to the 63-bit BCH code to obtain a 64-bit encoded watermark information sequence;

[0070] like Figure 3 As shown, further, a first preset sequence of 64 bits, such as a random 01 sequence, is obtained according to a random number generation algorithm, and the watermark information sequence is spread spectrum processed. Specifically: the watermark information sequence is multiplied by the first preset sequence to obtain a 6×64 watermark template matrix to expand the amount of watermark embedding; preferably, the watermark template matrix obtained after the spread spectrum processing can be scrambled by a preset scrambling method to ensure the complexity of the embedded watermark information, thereby ensuring the stability and security of the target image embedded with the watermark information; it should be known that since the watermark template matrix is ​​obtained by performing coding and spread spectrum after binary conversion of the original watermark information, the watermark template matrix only contains: the first digital watermark information whose matrix elements are the first digital information 1 and the second digital watermark information whose matrix elements are the second digital information 0.

[0071] In an optional embodiment of the present invention, the above step 13 may include:

[0072] Step 131 , performing discrete cosine transform on each of the plurality of first sub-image blocks obtained after segmentation, to obtain a first transform coefficient matrix corresponding to each first sub-image block.

[0073] In this embodiment, the image data represented by the first sub-image block in the spatial domain is converted into the frequency domain for representation by discrete cosine transform, so as to reduce the redundancy and complexity of the pixel values ​​of the first sub-image block, so as to reduce the complexity of the subsequent embedding of watermark information; specifically: after the pixel values ​​of the first sub-image block of size N×N are transformed by discrete cosine transform, the high-frequency transform coefficients are set to 0, and the transformed low-frequency transform coefficients are rearranged into a matrix of N rows and N columns, so as to obtain the first transform coefficient matrix of each first sub-image block; preferably, the first transform coefficient matrix of each first sub-image block can be calculated by the following formula:

[0074]

[0075] Where N represents the height and width of the first sub-image block (the first sub-image block is a square by default); f(x, y) is the pixel value at the position (x, y) in the first sub-image block; F(u, v) represents the first transform coefficient after transformation at the corresponding position; u and v represent different frequencies in the transform domain, and both have the value of N-1; K u , K v are normalized coefficients. When u=v=0, When u=v≠0, K u =K v =1;

[0076] Since the watermark template matrix has the same number of rows and columns as the first sub-image block matrix composed of multiple first sub-image blocks, each matrix element (digital watermark information) in the watermark template matrix corresponds to a first transformation coefficient matrix of a first sub-image block.

[0077] In an optional embodiment of the present invention, the above step 14 may include:

[0078] Step 141, traversing the watermark template matrix, each time traversing, if the digital watermark information on the current row and column is the first digital information, then according to the first preset embedding strength, the first transform coefficient on the target row and column position area in the first transform coefficient matrix of the first sub-image block corresponding to the digital watermark information on the current row and column is adjusted and increased, and a first target transform coefficient matrix corresponding to the first sub-image block is obtained;

[0079] Step 142: If the digital watermark information element on the current row and column is the second digital information, then according to the second preset embedding strength, the first transform coefficient on the target row and column position area in the first transform coefficient matrix of the first sub-image block corresponding to the digital watermark information on the current row and column is reduced to obtain the first target transform coefficient matrix corresponding to the first sub-image block.

[0080] In this embodiment, the first preset embedding strength and the second preset embedding strength can be set according to actual processing needs to ensure the accuracy of adjusting the first transform coefficient according to the numerical watermark information in the watermark template matrix, thereby ensuring the accuracy of the embedded watermark information;

[0081] Searching the watermark template matrix for the digital watermark information (the matrix elements in the watermark template matrix) corresponding to each first sub-image block in the first sub-image block matrix; in the watermark template matrix, processing the first transform coefficients in the target row and column position area in the first transform coefficient matrix of the first sub-image block corresponding to the digital watermark information in the current row and column according to the digital watermark information in the current row and column; if the digital watermark information in the current row and column (the matrix elements in the watermark template matrix) is the first digital information 1, all the first transform coefficients in the target row and column position area are increased according to the first preset embedding strength; if the digital watermark information (the matrix elements) in the current row and column is the second digital information 0, all the first transform coefficients in the target row and column position area are decreased according to the second preset embedding strength, and respectively obtaining the first target transform coefficient matrix of the first sub-image block corresponding to the digital watermark information being the first digital information 1 and the first target transform coefficient matrix of the first sub-image block corresponding to the digital watermark information being the second digital information 0;

[0082] The digital watermark information in the watermark template matrix is ​​used to adaptively modify the first transform coefficient in the target row and column position area in the first transform coefficient matrix of the first sub-image block corresponding to the digital watermark information, so that the first transform coefficient value in the target row and column position area in the first transform coefficient matrix corresponding to the digital watermark information of 1 is as high as possible, and the first transform coefficient value in the target row and column position area in the first transform coefficient matrix corresponding to the digital watermark information of 0 is as low as possible; the entire processing process is to modify directly on the original first sub-image block, and does not require complex operations such as integrating the watermark information with the first sub-image block, thereby reducing the difficulty of embedding the watermark information in the image; at the same time, multiple first transform coefficients in the target row and column position area are adjusted, which can improve the robustness of watermark embedding and the anti-attack property of the target image after the watermark information is embedded.

[0083] In an optional embodiment of the present invention, the above step 15 may include:

[0084] Step 151, performing inverse discrete cosine transform on each first sub-image block having a first target transform coefficient matrix, to obtain a second target transform coefficient matrix corresponding to each first sub-image block, wherein the second target transform coefficient matrix corresponds to the first target transform coefficient matrix one-to-one;

[0085] Step 152, splicing the plurality of first sub-image blocks having the second target transformation matrix in row and column order, and replacing the target embedded channel image block in the image to be processed, to obtain a target image with embedded watermark information.

[0086] In this embodiment, the watermark information is embedded by modifying the first transform coefficient in the first transform coefficient matrix of the first sub-image block according to the digital watermark information in the watermark template information, and the first target transform coefficient matrix obtained after the transformation is subjected to an inverse discrete cosine transform to restore the first sub-image block represented in the frequency domain to an image block represented in the spatial domain, so as to facilitate further splicing of the image blocks after the watermark information is embedded, thereby ensuring the integrity of the target image;

[0087] Preferably, the inverse discrete cosine transform may be performed on each first sub-image block having the first target transform coefficient matrix using the following formula:

[0088]

[0089] In an optional embodiment of the present invention, based on steps 11 to 15, the following may also be included:

[0090] Step 16, obtaining a second transformation coefficient matrix corresponding to each second sub-image block in a plurality of second sub-image blocks of a target channel image block in a target image;

[0091] Step 17, determining the target watermark information embedded in each second sub-image block according to the similarity between the preset detection matrix and the second transformation coefficient matrix;

[0092] Step 18, obtaining a target watermark information matrix of the target channel image block according to the target watermark information embedded in each second sub-image block;

[0093] Step 19: Process the target watermark information matrix according to the second preset sequence and preset decoding information to obtain embedded original target watermark information.

[0094] In this embodiment, the target channel image block is an image block corresponding to the G channel; here, firstly, the determined target channel image block is segmented to obtain a plurality of second sub-image blocks of the target channel image block; wherein the size and number of the segmented second sub-image blocks may be the same as the size and number of the first sub-image blocks in the above embodiment; and a discrete cosine transform is performed on each second sub-image block to obtain a second transform coefficient matrix of each second sub-image block;

[0095] Furthermore, by performing detection processing on each second transformation coefficient matrix according to the preset detection matrix, target watermark information embedded in each second sub-image block can be determined, wherein the target watermark information is the digital watermark information based on which the transformation coefficients in the target row and column position area in the sub-image block where the watermark information is not originally embedded are adjusted;

[0096] Here, the second transformation coefficient matrix can be detected and processed by two preset detection matrices: the first detection matrix and the second detection matrix; the first detection matrix and the second detection matrix are matrices of the same size as the second transformation coefficient matrix; Figure 7 As shown, in the first detection matrix, the digital information embedded in the position corresponding to the target row and column position area is -1, and the other positions are all 0; Figure 8 As shown, in the second detection, the digital information embedded in the position corresponding to the target row and column position area is 1, and the other positions are all 0; when performing detection: respectively obtain the first similarity between the first detection matrix and the second transformation coefficient matrix to be detected, and the second similarity between the second detection matrix and the second transformation coefficient matrix to be detected, and compare the first similarity with the second similarity; when the first similarity is greater than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the first detection matrix, and the corresponding embedded target watermark information is 0; when the first similarity is less than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the second detection matrix, and the corresponding embedded target watermark information is 1;

[0097] Preferably, the first similarity can be calculated by the following formula:

[0098]

[0099] The second similarity can be calculated by the following formula:

[0100]

[0101] Among them, S1 represents the first similarity; S2 represents the second similarity; A represents the first detection matrix, A j represents the jth element component in the first detection matrix; C represents the second detection matrix, C j represents the jth element component in the second detection matrix; B i represents the second transform coefficient matrix corresponding to the i-th second sub-image block, B ij represents the jth element component in the second transformation coefficient matrix; D represents the number of elements in the first detection matrix, the second detection matrix, and the second transformation coefficient matrix, j=1, 2, 3, ..., D is a positive integer;

[0102] Furthermore, according to the target watermark information embedded in each second sub-image block and the row and column order of the second sub-image, the target watermark information is arranged in the corresponding row and column order, so as to obtain the target watermark information matrix of the target channel image block; further, the target watermark information matrix is ​​subjected to inverse spread spectrum processing through the second preset sequence to obtain a target watermark information sequence corresponding to the target watermark matrix; the target watermark information sequence is decoded and binarized through the preset decoding information to obtain the corrected information, which is the original target watermark information embedded in the target image; here, after obtaining the target watermark information matrix, the process of processing the target watermark information to obtain the embedded original target watermark information is the inverse process of processing the watermark information to obtain the watermark information template matrix in the above-mentioned embodiment, thereby ensuring the accuracy of the extracted embedded original target watermark information.

[0103] In the method for processing image watermark information disclosed in the above-mentioned embodiment of the present invention, the target embedded channel image block in the processed image is segmented to obtain a plurality of first sub-image blocks, and the first transformation coefficient matrix corresponding to each first sub-image block in the plurality of first sub-image blocks is calculated; the watermark information to be embedded is encoded and spread spectrum processed in sequence according to the preset coding information and the first preset sequence to obtain a watermark template matrix, and the first transformation coefficients in the target row and column position area in the first transformation coefficient matrix are adjusted according to the digital watermark information in the watermark template matrix to obtain a first target transformation coefficient matrix corresponding to each first sub-image block; the target image after embedding the watermark information is obtained according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix. Image, in order to improve the capacity and stability of image embedded digital watermark; when embedding, the watermark information is embedded by modifying the first transform coefficient in the transform domain matrix of the first sub-image block, and the watermark embedding amount is increased by using the spread spectrum technology, and the robustness and invisibility of the watermark are enhanced. At the same time, the BCH error correction coding technology is combined to achieve more stable and reliable embedding, so that the generated target table image can effectively resist printing and scanning attacks, thereby realizing the protection and management of digital copyright; when extracting, based on the discrete cosine transform method, the local area (target channel image block) of the target image embedded with watermark information is sampled and compared with the preset detection matrix, and the BCH error correction decoding is used, so that the embedded original target watermark information can be effectively extracted to realize the protection and management of digital copyright.

[0104] like Figure 5 As shown, the embodiment of the present invention further provides an image watermark information processing device 50, comprising:

[0105] A first acquisition module 51 is used to acquire the image to be processed and a watermark template matrix, where each element in the watermark template matrix corresponds to a digital watermark information;

[0106] The first processing module 52 is used to segment the target embedded channel image block in the image to be processed to obtain multiple first sub-image blocks of the target embedded channel image block; determine the first transformation coefficient matrix corresponding to each first sub-image block in the multiple first sub-image blocks, each element in the first transformation coefficient matrix corresponds to a first transformation coefficient; according to the digital watermark information in the watermark template matrix, adjust the first transformation coefficients in the target row and column position area in the first transformation coefficient matrix to obtain the first target transformation coefficient matrix corresponding to each first sub-image block; according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix, obtain the target image after embedding the watermark information.

[0107] Optionally, the first acquisition module 51 is used to acquire a watermark template matrix, including:

[0108] The watermark information to be embedded is processed according to the preset coding information and the first preset sequence to obtain the watermark template matrix.

[0109] Optionally, the first acquisition module 51 is used to process the watermark information to be embedded according to the preset coding information and the first preset sequence to obtain the watermark template matrix, including:

[0110] Encoding the watermark information according to a preset coding word length and information bit number to obtain an encoded watermark information sequence;

[0111] The watermark template matrix is ​​obtained according to the first preset sequence and the watermark information sequence, and the length of the first preset sequence is the same as the length of the watermark information sequence.

[0112] Optionally, the first processing module 52 is used to determine a first transformation coefficient matrix corresponding to each first sub-image block in a plurality of first sub-image blocks, including:

[0113] A discrete cosine transform is performed on each of the plurality of first sub-image blocks obtained after segmentation to obtain a first transform coefficient matrix corresponding to each first sub-image block.

[0114] Optionally, the first processing module 52 is used to adjust the first transform coefficients in the target row and column position area in the first transform coefficient matrix according to the digital watermark information in the watermark template matrix to obtain a first target transform coefficient matrix corresponding to each first sub-image block, including:

[0115] Traversing the watermark template matrix, each time traversing, if the digital watermark information on the current row and column is the first digital information, then increasing the first transform coefficient on the target row and column position area in the first transform coefficient matrix of the first sub-image block corresponding to the digital watermark information on the current row and column according to the first preset embedding strength, and obtaining a first target transform coefficient matrix corresponding to the first sub-image block;

[0116] If the digital watermark information element on the current row and column is the second digital information, then according to the second preset embedding strength, the first transform coefficient in the target row and column position area in the first transform coefficient matrix of the first sub-image block corresponding to the digital watermark information on the current row and column is reduced to obtain the first target transform coefficient matrix corresponding to the first sub-image block.

[0117] Optionally, the first processing module 52 is further used for:

[0118] Obtaining a second transformation coefficient matrix corresponding to each second sub-image block in a plurality of second sub-image blocks of a target channel image block in a target image;

[0119] Obtaining similarity between the preset detection matrix and the second transformation coefficient matrix according to elements in the preset detection matrix and elements in the second transformation coefficient matrix;

[0120] Determining target watermark information to be embedded in each second sub-image block according to the similarity;

[0121] Obtaining a target watermark information matrix of the target channel image block according to the target watermark information embedded in each second sub-image block;

[0122] The target watermark information matrix is ​​processed according to the second preset sequence and the preset decoding information to obtain embedded original target watermark information.

[0123] It should be noted that the image watermark information processing device is a device corresponding to the above-mentioned image watermark information processing method, and all implementation methods in the above-mentioned method embodiment are applicable to the embodiment of the device and can achieve the same technical effect.

[0124] like Figure 6 As shown, an embodiment of the present invention further provides a method for extracting image watermark information, comprising:

[0125] Step 61, obtaining a second transformation coefficient matrix corresponding to each second sub-image block in a plurality of second sub-image blocks of a target channel image block in a target image; the target channel image block in the target image is embedded with watermark information;

[0126] Step 62, determining the target watermark information embedded in each second sub-image block according to the similarity between the preset detection matrix and the second transformation coefficient matrix;

[0127] Step 63, obtaining a target watermark information matrix of the target channel image block according to the target watermark information embedded in each second sub-image block;

[0128] Step 64: Process the target watermark information matrix according to the second preset sequence and the preset decoding information to obtain embedded original target watermark information.

[0129] In this embodiment, the target channel image block is an image block corresponding to the G channel in the target image; here, firstly, the determined target channel image block is segmented to obtain a plurality of second sub-image blocks of the target channel image block, and the size and number of the segmented second sub-image blocks can also be set according to the actual processing requirements; preferably, before segmentation, the target image can be corrected (here, it can be corrected with the aid of image processing software) to avoid perspective distortion of the acquired target image with watermark information, thereby reducing the influence on the subsequent extraction of watermark information; further, a discrete cosine transform is performed on each second sub-image block to obtain a second transform coefficient matrix of each second sub-image block, and the discrete cosine transform here is the same as the discrete cosine transform process in the above-mentioned processing method embodiment, which will not be repeated here;

[0130] Further, by performing detection processing on each second transformation coefficient matrix according to the preset detection matrix, target watermark information embedded in each second sub-image block can be determined, and the target watermark information is the digital watermark information based on which the transformation coefficients in the target row and column position area in the sub-image block in which the watermark information is not originally embedded are adjusted; further, the second transformation coefficient matrix can be respectively detected and processed by two preset detection matrices: the first detection matrix and the second detection matrix, so as to determine the target watermark information embedded in the second sub-image block;

[0131] The first detection matrix and the second detection matrix are both matrices of the same size as the second transformation coefficient matrix; preferably, the first detection matrix is ​​a matrix in which the first digital information is embedded in the first target row and column area, and the digital 0 is embedded in other areas except the first target row and column area; the second detection matrix is ​​a matrix in which the second digital information is embedded in the second target row and column area, and the digital 0 is embedded in other areas except the second target row and column area; the specific positions of the first target row and column area and the second target row and column area in the matrix are the same;

[0132] In an implementation example of the present invention, Figure 7 It can be expressed as a first detection matrix, in which the first digital information -1 can be embedded in the first target row and column area in the matrix, and the remaining positions are all 0; Figure 8 It can be expressed as a second detection matrix. In the second detection, the second digital information 1 can be embedded in the second target row and column area in the matrix, and the remaining positions are all 0;

[0133] Preferably, the first similarity can be calculated by the following formula:

[0134]

[0135] The second similarity can be calculated by the following formula:

[0136]

[0137] Among them, S1 represents the first similarity; S2 represents the second similarity; A represents the first detection matrix, A j represents the jth element component in the first detection matrix; C represents the second detection matrix, C j represents the jth element component in the second detection matrix; B i represents the second transform coefficient matrix corresponding to the i-th second sub-image block, B ij represents the jth element component in the second transformation coefficient matrix; D represents the number of elements in the first detection matrix, the second detection matrix, and the second transformation coefficient matrix, j=1, 2, 3, ..., D is a positive integer;

[0138] When performing a specific detection: respectively obtaining a first similarity between the first detection matrix and a second transformation coefficient matrix to be detected, and a second similarity between the second detection matrix and the second transformation coefficient matrix to be detected, and comparing the first similarity with the second similarity; when the first similarity is greater than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the first detection matrix, and the corresponding embedded target watermark information is 0; when the first similarity is less than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the second detection matrix, and the corresponding embedded target watermark information is 1;

[0139] Further, according to the target watermark information embedded in each second sub-image block and the row and column order of the second sub-image, the target watermark information is arranged in the corresponding row and column order, so as to obtain the target watermark information matrix of the target channel image block; further, the target watermark information matrix is ​​subjected to inverse spread spectrum processing through the second preset sequence to obtain a target watermark information sequence corresponding to the target watermark matrix; the target watermark information sequence is decoded and binarized through the preset decoding information to obtain the corrected information, which is the original target watermark information embedded in the target image; here, after obtaining the target watermark information matrix, the process of processing the target watermark information to obtain the embedded original target watermark information is the same as the inverse process of processing the watermark information to obtain the watermark information template matrix in the above-mentioned processing method embodiment, and will not be repeated here;

[0140] The discrete cosine transform-based method disclosed in the embodiment of the present invention can effectively extract the embedded original target watermark information by sampling the local area (target channel image block) of the target image embedded with watermark information and comparing it with a preset detection matrix, and using BCH error correction decoding to achieve protection and management of digital copyright. In the embodiment, the accuracy of the extracted embedded original target watermark information can be guaranteed.

[0141] like Fig. 9 As shown, the embodiment of the present invention further provides an image watermark information extraction device 90, comprising:

[0142] A second acquisition module 91 is used to acquire a second transformation coefficient matrix corresponding to each second sub-image block in a plurality of second sub-image blocks of a target channel image block in a target image; the target channel image block in the target image is embedded with watermark information;

[0143] The second processing module 92 is used to obtain the similarity between the preset detection matrix and the second transformation coefficient matrix based on the elements in the preset detection matrix and the elements in the second transformation coefficient matrix; determine the target watermark information embedded in each second sub-image block based on the similarity; obtain the target watermark information matrix of the target channel image block based on the target watermark information embedded in each second sub-image block; and process the target watermark information matrix according to a second preset sequence and preset decoding information to obtain the embedded original target watermark information.

[0144] Optionally, the preset detection matrix includes: a first detection matrix for embedding first digital information in a first target row and column area and a second detection matrix for embedding second digital information in a second target row and column area, and the first detection matrix, the second detection matrix and the second transformation coefficient matrix have the same number of rows and columns.

[0145] It should be noted that the image watermark information extraction device is a device corresponding to the above-mentioned image watermark information extraction method, and all implementation methods in the above-mentioned method embodiment are applicable to the embodiment of the device and can achieve the same technical effect.

[0146] The embodiment of the present invention further provides a computing device, comprising: a processor, a memory storing a computer program, wherein when the computer program is executed by the processor, the processing method of image watermark information or the method for extracting image watermark information as described above is executed. All implementations in the above-mentioned method for processing image watermark information or the method for extracting image watermark information are applicable to this embodiment, and can also achieve the same technical effect.

[0147] The embodiment of the present invention further provides a computer-readable storage medium, including instructions, which, when executed on a computer, enable the computer to execute the above-mentioned method for processing image watermark information or method for extracting image watermark information. All implementations in the above-mentioned method for processing image watermark information or method for extracting image watermark information are applicable to this embodiment and can achieve the same technical effect.

[0148] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0149] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0150] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0151] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0152] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0153] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0154] In addition, it should be noted that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understood that all or any steps or components of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or a network of computing devices in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.

[0155] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code that implements the method or device. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.

[0156] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for processing image watermark information, characterized in that: include: Obtaining an image to be processed and a watermark template matrix, wherein each element in the watermark template matrix corresponds to a digital watermark information; Segmenting the target embedded channel image block in the image to be processed to obtain a plurality of first sub-image blocks of the target embedded channel image block; Determine a first transformation coefficient matrix corresponding to each first sub-image block in a plurality of first sub-image blocks, wherein each element in the first transformation coefficient matrix corresponds to a first transformation coefficient; According to the digital watermark information in the watermark template matrix, adjusting the first transform coefficients in the target row and column position area in the first transform coefficient matrix to obtain a first target transform coefficient matrix corresponding to each first sub-image block; Obtaining a target image after embedding watermark information according to the first target transformation coefficient matrix and a first sub-image block corresponding to the first target transformation coefficient matrix; Among them, obtaining the watermark template matrix includes: The binary processed watermark information to be embedded is encoded to obtain an encoded watermark information sequence; the encoding method includes: representing the binary processed watermark information as an information vector, multiplying the information vector with a preset generation matrix to obtain an encoding vector; adding a preset error correction code to the encoding vector, and supplementing a 0 in the encoding vector after adding the preset error correction code to obtain the encoded watermark information sequence; Generate a first preset sequence by a random number generation algorithm, wherein the length of the first preset sequence is the same as the length of the watermark information sequence; Performing spread spectrum processing on the watermark information sequence through the first preset sequence to obtain the watermark template matrix; The step of obtaining a target image after embedding watermark information according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix includes: Performing an inverse discrete cosine transform on each first sub-image block having a first target transform coefficient matrix to obtain a second target transform coefficient matrix corresponding to each first sub-image block, wherein the second target transform coefficient matrix corresponds to the first target transform coefficient matrix in a one-to-one manner; Splicing a plurality of first sub-image blocks having the second target transformation matrix in row and column order, and replacing the target embedded channel image block in the image to be processed, to obtain a target image after embedding watermark information; The method further comprises: Acquire a second transformation coefficient matrix corresponding to each second sub-image block in a plurality of second sub-image blocks of a target channel image block in a target image; the second sub-image block is an image block obtained after segmentation processing of the target channel image block, and the size and number of the second sub-image blocks are equal to the size and number of the first sub-image blocks; perform discrete cosine transformation on the second sub-image block to obtain the second transformation coefficient matrix; According to the similarity between the preset detection matrix and the second transformation coefficient matrix, the target watermark information embedded in each second sub-image block is determined; the preset detection matrix includes a first detection matrix and a second detection matrix, and the first detection matrix and the second detection matrix are matrices of the same size as the second transformation coefficient matrix; in the first detection matrix, the digital information embedded in the position corresponding to the target row and column position area is -1, and the other positions are 0; in the second detection matrix, the digital information embedded in the position corresponding to the target row and column position area is 1, and the other positions are 0; when performing detection, respectively obtain the first similarity between the first detection matrix and the second transformation coefficient matrix to be detected, and the second similarity between the second detection matrix and the second transformation coefficient matrix to be detected, and compare the first similarity with the second similarity; when the first similarity is greater than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the first detection matrix, and the corresponding embedded target watermark information is 0; when the first similarity is less than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the second detection matrix, and the corresponding embedded target watermark information is 1; Obtaining a target watermark information matrix of the target channel image block according to the target watermark information embedded in each second sub-image block; The target watermark information matrix is ​​processed according to the second preset sequence and the preset decoding information to obtain embedded original target watermark information.

2. The image watermark information processing method according to claim 1, characterized in that: Determining a first transformation coefficient matrix corresponding to each first sub-image block in a plurality of first sub-image blocks, comprising: A discrete cosine transform is performed on each of the plurality of first sub-image blocks obtained after segmentation to obtain a first transform coefficient matrix corresponding to each first sub-image block.

3. The image watermark information processing method according to claim 1, characterized in that: According to the digital watermark information in the watermark template matrix, the first transform coefficients in the target row and column position area in the first transform coefficient matrix are adjusted to obtain a first target transform coefficient matrix corresponding to each first sub-image block, including: Traversing the watermark template matrix, each time traversing, if the digital watermark information on the current row and column is the first digital information, then increasing the first transform coefficient on the target row and column position area in the first transform coefficient matrix of the first sub-image block corresponding to the digital watermark information on the current row and column according to the first preset embedding strength, and obtaining a first target transform coefficient matrix corresponding to the first sub-image block; If the digital watermark information element on the current row and column is the second digital information, then according to the second preset embedding strength, the first transform coefficient in the target row and column position area in the first transform coefficient matrix of the first sub-image block corresponding to the digital watermark information on the current row and column is reduced to obtain the first target transform coefficient matrix corresponding to the first sub-image block.

4. An image watermark information processing device, characterized in that: include: A first acquisition module is used to acquire the image to be processed and a watermark template matrix, wherein each element in the watermark template matrix corresponds to a digital watermark information; A first processing module, configured to segment the target embedded channel image block in the image to be processed to obtain a plurality of first sub-image blocks of the target embedded channel image block; Determine a first transformation coefficient matrix corresponding to each first sub-image block in a plurality of first sub-image blocks, wherein each element in the first transformation coefficient matrix corresponds to a first transformation coefficient; adjust the first transformation coefficients in the target row and column position area in the first transformation coefficient matrix according to the digital watermark information in the watermark template matrix to obtain a first target transformation coefficient matrix corresponding to each first sub-image block; obtain a target image embedded with watermark information according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix; Among them, obtaining the watermark template matrix includes: The binary processed watermark information to be embedded is encoded to obtain an encoded watermark information sequence; the encoding method includes: representing the binary processed watermark information as an information vector, multiplying the information vector with a preset generation matrix to obtain an encoding vector; adding a preset error correction code to the encoding vector, and supplementing a 0 in the encoding vector after adding the preset error correction code to obtain the encoded watermark information sequence; Generate a first preset sequence by a random number generation algorithm, wherein the length of the first preset sequence is the same as the length of the watermark information sequence; Performing spread spectrum processing on the watermark information sequence through the first preset sequence to obtain the watermark template matrix; The step of obtaining a target image after embedding watermark information according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix includes: Performing an inverse discrete cosine transform on each first sub-image block having a first target transform coefficient matrix to obtain a second target transform coefficient matrix corresponding to each first sub-image block, wherein the second target transform coefficient matrix corresponds to the first target transform coefficient matrix in a one-to-one manner; Splicing a plurality of first sub-image blocks having the second target transformation matrix in row and column order, and replacing the target embedded channel image block in the image to be processed, to obtain a target image after embedding watermark information; The first processing module is also used for: Acquire a second transformation coefficient matrix corresponding to each second sub-image block in a plurality of second sub-image blocks of a target channel image block in a target image; the second sub-image block is an image block obtained after segmentation processing of the target channel image block, and the size and number of the second sub-image blocks are equal to the size and number of the first sub-image blocks; perform discrete cosine transformation on the second sub-image block to obtain the second transformation coefficient matrix; According to the similarity between the preset detection matrix and the second transformation coefficient matrix, the target watermark information embedded in each second sub-image block is determined; the preset detection matrix includes a first detection matrix and a second detection matrix, and the first detection matrix and the second detection matrix are matrices of the same size as the second transformation coefficient matrix; in the first detection matrix, the digital information embedded in the position corresponding to the target row and column position area is -1, and the other positions are 0; in the second detection matrix, the digital information embedded in the position corresponding to the target row and column position area is 1, and the other positions are 0; when performing detection, respectively obtain the first similarity between the first detection matrix and the second transformation coefficient matrix to be detected, and the second similarity between the second detection matrix and the second transformation coefficient matrix to be detected, and compare the first similarity with the second similarity; when the first similarity is greater than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the first detection matrix, and the corresponding embedded target watermark information is 0; when the first similarity is less than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the second detection matrix, and the corresponding embedded target watermark information is 1; Obtaining a target watermark information matrix of the target channel image block according to the target watermark information embedded in each second sub-image block; The target watermark information matrix is ​​processed according to the second preset sequence and the preset decoding information to obtain embedded original target watermark information.

5. A method for extracting image watermark information, characterized in that: include: Obtaining a second transformation coefficient matrix corresponding to each second sub-image block in a plurality of second sub-image blocks of a target channel image block in a target image; The target channel image block in the target image has watermark information embedded therein; the second sub-image block is an image block obtained by segmenting the target channel image block, and the size and number of the second sub-image blocks are equal to the size and number of the first sub-image blocks; the second sub-image block is subjected to discrete cosine transform to obtain the second transform coefficient matrix; Determining target watermark information embedded in each second sub-image block according to the similarity between a preset detection matrix and the second transformation coefficient matrix; The preset detection matrix includes a first detection matrix and a second detection matrix, and the first detection matrix and the second detection matrix are both matrices of the same size as the second transformation coefficient matrix; in the first detection matrix, the digital information embedded in the position corresponding to the target row and column position area is -1, and the other positions are 0; in the second detection matrix, the digital information embedded in the position corresponding to the target row and column position area is 1, and the other positions are 0; when performing detection, the first similarity between the first detection matrix and the second transformation coefficient matrix to be detected and the second similarity between the second detection matrix and the second transformation coefficient matrix to be detected are respectively obtained, and the first similarity is compared with the second similarity; when the first similarity is greater than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the first detection matrix, and the corresponding embedded target watermark information is 0; when the first similarity is less than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the second detection matrix, and the corresponding embedded target watermark information is 1; Obtaining a target watermark information matrix of the target channel image block according to the target watermark information embedded in each second sub-image block; Processing the target watermark information matrix according to the second preset sequence and the preset decoding information to obtain embedded original target watermark information; The target image and the first sub-image block are obtained by the following method: Obtaining an image to be processed and a watermark template matrix, wherein each element in the watermark template matrix corresponds to a digital watermark information; Segmenting the target embedded channel image block in the image to be processed to obtain a plurality of first sub-image blocks of the target embedded channel image block; Determine a first transformation coefficient matrix corresponding to each first sub-image block in a plurality of first sub-image blocks, wherein each element in the first transformation coefficient matrix corresponds to a first transformation coefficient; According to the digital watermark information in the watermark template matrix, adjusting the first transform coefficients in the target row and column position area in the first transform coefficient matrix to obtain a first target transform coefficient matrix corresponding to each first sub-image block; A target image after embedding watermark information is obtained according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix.

6. A device for extracting image watermark information, characterized in that: include: A second acquisition module, used for acquiring a second transformation coefficient matrix corresponding to each second sub-image block in a plurality of second sub-image blocks of a target channel image block in a target image; The target channel image block in the target image has watermark information embedded therein; the second sub-image block is an image block obtained by segmenting the target channel image block, and the size and number of the second sub-image blocks are equal to the size and number of the first sub-image blocks; the second sub-image block is subjected to discrete cosine transform to obtain the second transform coefficient matrix; A second processing module, configured to obtain a similarity between the preset detection matrix and the second transformation coefficient matrix according to elements in the preset detection matrix and elements in the second transformation coefficient matrix; Determining target watermark information to be embedded in each second sub-image block according to the similarity; The preset detection matrix includes a first detection matrix and a second detection matrix, and the first detection matrix and the second detection matrix are both matrices of the same size as the second transformation coefficient matrix; in the first detection matrix, the digital information embedded in the position corresponding to the target row and column position area is -1, and the other positions are 0; in the second detection matrix, the digital information embedded in the position corresponding to the target row and column position area is 1, and the other positions are 0; when performing detection, respectively obtain a first similarity between the first detection matrix and the second transformation coefficient matrix to be detected, and a second similarity between the second detection matrix and the second transformation coefficient matrix to be detected, and compare the first similarity with the The first similarity is compared with the second similarity; when the first similarity is greater than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the first detection matrix, and the corresponding embedded target watermark information is 0; when the first similarity is less than the second similarity, it is considered that the second transformation coefficient matrix of the second sub-image block is adjusted according to the second detection matrix, and the corresponding embedded target watermark information is 1; according to the target watermark information embedded in each second sub-image block, the target watermark information matrix of the target channel image block is obtained; the target watermark information matrix is ​​processed according to the second preset sequence and the preset decoding information to obtain the embedded original target watermark information; The second acquisition module is further used to acquire the target image and the first sub-image block, including: Obtaining an image to be processed and a watermark template matrix, wherein each element in the watermark template matrix corresponds to a digital watermark information; Segmenting the target embedded channel image block in the image to be processed to obtain a plurality of first sub-image blocks of the target embedded channel image block; Determine a first transformation coefficient matrix corresponding to each first sub-image block in a plurality of first sub-image blocks, wherein each element in the first transformation coefficient matrix corresponds to a first transformation coefficient; According to the digital watermark information in the watermark template matrix, adjusting the first transform coefficients in the target row and column position area in the first transform coefficient matrix to obtain a first target transform coefficient matrix corresponding to each first sub-image block; A target image after embedding watermark information is obtained according to the first target transformation coefficient matrix and the first sub-image block corresponding to the first target transformation coefficient matrix.

Citation Information

Patent Citations

  • Image watermark embedding method and extraction method and related method

    CN109191361A