Reversible watermarking algorithm based on IWT and prediction difference histogram shift

Through the method of integer wavelet transform and prediction difference histogram translation, the problem of watermark embedding capacity and visual quality balance in the existing technology is solved, and efficient watermark embedding and lossless recovery are achieved.

CN115393151BActive Publication Date: 2024-10-22HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211002487.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-19
Publication Date
2024-10-22
Estimated Expiration
2042-08-19

AI Technical Summary

Technical Problem

Existing image watermarking algorithms are difficult to expand the watermark embedding capacity while ensuring the visual quality of the watermarked image, and cannot restore the original image losslessly.

Method used

A reversible watermarking algorithm based on integer wavelet transform and prediction difference histogram translation is used. By selecting smoother image blocks for integer wavelet transformation, the three adjacent pixels on the upper left of the pixel are used to generate prediction differences and expand them. In the inverse integer wavelet The transformed high-frequency area is embedded with watermark information, and the histogram translation method is used to control distortion.

Benefits of technology

It effectively increases the watermark embedding capacity, reduces image distortion, and ensures the visual quality of the image and the ability to restore the original image without loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115393151B_ABST
    Figure CN115393151B_ABST
Patent Text Reader

Abstract

The invention relates to the field of information hiding and digital watermark technology, and discloses a reversible watermark algorithm based on IWT and predicted difference histogram shift. The original image is divided into blocks, and the image blocks with the highest smoothness value are selected for inverse integer wavelet transform. The predicted difference is expanded in the high-frequency area and a difference histogram is generated. The watermark information is embedded using the histogram shift method. The watermark capacity size, the number of watermark scrambling times c and d are embedded in the low-frequency area using the difference quantization method. The high-frequency area where the watermark is embedded and the low-frequency area where the auxiliary information is embedded are integer wavelet transformed, and then the image blocks with the highest smoothness value are combined for inverse integer wavelet transform to complete watermark embedding. Watermark extraction is the inverse process of watermark embedding. The invention selects a relatively smooth image block for integer wavelet transform, generates predicted difference using the three adjacent pixels to the upper left of the pixel and expands it, and embeds the watermark information in the high-frequency area after the inverse integer wavelet transform, so that the distortion is well controlled.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of information hiding and digital watermarking, and in particular to a reversible watermarking algorithm based on IWT and predicted difference histogram translation. Background Art

[0002] Reversible image watermarking technology has attracted widespread attention in the field of image information security research. Through this technology, secret data can be embedded into the image carrier, and the receiving end user can accurately extract the embedded data from the watermarked image and restore the original image without loss. In reversible image watermarking, the balance between watermark embedding capacity and image visual quality plays a very important role, especially in some fields with high precision requirements, such as medical diagnosis, military images, chemical industry, etc. The amount of watermark information embedded in the original image cannot be too low, otherwise it will affect the restoration of the original image and the quality of the watermarked image. Therefore, how to use reversible image watermarking technology to encrypt the original carrier image and expand the watermark embedding capacity while ensuring the visual quality of the watermarked image is of great significance.

[0003] Tian et al. first proposed a reversible watermarking algorithm based on difference expansion. By calculating the difference between two adjacent pixels and then doubling it, the difference between the two pixels is an even number. In the process of embedding watermarks, if the watermark value is 0, the difference remains unchanged and is an even number; if the watermark value is 1, the difference is an odd number; when extracting the watermark, the least significant bit of the difference between two adjacent pixels in the watermark image can be extracted, but the image visual quality of this algorithm is not high. Alattar et al. made improvements based on Tian's algorithm and selected several adjacent pixels as blocks to embed the watermark. This algorithm can improve the visual quality of the watermark image and increase the embedding capacity of the watermark. Jin et al. proposed a reversible watermarking algorithm without position graph. They calculated the difference between the embeddable pixel and the average value of its eight adjacent pixels to obtain a suitable threshold to ensure that the embeddable pixel does not have underflow or overflow problems. However, under the premise of ensuring that the pixel does not overflow, when the calculated threshold is very small, the watermark embedding capacity will be very low.

[0004] In order to obtain better image visual quality, people have proposed using histogram shifting to reduce image quality distortion. Ni et al. proposed a reversible watermarking algorithm using histogram shifting (HS), which calculates the number of pixels in the carrier image, generates a histogram, and uses the peak point to embed the watermark information. Since only some pixels between the peak point and the zero point are modified, the watermarked image has good visual quality. However, the disadvantage of this method is that the watermark embedding capacity is low. Li et al. proposed a reversible image watermarking algorithm based on modifying the difference between adjacent pixels. Since the values ​​of adjacent pixels are similar, the difference in the histogram is approximately zero. Two pairs of peak points and zero points are selected. The negative pair moves to the left as one level increases, and the positive pair moves to the right as one level increases to increase the watermark embedding capacity. The image visual quality of this histogram shifting method is still quite satisfactory. Zhang et al. proposed dividing the image into multiple image blocks, embedding watermarks and restoring the original image according to the smoothness of the image blocks. Based on Zhang's scheme, Hong et al. used a new method to calculate the pixel smoothness of image blocks and used edge matching technology to embed watermarks in smoother image blocks, which can effectively improve the embedding rate of watermarks. Huang et al. proposed to use domain mean prediction and made corresponding improvements to the error energy estimation and watermark information extraction algorithms. Liu et al. proposed to process the image in blocks, with 4 pixels as a group, select 1 pixel and its surrounding 3 pixels to obtain the predicted value, generate a difference histogram, and then embed the watermark. This scheme has good invisibility and the visual effect of the image is also good. Through the continuous efforts of researchers, a variety of prediction difference expansion algorithms have been proposed, which further improves the watermark embedding capacity and image visual quality.

[0005] In recent years, an algorithm based on integer wavelet transform has been proposed. Liu et al. combined integer wavelet transform with singular value decomposition, transformed the high-frequency area of ​​the second layer and embedded the watermark, which greatly improved the robustness and embedding rate of the watermark. Zhang et al. proposed an algorithm combining IWT with generalized difference expansion, performed IWT on the selected smoother blocks, and used generalized difference expansion to embed the watermark in the low-frequency area with higher energy. The algorithm effectively reduced the distortion of the image and increased the amount of watermark embedded. Xiong et al. used the Laplace distribution of integer wavelet high-frequency coefficients in the high-frequency subband and the independence of orthogonal coefficients to facilitate watermark embedding operations in the encryption domain and maintain reversibility. Compared with the existing technology, this scheme can be applied to all natural images and has a higher embedding rate.

[0006] In summary, it is difficult for existing image watermark embedding algorithms to expand the watermark embedding capacity while ensuring the visual quality of the watermarked image. How to further improve the watermark embedding capacity and image visual quality and be able to losslessly restore the original image is a technical problem that needs to be solved urgently. Summary of the invention

[0007] Purpose of the invention: In view of the problems existing in the prior art, the present invention provides a reversible watermarking algorithm based on IWT and prediction difference histogram shift. By selecting smoother image blocks for integer wavelet transform, the prediction difference is generated and expanded using the three adjacent pixels to the upper left of the pixel, and the watermark information is embedded in the high-frequency area after the inverse integer wavelet transform, the distortion is well controlled.

[0008] Technical solution: The present invention provides a reversible watermarking algorithm based on IWT and predicted difference histogram shift, including a watermark embedding algorithm, which specifically includes the following steps:

[0009] Step 1: Perform Arnold scrambling transformation on the original watermark image W to obtain the replaced watermark image W'. The number of horizontal and vertical transformations is c and d respectively.

[0010] Step 2: Divide the original image I into several n×n non-overlapping image blocks

[0011] Step 3: Calculate the smoothness values ​​of all pixel blocks, sort the image blocks from large to small according to the pixel smoothness values, and establish an image block sequence index table;

[0012] Step 4: According to the amount of watermark information, select the m image blocks with the highest smoothness value for integer wavelet transform, and decompose them to obtain the low-frequency area LL of each block. i , high frequency area HH i and two mid-frequency regions HL i , LH i ;

[0013] Step 5: The high-frequency region HH of the image obtained in step 4 i Perform inverse integer wavelet transform to obtain the image block H i , for image block H i The predicted difference is expanded and a difference histogram is generated, and the watermark information is embedded using the histogram shift method; the low-frequency area LL i Perform inverse integer wavelet transform to obtain image block L i , in the image block L i The auxiliary information of watermark capacity, watermark scrambling times c and d is embedded by using differential quantization method;

[0014] Step 6: In the difference histogram, select a suitable threshold T. If the predicted difference is between the threshold [-T, T], embed the watermark information; if the predicted difference is in the range of [T, ∞), shift right as a whole; if the predicted difference is in the range of (-∞, -T), shift left as a whole; continue to judge the next embedding point of the block until all blocks are processed;

[0015] Step 7: embed the watermark into the image block area H Wi and the image block region L generated by embedding auxiliary information Wi Perform integer wavelet transform to obtain the high frequency region HH Wi and low frequency region LL Wi ;

[0016] Step 8: According to the sequential index table, the two intermediate frequency regions HL that are not used for processing in the m image blocks with the highest smoothness values ​​are i , LH i and the corresponding high frequency region HH Wi And low frequency area LL Wi Reorganize to get the final watermark image I W .

[0017] Furthermore, the predicted difference is expanded and a difference histogram is generated in S5 specifically as follows: a basic pixel is selected and the difference is obtained by subtracting the mean of the three pixels to its upper left to obtain the predicted difference, and then the predicted difference is expanded to generate a difference histogram.

[0018] Furthermore, it is assumed that the blocks are non-overlapping smooth image blocks of size n×n:

[0019]

[0020] Where I′(i, j) represents the predicted difference at (i, j), I(i-1, j-1), I(i-1, j), and I(i+1, j) are the three adjacent pixels of pixel I(i, j), and the predicted difference sequence (d1, d2, ...d n ); Expand by prediction difference to obtain prediction error sequence (d′1, d′2, ... d′ n ) to generate a histogram of predicted differences.

[0021] Furthermore, the specific operation steps of the integer wavelet transform are:

[0022] 1) Decompose the image into four parts: low-frequency area LL, horizontal medium-high frequency area HL, vertical medium-high frequency area LH, and high-frequency area HH;

[0023] 2) Let X represent the low frequency coefficient, D = (d1, d2, ...d n) represents a transformation matrix of size n×n, then:

[0024]

[0025] Among them, d i =d i1 , d i2 ,...d in ) T It is an n-dimensional vector of matrix D. Using orthogonal decomposition based on D, it can be expressed as Y = D -1 X, Y are a set of orthogonal coefficients;

[0026] 3) The matrix D can be divided into two sub-matrices, namely D = (R, S), so R can be expressed as R = (d1, d2, ... d m ), S can be expressed as S = (d m+1 , d m+2 , …d n ); vector Y can also be divided into two sub-vectors, namely Y = (Y1, Y2) T ;

[0027] Then X can be described as

[0028] X=R·Y1+s·Y2 (5)

[0029] Subtract formula (5) from formula (4) and multiply formula (5) by (R T ·R) -1 ·R T , then we get:

[0030] (R T ·R) -1 ·R T ·X=(R T ·R) -1 ·R T ·R·Y1+(R T ·R) -1 ·R T ·S·Y2 (6)

[0031] It can be concluded that (R T ·R) -1 ·R T ·R=E,(R T ·R) -1 ·R T ·S·Y2=0, E is an identity matrix, Y1=(R T ·R) -1 ·R T ·R·X;

[0032] Multiply equation (5) by (S T ·S) -1·S T , then Y2=(S T ·S) -1 ·S T ·X; Therefore, according to formula (4) minus formula (5), we get formula (7)

[0033] Y1=(R T ·R) -1 ·R T ·X and Y2=(S T ·S) -1 ·S T ·X (7)

[0034] Finally, Y1=(R T ·R) -1 ·R T Substituting X into equation (7) yields S·Y2=X--R·(R T ·R) -1 ·R T ·X, R and S can be used to control Y1 and Y2 respectively.

[0035] Furthermore, the smoothness values ​​of all pixel blocks calculated in step 3 are obtained by constructing a pixel block smoothness approximate measurement function to perform approximate smoothness calculation on the image block to determine whether it is a smooth block, specifically:

[0036] Let x0 be the current pixel block, x1, x4, x2, x3 be the diagonal pixel blocks of x0, and the approximate smoothness function of x0 is:

[0037]

[0038] in, For x i (i=0, 1, 2, 3, 4) the mean value of pixels in the block, i.e.

[0039]

[0040] for The mean value of the pixel block, that is

[0041]

[0042] The pixel approximate smoothness values ​​of all image blocks are calculated using equation (8).

[0043] Furthermore, the approximate smoothness value of each pixel block does not change before and after the watermark is embedded, and can be used to identify the watermark embedding position and replace the position marker image that occupies a large amount of space.

[0044] Furthermore, in step 5, the embedding of watermark information using the histogram shift method is specifically as follows:

[0045]

[0046] Wherein, b is the watermark information, the value is binary 0 or 1, and T is the embedding threshold parameter that controls the embedding capacity.

[0047] Furthermore, a watermark extraction algorithm is also included, which is the inverse process of watermark embedding, and specifically includes the following steps:

[0048] S1: Watermark image I W Divide into several n×n non-overlapping image blocks

[0049] S2: Sort the image blocks from large to small according to the pixel smoothness values, and establish an image block sequence index table;

[0050] S3: For the m image blocks with the highest smoothness values ​​I Wi Perform integer wavelet transform and decompose to obtain the low-frequency area LL of each block Wi , high frequency area HH Wi and two mid-frequency regions HL wi , LH wi ;

[0051] S4: Since the pixel smoothness value before and after embedding remains unchanged, the low-frequency area LL Wi Perform inverse integer wavelet transform to obtain image block L wi , in the image block L wi The auxiliary information is extracted by using the difference quantization method to obtain the watermark scrambling times c and d and the watermark capacity. Then, the image block area L after the auxiliary information is extracted is i Perform integer wavelet transform;

[0052] S5: The high-frequency region HH of the image obtained in S3 Wi Perform inverse integer wavelet transform to obtain image block H Wi , in the image block H Wi In the process, the watermark information is extracted using the extracted auxiliary information, and then the image block area H after the watermark information is extracted is i Perform integer wavelet transform;

[0053] S6: If the predicted difference is between the threshold [-2T, 2T) region, the watermark information is extracted; if the predicted difference is in the range of [2T, ∞), the whole needs to be translated to the left; if the predicted difference is in the range of (-∞, -2T), the whole needs to be translated to the right; finally, continue to extract the next block embedding point until all blocks are processed;

[0054] S7: According to the sequential index table, the two intermediate frequency regions HL that are not used for processing in the m image blocks with the highest smoothness values ​​are wi , LH wi and the corresponding high frequency region HH i And low frequency area LL i Reorganize and restore the original image block;

[0055] S8: The extracted watermark information is transformed by Amold inverse scrambling to obtain the original watermark information W;

[0056] S9: reorganize all image blocks according to the sequential index information table to restore the original image I without loss.

[0057] Furthermore, the step of extracting watermark information by using the extracted auxiliary information in S5 is specifically as follows:

[0058] First, the prediction difference after expansion is calculated, the prediction difference is restored, and the watermark information is extracted using the inverse difference histogram translation method; the prediction difference after expansion is calculated, and the prediction difference is restored as follows:

[0059]

[0060] Where T is the embedding threshold parameter that controls the embedding capacity.

[0061] Furthermore, the scrambling method of the Arnold scrambling transformation is as follows:

[0062]

[0063] Where x′, y′∈{0, 1, 2, ..., N-1}, (x, y) is the original pixel coordinate of the watermark image, (x′, y′) is the new pixel coordinate of the original pixel after Arnold transformation, A is the size of the watermark image, and c and d are the randomly generated horizontal and vertical scrambling transformation times.

[0064] Beneficial effects:

[0065] 1. The present invention proposes an algorithm combining integer wavelet transform with prediction difference histogram shift. The algorithm selects a relatively smooth image block for integer wavelet transform, uses the three adjacent pixels to the upper left of the pixel to generate the prediction difference and expands it, embeds the watermark information in the high-frequency area after the inverse integer wavelet transform, and the distortion is well controlled. The algorithm can effectively improve the watermark embedding capacity and reduce image distortion.

[0066] 2. Ordinary wavelet transform realizes floating-point transform. If it is truncated or rounded, it is impossible to fully accurately represent the transform coefficients. Then, information may be lost through both forward transform and inverse transform, which will cause the reversible watermark system to fail and the original image cannot be restored losslessly from the watermark image. The reversible integer wavelet transform proposed in the present invention maps integers to integers, and no information loss will be caused through forward transform and inverse transform.

[0067] 3. With the increase of watermark information, the PSNR of the image decreases slightly, and the PSNR of the image after embedding the watermark information can still be maintained above 48.3dB. While effectively increasing the embedding capacity, it also ensures good invisibility of the image. When the image vision is good, the embedding capacity of the watermark is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 This is a flow chart of the watermark embedding algorithm of the present invention;

[0069] Figure 2 It is a flow chart of the watermark extraction algorithm of the present invention;

[0070] Figure 3 It is a traditional block prediction method, where (a) is the difference between two neighborhoods of a pixel, and (b) is the difference between four neighborhoods of a pixel;

[0071] Figure 4 A pixel parity difference prediction method according to the present invention;

[0072] Figure 5 It is a schematic diagram of secondary wavelet decomposition of the present invention;

[0073] Figure 6 It is the block structure diagram of the original image of the present invention;

[0074] Figure 7 These are four original carrier images according to an embodiment of the present invention;

[0075] Figure 8 is the watermark image of the present invention;

[0076] Fig. 9 The PSNR values ​​of the four images in the embodiment of the present invention are compared;

[0077] Fig.10 Comparison of embedding capacity and PSNR of the original image Lena under different algorithms in an embodiment of the present invention. DETAILED DESCRIPTION

[0078] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0079] The present invention discloses a reversible watermarking algorithm based on IWT and predicted difference histogram shift. By selecting a relatively smooth image block for integer wavelet transform, the predicted difference is generated and expanded using the three adjacent pixels to the upper left of the pixel, and the watermark information is embedded in the high-frequency area after the inverse integer wavelet transform, the distortion is well controlled. The algorithm can effectively improve the watermark embedding capacity and reduce image distortion. Specifically, it includes the following steps:

[0080] 1. Watermark embedding part:

[0081] (1) First, perform Arnold scrambling transformation on the original watermark image W to obtain the replaced watermark image W'. The scrambling method is as follows:

[0082]

[0083] Where x′, y′∈{0, 1, 2, ..., N-1}, (x, y) is the original pixel coordinate of the watermark image, (x′, y′) is the new pixel coordinate of the original pixel after Arnold transformation, A is the size of the watermark image, and c and d are the randomly generated horizontal and vertical scrambling transformation times.

[0084] (2) Divide the original image I into several n×n non-overlapping image blocks I i The embodiment of the present invention is described by taking 32×32 as an example.

[0085] (3) The smoothness values ​​of all pixel blocks are calculated, and the image blocks are sorted from large to small according to the pixel smoothness values ​​to establish an image block sequence index table.

[0086] When the difference between pixels in an image block is small, the human eye cannot easily perceive the modified image. Such an image block is called a smooth block. On the contrary, when the difference between pixels is large, the modified image is easily perceived by the human eye. That is, the image block with low smoothness is called a texture block. Embedding a watermark in a smooth image block can reduce the human eye's perception of the watermark, thereby reducing distortion.

[0087] We construct a pixel block smoothness approximate measurement function to calculate the approximate smoothness of the image block to determine whether it is a smooth block. Figure 6 As shown:

[0088] x0 is the current pixel block, x1x4x2, x3 are the diagonal pixel blocks of x0, and the approximate smoothness function of x0 is:

[0089]

[0090] in, For x i(i=0, 1, 2, 3, 4) the mean value of pixels in the block, i.e.

[0091]

[0092] for The mean value of the pixel block, that is

[0093]

[0094] The approximate smoothness values ​​of all image blocks are calculated by equation (8), and then the blocks are sorted according to the smoothness value. The image blocks with larger smoothness values ​​are selected to embed watermarks to reduce the image distortion rate. And because the approximate smoothness value of each pixel block does not change before and after watermark embedding, it can be used to identify the watermark embedding position and replace the position marker image that occupies a large amount of space.

[0095] (4) According to the amount of watermark information, select the m image blocks with the highest smoothness value for integer wavelet transform and decompose them to obtain the low-frequency region LL of each block. i , high frequency area HH i and two mid-frequency regions HL i , LH i .

[0096] Ordinary wavelet transform implements floating-point transform. If it is truncated or rounded, it is impossible to fully accurately represent the transform coefficients. Then, information may be lost through both forward and inverse transforms, which will cause the reversible watermarking system to fail and the original image cannot be restored losslessly from the watermarked image. In order to avoid this problem, a reversible integer wavelet transform is proposed, which maps integers to integers, and does not cause any information loss through forward and inverse transforms.

[0097] The present invention uses integer wavelet transform to decompose the image into four parts: low frequency area LL, horizontal medium and high frequency area HL, vertical medium and high frequency area LH, and high frequency area HH, as follows: Figure 5 shown.

[0098] Let X represent the low frequency coefficient, D = (d1, d2, ... d n ) represents a transformation matrix of size n×n, satisfying the following formula (4)

[0099]

[0100] Among them, d i =d i1 , d i2 ,...d in ) T It is an n-dimensional vector of matrix D. Using orthogonal decomposition based on D, it can be expressed as Y = D -1·X, Y are a set of orthogonal coefficients.

[0101] The matrix D can be divided into two sub-matrices, namely D = (R, S). Therefore, R can be expressed as R = (d1, d2, ... d m ), S can be expressed as S = (d m+1 , d m+2 , …d n ). Vector Y can also be divided into two sub-vectors, namely Y = (Y1, Y2) T Therefore, R and S can be used to control Y1 and Y2 respectively.

[0102] Then X can be described as

[0103] X=R·Y1+S·Y2 (5)

[0104] Subtract formula (5) from formula (4) and multiply formula (5) by (R T ·R) -1 ·R T , then we get

[0105] (R T ·R) -1 ·R T ·X=(R T ·R) -1 ·R T ·R·Y1+(R T ·R) -1 ·R T ·S·Y2 (6)

[0106] It can be concluded that (R T ·R) -1 ·R T ·R=E,(R T ·R) -1 ·R T ·s·Y2=0, E is an identity matrix, therefore, Y1=(R T ·R) -1 ·R T ·R·X.

[0107] Similarly, multiplying formula (5) by (S T ·S) -1 ·S T , then Y2=(S T ·S) -1 ·S T ·X. Therefore, by subtracting formula (5) from formula (4), we get formula (7)

[0108] Y1=(R T ·R) -1 ·R T ·X and Y2=(ST ·S) -1 ·S T ·X (7)

[0109] Finally, Y1=(R T ·R) -1 ·R T Substituting X into equation (7), we can obtain S·Y2=XR·(R T ·R) -1 ·R T ·X.

[0110] (5) The high-frequency region HH of the image obtained in step 4 i Perform inverse integer wavelet transform to obtain the image block H i , for image block H i The predicted difference is expanded and a difference histogram is generated. The watermark information is embedded using the histogram shift method, as shown in formula (12), where b is the watermark information, the value is binary 0 or 1, and T is the embedding threshold parameter that controls the embedding capacity. i Perform inverse integer wavelet transform to obtain image block L i , in the image block L i The difference quantization method is used to embed auxiliary information such as the watermark capacity, the number of watermark scrambling times c and d.

[0111]

[0112] The general block prediction is to predict the difference between two neighborhoods of pixels, and select a pixel value to make a difference with its adjacent pixels, such as Figure 3 (a); later, the diamond four-neighborhood prediction difference was proposed, as Figure 3 (b), Select a pixel value and take the difference with its four neighboring pixels. The average value on the diamond provides a good prediction.

[0113] Calculate the prediction difference between the two neighborhoods of a pixel as shown in formula (1):

[0114]

[0115] Calculate the pixel diamond four-neighborhood prediction difference as shown in formula (2):

[0116]

[0117] in, is the floor symbol, x i,j represents the pixel value at (i, j) and is the selected basic pixel in the figure, x′ i,j For x i,j The predicted difference.

[0118] The present invention proposes a method of dividing an image of size M×N into a number of n×n non-overlapping image blocks. Selecting a relatively smooth image block for inverse integer wavelet transform, selecting a corresponding area in a high-frequency area for prediction and difference. Selecting a basic pixel and the mean of the three pixels above and to the left to obtain a prediction difference, and then expanding the prediction difference to generate a prediction difference histogram.

[0119] Assume that the blocks are 32×32 non-overlapping smooth image blocks. Figure 4 As shown:

[0120]

[0121] Where I′(i, j) represents the predicted difference at (i, j), I(i-1, j-1), I(i-1, j), and I(i+1, j) are the three adjacent pixels of pixel I(i, j), and the predicted difference sequence (d1, d2, ...d n ).

[0122] By expanding the above prediction difference, we can get the prediction error sequence (d′1, d′2, ... d′ n ) to generate a histogram of predicted differences.

[0123] (6) In the difference histogram, select a suitable threshold T. If the predicted difference is between the threshold [-T, T], embed the watermark information. If the predicted difference is in the range of [T, ∞), shift the whole to the right. If the predicted difference is in the range of (-∞, -T), shift the whole to the left. Continue to judge the next embedding point of the block until all blocks are processed.

[0124] (7) The image block area H generated by embedding the watermark Wi and the image block region L generated by embedding auxiliary information Wi Perform integer wavelet transform to obtain the high frequency region HH Wi and low frequency region LL Wi .

[0125] (8) According to the sequential index table, the two intermediate frequency regions HL that are not used for processing in the m image blocks with the highest smoothness values ​​are i , LH i and the corresponding high frequency region HH Wi And low frequency area LL Wi Reorganize to get the final watermark image I W .

[0126] 2. Watermark extraction part:

[0127] (1) The watermark image I W Divided into several 32×32 non-overlapping image blocks

[0128] (2) Sort the image blocks from large to small according to the pixel smoothness value, and establish an image block sequence index table.

[0129] (3) For the m image blocks with the highest smoothness values ​​I Wi Perform integer wavelet transform and decompose to obtain the low-frequency area LL of each block Wi , high frequency area HH Wi and two mid-frequency regions HL wi , LH wi .

[0130] (4) Since the pixel smoothness value remains unchanged before and after embedding, the low-frequency area LL Wi Perform inverse integer wavelet transform to obtain image block L wi , in the image block L wi The auxiliary information is extracted by using the difference quantization method to obtain the watermark scrambling times c and d and the watermark capacity. Then, the image block area L after the auxiliary information is extracted is i Perform integer wavelet transform.

[0131] (5) The high-frequency region HH of the image obtained in S3 Wi Perform inverse integer wavelet transform to obtain image block H Wi , in the image block H Wi In the above method, the watermark information is extracted by using the extracted auxiliary information. First, the prediction difference after expansion is calculated and the prediction difference is restored, as shown in formula (13). The watermark information is extracted by using the inverse difference histogram translation method. Then, the image block area H after the watermark information is extracted is i Perform integer wavelet transform.

[0132]

[0133] (6) If the predicted difference is between the threshold [-2T, 2T), the watermark information is extracted; if the predicted difference is in the range of [2f, ∞), the whole needs to be shifted to the left; if the predicted difference is in the range of (-∞, -2T), the whole needs to be shifted to the right; finally, continue to extract the next block embedding point until all blocks are processed.

[0134] (7) According to the sequential index table, the two intermediate frequency regions HL that are not used for processing in the m image blocks with the highest smoothness values ​​are wi , LH wi and the corresponding high frequency region HH i And low frequency area LL i Reorganize and restore the original image block.

[0135] (8) The extracted watermark information is transformed through Amold inverse scrambling to obtain the original watermark information W.

[0136] (9) All image blocks are reorganized according to the sequential index information table to restore the original image I losslessly.

[0137] In this experiment, 8-bit standard grayscale images with a size of 512×512 based on the USC-SIPI database are selected as test images, including Lena, Boat, peppers and Plane, such as Figure 7 shown. Figure 8 The watermark image is 64×64 in size.

[0138] The experimental results use the embedding capacity of the watermark information and PSNR (peak signal-to-noise ratio) to evaluate the performance of the algorithm. The embedding capacity refers to the maximum digital watermark length that can be embedded in the original carrier image. PSNR is used to measure the visual quality of the embedded watermark image. Generally, the higher the value, the smaller the image distortion and the better the image quality. The formula is shown in equation (14).

[0139]

[0140] Where M and N are the width and height of the test image, respectively. w (i, j) are the two pixel values ​​of the original carrier image and the watermarked image at position (i, j) respectively.

[0141] We compare the proposed algorithm with two similar reversible watermarking algorithms, namely, Huang et al. Comparison 1: Huang Zhiqiang, Wang Meiqing. Reversible information hiding based on neighborhood prediction difference histogram shift [J]. Computer Engineering, 2014, 40(4): 116-119. and Liu et al. Comparison 2: Liu Lianshan, Wang Xiaoli, Chu Guanghui, et al. Reversible watermarking algorithm based on block prediction difference histogram shift [J]. Journal of Shandong University of Science and Technology: Natural Science Edition, 2019, 38(4): 74-82. Table 1 shows the PSNR values ​​and maximum embedding capacity of the four images of Lena, Boat, Peppers and Plane when embedding watermark information of size 64×64.

[0142] Table 1 Comparison results of embedding capacity and PSNR of embedded watermarks for four images

[0143]

[0144] Generally, when the PSNR value reaches 30dB or above, the image visual quality is good and difficult for human eyes to recognize. Fig. 9As shown in Table 1, with the increase of watermark information, the PSNR of the image decreases slightly, and the PSNR of the image after embedding the watermark information can still be maintained above 48.3dB. As can be seen from Table 1, this algorithm effectively increases the embedding capacity while also ensuring good invisibility of the image. Fig.10 It can be seen that the watermark embedding capacity of this algorithm is significantly improved compared with the other two algorithms.

[0145] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A reversible watermarking algorithm based on IWT and predicted difference histogram shift, characterized in that: Including watermark embedding algorithm, specifically including the following steps: Step 1: Perform Arnold scrambling transformation on the original watermark image W to obtain the replaced watermark image W'. The number of horizontal and vertical transformations is c and d respectively. The scrambling method of the Arnold scrambling transformation is as follows: Where x',y'∈{0,1,2,...,P-1}, (x,y) is the original pixel coordinate of the watermark image, (x',y') is the new pixel coordinate of the original pixel after Arnold scrambling transformation, A is the size of the watermark image, c and d are the randomly generated horizontal and vertical scrambling transformation times; Step 2: Divide the original image I into several n×n non-overlapping image blocks I i , Step 3: Calculate the smoothness values ​​of all pixel blocks, sort the image blocks from large to small according to the pixel smoothness values, and establish an image block sequence index table; Step 4: According to the amount of watermark information, select the m image blocks with the highest smoothness value for integer wavelet transform, and decompose them to obtain the low-frequency area LL of each block. i , high frequency area HH i and two mid-frequency regions HL i , LH i ; Step 5: The high-frequency region HH of the image obtained in step 4 i Perform inverse integer wavelet transform to obtain image block H i , for image block H i The predicted difference is expanded and a difference histogram is generated, and the watermark information is embedded using the histogram shift method; the low-frequency area LL i Perform inverse integer wavelet transform to obtain image block L i , in the image block L i The auxiliary information of watermark capacity, watermark scrambling times c and d is embedded by using differential quantization method; Among them, when embedding watermark information using the histogram shift method, in the difference histogram, select a suitable threshold T, if the predicted difference is between the threshold [-T, T) area, then embed the watermark information; if the predicted difference is in the range of [T, ∞), then it needs to be shifted to the right as a whole; if the predicted difference is in the range of (-∞, -T), then it needs to be shifted to the left as a whole; continue to judge the next embedding point of the block until all blocks are processed; Step 6: embed the watermark into the image block area H Wi and the image block region L generated by embedding auxiliary information Wi Perform integer wavelet transform to obtain the high frequency region HH Wi and low frequency region LL Wi ; Step 7: According to the sequential index table, the two intermediate frequency regions HL that are not used for processing in the m image blocks with the highest smoothness values ​​are i , LH i and the corresponding high frequency region HH Wi And low frequency area LL Wi Reorganize to get the final watermark image I W .

2. The reversible watermarking algorithm based on IWT and predicted difference histogram shift according to claim 1 is characterized in that: The step 5 of expanding the predicted difference and generating a difference histogram specifically includes: selecting a basic pixel and performing a difference calculation with the mean of the three pixels to its upper left to obtain a predicted difference, and then expanding the predicted difference to generate a difference histogram.

3. The reversible watermarking algorithm based on IWT and predicted difference histogram shift according to claim 1 is characterized in that: Before and after the watermark is embedded, the approximate smoothness value of each pixel block will not change, which is used to identify the watermark embedding position and replace the position marker image that occupies a large amount of space.

4. The reversible watermarking algorithm based on IWT and predicted difference histogram shift according to claim 1 is characterized in that: It also includes a watermark extraction algorithm, which is the inverse process of watermark embedding and specifically includes the following steps: S1: Watermark image I W Divide into several n×n non-overlapping image blocks I Wi , S2: Sort the image blocks from large to small according to the pixel smoothness values, and establish an image block sequence index table; S3: For the m image blocks with the highest smoothness values ​​I Wi Perform integer wavelet transform and decompose to obtain the low-frequency area LL of each block Wi , high frequency area HH Wi and two mid-frequency regions HL wi , LH wi ; S4: Since the pixel smoothness value before and after embedding remains unchanged, the low-frequency area LL Wi Perform inverse integer wavelet transform to obtain image block L wi , in the image block L wi The auxiliary information is extracted by using the difference quantization method to obtain the watermark scrambling times c and d and the watermark capacity. Then, the image block area L after the auxiliary information is extracted is i Perform integer wavelet transform; S5: The high-frequency region HH of the image obtained in S3 Wi Perform inverse integer wavelet transform to obtain image block H Wi , in the image block H Wi In the process, the watermark information is extracted using the extracted auxiliary information, and then the image block area H after the watermark information is extracted is i Perform integer wavelet transform; Among them, when the extracted auxiliary information is used to extract the watermark information, the predicted difference is within the threshold [-2T, 2T) area, the watermark information is extracted; if the predicted difference is in the range of [2T, ∞), it needs to be shifted to the left as a whole; if the predicted difference is in the range of (-∞, -2T), it needs to be shifted to the right as a whole, where T is the embedding threshold parameter that controls the embedding capacity; finally, continue to extract the next block embedding point until all blocks are processed; S6: According to the sequential index table, the two intermediate frequency regions HL that are not used for processing in the m image blocks with the highest smoothness values ​​are wi , LH wi and the corresponding high frequency region HH i And low frequency area LL i Reorganize and restore the original image block; S7: The extracted watermark information is transformed by Arnold inverse scrambling to obtain the original watermark image W; S8: reorganize all image blocks according to the sequential index information table to restore the original image I without loss.