Adaptive Reversible Data Hiding Method Based on Image Blocking and Histogram Shifting
Through an adaptive reversible data hiding method of blocking and sorting images, the pixel value is adjusted using the peak and zero points of the sub-graph, the problems of insufficient embedding capacity and poor image quality in the prior art are solved, and efficient information embedding and decryption are achieved.
Patent Information
- Application Number
- CN202111458244.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-12-02
AI Technical Summary
The existing reversible data hiding method based on histogram translation has low image embedding levels and high dependence on image content, resulting in insufficient embedding capacity and poor image quality.
Adaptive reversible data hiding method of image chunking and histogram translation is adopted. By blocking the images and sorting them according to certain rules, information embedding and decryption is realized, and pixel value adjustment is used to improve embedding capacity and image quality.
The embedding capacity of the image is improved while maintaining good image quality and reducing the degree of image degradation.
Smart Images

Figure CN114331793B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an adaptive reversible data hiding method based on image block segmentation and histogram translation, belonging to the field of image encryption technology in the field of information security. Background Art
[0002] Reversible data hiding embeds secret information into a carrier medium in a reversible and lossless manner. The so-called reversibility means that not only can the secret information be recovered completely and correctly, but also the carrier medium can be completely restored without any damage.
[0003] There are two common types of reversible data hiding methods: algorithms based on histogram translation and algorithms based on difference expansion. Algorithms based on histogram translation have a small change in image gray values and a low degree of image degradation. The disadvantages are that the image embedding level is low, and the algorithm has a high dependence on the image content, that is, the algorithm has a greater impact on the embedding level of different types of images. Summary of the Invention
[0004] Aiming at the defects existing in the above-mentioned prior art, the present invention aims to provide an adaptive reversible data hiding method based on image block segmentation and histogram translation. By segmenting the image and sorting the sub-images according to certain rules, the image can have a high embedding capacity while ensuring good image quality.
[0005] The present invention adopts the following technical solutions to solve the above technical problems:
[0006] An adaptive reversible data hiding method based on image block segmentation and histogram translation, comprising the following steps:
[0007] (1) Perform block processing on the original image P and divide it into k sub-images p1, p2... p k ;
[0008] (2) Sort the k sub-images according to certain rules to obtain a new sequence (s1, s2... s k );
[0009] (3) Embed information into the sub-images in sequence according to the sequence in step (2) to complete the encryption of the k sub-images;
[0010] Since the embedding steps of each sub-image are the same, taking s1 as an example:
[0011] (3.1) Process s1, digitize s1 through Matlab software to form a gray histogram H x1 , and find the peak h(b) and zero point h(a) in H x1 ;
[0012] (3.2) Determine whether h(a) is zero: If h(a) is not zero, record the coordinates (i, j) and pixel value a of the pixel points with pixel value a as the pixel value, denoted as the overhead information O, and then set h(a) to zero; if h(a) is zero, the overhead information O is 0;
[0013] (3.3) Determine the magnitudes of a and b: If a > b, shift the pixel values between (b, a) one bit to the right; conversely, if a < b, shift the pixel values between (b, a) one bit to the left;
[0014] (3.4) Embed the secret information: If a > b, retrieve s1 again. When the pixel value of the pixel point is retrieved as b, check the sequence to be embedded. If the bit to be embedded is 1, modify the pixel value b of this pixel point to b + 1; if the bit to be embedded is 0, keep the pixel value of this pixel point unchanged;
[0015] (4) Integrate the encrypted sub - graphs to form a complete ciphertext image E.
[0016] Further, the step (2) specifically includes the following sub - steps:
[0017] (2.1) The calculation method of the embedding capacity of the sub - graph is as follows:
[0018] (2.1.1) Determine the peak value and zero point of the sub - graph;
[0019] (2.1.2) Record the coordinates and pixel values of the non - zero zero points, denoted as the overhead information O, and mark this zero point as 0;
[0020] (2.1.3) The expression of the embedding capacity of the sub - graph is:
[0021] H = h(b)-O
[0022] Where H is the embedding capacity and h(b) is the peak value.
[0023] Further, the distance between the peak value and the zero point in (2.2) is:
[0024] L = |a - b|
[0025] Where L is the distance between the peak value and the zero point of the sub - graph, |·| represents taking the absolute value, a is the pixel value corresponding to the zero point, and b is the pixel value corresponding to the peak value.
[0026] A decryption method for a ciphertext image, the ciphertext image is encrypted by the above - mentioned adaptive reversible data hiding method based on image block division and histogram translation, and includes the following steps:
[0027] 1) Perform block processing on the ciphertext image E to obtain k ciphertext sub - graphs;
[0028] 2) Sort the k ciphertext sub - graphs according to the set rules to obtain a sequence of k ciphertext sub - graphs (e1, e2 …… e k ), where e i represents the i - th ciphertext sub - graph after sorting;
[0029] 3) Decrypt the k encrypted sub - graphs in sequence according to the sorting in step 2). Specifically: 3.1) Retrieve e i in the order from top to bottom and from left to right. When the pixel value of the retrieved pixel point is b + 1, extract the embedded information as 1, otherwise extract the embedded information as 0 until all the embedded information is extracted;
[0030] 3.2) Compare the magnitudes of a and b: Retrieve e i again. If a > b, shift all the pixel values between (a, b) one position to the left; otherwise, shift all the pixel values between (a, b) one position to the right;
[0031] 3.3) Check the overhead information O: If the overhead information O is not 0, extract the overhead information for zero point restoration, otherwise do not process;
[0032] 4) Integrate the k decrypted ciphertext sub - graphs to form the complete original image P.
[0033] Compared with the prior art, the present invention adopts the above technical solutions and has the following technical effects: The present invention utilizes image partitioning to affect the number of zero points of the image, thereby affecting the embedding capacity of the image, and utilizes sub - graph sorting to affect the quality of the encrypted image and the complexity of the encryption algorithm. This method not only realizes strong reversible data hiding of the image, increases the embedding capacity of the image, but also improves the image quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is the original image of Embodiment 1;
[0035] Figure 2 are the 4 sub - graphs divided in Embodiment 1, where (a) - (d) respectively represent the 4 sub - graphs after partitioning;
[0036] Figure 3 is the gray - level histogram of a sub - graph in Embodiment 1;
[0037] Figure 4 is the encrypted image of Embodiment 1;
[0038] Figure 5 is the comparison of the embedding capacity before and after image partitioning of Lena, Peppers, Portofino, and Zelda images;
[0039] Figure 6It is the comparison of the image quality before and after image segmentation of Lena, Peppers, Portofino, and Zelda images;
[0040] Figure 7 It is the flowchart of the method of the present invention. Specific embodiments
[0041] The technical solution of the present invention will be further elaborated below in conjunction with the accompanying drawings and specific embodiments.
[0042] As Figure 7 shown, in this embodiment, MATLAB2020 is used for simulation, and the original image selects the Lena image with a size of 512×512 (as Figure 1 shown), and the image pixels are composed of 8 bits. The specific process is as follows:
[0043] (1) Divide the Lena image into 4 sub-images (p1, p2, p3, p4), as Figure 2 shown in (a)-(d) of
[0044] (2) Sort the 4 sub-images according to a certain rule to obtain a new sequence (s1, s2, s3, s4) of the 4 sub-images. In this embodiment, any of the following sorting methods can be selected:
[0045] (2.1) Sort the sub-images according to the embedding capacity H of each sub-image: The embedding capacities of the four sub-images of Lena are: 1873, 2520, 1032, 2322;
[0046] (2.2) Sort the sub-images according to the distance between the peak point and the zero point of each sub-image: The distances between the peak points and the zero points of the four sub-images of Lena are: 158, 182, 200, 174.
[0047] (3) Embed information into the sub-images in sequence according to the sequence in step (2) (since the embedding steps of each sub-image are the same, s1 is taken as an example):
[0048] (3.1) Process s1, digitize s1 through Matlab software to form a gray histogram H as Figure 3 shown. In this embodiment, the peak h(b) of H x1 is 1032, and the zero point h(a) is 0; x1 In this embodiment, h(a) is 0, that is, the overhead information O is 0;
[0049] (3.3) In this embodiment, b = 201 > a = 0, then the pixel values belonging to the interval (a, b) are shifted one bit to the left;
[0050]
[0051] (3.4) Embed the encrypted information: When the pixel value of a pixel point is retrieved as 201, check the sequence to be embedded. If the bit to be embedded is 1, modify the pixel value 201 to 201 + 1 = 202. If the bit to be embedded is 0, keep the pixel value 201 unchanged.
[0052] (4) Integrate the encrypted sub - graphs to form a complete encrypted image E, as Figure 4 shown.
[0053] Decrypt the above - mentioned encrypted image E, including the following steps:
[0054] 1) Perform block processing on the encrypted image to obtain k encrypted sub - graphs;
[0055] 2) Sort the k encrypted sub - graphs according to the aforementioned set rules to obtain a sequence of k encrypted sub - graphs (e1, e2……e k ), where e i represents the i - th encrypted sub - graph after sorting;
[0056] 3) Decrypt the k encrypted sub - graphs in sequence according to the sorting in step 2). (Since the decryption steps of each encrypted sub - graph are the same, taking e1 as an example:
[0057] 3.1) Retrieve e1 in the order from top to bottom and from left to right. When the pixel value of a pixel point is retrieved as 201 + 1, extract the embedded information as 1 (i.e., modify the pixel value to 201), otherwise extract the embedded information as 0 (i.e., keep the pixel value unchanged) until all the embedded information is extracted;
[0058] 3.2) In this embodiment, b = 201 > a = 0, then shift all the pixel values between (a, b) one bit to the right;
[0059] 3.3) In this embodiment, the overhead information O is not 0, so no zero - point restoration processing is required;
[0060] 4) Integrate the k decrypted encrypted sub - graphs to form a complete original image.
[0061] Next, perform performance analysis on the image scrambling method of the present invention.
[0062] I. Analysis of the number of zero points and embedding capacity of the image
[0063] For the secret information embedding based on histogram shifting, the actual embedding capacity is equal to the maximum value in the histogram minus the overhead information. In the present invention, first, we divide the image into a certain number of sub-images, and each sub-image has its own maximum and minimum values. The image segmentation strategy will increase the number of zero points in the image, thereby reducing the overhead information and increasing the embedding capacity. We use Table 1 to compare the change in the number of zero points of the Lena image before and after block division.
[0064] Table 1 Comparison of the number of zero points of the Lena image before and after block division
[0065] Chunk 1 2 4 6 8 12 16 20 Number of zeros 71 148 306 507 679 1046 1496 1899
[0066] We use a line chart to compare the embedding capacities of the Lena, Peppers, Portofino, and Zelda images before and after block division. As Figure 5 shown.
[0067] II. Image quality analysis
[0068] The image quality is usually evaluated by the peak signal-to-noise ratio (PSNR) of the image. The larger the PSNR, the better the image quality. The PSNR expression is:
[0069]
[0070] The PSNR of the image after simple block division is above 48 dB. With the significant improvement of the embedding capacity, the image quality is well maintained. We use a line chart to compare the image qualities of the Lena, Peppers, Portofino, and Zelda images before and after block division, as Figure 6 shown.
[0071] The above is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. An adaptive reversible data hiding method based on image block segmentation and histogram shifting, characterized in that, It includes the following steps: (1) The original image is divided into blocks to obtain k sub-images; (2) Sort the k subgraphs according to the set rules to obtain a sequence of k subgraphs (s1, s2...s k ), s i represents the i-th subgraph after sorting; (3) Encryption information is embedded into the k sub-images in sequence according to the sorting in step (2). Specifically: (3.1) Digitalize s i to form a grayscale histogram Find out the peak h(b) and zero point h(a) in it; where a and b respectively represent the pixel values corresponding to the zero point and the peak (3.2) Determine whether h(a) is zero: If h(a) is not zero, record the coordinates and pixel value a of the pixel point with pixel value a, denoted as overhead information O, and then set h(a) to zero; If h(a) is zero, the overhead information O is 0; (3.3) Compare the magnitudes of a and b: If a > b, move all pixel values between (b, a) one bit to the right; Otherwise, move all pixel values between (b, a) one bit to the left; (3.4) Embed the encrypted information: If a > b, retrieve s i , when the pixel value of the retrieved pixel point is b, check the encrypted information to be embedded. If the bit to be embedded is 1, modify the pixel value of this pixel point to b + 1; otherwise, the pixel value of this pixel point remains unchanged; (4) The k sub-images after embedding the encryption information in step (3) are integrated to form a complete ciphertext image; The setting rule in step (2) is one of the following two rules: (2.1) Sort the sub-images according to the embedding capacity of each sub-image; (2.2) Sort the sub-images according to the distance between the peak point and the zero point of each sub-image.
2. An adaptive reversible data hiding method based on image block segmentation and histogram shifting as claimed in claim 1, characterized in that The calculation method of the embedding capacity of the sub-image in (2.1) is: (2.1.1) Determine the peak and zero point of the sub-image; (2.1.2) Record the coordinates and pixel value of the non-zero zero point, denoted as overhead information O, and denote this zero point as 0; (2.1.3) The expression of the embedding capacity of the sub-image is: H = h(b) - O where H is the embedding capacity and h(b) is the peak value.
3. An adaptive reversible data hiding method based on image block division and histogram shifting as described in claim 1, characterized in that, (2.2) The distance between the peak and the zero point of the sub-image is: L = |a - b| where L is the distance between the peak and the zero point of the sub-image, |·| represents taking the absolute value, a is the pixel value corresponding to the zero point, and b is the pixel value corresponding to the peak value.
4. A decryption method for a ciphertext image, wherein the ciphertext image is encrypted by an adaptive reversible data hiding method based on image block division and histogram translation as described in any one of claims 1 to 3, and is characterized in that, It includes the following steps: 1) The ciphertext image is divided into blocks to obtain k ciphertext sub-images; 2) Sort the k ciphertext subgraphs according to the set rules to obtain a sequence of k encrypted subgraphs (e1, e2... e k ), where e i represents the i-th ciphertext subgraph after sorting; 3) Decrypt the k encrypted sub - graphs in sequence according to the sorting in step 2), specifically: 3.1) Retrieve e in the order from top to bottom and from left to right i , when the pixel value of the pixel point is retrieved as b + 1, the embedded information extracted is 1, otherwise the embedded information extracted is 0, until all the embedded information is extracted; 3.2) Compare the magnitudes of a and b: Retrieve e again i , if a > b, shift all pixel values between (a, b) one position to the left; otherwise, shift all pixel values between (a, b) one position to the right; 3.3) Check the overhead information O: If the overhead information O is not 0, extract the overhead information to restore the zero point, otherwise do nothing; 4) The k encrypted sub-images after decryption are integrated to form a complete original image.
5. The decryption method of a ciphertext image according to claim 4, characterized in that, The method of dividing the ciphertext image into blocks in step 1) is the same as that of dividing the original image into blocks.
Citation Information
Patent Citations
Reversible information hiding method based on blocked self-adaptive histogram translation
CN105488773A
Image reversible information hiding method based on PVO and 3D mapping modification
CN113095990A