Reversible data hiding method based on prediction error histogram shift
By using the prediction error histogram movement technology in the reversible data hiding method, the images are divided into two sets of A and B, and asymmetric maximum error and minimum error are constructed, the problems of severe image distortion and low embedding capacity in the prior art are solved, and the effects of high visual quality and high embedding capacity are achieved.
Patent Information
- Application Number
- CN202111507235.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2041-12-10
AI Technical Summary
The existing reversible data hiding method causes severe image distortion and low embedding capacity during the histogram shift process, which cannot meet the needs of high visual quality and high embedding capacity.
Using a reversible data hiding method based on the movement of the prediction error histogram, the pixel prediction error of each set is calculated by dividing the original image into two sets A and B, and the histogram of asymmetric maximum error and minimum error is constructed, and data is embedded in the two sets, so as to reduce the number of invalid shifted pixels by moving the histogram.
Significantly reduces visual distortion of encrypted images, improves embedding capacity, and ensures the ability to fully restore the original image without losing information.
Smart Images

Figure CN114398649B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of reversible data hiding, and relates to a reversible data hiding method based on prediction error histogram movement. Background Art
[0002] With the rapid development and popularization of the Internet, people have more and more ways to get information, and it is becoming more and more convenient to obtain information. As the main information carriers in the digital age, multimedia information such as video, audio, images, and text can be spread on the Internet by simply copying and pasting, which greatly improves the diffusion capacity of multimedia data. At the same time, it deepens the communication between people in social interaction, real-time calls, information sharing, etc., and brings great convenience to people's lives. However, while the Internet brings convenience, there are also hidden dangers of information security. For example, some illegal organizations or individuals may deliberately leak the privacy of others, infringe protected copyrights, and steal important confidential information for improper or profit purposes. At present, my country's informatization is developing rapidly at a rapid pace, and the demand for information security is very urgent. Therefore, while enjoying the convenience brought by information science and technology, how to protect the security of multimedia data is an urgent problem to be solved.
[0003] Data hiding uses the redundancy of human senses to digital information to hide secret information in another non-confidential carrier so as not to attract the attention of the inspector. Generally speaking, the quality of the carrier image after embedding secret data does not change significantly, so people will not perceive or notice the existence of secret data. Therefore, the secret data is transmitted through multimedia carriers to achieve the purpose of secret and secure communication. The embedded secret information can be the digital fingerprint of the carrier, which is used to track and monitor the subsequent transmission of the carrier image; it can be the authentication index of the carrier, which is used to verify the origin and integrity of the carrier image; it can be the copyright mark of the carrier, which is used for the intellectual property protection of enterprises or individuals; of course, it can also be other important but carrier-independent secret data. Data hiding technology is divided into irreversible data hiding technology and reversible data hiding technology according to whether the carrier image can be obtained completely losslessly at the receiving end. As the name suggests, irreversible data hiding technology means that the carrier image cannot be completely restored losslessly, and the restored image obtained in the end is lossy. It is mainly used for copyright protection of carrier images. The requirements of reversible data hiding technology are much higher. It requires accurate extraction of secret data and lossless restoration of carrier images. It is mainly used in military transmission, medical diagnosis, judicial judgment and other occasions. These occasions have extremely high requirements for the restoration and fidelity of the original carrier image, and no error is allowed. Data hiding technology achieves the purpose of secure communication by embedding secret data in the carrier image. It can be seen that after the secret data is embedded in the carrier image, it will always spread and copy with the carrier image, and can track and monitor various changes of the carrier image well. It can protect the carrier image well, especially in maintaining and monitoring the integrity and data security of the carrier image. Reversible data hiding technology plays a great role. However, the existing reversible data hiding method has a significant impact on the visual quality of the marked image in the process of histogram shifting, which leads to serious distortion of the embedded image. Therefore, it is very urgent and necessary to comprehensively improve and innovate a set of reversible data hiding methods with lower distortion and stronger embedding capacity. Summary of the invention
[0004] The purpose of the present invention is to provide a reversible data hiding method based on prediction error histogram movement, which solves the problems of severe image distortion and low embedding capacity in the prior art.
[0005] The technical solution adopted by the present invention is a reversible data hiding method based on prediction error histogram movement, which is specifically implemented according to the following steps:
[0006] Step 1: Divide the original image into two sets, A and B, and calculate the prediction error of the current pixel in set A and set B;
[0007] Step 2, construct an asymmetric prediction error histogram;
[0008] Step 3, randomly generate a data string of 0 and 1 as the data to be embedded W, embed W into the set A and the set B, combine the set A and the set B after the data W is embedded, and obtain the encrypted image;
[0009] Step 4: extract the embedded data from the B set and the A set in the encrypted image obtained in step 3 and restore the original pixels.
[0010] The present invention is also characterized in that
[0011] The specific process of step 1 is:
[0012] Step 1.1, such as Figure 1 As shown, assuming that the size of the original image is W×H pixels, the original image is divided into two sets A and B according to the checkerboard pattern according to formula (1);
[0013]
[0014] In formula (1), x i,j is the current pixel of the original image, i is the horizontal coordinate of the current pixel of the original image, and j is the vertical coordinate of the current pixel of the original image;
[0015] Step 1.2: For the A set, for the current pixel x i,j , calculate the average value x′ of the left and right pixels of the current pixel along the horizontal direction i,j The average value x″ between the upper and lower pixels of the current pixel in the vertical direction i,j , as shown in formula (2);
[0016]
[0017] In formula (2), x i,j-1 is the left pixel of the current pixel in set A, x i,j+1 is the pixel to the right of the current pixel in set A, x i-1,j is the pixel above the current pixel in set A, x i+1,j is the pixel below the current pixel in set A;
[0018] Step 1.3, calculate the mean difference σ′ in the horizontal direction respectively i,j and the mean difference in the vertical direction σ″ i,j , as shown in formula (3);
[0019]
[0020] Step 1.4, calculate the mean difference σ′ in the horizontal direction respectively i,j The weight w i,j and the mean difference in the vertical direction σ″ i,j The weight (1-w i,j), as shown in formula (4);
[0021]
[0022] Step 1.5, calculate the current pixel x of set A i,j The first predicted pixel value As shown in formula (5);
[0023]
[0024] Step 1.6, calculate the first predicted pixel value of set A The prediction error value of As shown in formula (6);
[0025]
[0026] Step 1.7, calculate the right pixel x in set A respectively i,j+1 The predicted pixel mean x′ of the main diagonal pixels i,j+1 and the right pixel x in set A i,j+1 The predicted pixel mean x″ of the sub-diagonal pixels i,j+1 , as shown in formula (7);
[0027]
[0028] In formula (7), x i+1,j+2 For x i,j+1 The pixel value at the bottom right of the pixel, x i-1,j+2 For x i,j+1 The pixel value at the top right of the pixel;
[0029] Step 1.8, calculate the mean difference σ′ of the main diagonal pixels respectively i,j+1 and the mean difference of the sub-diagonal pixels σ″ i,j+1 , as shown in formula (8);
[0030]
[0031] Step 1.9, calculate the mean difference σ′ of the main diagonal pixels respectively i,j+1 The weight w i,j+1 and the mean difference of the sub-diagonal pixels σ″ i,j+1 The weight (1-w i,j+1 ), as shown in formula (9);
[0032]
[0033] Step 1.10, calculate the right pixel x in set A i,j+1 The predicted pixel value As shown in formula (10);
[0034]
[0035] Step 1.11, calculate the upper pixel x in set A according to steps 1.7-1.10 respectively i-1,j The predicted pixel value Left pixel x i,j-1 The predicted pixel value Pixels below x i+1,j The predicted pixel value Find the average of the predicted pixel value of the pixel on the right, the predicted pixel value of the pixel above, the predicted pixel value of the pixel on the left, and the predicted pixel value of the pixel below As shown in formula (11);
[0036]
[0037] Step 1.12, calculate the current pixel x in set A i,j The second predicted pixel value As shown in formula (12);
[0038]
[0039] Step 1.13, calculate the second predicted pixel value of the current pixel The prediction error value of As shown in formula (13);
[0040]
[0041] The specific process of step 2 is:
[0042] Step 2.1: max(·) is used as an asymmetric selection function, and the i,j The first prediction error value and the second prediction error value Determine the maximum prediction error for the current pixel As shown in formula (14);
[0043]
[0044] Step 2.2: The maximum prediction error of all pixels in set A Aggregate and construct an asymmetric histogram h of the maximum error + (e);
[0045] Step 2.3: min(·) is used as the asymmetric selection function, and the i,j The first prediction error value and the second prediction error value Determine the minimum prediction error for the current pixel As shown in formula (15);
[0046]
[0047] Step 2.4: The minimum prediction error of all pixels in set A Aggregate and construct an asymmetric histogram h with minimum error - (e).
[0048] The specific process of step 3 is:
[0049] Step 3.1, dividing the data to be embedded W into four parts D1, D2, D3 and D4 according to the embedding capacity at different stages;
[0050] Repeat step 1 to get the first prediction error of each pixel in set A and second
[0051] Step 3.2: Use max(·) as the asymmetric selection function and calculate the first prediction error of each pixel in set A. and the second prediction error Determine the maximum prediction error through step 2 Construct an asymmetric histogram of maximum errors
[0052] Step 3.3, by scanning the set A, embed the data D1 into the original image according to formula (16);
[0053]
[0054] In formula (16), x i,j,A is the pixel value of the current pixel in the A set, Z +,A is the asymmetric histogram of the maximum error constructed The zero point, P +,A is the asymmetric histogram of the maximum error constructed The peak point of , b is 1 bit of data to be embedded in the data D1;
[0055] Step 3.4, use min(·) as the asymmetric selection function, according to the first prediction error of each pixel in set A and the second prediction error Determine the minimum prediction error through step 2 Constructing an asymmetric histogram of minimum error
[0056] Step 3.5, scan set A again, and embed the data D2 into the original image using formula (17);
[0057]
[0058] In formula (17), Z -,A An asymmetric histogram of the minimum error constructed The zero point, P -,A An asymmetric histogram of the minimum error constructed The peak point of , b is 1 bit of data to be embedded in the data D2;
[0059] Step 3.6, based on the set A after embedding data D1 and data D2, repeat steps 3.1 to 3.5 to embed data D3 and D4 into the set B;
[0060] Step 3.7, combine the A set and the B set after embedding the data to obtain the encrypted image.
[0061] The specific process of step 4 is:
[0062] Step 4.1: Repeat step 1 for each pixel in the B set of the encrypted image obtained in step 3 to obtain the first prediction error of each pixel in the B set of the encrypted image. and the second prediction error
[0063] Step 4.2, using min(·) as the asymmetric selection function, according to the first prediction error of each pixel in the B set of the encrypted image and the second prediction error Determine the minimum prediction error through step 2 Constructing an asymmetric histogram of minimum error
[0064] Step 4.3, extract the embedded data D4 in the B set of the encrypted image by formula (18), and then restore the pixels moved by the embedded data according to formula (19);
[0065]
[0066]
[0067] In formulas (18) and (19), P -,B An asymmetric histogram of the minimum error constructed The peak point of b is the extracted data. represents the encrypted image pixel value after embedding data D4, To extract the data and restore the pixel value, Z -,B Asymmetric histogram representing the constructed minimum error The zero point of
[0068] Step 4.4, using max(·) as the asymmetric selection function, according to the first prediction error of each pixel in the B set of the encrypted image and the second prediction error Determine the maximum prediction error through step 2 Construct an asymmetric histogram of maximum errors
[0069] Step 4.5, extract the embedded data D3 in the B set of the encrypted image by formula (20), and then restore the pixels moved due to the embedded data according to formula (21);
[0070]
[0071]
[0072] In formulas (20) and (21), P +,B is the asymmetric histogram of the maximum error constructed The peak point, Z +,B is the asymmetric histogram of the maximum error constructed The zero point of
[0073] Step 4.6, based on the extracted and restored set B, repeat steps 4.1 to 4.5 to extract and restore the set A of the encrypted image to obtain the extracted data D2 and D1;
[0074] In step 4.7, all embedded data is obtained by connecting D1, D2, D3 and D4, thereby completely restoring the original image without losing any information.
[0075] The beneficial effects of the present invention are:
[0076] (1) The reversible data hiding method based on prediction error histogram movement of the present invention uses chessboard partitioning to divide the pixels of the image into two sets. For each set, two error prediction algorithms are used to calculate a more accurate pixel prediction error, and then an asymmetric histogram of the maximum error and the minimum error is constructed. The two corresponding asymmetric error histograms are constructed, which not only increases the height of the peak point, but also greatly reduces the number of moved pixels by moving the two asymmetric histograms in the direction of less data. For each set, the two embedding processes are complementary, which can greatly reduce the number of invalid shifted pixels and ensure that the visual distortion of the encrypted image is low;
[0077] (2) The present invention is a reversible data hiding method based on prediction error histogram movement. (2) The data to be embedded is evenly divided into four parts, four corresponding asymmetric error histograms are constructed, and the data is embedded four times, which provides more embedding positions and improves the embedding capacity of different images. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] Figure 1 is a schematic diagram of the chessboard pattern allocation of pixels by the method of the present invention, wherein black and white pixels belong to sets A and B respectively;
[0079] Figure 2 is the asymmetric maximum error histogram of the original image “Boat” of the method of the present invention;
[0080] Figure 3 is the asymmetric minimum error histogram of the original image “Boat” of the method of the present invention;
[0081] Figure 4 is a flow chart of the embedding process of the method of the present invention;
[0082] Figure 5 are the test pictures used in the method of the present invention, wherein (a) is Lena, (b) is Baboon, (c) is Plane, (d) is Boat, (e) is Elaine, and (f) is Man;
[0083] Figure 6 yes Figure 5 The maximum embedding capacity of the 6 images in;
[0084] Figure 7 yes Figure 5 Embedding capacity and PSNR values of the 6 images. DETAILED DESCRIPTION
[0085] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0086] The present invention provides a reversible data hiding method based on prediction error histogram movement, which is specifically implemented according to the following steps:
[0087] Step 1: Calculate the prediction error of the current pixel in the original image
[0088] Step 1.1, such as Figure 1 As shown, assuming that the size of the original image is W×H pixels, the original image is divided into two sets A and B according to the checkerboard pattern according to formula (1);
[0089]
[0090] In formula (1), x i,jis the current pixel of the original image, i is the horizontal coordinate of the current pixel of the original image, and j is the vertical coordinate of the current pixel of the original image;
[0091] Step 1.2: For the A set, for the current pixel x i,j , calculate the average value x′ of the left and right pixels of the current pixel along the horizontal direction i,j The average value x″ between the upper and lower pixels of the current pixel in the vertical direction i,j , as shown in formula (2);
[0092]
[0093] In formula (2), x i,j-1 is the left pixel of the current pixel in set A, x i,j+1 is the pixel to the right of the current pixel in set A, x i-1,j is the pixel above the current pixel in set A, x i+1,j is the pixel below the current pixel in set A;
[0094] Step 1.3, calculate the mean difference σ′ in the horizontal direction respectively i,j and the mean difference in the vertical direction σ″ i,j , as shown in formula (3);
[0095]
[0096] Step 1.4, calculate the mean difference σ′ in the horizontal direction respectively i,j The weight w i,j and the mean difference in the vertical direction σ″ i,j The weight (1-w i,j ), as shown in formula (4);
[0097]
[0098] Step 1.5, calculate the current pixel x of set A i,j The first predicted pixel value As shown in formula (5);
[0099]
[0100] Step 1.6, calculate the first predicted pixel value of set A The prediction error value of As shown in formula (6);
[0101]
[0102] Step 1.7, calculate the right pixel x in set A respectively i,j+1 The predicted pixel mean x′ of the main diagonal pixels i,j+1and the right pixel x in set A i,j+1 The predicted pixel mean x″ of the sub-diagonal pixels i,j+1 , as shown in formula (7);
[0103]
[0104] In formula (7), x i+1,j+2 For x i,j+1 The pixel value at the bottom right of the pixel, x i-1,j+2 For x i,j+1 The pixel value at the top right of the pixel;
[0105] Step 1.8, calculate the mean difference σ′ of the main diagonal pixels respectively i,j+1 and the mean difference of the sub-diagonal pixels σ″ i,j+1 , as shown in formula (8);
[0106]
[0107] Step 1.9, calculate the mean difference σ′ of the main diagonal pixels respectively i,j+1 The weight w i,j+1 and the mean difference of the sub-diagonal pixels σ″ i,j+1 The weight (1-w i,j+1 ), as shown in formula (9);
[0108]
[0109] Step 1.10, calculate the right pixel x in set A i,j+1 The predicted pixel value As shown in formula (10);
[0110]
[0111] Step 1.11, calculate the upper pixel x in set A according to steps 1.7-1.10 respectively i-1,j The predicted pixel value Left pixel x i,j-1 The predicted pixel value Pixels below x i+1,j The predicted pixel value Find the average of the predicted pixel value of the pixel on the right, the predicted pixel value of the pixel above, the predicted pixel value of the pixel on the left, and the predicted pixel value of the pixel below As shown in formula (11);
[0112]
[0113] Step 1.12, calculate the current pixel x in set A i,j The second predicted pixel value As shown in formula (12);
[0114]
[0115] Step 1.13, calculate the second predicted pixel value of the current pixel The prediction error value of As shown in formula (13);
[0116]
[0117] Step 2: Construct an asymmetric prediction error histogram
[0118] Step 2.1: max(·) is used as an asymmetric selection function, and the i,j The first prediction error value and the second prediction error value Determine the maximum prediction error for the current pixel As shown in formula (14);
[0119]
[0120] Step 2.2: The maximum prediction error of all pixels in set A Aggregate and construct an asymmetric histogram h of the maximum error + (e);
[0121] Step 2.3: min(·) is used as the asymmetric selection function, and the i,j The first prediction error value and the second prediction error value Determine the minimum prediction error for the current pixel As shown in formula (15);
[0122]
[0123] Step 2.4: The minimum prediction error of all pixels in set A Aggregate and construct an asymmetric histogram h with minimum error - (e);
[0124] Step 3, randomly generate a data string of 0 and 1 as the data to be embedded W, embed W into the set A and the set B, combine the set A and the set B after the data W is embedded, and obtain the encrypted image;
[0125] Step 3.1, dividing the data to be embedded W into four parts D1, D2, D3 and D4 according to the embedding capacity at different stages;
[0126] Repeat step 1 to get the first prediction error of each pixel in set A and second
[0127] Step 3.2: Use max(·) as the asymmetric selection function and calculate the first prediction error of each pixel in set A. and the second prediction error Determine the maximum prediction error through step 2 Construct an asymmetric histogram of maximum errors
[0128] Step 3.3, by scanning the set A, embed the data D1 into the original image according to formula (16);
[0129]
[0130] In formula (16), x i,j,A is the pixel value of the current pixel in the A set, Z +,A is the asymmetric histogram of the maximum error constructed The zero point, P +,A is the asymmetric histogram of the maximum error constructed The peak point of , b is 1 bit of data to be embedded in the data D1;
[0131] Step 3.4, use min(·) as the asymmetric selection function, according to the first prediction error of each pixel in set A and the second prediction error Determine the minimum prediction error through step 2 Constructing an asymmetric histogram of minimum error
[0132] Step 3.5, scan set A again, and embed the data D2 into the original image using formula (17);
[0133]
[0134] In formula (17), Z -,A An asymmetric histogram of the minimum error constructed The zero point, P -,A An asymmetric histogram of the minimum error constructed The peak point of , b is 1 bit of data to be embedded in the data D2;
[0135] Step 3.6, based on the set A after embedding data D1 and data D2, repeat steps 3.1 to 3.5 to embed data D3 and D4 into the set B;
[0136] Step 3.7, combining the A set and the B set after embedding the data to obtain the encrypted image;
[0137] Step 4, extracting the embedded data from the B set and the A set in the encrypted image obtained in step 3 and restoring the original pixels;
[0138] The extraction process is the opposite of the embedding process. First, the embedded data is extracted from the B set of the encrypted image and the related original pixels are restored. Then the same operation is performed on the A set of the encrypted image.
[0139] Step 4.1: Repeat step 1 for each pixel in the B set of the encrypted image obtained in step 3 to obtain the first prediction error of each pixel in the B set of the encrypted image. and the second prediction error
[0140] Step 4.2, using min(·) as the asymmetric selection function, according to the first prediction error of each pixel in the B set of the encrypted image and the second prediction error Determine the minimum prediction error through step 2 Constructing an asymmetric histogram of minimum error
[0141] Step 4.3, extract the embedded data D4 in the B set of the encrypted image by formula (18), and then restore the pixels moved by the embedded data according to formula (19);
[0142]
[0143]
[0144] In formulas (18) and (19), P -,B An asymmetric histogram of the minimum error constructed The peak point of b is the extracted data. represents the encrypted image pixel value after embedding data D4, To extract the data and restore the pixel value, Z -,B Asymmetric histogram representing the constructed minimum error The zero point of
[0145] Step 4.4, using max(·) as the asymmetric selection function, according to the first prediction error of each pixel in the B set of the encrypted image and the second prediction error Determine the maximum prediction error through step 2 Construct an asymmetric histogram of maximum errors
[0146] Step 4.5, extract the embedded data D3 in the B set of the encrypted image by formula (20), and then restore the pixels moved due to the embedded data according to formula (21);
[0147]
[0148]
[0149] In formulas (20) and (21), P +,B is the asymmetric histogram of the maximum error constructed The peak point, Z +,B is the asymmetric histogram of the maximum error constructed The zero point of
[0150] Step 4.6, based on the extracted and restored set B, repeat steps 4.1 to 4.5 to extract and restore the set A of the encrypted image to obtain the extracted data D2 and D1;
[0151] In step 4.7, all embedded data is obtained by connecting D1, D2, D3 and D4, thereby completely restoring the original image without losing any information.
[0152] In order to demonstrate the performance of the proposed method, Figure 4 A series of experiments are conducted on normal grayscale images of size 512×512 pixels, where a randomly generated bitstream is used as the secret data, which is embedded into each test image. The proposed method is evaluated in terms of image visual quality, embedding capacity, etc. The following is a comparative experiment between the proposed method and the methods of Chen et al. and Jung et al.
[0153] 1. Visual quality of encrypted images
[0154] In order to quantitatively evaluate the encrypted image, the peak signal-to-noise ratio (PSNR) is used as an objective measure of the image visual quality to identify the similarity between the original image and the corresponding encrypted image. For the encrypted image, the PSNR calculation is shown in formula (22):
[0155]
[0156] where x i,j and i,j Represent the original image pixel value and the marked pixel value respectively. Figure 5 The six test images shown in FIG. 1 are curves of embedding capacity and image quality at different embedding capacities obtained by the method of the present invention and the method of Jung et al. Figure 6 shown.
[0157] from Figure 7 It can be seen that under different embedding capacities, the image visual quality performance of the proposed method is better than that of other methods. As mentioned above, take the smooth image "Plane" and the texture image "Baboon" as examples. Figure 7 It can be seen that the method of the present invention can obtain a higher PSNR value, which can ensure that the marked host image has good visual quality. For the image "Plane", when the embedding capacity is 0.01bpp and 0.15bpp, the PSNR values of the method of the present invention are 63.81dB and 53.32dB respectively, while the method of Chen et al. only obtains 63.29dB and 52.02dB, and the method of Jung et al. only obtains 63.7dB and 52.13dB. For the image "Baboon", when the embedding capacity is 0.01bpp and 0.06bpp, the PSNR values of the method of the present invention are 57.72dB and 51.16dB respectively, while the method of Chen et al. only obtains 56.01dB and 50.53dB, and the method of Jung et al. only obtains 56.08dB and 50.47dB. Moreover, with the increase of the embedding capacity, the PSNR values of the methods of Chen et al. and Jung et al. decrease rapidly, resulting in a serious decrease in the visual quality of the encrypted image. When the embedding capacity is 0.06bpp, the PSNR values of the six test images are shown in Table 1. Figure 5 For the test images shown, the visual image quality obtained by the method of the present invention is better than that of the methods of Chen et al. and Jung et al.
[0158] Table 1 When the embedding capacity is 0.07Bpp, Figure 5 PSNR values of the 6 test images
[0159]
[0160] In summary, the encrypted image obtained by the method of the present invention has good image visual quality at low, high and average embedding capacities. There are two main reasons for this performance: first, during the embedding process, the asymmetric error histogram moves in the direction of less data, and the number of modified pixels is small. Therefore, the distortion of the encrypted image is reduced to a great extent; on the other hand, no matter whether the method uses image set A or set B to embed the entire data, the two corresponding error histograms are moved in opposite directions. When the asymmetric minimum error histogram moves, some pixels modified during the movement of the asymmetric maximum error histogram can be restored to their original values. Therefore, if Figure 6 As shown, the method of the present invention can further improve the visual quality of the encrypted image.
[0161] 2. Image Embedding Capacity
[0162] Figure 6 The comparison of the maximum embedding capacity of the proposed method with the methods of Chen et al. and Jung et al. on six test images is depicted. In order to quantitatively evaluate the increase in embedding capacity, the percentage of increased payload between the two methods is defined as formula (23) as follows:
[0163]
[0164] Among them, M payload and are the maximum embedding capacities of the method of this application and other methods, respectively. Figure 6 It can be seen that this method can obtain the maximum embedding capacity. For the image "Plane", the maximum payload obtained by the method is 69088 bits and 45222 bits, respectively, while the maximum payload obtained by this method is 80277 bits, which are increased by 16.2% and 77.5%, respectively. For the "Baboon" image, the maximum payloads obtained by the methods of Chen et al. and Jung et al. are 18407 bits and 16271, respectively, while the maximum payload obtained by this method is 21778 bits, which are increased by 18.3% and 33.8%, respectively. At the same time, for these 6 test images, the average embedding capacity of the methods of Chen et al. and Jung et al. is 40667 bits and 29929 bits, respectively, and the average embedding capacity of this method is 49129 bits, which are increased by 20.8% and 64.2%, respectively.
[0165] from Figure 6 It can be clearly seen that no matter whether the test image is smooth or textured, the proposed method can obtain significant embedding capacity. This is because the images are divided into two groups, such as Figure 1 As shown in , each group of asymmetric histograms based on the maximum prediction and the minimum prediction are embedded twice, which effectively increases the embeddable positions of the secret data. At the same time, the shape of the moving side of the asymmetric error histogram is concave, as shown in Figure 2 and Figure 3 As shown. The smaller the height of the embedding point, the lower the embedding efficiency. Since this method uses more accurate prediction, namely horizontal vertical prediction and diagonal prediction method to calculate the prediction error of image pixels, the height of the embedding point can be guaranteed, which means that more pixels can be moved to embed the secret data.
Claims
1. A reversible data hiding method based on prediction error histogram movement, characterized in that: Follow the steps below to implement it: Step 1: Divide the original image into two sets, A and B, and calculate the prediction error of the current pixel in set A and set B; The specific process of step 1 is: Step 1.1, assuming the size of the original image is Pixels, according to the checkerboard pattern, the original image is divided into two sets A and B according to formula (1); (1) In formula (1), is the current pixel of the original image, is the horizontal coordinate of the current pixel of the original image, is the ordinate of the current pixel of the original image; Step 1.2: For the A set, for the current pixel , calculate the average value of the left and right pixels of the current pixel along the horizontal direction The average value of the pixels above and below the current pixel in the vertical direction , as shown in formula (2); (2) In formula (2), is the left pixel of the current pixel in set A, is the pixel to the right of the current pixel in set A, is the pixel above the current pixel in set A, is the pixel below the current pixel in set A; Step 1.3, calculate the mean difference in the horizontal direction and the vertical mean difference , as shown in formula (3); (3) Step 1.4, calculate the mean difference in the horizontal direction The weight of and the vertical mean difference The weight of , as shown in formula (4); (4) Step 1.5, calculate the current pixel of set A The first predicted pixel value , as shown in formula (5); (5) Step 1.6, calculate the first predicted pixel value of set A The prediction error value of , as shown in formula (6); (6) Step 1.7, calculate the right pixels in set A respectively The predicted pixel mean of the main diagonal pixels and the right pixel in set A The predicted pixel mean of the sub-diagonal pixels , as shown in formula (7); (7) In formula (7), for The pixel value at the bottom right of the pixel, for The pixel value at the top right of the pixel; Step 1.8, calculate the mean difference of the main diagonal pixels respectively and the mean difference of the sub-diagonal pixels , as shown in formula (8); (8) Step 1.9, calculate the mean difference of the main diagonal pixels respectively The weight of and the mean difference of the sub-diagonal pixels The weight of , as shown in formula (9); (9) Step 1.10, calculate the right pixel in set A The predicted pixel value , as shown in formula (10); (10) Step 1.11: Calculate the top pixels in set A according to steps 1.7 to 1.10 The predicted pixel value , left pixel The predicted pixel value , pixels below The predicted pixel value , find the average of the predicted pixel values of the right pixel, the predicted pixel values of the upper pixel, the predicted pixel values of the left pixel, and the predicted pixel values of the lower pixel , as shown in formula (11); (11) Step 1.12, calculate the current pixel in set A The second predicted pixel value , as shown in formula (12); (12) Step 1.13, calculate the second predicted pixel value of the current pixel The prediction error value of , as shown in formula (13); (13); Step 2, construct an asymmetric prediction error histogram; The specific process of step 2 is: Step 2.1, As an asymmetric selection function, according to the current pixel The first prediction error value and the second prediction error value , determine the maximum prediction error of the current pixel , as shown in formula (14); (14) Step 2.2: The maximum prediction error of all pixels in set A Aggregation, constructing an asymmetric histogram of the maximum error ; Step 2.3, As an asymmetric selection function, according to the current pixel The first prediction error value and the second prediction error value , determine the minimum prediction error of the current pixel , as shown in formula (15); (15) Step 2.4: The minimum prediction error of all pixels in set A Aggregation, constructing an asymmetric histogram with minimum error ; Step 3, randomly generate a data string of 0 and 1 as the data to be embedded W, embed W into the set A and the set B, combine the set A and the set B after the data W is embedded, and obtain the encrypted image; The specific process of step 3 is: Step 3.1, according to the embedding capacity of different stages, the data to be embedded W is divided into four parts , , and ; Repeat step 1 to get the first prediction error of each pixel in set A and second ; Step 3.2, use As an asymmetric selection function, according to the first prediction error of each pixel in set A and the second prediction error , determine the maximum prediction error through step 2 , construct an asymmetric histogram of the maximum error ; Step 3.3, by scanning the A set, according to formula (16), the data Embedded into the original image; (16) In formula (16), is the pixel value of the current pixel in set A, is the asymmetric histogram of the maximum error constructed The zero point of is the asymmetric histogram of the maximum error constructed The peak point, Data to be embedded 1 bit of data in ; Step 3.4, use As an asymmetric selection function, according to the first prediction error of each pixel in set A and the second prediction error , determine the minimum prediction error through step 2 , construct an asymmetric histogram of minimum error ; Step 3.5, scan set A again and use formula (17) to convert the data Embedded into the original image; (17) In formula (17), An asymmetric histogram of the minimum error constructed The zero point of An asymmetric histogram of the minimum error constructed The peak point, Data to be embedded 1 bit of data in ; Step 3.6, embedding data and data Repeat steps 3.1 to 3.5 based on the A set. and Embedded in set B; Step 3.7, combining the A set and the B set after embedding the data to obtain the encrypted image; Step 4: extract the embedded data from the B set and the A set in the encrypted image obtained in step 3 and restore the original pixels.
2. The reversible data hiding method based on prediction error histogram movement according to claim 1 is characterized in that: The specific process of step 4 is: Step 4.1: Repeat step 1 for each pixel in the B set of the encrypted image obtained in step 3 to obtain the first prediction error of each pixel in the B set of the encrypted image. and the second prediction error ; Step 4.2, use As an asymmetric selection function, according to the first prediction error of each pixel in the B set of the encrypted image and the second prediction error , determine the minimum prediction error through step 2 , construct an asymmetric histogram of minimum error ; Step 4.3, extract the data embedded in the B set of the encrypted image through formula (18) , and then restore the pixels moved due to the embedded data according to formula (19); (18) (19) In formulas (18) and (19), An asymmetric histogram of the minimum error constructed The peak point, For the extracted data, Represents embedded data The encrypted image pixel value after To extract the data and restore the pixel value, Asymmetric histogram representing the constructed minimum error The zero point of Step 4.4, use As an asymmetric selection function, according to the first prediction error of each pixel in the B set of the encrypted image and the second prediction error , determine the maximum prediction error through step 2 , construct an asymmetric histogram of the maximum error ; Step 4.5, extract the data embedded in the B set of the encrypted image through formula (20) , and then restore the pixels moved due to the embedded data according to formula (21); (20) (21) In formulas (20) and (21), is the asymmetric histogram of the maximum error constructed The peak point, is the asymmetric histogram of the maximum error constructed The zero point of Step 4.6, based on the extracted and restored set B, repeat steps 4.1 to 4.5 to extract and restore the encrypted image set A to obtain the extracted data and ; Step 4.7, connect , , and All embedded data is obtained, and the original image can be completely restored without losing information.