Reversible digital watermarking method and device

By improving the grouping and consistency judgment of the diamond predictor, multi-directional prediction is adaptively adopted, and pixel points with small fluctuations are preferred, which solves the problem of the diamond predictor in the prior art when the four-point consistency is poor and the high embedding capacity is high. The prediction accuracy problem achieves smaller prediction errors and visual differences.

CN113919996BActive Publication Date: 2024-12-24INST OF INT RELATIONS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010658133.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-09
Publication Date
2024-12-24
Estimated Expiration
2040-07-09

AI Technical Summary

Technical Problem

The existing diamond predictor has poor prediction accuracy when pixels with poor consistency of four points, while the traditional fluctuation value sorting strategy fails when high embedding capacity and fails to effectively utilize the consistency in the diagonal direction.

Method used

By dividing the pixels around the central pixel value into horizontal, vertical, positive diagonal and negative diagonal groups, calculate the local consistency difference, judge the direction consistency, and adaptively adopt the horizontal, vertical and diagonal directions. Pixel prediction, a third pixel is introduced to improve prediction accuracy, and pixels with smaller fluctuations are preferred when high embedding capacity are selected.

Benefits of technology

The effect of prediction error is improved, the distortion and visual differences of digital image carriers are reduced, and the adaptability and invisibility of the diamond predictor are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113919996B_ABST
    Figure CN113919996B_ABST
Patent Text Reader

Abstract

The present invention discloses a reversible digital watermarking method and device based on an improved diamond predictor and prediction error expansion, the method comprising: dividing the pixels around the central pixel value into a horizontal group, a vertical group, two positive diagonal groups and two negative diagonal groups, and calculating the absolute value of the difference between each pair of pixels of local consistency; judging whether the horizontal and vertical directions have strong consistency or whether the two directions have strong overall consistency; when the horizontal and vertical directions have strong consistency, performing pixel prediction through two neighboring pixel points to determine whether to introduce a third pixel; when the two directions have strong overall consistency, performing pixel prediction through four neighboring pixel points to determine whether there are pixels inconsistent with the two selected pixels; respectively predicting the prediction value of the target pixel according to the comparison result and the determination result. The method obtains better effects when the prediction error is expanded, and reduces the distortion and visual difference of the digital image carrier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of reversible digital watermarking, and in particular to a reversible digital watermarking method and device based on an improved diamond predictor and prediction error expansion. Background Art

[0002] Related technologies, Sachnev et al. proposed to construct a diamond predictor for prediction by adding the average of the four adjacent points in the upper, lower, left and right directions. In a single diamond unit, the four vertex pixels of the diamond are added and averaged to predict the central pixel. At the same time, a definition of pixel fluctuation value is proposed. Pixels with smaller fluctuation values ​​are embedded first according to the ascending order of fluctuation values ​​to reduce the distortion introduced by watermark embedding. Dragoi developed a differential extended reversible watermark algorithm based on local prediction, which predicts the central pixel by calculating the weighted sum of surrounding pixels. Specifically, the optimal weight is obtained by solving the linear regression problem. Dragoi improved the prediction performance in the texture area. Once the pixel consistency of a diamond unit in the horizontal or vertical direction exceeds a predetermined threshold, the values ​​of two pixels in the horizontal direction or two pixels in the vertical direction are averaged according to the local consistency of the horizontal pixels or the vertical pixels for prediction, because they are considered to be more relevant to the target pixel. Otherwise, the diamond predictor is constructed to generate the predicted value of the central pixel in the four-point summing and averaging method.

[0003] However, the diamond predictor that uses the average of the four vertices for prediction will result in poor prediction accuracy for pixels with poor consistency among the four points. Although the fluctuation value sorting method is used to solve this problem, the pixels are sorted according to the fluctuation defined by the cell, and the cells with smaller fluctuation values ​​are preferentially embedded with watermarks. If the number of watermark bits to be embedded is small enough, this strategy can ensure better imperceptibility. However, once the upper limit of the embedding capacity is reached, it is inevitable that watermark bits will be embedded using cells with larger fluctuations, which means that neighboring pixels with weaker correlation will still be used for prediction.

[0004] On the other hand, pixel consistency along the horizontal and vertical directions is used to improve the prediction accuracy. In this case, the prediction accuracy is no longer related to the previously defined fluctuation, so the traditional fluctuation value ranking strategy no longer works. In addition, in this work, only the local consistency of the diamond predictor in the horizontal and vertical directions is considered, and the diagonal direction of the diamond predictor is not well considered and used for prediction. Summary of the invention

[0005] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.

[0006] Therefore, an object of the present invention is to propose a reversible digital watermarking method based on an improved diamond predictor and prediction error expansion, which method achieves better results when the prediction error is expanded and reduces the distortion and visual difference of the digital image carrier.

[0007] Another object of the present invention is to provide a reversible digital watermarking device based on an improved diamond predictor and prediction error expansion.

[0008] To achieve the above-mentioned purpose, an embodiment of the present invention proposes a reversible digital watermarking method based on an improved diamond predictor and prediction error expansion, comprising the following steps: dividing the pixels around the central pixel value into a horizontal group, a vertical group, two positive diagonal groups and two negative diagonal groups, and calculating the absolute value of the difference between each pair of pixels of local consistency; judging whether the horizontal and vertical directions have strong consistency or whether the two directions have strong overall consistency; when the horizontal and vertical directions have strong consistency, pixel prediction is performed through two neighboring pixel points, wherein a third pixel is introduced according to a consistency threshold T2 for comparison with the selected two pixels to determine whether the third pixel is introduced, and the predicted value of the target pixel is predicted according to the comparison result; when the two directions have strong overall consistency, pixel prediction is performed through four neighboring pixel points, wherein two pixels with greater local uniformity are selected, and whether there are pixels inconsistent with the selected two pixels is determined according to the consistency threshold T3, and the predicted value of the target pixel is predicted according to the determination result. .

[0009] The reversible digital watermarking method based on the improved diamond predictor and prediction error expansion of the embodiment of the present invention improves the diamond predictor, so that in the reversible digital watermarking technology based on prediction error expansion, a pixel prediction set with high consistency in the horizontal, vertical and diagonal directions can be adaptively used for pixel prediction to obtain a smaller prediction error, thereby obtaining a better effect when the prediction error is expanded, reducing the distortion and visual difference of the digital image carrier.

[0010] In addition, the reversible digital watermarking method based on the improved diamond predictor and prediction error expansion according to the above embodiment of the present invention may also have the following additional technical features:

[0011] In one embodiment of the present invention, introducing a third pixel according to the consistency threshold T2 and comparing it with the selected two pixels to determine whether to introduce the third pixel, and predicting a predicted value of the target pixel according to the comparison result, comprises:

[0012] If the absolute value m1 of the difference between pixels in the horizontal group is less than the absolute value m2 of the difference between pixels in the vertical group, then two pixel points along the horizontal direction are selected, and the average value n3 of the absolute values m3 and m5 of the differences between pixels in each of the two positive diagonal groups, and the average value n4 of the absolute values m4 and m6 of the differences between pixels in each of the two negative diagonal groups are calculated. Denotes taking the integer part, where,

[0013] If n3 < n4 and n3 ≤ T2, then the upper vertical direction pixel value v i-1,j Has a high consistency with the first prediction set {the left horizontal direction pixel value v i,j-1 , the right horizontal direction pixel value v i,j+1}}, add v i-1,j To the first prediction set, then the predicted value is:

[0014] If n3 > n4 and n4 ≤ T2, then the lower vertical direction pixel value v i+1,j Maintains a high consistency with the first prediction set {v i,j-1 , v i,j+1}}, add v i+1,j To the first prediction set, then the predicted value is:

[0015] If neither v i-1,j Nor v i+1,j Has a high consistency with the first prediction set {v i,j-1 , v i,j+1}}, then predict the predicted value of the target pixel according to the average value of v i-1,j And v i+1,j , where the predicted value is:

[0016] In an embodiment of the present invention, introducing a third pixel according to the consistency threshold T2 to compare with the selected two pixels to determine whether to introduce the third pixel, and predicting the predicted value of the target pixel according to the comparison result further includes:

[0017] If m1 > m2, then select v i-1,j And v i+1,j Along the vertical direction, and calculate the average value n5 of m4 and m5, and the average value n6 of m3 and m6 respectively, Where,

[0018] If n5 < n6 and n5 ≤ T2, then v i,j-1 Maintains a high consistency with the second prediction set {v i-1,j , v i+1,j} and add vi,j-1 If it is added to the second prediction set, then the predicted value is:

[0019] If n5 > n6 and n6 ≤ T2, then v i,j+1 is highly consistent with the second prediction set {v i-1,j , v i+1,j}, and v i,j+1 is added to the second prediction set, then the predicted value is:

[0020] If neither v i,j-1 nor v i,j+1 is highly consistent with the second prediction set {v i-1,j , v i+1,j}, then the predicted value of the target pixel is predicted according to the average value of v i-1,j and v i+1,j , where the predicted value is:

[0021] In an embodiment of the present invention, the method of selecting two pixels with greater local uniformity, determining whether there are pixels inconsistent with the selected two pixels according to the consistency threshold T3, and predicting the predicted value of the target pixel according to the determination result includes:

[0022] If m1 < m2, then select v i,j-1 and v i,j+1 , and remove the pixels inconsistent with the third prediction set {v i,j-1 , v i,j+1} to generate the predicted value:

[0023]

[0024] If m1 > m2, then select v i-1,j and v i+1,j , and remove the pixels inconsistent with the fourth prediction set {v i-1,j , v i+1,j} to generate the predicted value:

[0025]

[0026] Otherwise, predict by the average value of the pixel values of the neighboring pixel points, and the predicted value obtained is:

[0027] In one embodiment of the present invention, it also includes: calculating the fluctuation value of the predicted value of the target pixel, and after calculating the fluctuation value of each processed pixel according to the surrounding upper, lower, left and right adjacent points, arranging the pixel points in ascending order according to the fluctuation, and embedding digital watermarks in sequence.

[0028] To achieve the above-mentioned purpose, another embodiment of the present invention proposes a reversible digital watermarking device based on an improved diamond predictor and prediction error expansion, including: a calculation module, which is used to divide the pixels around the central pixel value into a horizontal group, a vertical group, two positive diagonal groups and two negative diagonal groups, and calculate the absolute value of the difference between each pair of pixels with local consistency; a judgment module, which is used to judge whether the horizontal and vertical directions have strong consistency or whether the two directions have strong overall consistency; a prediction module, which is used to perform pixel prediction through two neighboring pixel points when the horizontal and vertical directions have strong consistency, wherein a third pixel is introduced according to a consistency threshold T2 for comparison with the two selected pixels to determine whether the third pixel is introduced, and the predicted value of the target pixel is predicted according to the comparison result; when the two directions have strong overall consistency, pixel prediction is performed through four neighboring pixel points, wherein two pixels with greater local uniformity are selected, and whether there are pixels inconsistent with the two selected pixels is determined according to the consistency threshold T3, and the predicted value of the target pixel is predicted according to the determination result.

[0029] The reversible digital watermarking device based on the improved diamond predictor and prediction error expansion of the embodiment of the present invention improves the diamond predictor, so that it can adaptively use a pixel prediction set with high consistency in the horizontal, vertical and diagonal directions to perform pixel prediction in the reversible digital watermarking technology based on prediction error expansion, thereby obtaining a smaller prediction error, thereby obtaining a better effect when the prediction error is expanded, and reducing the distortion and visual difference of the digital image carrier.

[0030] In addition, the reversible digital watermarking device based on the improved diamond predictor and prediction error expansion according to the above embodiment of the present invention may also have the following additional technical features:

[0031] In one embodiment of the present invention, the prediction module is used to:

[0032] If the absolute value m1 of the difference between the pixels in the horizontal group is less than the absolute value m2 of the difference between the pixels in the vertical group, two pixel points along the horizontal direction are selected, and the average value n3 of the absolute values ​​m3 and m5 of the difference between the pixels in each of the two positive diagonal groups, and the average value n4 of the absolute values ​​m4 and m6 of the difference between the pixels in each of the two negative diagonal groups are calculated. It means to take the integer, where

[0033] If n3 <n 4,And if n3 ≤ T2, then the upper vertical pixel value v i-1,j has a high consistency with the first prediction set {the left horizontal pixel value v i,j-1 , the right horizontal pixel value v i,j+1}. Add v i-1,j to the first prediction set, then the predicted value is:

[0034] If n3 > n4 and n4 ≤ T2, then the lower vertical pixel value v i+1,j has a high consistency with the first prediction set {v i,j-1 , v i,j+1}. Add v i+1,j to the first prediction set, then the predicted value is:

[0035] If neither v i-1,j nor v i+1,j has a high consistency with the first prediction set {v i,j-1 , v i,j+1}, then predict the predicted value of the target pixel according to the average value of v i-1,j and v i+1,j , where the predicted value is:

[0036] In an embodiment of the present invention, the prediction module is further configured to:

[0037] If m1 > m2, then select v i-1,j and v i+1,j vertically, and calculate the average value n5 of m4 and m5, and the average value n6 of m3 and m6 respectively, wherein,

[0038] If n5 < n6 and n5 ≤ T2, then v i,j-1 has a high consistency with the second prediction set {v i-1,j , v i+1,j}, and add v i,j-1 to the second prediction set, then the predicted value is:

[0039] If n5 > n6 and n6 ≤ T2, then v i,j+1 has a high consistency with the second prediction set {v i-1,j , v i+1,j}, and add v i,j+1 to the second prediction set, then the predicted value is:

[0040] If vi,j-1 and v i,j+1 are not highly consistent with the second prediction set {v i-1,j , v i+1,j}, then predict the predicted value of the target pixel according to the average value of v i-1,j and v i+1,j , where the predicted value is:

[0041] In an embodiment of the present invention, the prediction module is further configured to:

[0042] If m1 < m2, then select v i,j-1 and v i,j+1 , and remove the pixels inconsistent with the third prediction set {v i,j-1 , v i,j+1}, and generate the predicted value:

[0043]

[0044] If m1 > m2, then select v i-1,j and v i+1,j , and remove the pixels inconsistent with the fourth prediction set {v i-1,j , v i+1,j}, and generate the predicted value:

[0045]

[0046] Otherwise, predict by the average value of the pixel values of the neighboring pixel points, and the predicted value is:

[0047] In an embodiment of the present invention, it further includes: an embedding module, configured to calculate the fluctuation value of the predicted value of the target pixel, and after calculating the fluctuation values of each processed pixel according to the surrounding top, bottom, left, and right adjacent points, arrange the pixel points in ascending order according to the volatility, and sequentially embed digital watermarks.

[0048] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be understood through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The above and / or additional aspects and advantages of the present invention will become apparent and be readily understood from the following description of the embodiments in conjunction with the drawings, wherein:

[0050] Figure 1 is an example diagram of pixel set classification in the related art;

[0051] Figure 2An example diagram of a diamond unit of the related art;

[0052] Figure 3 A flowchart of a method based on an improved diamond predictor and prediction error expansion according to an embodiment of the present invention;

[0053] Figure 4 A flowchart of a method based on an improved diamond predictor and prediction error expansion according to an embodiment of the present invention;

[0054] Figure 5 is a schematic diagram of a pixel unit to be predicted according to an embodiment of the present invention;

[0055] Figure 6 It is a schematic diagram of the structure of an improved diamond predictor and a prediction error expansion device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0056] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0057] This application is based on the inventor's understanding and discovery of the following problems:

[0058] Reversible digital watermarking technology is a digital watermarking algorithm that supports lossless recovery of digital image carriers. The sender embeds the digital watermark through the digital watermark embedding method to ensure that the carrier image is imperceptible. When the receiver receives the digital image carrier containing the digital watermark, it uses the digital watermark extraction algorithm to extract the digital watermark while ensuring that the digital image carrier containing the digital watermark can restore the original digital image carrier. Due to the disadvantage of ordinary digital watermarking technology causing digital image damage after extraction, the lossless reverse recovery characteristics of this method are particularly suitable for occasions where sensitive images are tampered with, such as medical, military, high-fidelity digital media and other fields.

[0059] By establishing a diamond predictor and using the prediction error expansion method, it is an effective technology to realize the reversible digital watermark of digital images. It is divided into the pixel set classification stage, the fluctuation value sorting stage, the pixel prediction stage, the prediction pixel error expansion embedding stage, and the digital watermark extraction and digital image carrier recovery stage.

[0060] (1) Pixel set classification stage

[0061] First, the digital image carrier is divided into two sets, the point set and the cross set, in order not to destroy the adjacent pixel values ​​of the next prediction point, otherwise the reversible lossless restoration effect cannot be achieved. Therefore, according to Figure 1 As shown, the point set is processed first, and then stages (2)(3)(4)(5) are carried out according to the point set.

[0062] For each pixel in the point set, Figure 2 In this way, diamond units are formed and relevant rules are set for the upper, lower, left and right adjacent points to construct a diamond predictor to predict the central pixel value and calculate the fluctuation value sorting.

[0063] (2) Pixel prediction stage

[0064] Modify the central pixel v by the prediction i,j The upper, lower, left, and right adjacent pixel association information is used to establish rules. By setting rules, a diamond predictor is constructed to predict the central pixel through the surrounding adjacent pixels. The result is the predicted value

[0065] (3) Fluctuation value sorting stage

[0066] In order to minimize image distortion and visual perception after the digital watermark is not fully embedded, the definition of pixel fluctuation value must be determined first. The larger the fluctuation value, the greater the change in the point caused by modifying the point. The smaller the fluctuation value, the priority is given to predicting and modifying the point in the group. Therefore, the fluctuation value of the pixels in the first set point area is calculated according to the fluctuation value definition, and they are arranged in ascending order according to the fluctuation value, and then predicted, error expanded, and embedded in sequence.

[0067] (4) Prediction pixel error expansion and embedding stage

[0068] Actual pixel value v i,j Subtract the prediction error value The prediction error e is calculated according to the following formula i,j :

[0069]

[0070] The prediction error is expanded according to the following formula:

[0071] E i,j =2e i,j + b,

[0072] The digital watermark to be embedded is composed of a string of binary bits (0, 1), where b is the digital watermark bit 0 or 1 to be embedded.

[0073] The digital image carrier consists of the original pixel v i,j To the pixel V containing the digital watermark i,j The digital watermark is embedded in this process.

[0074]

[0075] (5) Extracting the digital watermark and restoring the digital image carrier

[0076] The pixels embedded with digital watermarks in the group are sorted in ascending order according to the fluctuation value and extracted one by one. i,j , since only the central pixel to be predicted and modified is changed, without changing its upper, lower, left and right adjacent points, the predicted value of this point is No change, calculate the prediction expansion error E' i,j :

[0077]

[0078] Extract digital watermark b:

[0079] b=E' i,j mod 2,

[0080] At the same time, the original prediction error is restored:

[0081]

[0082] Restore the original digital image carrier pixels:

[0083]

[0084] The present invention adopts an improved diamond predictor and prediction error expansion method, mainly designs an improved diamond predictor, and further proposes a corresponding prediction strategy to support a reversible watermarking algorithm based on prediction error expansion. Specifically, according to the consistency threshold, pixels along the horizontal, vertical and diagonal directions are adaptively adopted.

[0085] Considering the performance of diamond predictor, a fluctuation sorting based framework is proposed to support high fidelity reversible data hiding. The present invention proposes an improved diamond predictor and a corresponding fluctuation sorting strategy, both of which greatly improve the accuracy and imperceptibility of prediction.

[0086] Therefore, in the present invention, the problem is how to improve the diamond predictor so as to make more accurate predictions for diamond units with larger fluctuations, and to define more relevant fluctuation values ​​and provide better fluctuation sorting strategies. The present invention is a solution that considers the consistency of horizontal, vertical and diagonal directions at the same time.

[0087] The following describes a reversible digital watermarking method and apparatus based on an improved diamond predictor and prediction error expansion according to an embodiment of the present invention with reference to the accompanying drawings. First, the reversible digital watermarking method based on an improved diamond predictor and prediction error expansion according to an embodiment of the present invention will be described with reference to the accompanying drawings.

[0088] Figure 3 The flowchart of a reversible digital watermarking method based on an improved diamond predictor and prediction error expansion according to an embodiment of the present invention.

[0089] like Figure 3 As shown, the reversible digital watermarking method based on the improved diamond predictor and prediction error expansion includes the following steps:

[0090] In step S301, pixels around the central pixel value are divided into a horizontal group, a vertical group, two positive diagonal groups and two negative diagonal groups, and the absolute value of the difference between each pair of pixels of local consistency is calculated.

[0091] It is understandable that if Figure 4 As shown, the embodiment of the present invention uses a diamond predictor of pixels along the horizontal, vertical and diagonal directions adaptively according to the consistency threshold, mainly to increase the judgment of the diagonal direction.

[0092] Specifically: Figure 5 As shown, for Figure 5 The pixel unit shown in the figure will first be based on the central pixel value v i,j The surrounding pixels are divided into horizontal groups, vertical groups, two positive diagonal groups and two negative diagonal groups. i-1,j , v i+1,j , v i,j-1 , v i,j+1 They correspond to the four adjacent pixel values ​​of top, bottom (vertical direction), left and right (horizontal direction) respectively.

[0093] The absolute value of the difference between each pair of pixels for calculating local consistency is defined as mi(i∈[1,6]) as follows:

[0094]

[0095] In step S302, it is determined whether the horizontal and vertical directions have strong consistency or whether the two directions have strong overall consistency.

[0096] It is understandable that if Figure 4 As shown, the judgment is whether the horizontal and vertical directions have strong consistency or whether the two directions have strong overall consistency, so the calculation is:

[0097]

[0098]

[0099] M1=|n1-n2|

[0100] where n1 is the average value in the horizontal direction, n2 is the average value in the vertical direction, and the absolute value M1 of the difference between the horizontal average value and the vertical average value is compared with the cell consistency threshold T1. If M1 < T1, the overall consistency between the horizontal direction and the vertical direction is considered to be at a high level. If M1 ≥ T1, only one direction with higher local consistency is used for prediction. Therefore, the predicted value of the target pixel is defined as:

[0101]

[0102] where represents taking the integer part. In the embodiments of the present invention, the target pixels can be divided into two groups according to the number of pixels in the prediction variable, and each group is processed as follows:

[0103] In step S303, when there is strong consistency in the horizontal and vertical directions, pixel prediction is performed through two neighboring pixel points. Among them, according to the consistency threshold T2, a third pixel is introduced to compare with the selected two pixels to determine whether to introduce the third pixel, and the predicted value of the target pixel is predicted according to the comparison result.

[0104] It can be understood that for the pixels predicted by two neighboring nodes, the overall consistency between the horizontal direction and the vertical direction is considered to be at a low level. If only two pixels with higher local consistency are used to predict the target pixel, a large prediction error may be introduced. Therefore, the embodiments of the present invention consider the consistency along the diagonal direction, thereby trying to improve the prediction accuracy. According to the consistency threshold T2, a third pixel is introduced to compare with the selected two pixels to determine whether it should be included in the prediction variable, specifically as follows:

[0105] If m1 < m2, then select v i,j-1 and v i,j+1 two pixels in the horizontal direction, because the two pixel points in the horizontal direction have higher local consistency. Calculate the average values of m3 and m5, m4 and m6, representing the results n3 and n4 shown below,

[0106]

[0107] If n3 < n4 and n3 ≤ T2, then it is considered that v i-1,j has a high consistency with {v i,j-1 , v i,j+1}. Add v i-1,j to the prediction set, and define the predicted value as:

[0108]

[0109] If n3 > n4 and n4 ≤ T2, then v i+1,j is highly consistent with {v i,j-1 , v i,j+1}. Add v i+1,j to the prediction set, and define the predicted value as

[0110]

[0111] In other cases, neither v i-1,j nor v i+1,j is considered to be highly consistent with {v i,j-1 , v i,j+1}. In this case, only use the horizontal average of v i-1,j and v i+1,j to predict the target pixel as:

[0112]

[0113] If m1 > m2, then select v i-1,j and v i+1,j along the vertical direction because the two pixel points in the vertical direction have high local consistency. Calculate the averages of m4 and m5, and m3 and m6, denoted as the results n5 and n6 shown below.

[0114]

[0115] If n5 < n6 and n5 ≤ T2, then v i,j-1 is highly consistent with {v i-1,j , v i+1,j}. Add v i,j-1 to the prediction set, and define the predicted value as:

[0116]

[0117] Once n5 > n6 and n6 ≤ T2, then v i,j+1 is highly consistent with {v i-1,j , v i+1,j}. Add v i,j+1 to the prediction set, and define the predicted value as:

[0118]

[0119] In other cases, neither v i,j-1 nor v i,j+1 is considered to be highly consistent with {v i-1,j , v i+1,j}. In this case, only use v i-1,j and v i+1,j to predict the target pixel as:

[0120]

[0121] In step S304, when there is a strong overall consistency in both directions, pixel prediction is performed through four neighboring pixel points. Among them, two pixels with greater local uniformity are selected, and it is determined whether there are pixels inconsistent with the two selected pixels according to the consistency threshold T3, and the predicted value of the target pixel is predicted according to the determination result.

[0122] It can be understood that for the pixels predicted by four neighboring nodes, the overall consistency between the horizontal direction and the vertical direction is considered to be at a relatively high level. To improve the prediction accuracy, in the embodiments of the present invention, two pixels with greater local uniformity are first selected, and then it is determined whether any third pixel should be removed from the prediction set according to the consistency threshold T3, as follows:

[0123] If m1 < m2, then v is first selected i,j-1 and v i,j+1 . Remove the pixels inconsistent with the selected prediction set {v i,j-1 , v i,j+1}, and generate a predicted value:

[0124]

[0125] If m1 > m2, then v is first selected i-1,j and v i+1,j . Remove the pixels inconsistent with the selected prediction set {v i-1,j , v i+1,j}, and generate a predicted value:

[0126]

[0127] Otherwise, predict by the mean of four adjacent points:

[0128]

[0129] The improved diamond predictor in the embodiments of the present invention can obtain a good prediction effect compared with the existing diamond predictor, providing a smaller prediction error e i,j , so as to reduce the prediction error expansion value E i,j , and reduce the visual difference of the digital image carrier.

[0130] It should be noted that the consistency thresholds T1, T2, and T3 in the embodiments of the present invention are determined according to the best results found through traversal within the range of [1, 20].

[0131] Furthermore, in one embodiment of the present invention, it also includes: calculating the fluctuation value of the predicted value of the target pixel, and after calculating the fluctuation value of each processed pixel according to the surrounding upper, lower, left and right adjacent points, arranging the pixel points in ascending order according to the fluctuation, and embedding digital watermarks in sequence.

[0132] Specifically, the embodiment of the present invention provides a fluctuation value definition that is more relevant to the prediction error value of the diamond predictor of the embodiment of the present invention. In this method, the prediction error has a stronger correlation with the fluctuation value. The smaller the fluctuation value of the central pixel point, the smaller the prediction error.

[0133] Based on the improved diamond predictor and prediction error expansion method, the following method is used to calculate the fluctuation value of pixel value. After experimental detection, the diamond predictor of this method is better adapted than the fluctuation value of the prior art, and can provide a smaller visual difference in the digital image carrier after embedding the watermark.

[0134] F i,j =m1+m2+m3+m4+m5+m6

[0135] When the watermark is not completely embedded in the digital image, the embodiment of the present invention calculates the fluctuation value of each processed pixel according to the surrounding upper, lower, left, and right adjacent points in the processed pixel set, arranges the pixels in ascending order according to the fluctuation, and embeds the digital watermarks in sequence. The purpose is to minimize the visual difference when the number of watermarks is small and not completely embedded in the entire digital image.

[0136] Based on the improved diamond predictor and prediction error expansion method, the improved diamond predictor is used to predict pixel values. According to experiments, a better prediction error can be obtained, which reduces the distortion and visual difference of the digital image carrier caused by the expanded prediction error.

[0137] According to the reversible digital watermarking method based on improved diamond predictor and prediction error expansion proposed in the embodiment of the present invention, the diamond predictor is improved, so that in the reversible digital watermarking technology based on prediction error expansion, a pixel prediction set with high consistency in the horizontal, vertical and diagonal directions can be adaptively used for pixel prediction to obtain a smaller prediction error, thereby obtaining a better effect when the prediction error is expanded, reducing the distortion and visual difference of the digital image carrier; and providing a new fluctuation value definition with a high degree of correlation with the improved diamond predictor, so that when the watermark is not completely embedded, pixel points with smaller fluctuation values ​​are preferentially selected for prediction. Since the prescribed fluctuation value has a high degree of correlation with the prediction error, these pixel points also have the characteristics of small prediction error, thereby further reducing the distortion and visual difference of the digital image carrier.

[0138] Figure 6It is a structural schematic diagram of a reversible digital watermarking device based on an improved diamond predictor and prediction error expansion according to an embodiment of the present invention.

[0139] like Figure 6 As shown, the reversible digital watermarking device 10 based on the improved diamond predictor and prediction error expansion includes: a calculation module 100, a judgment module 200 and a prediction module 300.

[0140] Among them, the calculation module 100 is used to divide the pixels around the central pixel value into horizontal groups, vertical groups, two positive diagonal groups and two negative diagonal groups, and calculate the absolute value of the difference between each pair of pixels of local consistency; the judgment module 200 is used to judge whether the horizontal and vertical directions have strong consistency or whether the two directions have strong overall consistency; the prediction module 300 is used to predict pixels through two neighboring pixels when the horizontal and vertical directions have strong consistency, wherein a third pixel is introduced according to the consistency threshold T2 to compare with the selected two pixels to determine whether to introduce the third pixel, and the predicted value of the target pixel is predicted according to the comparison result; when the two directions have strong overall consistency, pixel prediction is performed through four neighboring pixels, wherein two pixels with greater local uniformity are selected, and whether there are pixels inconsistent with the selected two pixels is determined according to the consistency threshold T3, and the predicted value of the target pixel is predicted according to the determination result. The device 10 of the embodiment of the present invention obtains better effects when the prediction error is expanded, reducing the distortion and visual difference of the digital image carrier.

[0141] In one embodiment of the present invention, the prediction module 300 is used to:

[0142] If the absolute value m1 of the difference between the pixels in the horizontal group is less than the absolute value m2 of the difference between the pixels in the vertical group, two pixel points along the horizontal direction are selected, and the average value n3 of the absolute values ​​m3 and m5 of the difference between the pixels in each of the two positive diagonal groups, and the average value n4 of the absolute values ​​m4 and m6 of the difference between the pixels in each of the two negative diagonal groups are calculated. It means to take the integer, where

[0143] If n3 <n 4, And n3≤T2, then the upper vertical pixel value v i-1,j and the first prediction set {left horizontal pixel value v i,j-1 , right horizontal pixel value v i,j+1} has a high degree of consistency, v i-1,j Added to the first prediction set, the prediction value is:

[0144] If n3>n4 and n4≤T2, then the lower vertical pixel value v i+1,jHighly consistent with the first prediction set {v i,j-1 , v i,j+1}, add v i+1,j to the first prediction set, then the predicted value is:

[0145] If neither v i-1,j nor v i+1,j is highly consistent with the first prediction set {v i,j-1 , v i,j+1}, then predict the predicted value of the target pixel according to the average value of v i-1,j and v i+1,j , where the predicted value is:

[0146] In an embodiment of the present invention, the prediction module 300 is further configured to:

[0147] If m1 > m2, select v i-1,j and v i+1,j along the vertical direction, and calculate the average values n5 of m4 and m5, and n6 of m3 and m6 respectively, where,

[0148] If n5 < n6 and n5 ≤ T2, then v i,j-1 is highly consistent with the second prediction set {v i-1,j , v i+1,j}, and add v i,j-1 to the second prediction set, then the predicted value is:

[0149] If n5 > n6 and n6 ≤ T2, then v i,j+1 is highly consistent with the second prediction set {v i-1,j , v i+1,j}, and add v i,j+1 to the second prediction set, then the predicted value is:

[0150] If neither v i,j-1 nor v i,j+1 is highly consistent with the second prediction set {v i-1,j , v i+1,j}, then predict the predicted value of the target pixel according to the average value of v i-1,j and v i+1,j , where the predicted value is:

[0151] In an embodiment of the present invention, the prediction module 300 is further configured to:

[0152] If m1 < m2, select v i,j-1and v i,j+1 , and remove the third prediction set {v i,j-1 , v i,j+1}Inconsistent pixels, generate prediction values:

[0153]

[0154] If m1>m2, then choose v i-1,j and v i+1,j , and remove the fourth prediction set {v i-1,j , v i+1,j}Inconsistent pixels, generate prediction values:

[0155]

[0156] Otherwise, the prediction is made by the mean pixel value of the neighboring pixels, and the predicted value is:

[0157] In one embodiment of the present invention, the device 10 of the embodiment of the present invention further includes: an embedding module. The embedding module is used to calculate the fluctuation value of the predicted value of the target pixel, and after calculating the fluctuation value of each processed pixel according to the surrounding upper, lower, left and right adjacent points, the pixel points are arranged in ascending order according to the fluctuation, and the digital watermarks are embedded in sequence.

[0158] It should be noted that the above explanation of the embodiment of the reversible digital watermarking method based on the improved diamond predictor and prediction error expansion is also applicable to the reversible digital watermarking device based on the improved diamond predictor and prediction error expansion of this embodiment, which will not be repeated here.

[0159] According to the reversible digital watermarking device based on the improved diamond predictor and prediction error expansion proposed in the embodiment of the present invention, the diamond predictor is improved, so that in the reversible digital watermarking technology based on the prediction error expansion, a pixel prediction set with high consistency in the horizontal, vertical and diagonal directions can be adaptively used for pixel prediction to obtain a smaller prediction error, thereby obtaining a better effect when the prediction error is expanded, reducing the distortion and visual difference of the digital image carrier; and providing a new fluctuation value definition with a high degree of correlation with the improved diamond predictor, so that when the watermark is not completely embedded, pixel points with smaller fluctuation values ​​are preferentially selected for prediction. Since the prescribed fluctuation value has a high degree of correlation with the prediction error, these pixel points also have the characteristics of small prediction error, thereby further reducing the distortion and visual difference of the digital image carrier.

[0160] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0161] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "N" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

Claims

1. A reversible digital watermarking method based on an improved diamond predictor and prediction error expansion, characterized in that: The following steps are involved: The pixels around the central pixel value are divided into a horizontal group, a vertical group, two positive diagonal groups and two negative diagonal groups, and the absolute value of the difference between each pair of pixels of local consistency is calculated; Determine whether the horizontal and vertical directions have strong consistency or whether the two directions have strong overall consistency, where the calculation is: n1 = n2 = M1 = where n1 is the average value in the horizontal direction, n2 is the average value in the vertical direction, the absolute value M1 of the difference between the horizontal average value and the vertical average value is compared with the cell consistency threshold T1. If M1 < T1, the overall consistency between the horizontal direction and the vertical direction is considered to be at a high level. If M1 ≥ T1, only one direction with high local consistency is used for prediction; When there is strong consistency in the horizontal and vertical directions, pixel prediction is performed through two neighboring pixel points, wherein a third pixel is introduced according to the consistency threshold T2 to compare with the selected two pixels to determine whether to introduce the third pixel, and a prediction value of the target pixel is predicted according to the comparison result; and When the two directions have strong overall consistency, pixel prediction is performed through four neighboring pixel points, where the consistency threshold T3 is used to determine whether there are pixels inconsistent with the two selected pixels, and the predicted value of the target pixel is predicted based on the determination result, the absolute value of the difference between the pixels in the horizontal group m1, the absolute value of the difference between the pixels in the vertical group m2, the left horizontal direction pixel value v i,j-1 , right horizontal pixel value v i,j+1 , If m1 < m2, then select v i,j-1 and v i,j+1 , and remove pixels inconsistent with the third prediction set {v i,j-1 , v i,j+1}, to generate the predicted value: , If m1>m2, then choose v i-1,j and v i+1,j , and remove the fourth prediction set {v i-1,j , v i+1,j }Inconsistent pixels, generate prediction values: , Otherwise, the prediction is made by the mean pixel value of the neighboring pixels, and the predicted value is: 。 2. The method according to claim 1, characterized in that The introducing a third pixel according to the consistency threshold T2 and comparing it with the selected two pixels to determine whether to introduce the third pixel, and predicting the predicted value of the target pixel according to the comparison result, comprises: If the absolute value m1 of the difference between the pixels in the horizontal group is less than the absolute value m2 of the difference between the pixels in the vertical group, two pixel points along the horizontal direction are selected, and the average value n3 of the absolute values ​​m3 and m5 of the difference between the pixels in each of the two positive diagonal groups, and the average value n4 of the absolute values ​​m4 and m6 of the difference between the pixels in each of the two negative diagonal groups are calculated. , ⌊•⌋ represents taking an integer, where, If n3 <n 4, And n3≤T2, then the upper vertical pixel value v i-1,j and the first prediction set {left horizontal pixel value v i,j-1 , right horizontal pixel value v i,j+1 } has a high degree of consistency, v i-1,j Added to the first prediction set, the prediction value is: ; If n3>n4 and n4≤T2, then the lower vertical pixel value v i+1,j With the first prediction set {v i,j-1 , v i,j+1 }Maintain high consistency and set v i+1,j Added to the first prediction set, the prediction value is: ; If v i-1,j and v i +1,j Neither of them is consistent with the first prediction set {v i,j-1 , v i,j+1 } has a high consistency, then according to v i-1,j and v i+1,j The predicted value of the target pixel is predicted by the average value of .

3. The method according to claim 2, characterized in that The introducing a third pixel according to the consistency threshold T2 and comparing it with the selected two pixels to determine whether to introduce the third pixel, and predicting the predicted value of the target pixel according to the comparison result, further includes: If m1>m2, then choose v in the vertical direction i-1,j and v i+1,j , and calculate the average value n5 of m4 and m5, the average value n6 of m3 and m6, ,in, If n5 < n6 and n5 ≤ T2, then v i,j-1 is highly consistent with the second prediction set {v i-1,j , v i+1,j}, and v i,j-1 is added to the second prediction set, then the predicted value is: ; If n5>n6 and n6≤T2, then v i,j+1 With the second prediction set {v i-1,j , v i+1,j } Maintain high consistency and set v i,j + 1 Added to the second prediction set, the prediction value is: ; If v i,j-1 and v i,j+1 Neither of them is consistent with the second prediction set {v i-1,j , v i+1,j } has a high consistency, then according to v i-1,j and v i + 1,j The predicted value of the target pixel is predicted by the average value of .

4. The method according to claim 1, characterized in that Also includes: The fluctuation value of the predicted value of the target pixel is calculated, and after the fluctuation value of each processed pixel according to the surrounding upper, lower, left and right adjacent points is calculated, the pixel points are arranged in ascending order according to the fluctuation value, and digital watermarks are embedded in sequence.

5. A reversible digital watermarking device based on an improved diamond predictor and prediction error expansion, characterized in that: include: A calculation module, used for dividing the pixels around the central pixel value into a horizontal group, a vertical group, two positive diagonal groups and two negative diagonal groups, and calculating the absolute value of the difference between each pair of pixels of local consistency; A judgment module is used to judge whether the horizontal and vertical directions have strong consistency or whether the two directions have strong overall consistency; as well as A prediction module is used to perform pixel prediction through two neighboring pixel points when there is strong consistency in the horizontal and vertical directions, wherein a third pixel is introduced according to a consistency threshold T2 to compare with the two selected pixels to determine whether to introduce the third pixel, and the predicted value of the target pixel is predicted according to the comparison result; when there is strong overall consistency in the two directions, pixel prediction is performed through four neighboring pixel points, wherein it is determined whether there is a pixel inconsistent with the two selected pixels according to the consistency threshold T3, and the predicted value of the target pixel is predicted according to the determination result, the absolute value m1 of the difference between the pixels in the horizontal group, the absolute value m2 of the difference between the pixels in the vertical group, and the left horizontal direction pixel value v i,j-1 , right horizontal pixel value v i,j+1 , If m1 < m2, then select v i,j-1 and v i,j+1 , and remove pixels inconsistent with the third prediction set {v i,j-1 , v i,j+1}, to generate the predicted value: , If m1>m2, then choose v i-1,j and v i+1,j , and remove the fourth prediction set {v i-1,j , v i+1,j }Inconsistent pixels, generate prediction values: , Otherwise, the prediction is made by the mean pixel value of the neighboring pixels, and the predicted value is: 。 6. The device according to claim 5, characterized in that The prediction module is used to: If the absolute value m1 of the difference between the pixels in the horizontal group is less than the absolute value m2 of the difference between the pixels in the vertical group, two pixel points along the horizontal direction are selected, and the average value n3 of the absolute values ​​m3 and m5 of the difference between the pixels in each of the two positive diagonal groups, and the average value n4 of the absolute values ​​m4 and m6 of the difference between the pixels in each of the two negative diagonal groups are calculated. , ⌊•⌋ represents taking an integer, where, If n3 <n 4, And n3≤T2, then the upper vertical pixel value v i-1,j and the first prediction set {left horizontal pixel value v i,j-1 , right horizontal pixel value v i,j+1 } has a high degree of consistency, v i-1,j Added to the first prediction set, the prediction value is: ; If n3>n4 and n4≤T2, then the lower vertical pixel value v i+1,j With the first prediction set {v i,j-1 , v i,j+1 }Maintain high consistency and set v i+1,j Added to the first prediction set, the prediction value is: ; If v i-1,j and v i +1,j Neither of them is consistent with the first prediction set {v i,j-1 , v i,j+1 } has a high consistency, then according to v i-1,j and v i+1,j The predicted value of the target pixel is predicted by the average value of .

7. The device according to claim 6, characterized in that The prediction module is further used to: If m1>m2, then choose v in the vertical direction i-1,j and v i+1,j , and calculate the average value n5 of m4 and m5, the average value n6 of m3 and m6, ,in, If n5 < n6 and n5 ≤ T2, then v i,j-1 is highly consistent with the second prediction set {v i-1,j , v i+1,j}, and v i,j-1 is added to the second prediction set, then the predicted value is: ; If n5>n6 and n6≤T2, then v i,j+1 With the second prediction set {v i-1,j , v i+1,j } Maintain high consistency and set v i,j + 1 Added to the second prediction set, the prediction value is: ; If v i,j-1 and v i,j+1 Neither of them is consistent with the second prediction set {v i-1,j , v i+1,j } has a high consistency, then according to v i-1,j and v i + 1,j The predicted value of the target pixel is predicted by the average value of .

8. The device according to claim 5, characterized in that Also includes: The embedding module is used to calculate the fluctuation value of the predicted value of the target pixel, and after calculating the fluctuation value of each processed pixel according to the surrounding upper, lower, left and right adjacent points, the pixel points are arranged in ascending order according to the fluctuation value, and the digital watermarks are embedded in sequence.