CN114004724A - Reversible watermarking method and device based on improved weight predictor - Google Patents

Reversible watermarking method and device based on improved weight predictor Download PDF

Info

Publication number
CN114004724A
CN114004724A CN202010910082.9A CN202010910082A CN114004724A CN 114004724 A CN114004724 A CN 114004724A CN 202010910082 A CN202010910082 A CN 202010910082A CN 114004724 A CN114004724 A CN 114004724A
Authority
CN
China
Prior art keywords
pixel
target pixel
value
prediction error
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010910082.9A
Other languages
Chinese (zh)
Inventor
唐鑫
曾伊琳
狄宏
吴昊雯
储泠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Relations, University of
Original Assignee
International Relations, University of
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Relations, University of filed Critical International Relations, University of
Priority to CN202010910082.9A priority Critical patent/CN114004724A/en
Publication of CN114004724A publication Critical patent/CN114004724A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/40Analysis of texture
    • G06T7/41Analysis of texture based on statistical description of texture

Abstract

The invention discloses a reversible watermarking method and a reversible watermarking device based on an improved weight predictor, wherein the method comprises the following steps: converting the target picture into a gray image, and dividing the gray image into a cross set and a point set; taking any pixel of the cross set or the point set as a target pixel, obtaining a predicted value of the target pixel according to the correlation between adjacent pixels in the pixels around the target pixel, and obtaining a prediction error according to the difference value between the pixel value of the target pixel and the predicted value, wherein the target pixel and the pixels around the target pixel are in different sets; calculating the fluctuation value of each pixel point, and sequencing the fluctuation values of each pixel point to obtain the sequence of embedded information; and expanding the embedded information into the prediction error so as to restore the expanded prediction error to any pixel to obtain a new pixel value until all pixel points of the cross set and the point set are embedded. The method improves the existing diamond predictor, so that the prediction accuracy of the diamond predictor in the texture area of the natural image is better, and a better embedding effect is achieved.

Description

Reversible watermarking method and device based on improved weight predictor
Technical Field
The invention relates to the technical field of reversible digital watermarking, in particular to a reversible watermarking method and a reversible watermarking device based on an improved weight predictor.
Background
In 2004, Thodi and Rodriguez propose a prediction error expansion algorithm, and the algorithm further solves the problem of low embedding capacity caused by the limitation of the number of peak point pixels in a prediction error histogram method by expanding a prediction error. Specifically, the prediction error is multiplied by 2, and the embedded one-bit information is added to obtain the prediction error of the embedded information, which is then added back to the original pixel to form the image with the embedded information. The ideal embedding capacity is 1 bit/pixel. In the information hiding technology based on prediction error expansion, the design of a predictor is a big research hotspot.
In 2009, Sachnev et al propose a prediction method of a diamond predictor on the basis of a prediction error expansion algorithm. The predictor has a double-layer embedding characteristic, and the embedding capacity is further improved. Specifically, it first divides the pixels into a cross set and a point set, and then embeds the data into these two sets in turn. Taking the point set as an example, the predicted value is calculated by averaging the pixels of 4 cross sets around the target, and the difference between the original pixel value and the predicted value becomes the prediction error. Then, the prediction errors are sorted in ascending order and the data are embedded in turn by using a prediction error expansion method.
In 2012, Dragoi et al proposed an adaptive prediction value calculation method based on a diamond predictor, which improved the previous diamond predictor to some extent. Specifically, the four surrounding pixels are divided into two groups, the horizontal direction and the vertical direction. For each group, the absolute value of the difference between them is calculated. Then, the two absolute difference values are compared, and the average value of the two pixels is calculated by a group with a smaller difference value to serve as the predicted value of the target pixel.
In 2019, Jia et al established a diamond predictor based on weighted averaging, which was again improved. The predicted value of the target pixel is obtained by weighting and adding up, down, left and right four pixels. The greater the proportion of a pixel if the values of all four surrounding pixels are closer to their average value. Thus, the proportion of the pixel points with large difference with the target pixel can be reduced. In order to embed information into an area with a small prediction error preferentially, the method sorts the fluctuation values in ascending order by calculating the fluctuation value of each pixel point, and embeds the information into the pixels with small fluctuation values preferentially.
However, the prior art has the following disadvantages:
(1) in 2009, Sachnev et al proposed a diamond predictor based on prediction error expansion, and solved the problem of incomplete prediction commonly existing in previous methods which were not diamond predictors. However, since the prediction is performed only by using the average value of the four surrounding pixels, the texture region is not considered, and there may be a pixel value that is greatly different from the target pixel. These pixels with large differences bring large errors in the prediction process, so that the prediction method is not suitable for texture regions.
(2) In 2012, Dragoi et al proposed an adaptive predictive value calculation method. This approach takes into account to some extent that the need for prediction with less different pixels makes some improvement over the approach proposed by Sachnev et al. However, the method only considers the horizontal and vertical directions of the diamond region where the target pixel point is located, and does not comprehensively consider other directions, such as positive and negative diagonal directions, so that the prediction result does not achieve a good effect. Meanwhile, the prediction value is calculated only by averaging, and this method is not well applied to the texture region as well.
(3) In 2019, Jia et al established a diamond predictor based on weighted averaging. The weighted average solves the problem that the prior mean prediction method cannot be well utilized for texture areas to a certain extent, and is improved over the prior Sachnev and Dragoi methods. However, since the method only considers the relationship between the target pixel and the neighboring pixels around the target pixel, and does not comprehensively consider the relationship between the neighboring pixels, the effect is not improved much when the method is applied to the texture region. In addition, the correlation between the fluctuation value and the prediction error is not very high in this method, so there is a problem in the embedding order, which also causes a certain degree of visual distortion in the texture region of the image after embedding information.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, an object of the present invention is to provide a reversible watermarking method based on an improved weight predictor, which improves the existing diamond predictor to make it have better prediction accuracy in the texture region of the natural image, thereby achieving better embedding effect.
Another object of the present invention is to provide a reversible watermarking apparatus based on an improved weight predictor.
In order to achieve the above object, an embodiment of an aspect of the present invention provides a reversible watermarking method based on an improved weight predictor, including the following steps: converting a target picture into a gray image, and dividing the gray image into a cross set and a point set; taking any pixel of the cross set or the point set as a target pixel, obtaining a predicted value of the target pixel according to correlation between adjacent pixels in the pixels around the target pixel, and obtaining a prediction error according to a difference value between a pixel value of the target pixel and the predicted value, wherein the target pixel and the pixels around the target pixel are in different sets; calculating the fluctuation value of each pixel point, and sequencing the fluctuation values of each pixel point to obtain the sequence of embedded information, wherein correlation exists between the fluctuation values and prediction errors; and expanding the embedded information into the prediction error to restore the expanded prediction error to any pixel to obtain a new pixel value, and embedding one set into the other set in the same method until all pixel points of the cross set and the point set are embedded.
The reversible watermarking method based on the improved weight predictor has a good prediction effect when the reversible watermarking work based on prediction error expansion is carried out and pixel points of texture areas of images are predicted, so that the embedded images generate smaller visual distortion, and the reversible watermarking method based on the improved weight predictor is more obvious when the embedding capacity is smaller; the relevance of the pixel points around the target pixel point and the smoothness degree of each direction are considered, and meanwhile, the calculation method of the fluctuation value has good relevance with the predicted value, so that the prediction effect reaches a good level.
In addition, the reversible watermarking method based on the improved weight predictor according to the above embodiment of the present invention may also have the following additional technical features:
in an embodiment of the present invention, the obtaining a predicted value of the target pixel according to a correlation between adjacent pixels in the four surrounding pixels of the target pixel includes:
calculating the target pixel xi,jAbsolute value of the difference between two of the four pixel values:
d1=|yi-1,j-yi+1,j|,
d2=|yi,j-1-yi,j+1|,
d3=|yi-1,j-yi,j-1|,
d4=|yi-1,j-yi,j+1|,
d5=|yi+1,j-yi,j-1|,
d6=|yi+1,j-yi,j+1|,
wherein, yi,j-1Is the target pixel xi,jLeft adjacent pixel, yi,j+1Is the target pixel xi,jRight adjacent pixel point, yi-1,jIs the target pixel xi,jUpper edge adjacent pixel, yi+1,jIs the target pixel xi,jLower adjacent pixel points;
respectively calculating the target pixel xi,jPairwise average of the four surrounding pixel values:
Figure BDA0002662948190000031
Figure BDA0002662948190000032
Figure BDA0002662948190000033
Figure BDA0002662948190000034
Figure BDA0002662948190000035
Figure BDA0002662948190000036
calculating the target pixel xi,jPredicted value P ofi,jThe predicted value Pi,jThe calculation formula is as follows:
Pi,j=w1·temp1+w2·temp2+w3·temp3+w4·temp4+w5·temp5+w6·temp6
wherein, wiRepresentative is the weight of the mean.
In one embodiment of the present invention, further comprising: calculating the sum of all the absolute values d _ sum, and calculating the weight of each average value according to whether d _ sum is 0:
Figure BDA0002662948190000041
normalizing the weight of all the average values to obtain wi:w1+w2+w3+w4+w5+w6=1。
In one embodiment of the present invention, wherein the calculation formula of the fluctuation value is:
Δvi,j=|yi-1,j-yi+1,j|+|yi,j-1-yi,j+1|+|yi-1,j-yi,j-1|+|yi-1,j-yi,j+1|+|yi+1,j-yi,j-1|+|yi+1,j-yi,j+1|。
in an embodiment of the present invention, further wherein the prediction error is:
Pei,j=xi,j-Pi,j
wherein x isi,jIs the pixel value, P, of the target pixeli,jIs a predicted value.
In order to achieve the above object, another embodiment of the present invention provides a reversible watermarking apparatus based on an improved weight predictor, including: the preprocessing module is used for converting a target picture into a gray image and dividing the gray image into a cross set and a point set; the prediction module is used for taking any pixel of the cross set or the point set as a target pixel, obtaining a predicted value of the target pixel according to correlation between adjacent pixels in the pixels around the target pixel, and obtaining a prediction error according to a difference value between a pixel value of the target pixel and the predicted value, wherein the target pixel and the pixels around the target pixel are in different sets; the sorting module is used for calculating the fluctuation value of each pixel point and sorting the fluctuation value of each pixel point to obtain the sequence of embedded information, wherein correlation exists between the fluctuation value and the prediction error; and the embedding module is used for expanding the embedded information into the prediction error so as to restore the expanded prediction error to any pixel to obtain a new pixel value, and embedding one set into the other set by the same method until all pixel points of the cross set and the point set are embedded.
The reversible watermarking device based on the improved weight predictor has a good prediction effect when the reversible watermarking work based on prediction error expansion is carried out and pixel points of texture areas of images are predicted, so that the embedded images generate smaller visual distortion, and the reversible watermarking device based on the improved weight predictor is more obvious when the embedding capacity is smaller; the relevance of the pixel points around the target pixel point and the smoothness degree of each direction are considered, and meanwhile, the calculation method of the fluctuation value has good relevance with the predicted value, so that the prediction effect reaches a good level.
In addition, the reversible watermarking device based on the improved weight predictor according to the above embodiment of the present invention may also have the following additional technical features:
in one embodiment of the present invention, the prediction module is further configured to:
calculating the target pixel xi,jAbsolute value of the difference between two of the four pixel values:
d1=|yi-1,j-yi+1,j|,
d2=|yi,j-1-yi,j+1|,
d3=|yi-1,j-yi,j-1|,
d4=|yi-1,j-yi,j+1|,
d5=|yi+1,j-yi,j-1|,
d6=|yi+1,j-yi,j+1|,
wherein, yi,j-1Is the target pixel xi,jLeft adjacent pixel, yi,j+1Is the target pixel xi,jRight adjacent pixel point, yi-1,jIs the target pixel xi,jUpper edge adjacent pixel, yi+1,jIs the target pixel xi,jLower adjacent pixel points;
respectively calculating the target pixel xi,jPairwise average of the four surrounding pixel values:
Figure BDA0002662948190000051
Figure BDA0002662948190000052
Figure BDA0002662948190000053
Figure BDA0002662948190000054
Figure BDA0002662948190000055
Figure BDA0002662948190000056
calculating a predicted value P of the target pixeli,jThe predicted value Pi,jThe calculation formula is as follows:
Pi,j=w1·temp1+w2·temp2+w3·temp3+w4·temp4+w5·temp5+w6·temp6
wherein, wiRepresentative is the weight of the mean.
In one embodiment of the invention, the prediction module is further configured to calculate a sum d _ sum of all the absolute values, and to calculate a weight for each average value according to whether d _ sum is 0:
Figure BDA0002662948190000061
normalizing the weight of all the average values to obtain wi:w1+w2+w3+w4+w5+w6=1。
In one embodiment of the present invention, wherein the calculation formula of the fluctuation value is:
Δvi,j=|yi-1,j-yi+1,j|+|yi,j-1-yi,j+1|+|yi-1,j-yi,j-1|+|yi-1,j-yi,j+1|+|yi+1,j-yi,j-1|+|yi+1,j-yi,j+1|。
in an embodiment of the present invention, wherein the prediction error is:
Pei,j=xi,j-Pi,j
wherein x isi,jIs the pixel value, P, of the target pixeli,jIs a predicted value.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow chart of a reversible watermarking method based on an improved weight predictor according to an embodiment of the present invention;
FIG. 2 is a flow diagram of a reversible watermarking method based on an improved weight predictor according to one embodiment of the present invention;
FIG. 3 is an example of a diamond predictor according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating an example of calculating absolute differences between pixel values of four sides of a target pixel according to an embodiment of the present invention;
FIG. 5 is an example of d _ sum being 0 according to an embodiment of the present invention;
FIG. 6 is an example of d _ sum being other than 0 according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a reversible watermarking apparatus based on an improved weight predictor according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The present invention is based on the recognition and discovery by the inventors of the following problems:
the reversible digital watermarking technology is a technology which can transmit information secretly on the basis of not destroying the original image of a carrier, thereby accurately extracting watermarking information and perfectly recovering the image of the carrier. The digital product copyright protection system can be used as a guard for protecting the copyright of digital products in any field and any place, provides invisible authentication marks, namely watermarks for various images, bills and the like, can assist relevant personnel to realize the functions of authenticity confirmation, falsification prevention, important information hiding and the like, ensures confidentiality and integrity, and is widely applied to the fields of military affairs, medicine, remote sensing and the like. Reversible digital watermarking techniques have two important requirements: the reversible digital watermarking technology based on prediction error expansion has a good effect on balance selection of the two important points, and specific technologies on the basis have better performance. Prediction error extension techniques can bring many benefits and are widely used.
The diamond predictor predicts a central pixel point by using values of four pixel points, namely an upper pixel point, a lower pixel point, a left pixel point, a right pixel point and a right pixel point, and performs a difference to obtain a prediction error. And converting the data into binary bits to be embedded into the prediction error. And adding the expanded prediction error to the original pixel to obtain the image embedded with the key information. The key to this technique is the prediction accuracy of the predictor. Although the accuracy of existing diamond predictors is already higher than many other predictors, the effect of texture of natural images on embedding distortion is still not fully considered. The image distortion caused by embedding data in the smooth area of the image is much smaller than that in the texture area, which directly causes the visual distortion of the image, the imperceptibility of the watermarking algorithm is reduced, and the result is obviously immeasurable.
That is, in the existing reversible digital watermarking algorithm based on prediction error extension, there is a case where large distortion exists in the texture region embedding information. The invention analyzes that the problem comes from insufficient prediction accuracy of the predictor, so that the prediction error is further amplified after the expansion. Meanwhile, after a certain error is generated, the embedding of the first layer can affect the embedding of the second layer, so that a larger visual distortion condition is generated. The method provided by the invention is also based on the diamond predictor of prediction error expansion, and the existing diamond predictor is improved, so that the prediction accuracy in the texture area of the natural image is better, and the better embedding effect is achieved.
The reversible watermarking method and apparatus based on the improved weight predictor according to the embodiment of the present invention are described below with reference to the accompanying drawings, and first, the reversible watermarking method based on the improved weight predictor according to the embodiment of the present invention will be described with reference to the accompanying drawings.
Fig. 1 is a flowchart of a reversible watermarking method based on an improved weight predictor according to an embodiment of the present invention.
As shown in fig. 1, the reversible watermarking method based on the improved weight predictor comprises the following steps:
in step S101, the target picture is converted into a grayscale image, and the grayscale image is divided into a cross set and a point set.
It can be understood that, as shown in fig. 2, first, a picture is converted into a grayscale image; the image is then divided into cross sets and point sets.
In step S102, any one of the pixels in the cross set or the point set is used as a target pixel, a predicted value of the target pixel is obtained according to correlation between adjacent pixels in the pixels around the target pixel, and a prediction error is obtained according to a difference between a pixel value of the target pixel and the predicted value, where the target pixel and the pixels around the target pixel are in different sets.
It is understood that, as shown in fig. 2 and 3, the target pixel x is taken as an example of a cross seti,jUp, down, left, and right four pixels yi-1,j,yi+1,j,yi,j-1,yi,j+1All come from the point set, and the target pixel of the cross set is predicted by using four pixels of the point set to obtain a prediction error.
Specifically, the innovation points of the invention are as follows: and calculating the prediction of the target pixel, and calculating the weight of the diamond predictor through the difference value of each direction between adjacent pixels, thereby more accurately predicting the value of the target pixel. The specific method comprises the following steps:
1. taking FIG. 3 as an example, first, the target pixel x is calculatedi,jAbsolute value of the difference between two of the four pixel values:
d1=|yi-1,j-yi+1,j|,
d2=|yi,j-1-yi,j+1|,
d3=|yi-1,j-yi,j-1|,
d4=|yi-1,j-yi,j+1|,
d5=|yi+1,j-yi,j-1|,
d6=|yi+1,j-yi,j+1|, (1)
the target pixel x can be reflected by the difference between two adjacent pixelsi,jThe gradient values in the four directions of horizontal, vertical, right diagonal and negative diagonal can more fully reflect whether the neighborhood where the target pixel is located is smooth or textured, as shown in fig. 4.
2. Respectively calculate the target pixel xi,jPairwise average of the four surrounding pixel values:
Figure BDA0002662948190000081
Figure BDA0002662948190000082
Figure BDA0002662948190000083
Figure BDA0002662948190000084
Figure BDA0002662948190000085
Figure BDA0002662948190000086
the temp value is the object to be weighted in the predictor, so the object to be weighted is not only the pixel values around the target pixel. Because this makes good use of the correlation between neighboring pixels for prediction.
3. Giving a target pixel xi,jPredicted value P ofi,jThe calculation formula of (2):
Pi,j=w1·temp1+w2·temp2+w3·temp3+w4·temp4+w5·temp5+w6·temp6, (3)
wherein, wiRepresented by each tempiThe value corresponds to the weight. It can be seen that if temp. is reachediThe smaller the difference between two pixel points corresponding to the value is, the closer the two pixels are, the more the two pixels are located in a relatively smooth area, and the influence of the smooth area on the predicted value should be increased, so that the temp isiThe greater the corresponding weight should be. On the contrary, if tempiIf the difference value between two pixel points corresponding to the value is larger, the two pixel values are far away from each other, the pixel values are in the texture area, and the influence of the value with larger error in the texture area on the predicted value is reduced, so that the temp is controllediThe smaller the corresponding weight should be.
4. The method of calculating the weights is as follows:
first, the sum of six absolute errors is calculated:
d_sum=d1+d2+d3+d4+d5+d6; (4)
the weight is then calculated according to whether d _ sum is 0:
Figure BDA0002662948190000091
it can be seen here that the value of d _ sum is fixed for a certain pixel. So for each temp value, if the difference between its corresponding two neighboring pixels is smaller, i.e. diThe smaller the temp, the greater the weight corresponding to temp. Finally, six w are requirediNormalization is carried out, i.e. to obtain w1+w2+w3+w4+w5+w 61, thereby ensuring the accuracy of the prediction. As shown in fig. 5 and 6, d _ sum is 0 and d _ sum is not 0, respectively.
5. After obtaining the predicted value, the target pixel xi,jSubtracting the predicted value from the pixel value of (1) to obtain a prediction error Pei,jAnd the method is used for carrying out prediction error expansion in the next step so as to embed information:
Pei,j=xi,j-Pi,j。 (6)
in step S103, the fluctuation value of each pixel is calculated, and the fluctuation values of each pixel are sorted to obtain the sequence of the embedded information, where there is a correlation between the fluctuation value and the prediction error.
It can be understood that the fluctuation value of each pixel point is calculated, wherein the fluctuation value has strong correlation with the prediction error. And then sequencing the fluctuation value of each pixel point, thereby obtaining the sequence of the embedded information.
It should be noted that, in order to make the image generate smaller visual distortion after embedding the information, the embodiment of the present invention needs to be applied toAnd (4) well sequencing the sequence of embedding information into each pixel point, and preferentially selecting the pixel points with small prediction errors to embed the information. The concept of a fluctuation value needs to be introduced here. If the area where the pixel point is located is smoother, the predicted value of the pixel point is more accurate, and therefore the smaller the obtained prediction error is, the more information is preferentially embedded. Fluctuation value Deltavi,jIt is used to judge the smoothness of the region where the pixel is located. The calculation method is as follows:
Δvi,j=|yi-1,j-yi+1,j|+|yi,j-1-yi,j+1|+|yi-1,j-yi,j-1|+|yi-1,j-yi,j+1|+|yi+1,j-yi,j-1|+|yi+1,j-yi,j+1|。 (7)
in fact, each sub-formula in the above equation is the target pixel xi,jAnd the absolute difference value of every two of the surrounding pixel points. Each difference value represents the degree of smoothness in a certain direction around the target pixel. If the absolute values of the six differences are all small, it is indicated that the region in which the target pixel is located is relatively smooth in each direction, so it can be located in a smooth region. Conversely, if the value of one or more sub-formulas is too large, it means that the region in which the target pixel is located is not smooth, i.e., the region is too large in the gradient direction represented by these sub-formulas, and information cannot be embedded into such pixel preferentially. Therefore, the fluctuation value can more comprehensively reflect the smoothness of the area where the target pixel is located in each direction, and is highly related to the calculation weight and the predicted value in the predictor.
In step S104, the embedding information is expanded into the prediction error to restore the expanded prediction error to any pixel, so as to obtain a new pixel value, and at this time, one set is embedded with the embedding completed, and then another set is embedded with the same method until all the pixel points of the cross set and the point set are embedded completely.
It is to be understood that, as shown in fig. 2, after d _ sum is sorted, data is embedded using the PEE method: and expanding the information to be embedded into the prediction error, and finally restoring the prediction error to the original pixel to obtain a new pixel value. And after all the pixel points from the cross set are embedded, embedding the point set by using the same method. It should be noted that, as shown in fig. 3, the edge of the image is not embedded because there are no complete adjacent pixels.
Specifically, 1, a threshold range [ T ] is set in advance before the embedding step is performed-,T+]And embedding information into the pixel points with the prediction errors within the range. The threshold range should be chosen to match the degree of smoothness of the image as a whole.
2. After the threshold range is set, the prediction error is expanded, and information is embedded in the prediction error. The specific method comprises the following steps:
Pei,j’=2Pei,j+b, (8)
the prediction error is multiplied by 2 to obtain a binary number corresponding to the prediction error, the binary number is shifted to the left by one bit, the lowest bit is left, and the information b is embedded, thereby obtaining the extended prediction error.
3. And shifting the pixel points of which the prediction errors do not belong to the threshold range. For prediction error at T+Pixel point on right side, pixel value is shifted right by T+Thereby preventing pixels within the threshold range from overlapping with the pixel after expansion. With the same principle, the prediction error is at T-Left pixel with you, pixel value shifted left by one T-. Then the synthetic prediction error falls within the threshold range of the expansion operation as follows:
Figure BDA0002662948190000101
4. when the expansion of the prediction error is finished, the expanded prediction error is restored to the original pixel to form a new pixel value xi,j’:
xi,j’=Pei,j’+Pi,j。 (10)
5. One important issue in embedding is to prevent overflow and underflow. For example oneThe pixel value of the pixel is 253, the predicted value is 252, and the prediction error is 1. If the bit of the embedded information is 1, the extended prediction error is 3, and then the original pixel value is restored, and the new pixel value is 256, which exceeds the pixel value range [0, 255 ] of the gray image]Indicating that overflow occurred. Similarly, when the new pixel value after embedding the information becomes negative, it indicates that underflow has occurred. To avoid such a problem, pixels that may cause underflow or overflow need to be excluded from the embedded queue in advance. For a gray-scale image, let L be 256, the maximum prediction error value that can be embedded with information is T+. Assuming that the information to be embedded is 1, the maximum prediction error after expansion can reach 2T++1. When the original pixel value xi,jTo a value of L-2T+With-1, overflow is possible after embedding the information. Equivalent to the original pixel value xi,jTo a value of 0-2T -1, the pixel may overflow down after embedding the information. Therefore, in order to distinguish the pixel points where the prediction errors meet the condition of embedding information but overflow is possible, in the embodiment of the present invention, a position map is set to distinguish the pixels, and the marking method is as follows:
if pixel point xi,j∈(-2T--1,L-2T+-1), it will not overflow, when it needs to be distinguished whether it is embedded or shifted. If Pei,j∈[T-,T+]If yes, the position diagram is not marked; if Pei,j>T+Or Pei,j<T-Then "0" is marked on the position map.
If pixel point xi,j≥L-2T+-1 or xi,j≤-2T -1, as can be seen from the above analysis, this point may have underflow and overflow during the embedding process, so the position map is marked with "1" to distinguish from the previous pixel points.
Further, in an embodiment of the present invention, the method further includes: and an image extracting and restoring module. In the reversible digital watermarking, the work done by the extraction module is actually the reverse process of the embedding work. In the above embodiment, the cross set is embedded first and then the point set is embedded, so that during the recovery, the information embedded in the point set needs to be extracted first and the image needs to be recovered, and then the cross set is operated by the same method, as shown in fig. 2, specifically as follows:
1. firstly, the above mentioned prediction method is required to predict the point set by the pixel points of the cross set to obtain the predicted value P of the point seti,j
2. And then using the pixel value x of the image after embedding the informationi,j' subtracting the prediction value to obtain the prediction error of the embedded information:
Pei,j’=xi,j’-pi,j。 (11)
3. in order to determine the extraction sequence, the fluctuation value of each pixel point of the point set needs to be calculated, the fluctuation values are sorted in an ascending order, and the mark of the position map is combined, so that the sequence of the pixel points embedded with the information is obtained.
4. Embodiments of the present invention utilize the way of prediction error expansion when embedding information and place the embedded information at the lowest order of prediction error. So in the extraction process, modulo-2 operation needs to be performed on the prediction error of the already embedded information, so as to extract the information:
b=Pei,j’mod 2。 (12)
after the information is extracted, the image needs to be restored, and the original prediction error Pe needs to be obtained firsti,j
Figure BDA0002662948190000121
5. After the original prediction error is obtained, the image restoration can be performed:
xi,j=Pi,j+Pei,j。(14)
according to the reversible watermarking method based on the improved weight predictor, which is provided by the embodiment of the invention, in the reversible watermarking work based on prediction error expansion, when the pixel point of the texture region of the image is predicted, a better prediction effect is achieved, so that the embedded image generates smaller visual distortion, and the reversible watermarking method based on the improved weight predictor is more obvious when the embedding capacity is smaller; the relevance of the pixel points around the target pixel point and the smoothness degree of each direction are considered, and meanwhile, the calculation method of the fluctuation value has good relevance with the predicted value, so that the prediction effect reaches a good level.
Next, a reversible watermarking apparatus based on an improved weight predictor proposed according to an embodiment of the present invention will be described with reference to the accompanying drawings.
Fig. 7 is a structural diagram of a reversible watermarking device based on an improved weight predictor according to an embodiment of the invention.
As shown in fig. 7, the reversible watermarking apparatus 10 based on the improved weight predictor includes: a pre-processing module 100, a prediction module 200, a ranking module 300, and an embedding module 400.
The preprocessing module 100 is configured to convert a target picture into a grayscale image, and divide the grayscale image into a cross set and a point set; the prediction module 200 is configured to use any one pixel of the cross set or the point set as a target pixel, obtain a predicted value of the target pixel according to correlation between adjacent pixels in the peripheral pixels of the target pixel, and obtain a prediction error according to a difference between a pixel value of the target pixel and the predicted value, where the peripheral pixels of the target pixel and the target pixel are in different sets; the embedding module 300 is configured to calculate a fluctuation value of each pixel, and sort the fluctuation values of each pixel to obtain an embedded information sequence, where there is a correlation between the fluctuation value and a prediction error; the embedding module 400 is configured to expand the embedding information into the prediction error to restore the expanded prediction error to any pixel to obtain a new pixel value, where one set is embedded completely, and then another set is embedded in the same manner until all the pixels in the cross set and the point set are embedded completely. The apparatus 10 of the embodiment of the present invention improves the existing diamond predictor, so that it has better prediction accuracy in the texture region of the natural image, thereby achieving better embedding effect.
In one embodiment of the present invention, the prediction module 200 is further configured to:
calculating a target pixel xi,jAbsolute value of the difference between two of the four pixel values:
d1=|yi-1,j-yi+1,j|,
d2=|yi,j-1-yi,j+1|,
d3=|yi-1,j-yi,j-1|,
d4=|yi-1,j-yi,j+1|,
d5=|yi+1,j-yi,j-1|,
d6=|yi+1,j-yi,j+1|,
wherein, yi,j-1Is a target pixel xi,jLeft adjacent pixel, yi,j+1Is a target pixel xi,jRight adjacent pixel point, yi-1,jIs a target pixel xi,jUpper edge adjacent pixel, yi+1,jIs a target pixel xi,jLower adjacent pixel points;
respectively calculate the target pixel xi,jPairwise average of the four surrounding pixel values:
Figure BDA0002662948190000131
Figure BDA0002662948190000132
Figure BDA0002662948190000133
Figure BDA0002662948190000134
Figure BDA0002662948190000135
Figure BDA0002662948190000136
calculating a predicted value P of a target pixeli,jPredicted value Pi,jThe calculation formula is as follows:
Pi,j=w1·temp1+w2·temp2+w3·temp3+w4·temp4+w5·temp5+w6·temp6
wherein, wiThe weight of the mean is represented.
In one embodiment of the invention, the prediction module 200 is further configured to calculate the sum of all absolute values d _ sum, and to calculate the weight of each average value according to whether d _ sum is 0:
Figure BDA0002662948190000141
normalizing the weight of all the average values to obtain wi:w1+w2+w3+w4+w5+w6=1。
In one embodiment of the present invention, wherein the calculation formula of the fluctuation value is:
Δvi,j=|yi-1,j-yi+1,j|+|yi,j-1-yi,j+1|+|yi-1,j-yi,j-1|+|yi-1,j-yi,j+1|+|yi+1,j-yi,j-1|+|yi+1,j-yi,j+1|。
in one embodiment of the present invention, wherein the prediction error is:
Pei,j=xi,j-Pi,j
wherein x isi,jIs the pixel value, P, of the target pixeli,jIs a predicted value.
It should be noted that the foregoing explanation of the embodiment of the reversible watermarking method based on the improved weight predictor is also applicable to the reversible watermarking apparatus based on the improved weight predictor of this embodiment, and details are not repeated here.
According to the reversible watermarking device based on the improved weight predictor, which is provided by the embodiment of the invention, in the reversible watermarking work based on prediction error expansion, when the pixel point of the texture region of the image is predicted, a better prediction effect is achieved, so that the embedded image generates smaller visual distortion, and the reversible watermarking device is more obvious when the embedding capacity is smaller; the relevance of the pixel points around the target pixel point and the smoothness degree of each direction are considered, and meanwhile, the calculation method of the fluctuation value has good relevance with the predicted value, so that the prediction effect reaches a good level.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A reversible watermarking method based on an improved weight predictor is characterized by comprising the following steps:
converting a target picture into a gray image, and dividing the gray image into a cross set and a point set;
taking any pixel of the cross set or the point set as a target pixel, obtaining a predicted value of the target pixel according to correlation between adjacent pixels in the pixels around the target pixel, and obtaining a prediction error according to a difference value between a pixel value of the target pixel and the predicted value, wherein the target pixel and the pixels around the target pixel are in different sets;
calculating the fluctuation value of each pixel point, and sequencing the fluctuation values of each pixel point to obtain the sequence of embedded information, wherein correlation exists between the fluctuation values and prediction errors;
and expanding the embedded information into the prediction error to restore the expanded prediction error to any pixel to obtain a new pixel value, and embedding one set into the other set in the same method until all pixel points of the cross set and the point set are embedded.
2. The method according to claim 1, wherein the deriving a predicted value of the target pixel according to correlations between adjacent pixels in the four surrounding pixels of the target pixel comprises:
calculating the target pixel xi,jAbsolute value of the difference between two of the four pixel values:
d1=|yi-1,j-yi+1,j|,
d2=|yi,j-1-yi,j+1|,
d3=|yi-1,j-yi,j-1|,
d4=|yi-1,j-yi,j+1|,
d5=|yi+1,j-yi,j-1|,
d6=|yi+1,j-yi,j+1|,
wherein, yi,j-1Is the target pixel xi,jLeft adjacent pixel, yi,j+1Is the target pixel xi,jRight adjacent pixel point, yi-1,jIs the target pixel xi,jUpper edge adjacent pixel, yi+1,jIs the target pixel xi,jLower adjacent pixel points;
respectively calculating the target pixel xi,jPairwise average of the four surrounding pixel values:
Figure FDA0002662948180000011
Figure FDA0002662948180000012
Figure FDA0002662948180000021
Figure FDA0002662948180000022
Figure FDA0002662948180000023
Figure FDA0002662948180000024
calculating the target pixel xi,jPredicted value P ofi,jThe predicted value Pi,jThe calculation formula is as follows:
Pi,j=w1·temp1+w2·temp2+w3·temp3+w4·temp4+w5·temp5+w6·temp6
3. the method of claim 2, further comprising:
calculating the sum of all the absolute values d _ sum, and calculating the weight of each average value according to whether d _ sum is 0:
Figure FDA0002662948180000025
normalizing the weight of all the average values to obtain wi:w1+w2+w3+w4+w5+w6=1。
4. The method according to claim 1, wherein the fluctuation value is calculated by the formula:
Δvi,j=|yi-1,j-yi+1,j|+|yi,j-1-yi,j+1|+|yi-1,j-yi,j-1|+|yi-1,j-yi,j+1|+|yi+1,j-yi,j-1|+|yi+1,j-yi,j+1|。
5. the method according to any one of claims 1-4, wherein the prediction error is:
Pei,j=xi,j-Pi,j
wherein x isi,jIs the pixel value, P, of the target pixeli,jIs a predicted value.
6. A reversible watermarking apparatus based on an improved weight predictor, comprising:
the preprocessing module is used for converting a target picture into a gray image and dividing the gray image into a cross set and a point set;
the prediction module is used for taking any pixel of the cross set or the point set as a target pixel, obtaining a predicted value of the target pixel according to correlation between adjacent pixels in the pixels around the target pixel, and obtaining a prediction error according to a difference value between a pixel value of the target pixel and the predicted value, wherein the target pixel and the pixels around the target pixel are in different sets;
the sorting module is used for calculating the fluctuation value of each pixel point and sorting the fluctuation value of each pixel point to obtain the sequence of embedded information, wherein correlation exists between the fluctuation value and the prediction error;
and the embedding module is used for expanding the embedded information into the prediction error so as to restore the expanded prediction error to any pixel to obtain a new pixel value, and embedding one set into the other set by the same method until all pixel points of the cross set and the point set are embedded.
7. The apparatus of claim 6, wherein the prediction module is further configured to:
calculating the target pixel xi,jAbsolute value of the difference between two of the four pixel values:
d1=|yi-1,j-yi+1,j|,
d2=|yi,j-1-yi,j+1|,
d3=|yi-1,j-yi,j-1|,
d4=|yi-1,j-yi,j+1|,
d5=|yi+1,j-yi,j-1|,
d6=|yi+1,j-yi,j+1|,
wherein, yi,j-1Is the target pixel xi,jLeft adjacent pixel, yi,j+1Is the target pixel xi,jRight adjacent pixel point, yi-1,jIs the target pixel xi,jUpper edge adjacent pixel, yi+1,jIs the target pixel xi,jLower adjacent pixel points;
respectively calculating the target pixel xi,jPairwise average of the four surrounding pixel values:
Figure FDA0002662948180000031
Figure FDA0002662948180000032
Figure FDA0002662948180000033
Figure FDA0002662948180000034
Figure FDA0002662948180000035
Figure FDA0002662948180000036
calculating a predicted value P of the target pixeli,jThe predicted value Pi,jThe calculation formula is as follows:
Pi,j=w1·temp1+w2·temp2+w3·temp3+w4·temp4+w5·temp5+w6·temp6
8. the apparatus of claim 7, wherein the prediction module is further configured to calculate a sum d _ sum of all the absolute values, and wherein the weight of each average is calculated according to whether d _ sum is 0:
Figure FDA0002662948180000041
normalizing the weight of all the average values to obtain wi:w1+w2+w3+w4+w5+w6=1。
9. The apparatus of claim 6, wherein the fluctuation value is calculated by the following formula:
Δvi,j=|yi-1,j-yi+1,j|0|yi,j-1-yi,j+1|+|yi-1,j-yi,j-1|+|yi-1,j-yi,j+1|+|yi+1,j-yi,j-1|+|yi+1,j-yi,j+1|。
10. the apparatus according to any one of claims 6-9, wherein the prediction error is:
Pei,j=xi,j-Pi,j
wherein x isi,jIs the pixel value, P, of the target pixeli,jIs a predicted value.
CN202010910082.9A 2020-09-02 2020-09-02 Reversible watermarking method and device based on improved weight predictor Pending CN114004724A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010910082.9A CN114004724A (en) 2020-09-02 2020-09-02 Reversible watermarking method and device based on improved weight predictor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010910082.9A CN114004724A (en) 2020-09-02 2020-09-02 Reversible watermarking method and device based on improved weight predictor

Publications (1)

Publication Number Publication Date
CN114004724A true CN114004724A (en) 2022-02-01

Family

ID=79920714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010910082.9A Pending CN114004724A (en) 2020-09-02 2020-09-02 Reversible watermarking method and device based on improved weight predictor

Country Status (1)

Country Link
CN (1) CN114004724A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979403A (en) * 2022-05-10 2022-08-30 北京交通大学 Reversible information hiding method and system based on pixel residual error histogram modification

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979403A (en) * 2022-05-10 2022-08-30 北京交通大学 Reversible information hiding method and system based on pixel residual error histogram modification

Similar Documents

Publication Publication Date Title
Cai et al. Reliable histogram features for detecting LSB matching
CN104217388A (en) Method and device of embedding and extracting image watermark based on FSSVM (Fuzzy Smooth Support Vector Machine)
Pakdaman et al. A prediction based reversible image watermarking in Hadamard domain
KR20190098487A (en) Apparatus for processing watermarking using artificial neural network which identifies watermarking attack, method thereof and computer recordable medium storing program to perform the method
CN104217389A (en) Image watermark embedding and extracting method and device based on improved Arnold transform
Jana et al. Local feature based self-embedding fragile watermarking scheme for tampered detection and recovery utilizing AMBTC with fuzzy logic
CN114913422B (en) Karst mountain area soil erosion and water loss field monitoring device
CN102073978B (en) Method and system for identifying and recovering digital images by utilizing irregular region segmentation
CN114004724A (en) Reversible watermarking method and device based on improved weight predictor
CN101833745A (en) Method for detecting embedding and extracting of multiple binary embedded watermarks of digital image
CN113032813B (en) Reversible information hiding method based on improved pixel local complexity calculation and multi-peak embedding
Bhandari et al. Reversible data hiding using multi-layer perceptron based pixel prediction
CN115690014A (en) Medical image tampering detection and self-recovery method based on texture degree cross embedding
KR102028824B1 (en) Apparatus for processing watermarking using artificial neural network which identifies objects, method thereof and computer recordable medium storing program to perform the method
CN115100014B (en) Multi-level perception-based social network image copying and moving counterfeiting detection method
CN114565500A (en) Reversible image authentication method and system based on prediction error expansion
Zhao et al. A Higher Efficient Reversible Data Hiding Scheme Based on Pixel Value Ordering.
JP4134992B2 (en) Watermark information detection apparatus, watermark information embedding apparatus, watermark information detection method, and watermark information embedding method
Chu et al. Improved weighted average-based rhombus predictor in reversible data hiding using prediction error expansion
CN114511437A (en) Watermark embedding and image self-recovery method based on reference matrix and LSB replacement
Li et al. A new PEE-based reversible watermarking algorithm for color image
He Improved block redundancy mining based reversible data hiding using multi-sub-blocking
CN112926598B (en) Image copy detection method based on residual error domain deep learning characteristics
Deng et al. Histogram modification based robust image watermarking approach
Lavanya et al. Analyzing the performance of watermarking based on swarm optimization methods

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination