A reversible double watermarking method for color images

By embedding robust watermarks using integer wavelet transformation and differential histogram translation in color images, and embedding fragile watermarks using prediction error expansion, the problem of single and poor robustness of existing watermark solutions is solved, and the reversible double watermark embedding and extraction of images is realized, providing robustness and tamper detection capabilities.

CN113763226BInactive Publication Date: 2025-04-29HAINAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111094431.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-17
Publication Date
2025-04-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing watermark scheme has a single function, which will cause irreversible distortion to the host image, and the reversible watermark scheme is poorly robust.

Method used

A reversible double watermark method suitable for color images is adopted, and robust watermarks are embedded through integer wavelet transformation and differential histogram translation, and fragile watermarks are embedded using prediction error expansion to achieve embedding and extraction of double watermarks.

Benefits of technology

This method can restore the embedded watermarked image without being attacked, providing robustness and copyright protection, and can perform tamper detection and positioning, which is suitable for scenarios with high requirements for image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113763226B_ABST
    Figure CN113763226B_ABST
Patent Text Reader

Abstract

The invention relates to a reversible double watermark method suitable for color images, comprising the embedding of robust watermark, the extraction of robust watermark, the embedding of fragile watermark, the extraction of fragile watermark and image restoration; in the process of robust watermark embedding, the method comprises using a pre-embedding method to generate an embedding position map, using integer wavelet transform to increase robustness, and using a differential histogram shift method to embed the robust watermark; in the robust watermark extraction, the method comprises using an inverse integer wavelet transform and a differential histogram shift to extract the watermark; when embedding the fragile watermark, a hash sequence is used to generate the fragile watermark and the block prediction error expansion method is used to embed the fragile watermark; when extracting the fragile watermark, the hash sequences are compared, and if they are consistent, the watermark map is restored, and if they are inconsistent, a tampering detection positioning map is generated to locate the tampering position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of image digital watermarking and relates to a reversible double watermarking method for color images. Background Art

[0002] The development of Internet technology enables digital multimedia to be transmitted to everyone in real time through the Internet. Digital media complements traditional media and has a profound impact on people's lives. In the digital world, even non-professional users can use many tools to process digital images. Since the means of copyright infringement are very diverse, the process of protecting rights is often complicated. The reason is that the copyright owner did not take effective measures to prevent infringement in advance. Digital watermarking has been recognized as an effective way to ensure the authenticity and integrity of images.

[0003] At present, watermark technology can be divided into zero watermark, reversible watermark, and irreversible watermark according to whether the original image can be restored. Zero watermark is to extract the features of the original image and use the intellectual property protection center to store the image embedded with the watermark. The original image is not embedded with watermark during the whole process, and the original image will not be damaged. Reversible watermark embeds watermarks by using some reversible methods. After getting the image embedded with the watermark, the image embedded with the watermark can be restored to the original image through the recovery operation. The irreversible watermark method will inevitably have a certain impact on the host image after embedding the watermark into the host image. In the fields of medicine, remote sensing, etc., high-fidelity image watermarks are required. Reversible watermarks can solve the problem of image distortion and do not require a special intellectual property protection center, but the robustness of reversible watermarks is generally not good. According to the function, watermarks can be divided into robust watermarks and fragile watermarks. The main purpose of robust watermarks is copyright protection, and the main purpose of fragile watermarks is tampering detection. Most of the current watermarking schemes only focus on one point. There are few robust and fragile comprehensive watermarking schemes, and there is no reversible solution for the existing robust and fragile double watermarking schemes, which will cause irreversible distortion to the host image.

[0004] In summary, the current watermarking schemes have the disadvantages of single function, irreversible distortion of the host image, and poor robustness of reversible watermarking schemes. Summary of the invention

[0005] In order to solve the problem that the watermarking scheme has a single function, will cause distortion to the image, and the reversible scheme has poor robustness, the present invention provides a reversible double watermarking method for color images. The problem of single watermarking function is improved, and a reversible method is used for embedding. The image after embedding the watermark can be restored without being attacked. The technical solution is as follows:

[0006] The main steps of embedding a reversible double watermark method suitable for color images are as follows:

[0007] (1) The color image is divided into three layers: R, G, and B. The difference values ​​of the R and G layers are calculated using integer wavelet transform (IWT) and histogram methods, and pre-embedded to determine the embedding position map;

[0008] (2) Perform three IWT transformations on the position to be embedded, and use the differential histogram shift method to embed the robust watermark into the R layer and G layer;

[0009] (3) The R layer and the G layer after the watermark is embedded are divided into blocks to generate hash sequences as fragile watermarks, and the B layer is divided into blocks to perform prediction error expansion to embed the fragile watermark, and a prediction error extension length map is generated.

[0010] The main steps of extracting and restoring a reversible double watermark method suitable for color images are as follows:

[0011] (1) The suspicious image is divided into three layers: R, G, and B. The R and G layers are used to extract robust watermarks using IWT and differential histogram according to the embedding position map;

[0012] (2) Generate hash sequence H1 using R layer and G layer of the suspicious image, and extract hash sequence H2 of B layer of the suspicious image using block prediction error extension method according to prediction error extension length map;

[0013] (3) Compare H1 and H2. If they are consistent, restore the watermark and obtain the restored image.

[0014] (4) If the comparison results of H1 and H2 are inconsistent, it proves that the image has been tampered with. Tampering detection is performed to obtain a tampering detection positioning map. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the specific technical solutions of the present invention, the accompanying drawings involved in the present invention will be described below.

[0016] Figure 1 It is a flow chart of the embedding process of the reversible double watermarking method;

[0017] Figure 2 It is a flow chart of the extraction process of the reversible double watermark method;

[0018] Figure 3 It is an embedded graph generation flow chart. DETAILED DESCRIPTION

[0019] The present invention will be described below in conjunction with the accompanying drawings.

[0020] The present invention proposes a reversible dual watermarking method for color images. The scheme is robust and can resist common robust attacks to achieve copyright protection. The fragile watermark can detect and locate tampering. The fully reversible watermarking scheme can be applied to medical, remote sensing and other scenarios with high requirements on image quality.

[0021] The host image is divided into three layers: R, G, and B. After the robust watermark image is scrambled, the embedding position map is generated using the pre-embedding method to determine the embedding position. The robust watermark is embedded using integer wavelet transform and differential histogram shift according to the embedding position map. After the robust watermark is embedded, the hash sequence is generated using the embedded R' and G' layer blocks, and then embedded into the B layer using the prediction error expansion method to complete the embedding of the fragile watermark. When extracting the watermark, the watermarked image is divided into three layers, and the hash sequence H1 is generated using the R' and G' layer blocks; then the hash sequence H2 in the B' layer is extracted using the prediction error length map. H1 and H2 are compared to generate a tampering detection map, and then the robust watermark is extracted.

[0022] The specific operation process of the present invention is as follows:

[0023] The watermark embedding process first embeds the robust watermark. In the present invention, the robust watermark is embedded by using the differential histogram shift method. In the embedding process of the present invention, the R layer and the G layer use the same position map. First, the position with a small differential value is embedded. When the histogram is shifted, the smaller absolute value of the maximum prediction error is taken, and this value is set as T, thereby taking a smaller embedding strength, and this value is set as G. The specific embedding process is as follows:

[0024] 1. Calculate the difference value of R layer and G layer in blocks to obtain sequences S_R and S_G. Add the two sequences bit by bit to generate sequence S. Sort the S sequence from small to large to obtain sequence S_sort. When embedding, embed according to the order of S_sort;

[0025] 2. Because the R and G layers use the same position map for embedding, a 2-bit watermark can be embedded at a time. The number of blocks to be embedded is calculated by the length of the watermark sequence len_w: Some blocks may not be embedded due to overflow after embedding, so a pre-embedding is performed before formal embedding. The number of pre-embedded blocks (Num_block)^p=a×Num_block, where a≥1;

[0026] 3. Let T be the threshold of histogram shift, G be the robust watermark embedding strength, and T^p be the predicted shift threshold. Take the first (Num_block)^p positions in S_sort, find the corresponding blocks in R and G, calculate the difference value Dt(l) of these blocks in the two layers of R and G, and take T^p = Max(Dt(l)). Only when the offset B is greater than T can it be guaranteed that there will be no misjudgment during extraction. The predicted offset B^p is the sum of the embedding strength and the predicted shift threshold T^p;

[0027] 4. Use the B^p generated in step 3 to pre-embed the first (Num_block)^p blocks in S_sort. If the watermark capacity can embed all watermark sequences, generate the location map Map_local, set B = B^p, T = T^p, otherwise increase the value of a and return to step 2. The flowchart for generating Map_local is attached. Figure 3 ;

[0028] 5. According to Map_local, perform IWT on each small block of the R and G layers, take LL and use the block difference histogram translation method to embed the robust watermark;

[0029] 6. Each embedded block is subjected to inverse IWT and replaces the block of the original image to generate a watermarked image after embedding the robust watermark.

[0030] After embedding the robust watermark, the fragile watermark is embedded. The present invention uses an improved prediction error expansion scheme, proposes a method for recording the prediction error length map, and only embeds the position where the watermark sequence is 1. The specific process of fragile watermark embedding is as follows:

[0031] 1. Divide the R' and G' layers of the image embedded with the robust watermark into blocks (taking 8×8 small blocks as an example), generate a hash value for each small block, and intercept the first M bits of the hash value. Use the diamond prediction method to predict the embedding position. Each group has M prediction positions. Use the prediction error expansion embedding method for embedding, and each small block can embed an M bit watermark;

[0032] 2. Generate a prediction error length map Map_len. Map_len(x, y) is the block at position (x, y) in Map_len. Set a S_len. During the embedding process, if the binary sequence length of the prediction error value is greater than S_len or overflows after embedding the watermark, the position will not be embedded and the value recorded in the prediction error length map is -1. Otherwise, the prediction error length map records the binary sequence length of the prediction error value as

[0033] 3. Embed the fragile watermark at the position where Map_len(x, y)≠-1 in the prediction error length map. In the present invention, only the embedding operation is performed at the position where w(i)=1.

[0034] At this point, the watermark embedding is complete. Next, the watermark will be extracted and restored. First, the fragile watermark is extracted. The specific watermark extraction process is as follows:

[0035] 1. Divide the watermarked image into blocks, and use the R' and G' layers to generate a hash sequence for each block;

[0036] 2. Use the prediction error expansion method to calculate the prediction error length, and compare the calculated prediction error length with the record in the prediction error length map to extract the watermark. When Map_len(x, y) = -1, w(i) = -1; when Map_len(x, y) = P_len, w(i) = 0; when Map_len(x, y) ≠ P_len, w(i) = 1;

[0037] 3. Compare the extracted hash sequence of each block with the generated hash sequence to generate an initial tampering detection graph;

[0038] 4. Tamper detection map recovery. Set Num_skip (0≤Num_skip≤M). When Num_skip positions in a single n×n small block are not embedded (i.e. Map_len(x, y) corresponding to the position = -1), mark the block as a suspected block. Review all suspected blocks in the initial tamper detection map to determine whether they have been tampered with.

[0039] If the image has not been tampered with, the fragile watermark is restored. The fragile watermark recovery process is as follows:

[0040] 1. Use diamond prediction to calculate the prediction error value Pe, and restore it according to the extracted watermark sequence. When the watermark sequence is 0, no change is required. When the watermark sequence is 1, restore it. Calculate the prediction error recovery value Pe^r. When the watermark sequence is 0, Pe^r = Pe; when the watermark sequence is 1

[0041] 2. Calculate the restored central pixel value based on the calculated prediction error restoration value Pe^r to restore the image. The central pixel restoration value of the image is C^r, Pc is the prediction value, Pe^r is the restored prediction error, C^r=Pc+Pe^r;

[0042] 3. Use the calculated restoration value C^r to restore the previously embedded central pixel blocks one by one to restore the image.

[0043] After the fragile watermark is extracted, the robust watermark is extracted. The extraction process is as follows:

[0044] 1. Extract the watermark from the image after embedding the watermark according to the embedding position map. Three methods of extracting watermarks are used to extract the watermark. The first two methods use the control range method, and the third method uses the K-means clustering algorithm to classify the generated prediction errors and histograms;

[0045] 2. For the three different watermark sequences extracted by the three methods, the pixel value of each watermark sequence pixel block is determined by majority voting mechanism;

[0046] If the image has not been tampered with, robust watermark recovery is performed on the image after fragile watermark recovery to obtain the recovered image.

[0047] The recovery process is as follows:

[0048] 1. Use the embedding position map to obtain the blocks with watermarks embedded in the R and G layers;

[0049] 2. Perform IWT transformation on these blocks to obtain the LL layer, and restore them using the histogram shift method;

[0050] 3. After restoration, perform inverse IWT and replace the corresponding blocks in the watermark image to generate the restored image.

Claims

1. A reversible double watermarking method for color images, comprising the following steps: S1. Robust watermark embedding: The host image is divided into three layers of R, G, and B. After the robust watermark image is scrambled, an embedding position map is generated using a pre-embedding method to determine the embedding position. The robust watermark is embedded according to the embedding position map using integer wavelet transform and differential histogram shift. S2. Fragile watermark embedding: After embedding the robust watermark, the hash sequence is generated using the embedded R' and G' layer blocks, and then embedded into the B layer using the prediction error expansion method to complete the embedding of the fragile watermark; S3. Extraction of fragile watermark: Divide the image after embedding the watermark into blocks, and generate a hash sequence for each small block using the R' and G' layers; calculate the length of the prediction error by using the prediction error expansion method, and compare the calculated prediction error length with the record in the prediction error length map to extract the watermark; compare the extracted hash sequence of each block with the generated hash sequence to generate an initial tampering detection map to determine whether the image has been tampered with; S4. Fragile watermark recovery: Use diamond prediction to calculate the prediction error value Pe, and recover it according to the extracted watermark sequence. When the watermark sequence is 0, no change is required. When the watermark sequence is 1, recovery is performed; calculate the prediction error recovery value Pe^r. When the watermark sequence is 0, Pe^r = Pe; when the watermark sequence is 1, The image is restored by calculating the restored central pixel value according to the calculated prediction error restoration value Pe^r, and the central pixel restoration value is obtained as C^r, where Pc is the prediction value, Pe^r is the restored prediction error, and C^r=Pc+Pe^r; the image can be restored by using the calculated restoration value C^r to restore the previously embedded central pixel blocks in sequence; S5. Robust watermark extraction: Three watermark extraction schemes are used to extract watermarks. The first two schemes use the control range method, and the third scheme uses the K-means clustering algorithm to classify the generated prediction errors and histograms. For the three different watermark sequences extracted by the three methods, the majority voting mechanism is used to determine the pixel value of each watermark sequence pixel block; S6. Robust watermark recovery: Use Map_local to obtain the blocks with watermarks embedded in the R and G layers; restore the robust watermark using integer wavelet inverse transform and differential histogram shift according to the embedding position map; The specific process of robust watermark embedding is as follows: S11. The R layer and the G layer calculate the difference value in blocks to obtain the sequences S_R and S_G. The two sequences are added bit by bit to generate the sequence S. The S sequence is sorted from small to large to obtain the sequence S_sort. When embedding, the sequences are embedded in the order of S_sort. S12. Because the R and G layers are embedded using the same position map, a 2-bit watermark can be embedded at a time. The number of blocks to be embedded can be calculated using the watermark sequence length len_w Some blocks may not be embedded due to overflow after embedding, so a pre-embedding is performed before formal embedding. The number of pre-embedded blocks (Num_block)^p=a×Num_block, where a≥1; S13. Let T be the threshold of histogram shift, G be the robust watermark embedding strength, T^p be the predicted shift threshold, take the first (Num_block)^p positions in S_sort, find the corresponding blocks in R and G, calculate the difference value Dt(l) of these blocks in the two layers of R and G, and take T^p=Max(Dt(l)). Only when the offset B is greater than T can it be guaranteed that there will be no misjudgment during extraction. The predicted offset B^p is the sum of the embedding strength and the predicted shift threshold T^p; S14. Use the B^p generated in step S13 to pre-embed the first (Num_block)^p blocks in S_sort. If the watermark capacity can embed all watermark sequences, generate a location map Map_local, set B = B^p, T = T^p, otherwise increase the value of a and return to step S12; S15. According to Map_local, perform IWT on each small block of the R and G layers, take LL and use the block difference histogram translation method to embed the robust watermark; S16. Perform inverse IWT on each embedded block and replace the block of the original image to generate a watermarked image after embedding the robust watermark; The specific process of fragile watermark embedding is as follows: S21. Divide the R' and G' layers of the image embedded with the robust watermark into blocks, generate a hash value for each small block, and intercept the first M bits of the hash value. Use the diamond prediction method to predict the embedding position. Each group has M prediction positions. Use the prediction error expansion embedding method to embed. Each small block can embed an M bit watermark. S22. Generate a prediction error length map Map_len, where Map_len(x,y) is the block at position (x,y) in Map_len, set a S_len, and during the embedding process, if the binary sequence length of the prediction error value is greater than S_len or overflows after embedding the watermark, the position will not be embedded, and the value recorded in the prediction error length map is -1, otherwise the prediction error length map records the binary sequence length of the prediction error value as S23. Embed a fragile watermark at the position where Map_len(x,y)≠-1 in the prediction error length map.