A reversible data hiding method and device based on histogram shift
By performing sub-block division and entropy decoding on JPEG pictures, preferential selection of coefficient blocks with less impact according to the condition threshold for data hiding, the problem of image visual loss and file size changes caused by data hiding in the prior art is solved, and efficient , reversible data hiding effect.
Patent Information
- Application Number
- CN202111535744.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-12-15
AI Technical Summary
When the prior art hides data into JPEG pictures, it is easy to cause problems such as visual loss of the picture and abnormal changes in file size.
By dividing the original image into sub-blocks, performing entropy decoding processing, and determining the embeddable DCT coefficient blocks based on preset sorting rules and conditional thresholds, preferentially selecting coefficient blocks with less impact on the image for data hiding, avoiding invalid displacement of external coefficients , ensure a balance between image quality and embed capacity.
It realizes that the auxiliary message length is effectively controlled while ensuring image quality, avoiding visual loss of image and abnormal changes in file size, and improving the efficiency and reversibility of data hiding.
Smart Images

Figure CN114189597B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a reversible data hiding method and device based on histogram shifting. Background Art
[0002] With the strengthening of privacy awareness, the protection of customer information when banks handle business and the hiding of private data in the system production environment are also receiving attention from the banking industry. Private information or keys are absolutely not satisfied with being transmitted in the network and stored on the terminal in plain text. These private information or keys need to be encrypted or hidden.
[0003] With the widespread use of digital images, data hiding algorithms based on images (Joint Photographic Experts Group, JPEG) are often used to embed and extract these special data on the image carrier. In JPEG images with different quality factors, the AC coefficients with a value of "0" are concentrated in the high-frequency part of the image. If a high-frequency coefficient similar to the "0" coefficient is selected for modification, on the one hand, the image will be severely distorted due to too many extended coefficients, and on the other hand, the run length in the run length encoding of the AC coefficient will increase, which will lead to obvious visual loss of the image carrying hidden information and abnormal changes in the size of the image file. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a reversible data hiding method and device based on histogram shifting to solve the problem in the prior art that pictures carrying hidden information have obvious visual loss and the size of picture files is prone to abnormal changes.
[0005] To achieve the above objectives, the present application provides the following technical solutions:
[0006] A first aspect of an embodiment of the present invention shows a reversible data hiding method based on histogram shifting, the method comprising:
[0007] Dividing the original image into sub-blocks, where the number of the sub-blocks is multiple;
[0008] Performing entropy decoding on each of the sub-blocks to obtain a corresponding discrete cosine transform (DCT) coefficient block;
[0009] When it is determined that the embedding capacity of the original picture meets the embedding requirement of the information to be embedded, based on the order of each of the DCT coefficient blocks and the message bit of the auxiliary information, a DCT coefficient block in which the auxiliary information can be embedded is determined, and the DCT coefficient block is set as a first target block, wherein the order of each of the DCT coefficient blocks is ordered according to a preset ordering rule;
[0010] Embedding auxiliary information into the first target block according to a first preset order based on an embedding algorithm, the auxiliary information including a message bit length of the information to be embedded and a pre-calculated conditional threshold;
[0011] According to a pre-calculated conditional threshold and the number of zero AC coefficients in each DCT coefficient block, a DCT coefficient block in which the information to be embedded can be embedded is determined as a second target block;
[0012] Embedding the message bits of the information to be embedded into the second target block in sequence according to a second preset order based on an embedding algorithm;
[0013] The first target block embedded with auxiliary information, the second target block embedded with information to be embedded, and all remaining DCT coefficient blocks are entropy encoded to generate a marked picture.
[0014] Optionally, also include:
[0015] After receiving the marked picture, entropy decoding is performed on the picture to obtain a corresponding DCT coefficient block, and the number of zero AC coefficients in each DCT coefficient block is counted;
[0016] Determining a first target block for storing the auxiliary information based on the length of the auxiliary message bits and a preset ordering rule of the DCT coefficient blocks;
[0017] extracting auxiliary information in the first target block based on an extraction algorithm;
[0018] Determine a second target block from the DCT coefficient blocks based on the threshold information in the auxiliary information and the number of zero AC coefficients in each DCT coefficient block;
[0019] extracting the message bits in the second target block based on the message bit length of the embedded information in the auxiliary information and the extraction algorithm;
[0020] After extracting the message bits in all the second target blocks, all the DCT coefficient blocks are entropy encoded to generate a JPEG picture.
[0021] Optionally, determining that the embedding capacity of the original image meets the embedding requirement of the information to be embedded includes:
[0022] Count the number of internal coefficients in each DCT coefficient block;
[0023] Determining whether the number of message bits of the message to be embedded is less than or equal to the number of internal coefficients;
[0024] If it is less than or equal to, determining that the embedding capacity of the original image meets the embedding requirement of the information to be embedded;
[0025] If it is greater, it is determined that the embedding capacity of the original image does not meet the embedding requirement of the information to be embedded.
[0026] Optionally, embedding the auxiliary information into the first target block according to a first preset order based on an embedding algorithm includes:
[0027] For each internal coefficient in the first target block, hide each message bit of the auxiliary information based on the internal coefficient to determine a marked internal coefficient;
[0028] When it is determined that each message bit in the auxiliary information has a corresponding marked internal coefficient, it is determined that the embedding of the auxiliary information is completed.
[0029] Optionally, determining the DCT coefficient block in which the information to be embedded can be embedded as the second target block according to the pre-calculated conditional threshold and the number of zero AC coefficients in each DCT coefficient block includes:
[0030] Calculate the number of zero AC coefficients in each DCT coefficient block;
[0031] The number of zero AC coefficients in each DCT coefficient block is compared with a pre-calculated conditional threshold;
[0032] When it is determined that the number of AC coefficients with values of zero in the DCT coefficient block is greater than a pre-calculated conditional threshold, the DCT coefficient block is determined to be a second target block.
[0033] Optionally, embedding the message bits of the information to be embedded into the second target block in sequence according to a second preset order based on an embedding algorithm includes:
[0034] hiding the message bit of the embedded information based on each internal coefficient in the second target block to determine the marked internal coefficient;
[0035] When it is determined that each message bit in the embedded information has a corresponding marked internal coefficient, it is determined that the embedding of the embedded information is completed.
[0036] Optionally, extracting the message bits of the message to be embedded in the second target block based on the extraction algorithm includes:
[0037] For each of the second target blocks, determining each marked internal coefficient in the second target block;
[0038] The message bits of the message to be embedded are extracted from each marked inner coefficient based on the extraction algorithm.
[0039] A second aspect of an embodiment of the present invention shows a reversible data hiding device based on histogram shifting, the device comprising:
[0040] A dividing unit, used for dividing the original picture into multiple sub-blocks;
[0041] A first processing unit is used to perform entropy decoding processing on each of the sub-blocks to obtain a corresponding discrete cosine transform DCT coefficient block;
[0042] a first determining unit, configured to, when determining that the embedding capacity of the original picture meets the embedding requirement of the information to be embedded, determine the DCT coefficient block in which the auxiliary information can be embedded based on the order of each of the DCT coefficient blocks and the message bit of the auxiliary information, and set the DCT coefficient block as the first target block, wherein the order of each of the DCT coefficient blocks is arranged according to a preset ordering rule; and determine the DCT coefficient block in which the information to be embedded can be embedded as the second target block according to a pre-calculated conditional threshold and the number of zero AC coefficients in each DCT coefficient block;
[0043] an embedding processing unit, configured to embed auxiliary information into the first target block according to a first preset order based on an embedding algorithm, wherein the auxiliary information includes a message bit length of the information to be embedded and a pre-calculated conditional threshold; and to embed the message bits of the information to be embedded into the second target block in sequence according to a second preset order based on the embedding algorithm;
[0044] The first generating unit is used to perform entropy coding on the first target block embedded with auxiliary information, the second target block embedded with information to be embedded, and all remaining DCT coefficient blocks to generate a marked picture.
[0045] Optionally, also include:
[0046] A second processing unit is used to perform entropy decoding on the marked picture after receiving the picture to obtain a corresponding DCT coefficient block, and count the number of zero AC coefficients in each DCT coefficient block;
[0047] A second determination unit is configured to determine a first target block storing auxiliary information based on the length of the auxiliary message bit and a preset sorting rule of the DCT coefficient block; and determine a second target block storing hidden information based on threshold information in the auxiliary information and the number of zero AC coefficients in each DCT coefficient block;
[0048] an extraction unit, configured to extract the auxiliary information in the first target block based on an extraction algorithm; and extract the message bits in the second target block based on the message bit length of the information embedded in the auxiliary information and the extraction algorithm;
[0049] The second generating unit is used to perform entropy coding on all the DCT coefficient blocks to generate a JPEG picture after extracting the message bits in all the second target blocks.
[0050] Optionally, the first determination unit for determining whether the embedding capacity of the original image meets the embedding requirements of the information to be embedded is specifically used to: count the number of internal coefficients in each DCT coefficient block; determine whether the number of message bits of the message to be embedded is less than or equal to the number of internal coefficients; if less than or equal to, determine that the embedding capacity of the original image meets the embedding requirements of the information to be embedded; if greater than, determine that the embedding capacity of the original image does not meet the embedding requirements of the information to be embedded.
[0051] Based on the above-mentioned embodiment of the present application, a reversible data hiding method and device based on histogram shift is provided, the method comprising: dividing an original picture into multiple sub-blocks; performing entropy decoding processing on each sub-block to obtain a corresponding discrete cosine transform DCT coefficient block; when it is determined that the embedding capacity of the original picture meets the embedding requirements of the information to be embedded, based on the sorting of each DCT coefficient block and the message bit of the auxiliary information, determining the DCT coefficient block in which the auxiliary information can be embedded, and setting the DCT coefficient block as a first target block, wherein the sorting of each DCT coefficient block is sorted according to a preset sorting rule; embedding the auxiliary information into the first target block according to a first preset order based on an embedding algorithm, the auxiliary information includes the message bit length of the information to be embedded and a pre-calculated conditional threshold; determining the DCT coefficient block in which the information to be embedded can be embedded as a second target block according to the pre-calculated conditional threshold and the number of zero AC coefficients in each DCT coefficient block; embedding the message bit of the information to be embedded into the second target block in sequence according to the embedding algorithm according to a second preset order; performing entropy coding on the first target block in which the auxiliary information is embedded, the second target block in which the information to be embedded is embedded, and all the remaining DCT coefficient blocks to generate a marked picture. In the embodiment of the present application, the coefficient block with less impact on the image is preferentially selected for embedding operation through the conditional threshold calculated in advance, that is, the second target block is determined. The message bits of the information to be embedded are sequentially embedded into the second target block through the embedding algorithm, that is, the information to be embedded is data hidden through the appropriate coefficients in the second target block, which can not only better balance the relationship between image quality and embedding capacity, and effectively control the length of the auxiliary message, but also avoid obvious visual loss in the picture and abnormal changes in the size of the picture file. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0053] Figure 1a-1h A picture randomly selected from the picture library;
[0054] Figure 2 Schematic diagram of PSNR corresponding to different embedding capacities of three methods when the quality factor QF is equal to 60;
[0055] Figure 3 Schematic diagram of PSNR corresponding to different embedding capacities of three methods when the quality factor QF is 70;
[0056] Figure 4 The PSNR diagram of the three methods with different embedding capacities is compared when the quality factor QF is 80;
[0057] Figure 5 Schematic diagram of PSNR comparison of three methods with different embedding capacities when the quality factor QF is 90;
[0058] Figure 6 Schematic diagram of average PSNR values for different payloads when QF is 90;
[0059] Figure 7 This is a schematic diagram of the number of files added when the embedding capacity is maximum;
[0060] Figure 8 A schematic diagram of a flow chart of a data hiding method based on histogram shifting according to an embodiment of the present application;
[0061] Fig. 9 An example schematic diagram of internal coefficient embedding data shown in an embodiment of the present application;
[0062] Fig.10 A schematic flow chart of another data hiding method based on histogram shifting according to an embodiment of the present application;
[0063] Fig.11 A schematic diagram of marked internal coefficients of a DCT coefficient block shown in an embodiment of the present application;
[0064] Fig.12 A structural schematic diagram of a data hiding device based on histogram shifting shown in an embodiment of the present application;
[0065] Fig.13 It is a schematic structural diagram of another data hiding device based on histogram shifting according to an embodiment of the present application. DETAILED DESCRIPTION
[0066] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0067] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0068] As can be seen from the background technology, the first existing scheme is currently extended by selecting coefficients with values of 1 and -1 to carry message bits, and using a block selection strategy to achieve the effect of adaptively selecting discrete cosine transform (DCT) coefficients for data hiding. However, this algorithm still has shortcomings, and the image quality after embedding data in the texture image is poor, which leads to abnormal changes in the size of the image file. The second existing scheme expands the internal coefficients for some blocks. Although the movement of the external coefficients is reduced, the image is severely distorted due to the excessive number of extended coefficients, and the run length in the run length coding of the AC coefficient is increased, that is, the length of the auxiliary message is increased, and the embedding rate and the image quality are not too high.
[0069] In summary, the prior art will cause serious distortion of the image due to too many extended coefficients on the one hand, and will also increase the run length in the run length coding of the AC coefficients on the other hand, thus causing abnormal changes in the size of the image file.
[0070] Therefore, in the present application, the coefficient block with less impact on the image is preferentially selected for embedding operation through the conditional threshold calculated in advance, that is, the second target block is determined. The message bits of the information to be embedded are sequentially embedded into the second target block through the embedding algorithm, that is, the data of the information to be embedded is hidden through the appropriate coefficients in the second target block, which can not only better balance the relationship between image quality and embedding capacity, and effectively control the length of the auxiliary message, but also avoid obvious visual loss in the picture and abnormal changes in the size of the picture file.
[0071] The applicant conducted a comparative experiment on the first existing solution and the second existing solution to compare them in terms of embedding capacity, visual quality of the labeled images, and file size.
[0072] The applicant selected some 512*512 8-bit grayscale images from the USC-SIPI database, such as Figure 1a-Figure 1h As shown, the corresponding Huffman table is optimized by the image JPEG library libjpeg to compress the image according to the quality factor QF=60, 70, 80, 90, and select a random binary string as the secret message bit.
[0073] Specifically, first, according to different quality factors QF, the first existing solution, that is, the existing 1, the second existing solution, that is, the existing 2 and the solution shown in the present application, that is, the method of the present invention is Figure 1a-Figure 1h In other words, the maximum embeddable capacity of the same image by the three methods is compared under different quality factors, as shown in Table 1.
[0074] Table 1:
[0075]
[0076] Among them, the maximum number of bits that can be embedded in this method is higher than that of the other methods 1 and 2. And as can be seen from Table 1, for pictures with different textures and different quality factors, the embedding capacity varies to varying degrees. In contrast, for pictures with simpler textures such as Peppers, pictures with more complex textures such as Baboon can embed more bits. And as the picture quality factor increases, the distribution of the non-zero AC coefficient histogram becomes sharper, so pictures with larger quality factors have more internal coefficients than pictures with smaller quality factors.
[0077] Next, since both the present method and the second existing solution increase the number of embeddable bits relative to the first existing solution, it is only necessary to use different quality factors QF to pass the second existing solution, that is, the solution shown in the present invention 2 and the present application, that is, the present method Figure 1a-Figure 1h The pictures in are processed to determine the corresponding number of embeddable bits, that is, the maximum number of embeddable bits of the two methods for the same picture are compared under different quality factors, as shown in Table 2.
[0078] Table 2:
[0079]
[0080] Among them, as the quality factor increases, the number of embeddable bits increases. Since the number of specific blocks decreases with the increase of quality factor, when QF=90, the embeddable coefficient of many pictures is not obvious, so the second existing solution is more suitable for pictures with smaller quality factors. The method proposed in this paper is superior to the second existing solution in terms of embedding capacity regardless of the quality factor, and greatly increases the number of embeddable message bits.
[0081] Since the peak signal to noise ratio of an image is a general indicator for evaluating image quality, in order to measure the difference between the original grayscale JPEG image and the marked image, this indicator is usually used to determine whether the result of image processing is satisfactory. Therefore, the applicant uses the peak signal to noise ratio (PSNR) to measure data to determine the image quality of the marked image generated after embedding.
[0082] The calculation of PSNR is as follows:
[0083] Formula (1):
[0084]
[0085] The unit dB is logarithmic decibel, and the mean square error (MSE) is the mean square difference between the secret image and the original carrier image.
[0086] Then, by using different embedding capacities and different quality factors QF, according to the first existing solution, namely, the existing solution 1, the second existing solution, namely, the existing solution 2 and the solution shown in this application, that is, the mean square error of the secret image and the original carrier image in this method is substituted into formula (1) to determine the corresponding PSNR, which can be obtained by Figures 2 to 5 show.
[0087] like Figure 2 As shown, when the quality factor QF is equal to 60, the PSNR corresponding to different embedding capacities of the three methods are compared.
[0088] like Figure 3 As shown, when the quality factor QF is equal to 70, the PSNR corresponding to different embedding capacities of the three methods are compared.
[0089] like Figure 4 As shown in Figure 2, when the quality factor QF is equal to 80, the PSNR corresponding to different embedding capacities of the three methods are compared.
[0090] like Figure 5 As shown, when the quality factor QF is equal to 90, the PSNR corresponding to different embedding capacities of the three methods are compared.
[0091] Based on the above Figures 2 to 5 The average PSNR values under different quality factors and the same embedding capacity are shown, where the horizontal axis represents the embedded payload and the vertical axis represents the average PSNR value. It can be seen that the lower the image quality degradation of the marked image, the lower the corresponding MSE value and the higher the PSNR value.
[0092] Since the second existing scheme needs to embed auxiliary messages in the first-layer marked DCT coefficients twice, and needs to record the indicators used to distinguish between moving blocks and non-moving blocks, it still causes a certain degree of visual loss to the original image when fewer message bits are embedded. This scheme avoids invalid displacement of external coefficients, and the impact of auxiliary information on the visual quality of the image is not obvious. Therefore, compared with the other two schemes, no matter how many message bits are embedded, the average PSNR of the proposed scheme is higher. Moreover, as the number of embedded bits increases, the superiority of this method becomes more obvious. For example, when QF=70 and 2.1k message bits are embedded, the PSNR value is 3.29dB higher than that of the second existing scheme.
[0093] The applicant found that this method not only has a high embedding rate, but also can ensure high visual visibility of the image when embedding, and can better balance the image quality and the relationship between quality and capacity. When QF = 90, the quality of visual embedding of the maximum capacity message bit, that is, the PSNR value, is as follows Figure 6 As shown in Figure 1, the average PSNR values of different payloads are shown when QF is 90. Compared with the other two schemes, the PSNR value of the target image obtained by this method is the largest. The larger the PSNR, the better the effect of information hiding, so this method has better invisibility of embedded information.
[0094] Finally, the applicant found that when QF=70, after embedding the same number of message bits, the file size of the marked image increased to varying degrees, such as Figure 7 As shown in the figure. Through experimental comparison, it is found that when embedding a 16000-bit binary stream, the results obtained by the second existing scheme and the first existing scheme are not much different. In addition, both methods require invalid shifting of a large number of external coefficients, which largely causes an imbalance between the increase in file size and the embedding bit. As a result, the size of the marked file changes abnormally.
[0095] Therefore, the present application preferentially selects the coefficient block with less impact on the image for embedding operation through the conditional threshold calculated in advance, that is, determines the second target block. The message bits of the information to be embedded are sequentially embedded into the second target block through the embedding algorithm, that is, the data of the information to be embedded is hidden through the appropriate coefficients in the second target block, which can not only better balance the relationship between image quality and embedding capacity, and effectively control the length of the auxiliary message, but also avoid obvious visual loss in the picture and abnormal changes in the size of the picture file.
[0096] See also Figure 8 , is a flow chart of a data hiding method based on histogram shifting shown in an embodiment of the present application, the method comprising:
[0097] Step S801: Divide the original image into sub-blocks.
[0098] In step S801, the number of the sub-blocks is multiple.
[0099] In the specific implementation of step S801, when the data to be embedded needs to be hidden, the original image is divided into a number of 8*8 sub-blocks.
[0100] For example, a 512*512 grayscale image A is divided into several 8*8 sub-blocks.
[0101] Step S802: performing entropy decoding processing on each of the sub-blocks to obtain a corresponding discrete cosine transform DCT coefficient block.
[0102] In the specific implementation process of step S802, all sub-blocks are entropy decoded to obtain corresponding quantized discrete cosine transform DCT coefficient blocks.
[0103] It should be noted that each sub-block corresponds to a DCT coefficient block.
[0104] The DCT coefficient block includes 1 DC coefficient and 63 AC coefficients.
[0105] Step S803: Determine whether the embedding capacity of the original image meets the embedding requirements of the information to be embedded. When it is determined that the embedding capacity of the original image meets the embedding requirements of the information to be embedded, execute step S804. If not, it is determined that the embedding capacity of the image is limited and the original image cannot be completely embedded in the data to be embedded.
[0106] It should be noted that the message bits of the information to be embedded are binary strings. The embedding requirement of the information to be embedded means that the number of message bits to be embedded in the message must meet the number of internal coefficients of the embedding requirement.
[0107] In the process of implementing step S803, the number of internal coefficients in each DCT coefficient block is counted; it is determined whether the number of message bits of the message to be embedded is less than or equal to the number allowed to be embedded, that is, the number of internal coefficients; if it is less than or equal to, it is determined that the embedding capacity of the original picture meets the embedding requirements of the information to be embedded, and step S804 is executed; if it is greater than, it is determined that the embedding capacity of the original picture does not meet the embedding requirements of the information to be embedded, which means that the embedding capacity of the picture is limited and the original picture cannot be completely embedded in the data to be embedded.
[0108] It should be noted that the internal coefficients refer to AC coefficients with absolute values of 1 and 2.
[0109] Step S804: Based on the order of each of the DCT coefficient blocks and the message bit of the auxiliary information, determine a DCT coefficient block in which the auxiliary information can be embedded, and set the DCT coefficient block as the first target block.
[0110] In step S804, each of the DCT coefficient blocks is sorted according to a preset sorting rule.
[0111] In the specific implementation of step S804, each of the DCT coefficient blocks is sorted according to a preset sorting rule, and based on the length of the auxiliary message bit, the DCT coefficient into which the auxiliary information can be embedded is determined.
[0112] It should be noted that the preset sorting rule refers to the natural order of the DCT coefficient blocks in the image library from left to right and from top to bottom.
[0113] The number of selected DCT coefficient blocks is determined according to the number of message bits of the auxiliary information. The message bits of the auxiliary information calculated as shown in the present application are relatively small, and generally one DCT coefficient block can be hidden.
[0114] It should be noted that the auxiliary information includes the message bit length of the information to be embedded and the pre-calculated conditional threshold.
[0115] Step S805: embedding the auxiliary information into the first target block according to a first preset order based on an embedding algorithm.
[0116] In step S805, the auxiliary information includes the message bit length of the information to be embedded and a pre-calculated conditional threshold.
[0117] It should be noted that the first preset order is a zigzag manner.
[0118] It should be noted that the calculation process of the conditional threshold includes:
[0119] First, according to the number of AC coefficients of "1", "-1", "2", and "-2" in all DCT coefficient blocks, the message bits to be embedded, the number of bits required for the message bits to be embedded, and the number of bits required for the conditional threshold are substituted into formula (2) for calculation to obtain the conditional threshold T Z .
[0120]
[0121] Where S is the number of AC coefficients of "1", "-1", "2", and "-2" in all DCT coefficient blocks, L is the message bit to be embedded, l1 is the number of bits required to represent the L value, and l2 is the number of bits required to represent T Z The number of bits required.
[0122] It should be noted that T Z The required number of bits l2 is set in advance according to actual conditions.
[0123] For example, if the original image is a grayscale image of 512*512 size, the maximum capacity that can be embedded will not exceed 2 18 bits, so l1=18, l2=5 can be taken. After calculation by formula (2), it can be determined that the auxiliary information composed of the message bit length of the information to be embedded and the pre-calculated conditional threshold is 23 bits in total.
[0124] In the specific implementation of step S805, in order to ensure that the proposed method can completely extract the hidden data, it is necessary to embed the effective embedding capacity length L and the embedding priority judgment condition value range T in the image. Z As the auxiliary message. For each internal coefficient in the first target block, each message bit of the auxiliary information is hidden based on the internal coefficient, and the marked internal coefficient is determined, that is, the auxiliary message is sequentially embedded into the first target block in a zigzag manner, and when it is determined that each message bit in the auxiliary information has a corresponding marked internal coefficient, it is determined that all data in the auxiliary information are hidden, and then it is determined that the hiding of the auxiliary information is completed.
[0125] Specifically, firstly, each AC coefficient in the first target block is substituted into formula (3) to calculate the corresponding sign function Sign(C).
[0126] Formula (3):
[0127]
[0128] Where C is the AC coefficient in the DCT coefficient block, C includes C1, C2, ..., C N There are N AC coefficients in total.
[0129] It can be understood that when the AC coefficient value is zero, the sign function value is 0, when the AC coefficient value is a positive number, the function sign value is 1, otherwise the function sign value is -1.
[0130] It should be noted that the sign function sign(C) represents the positive or negative state of the DCT coefficient value in the JPEG image.
[0131] Next, each internal coefficient in the first target block and the message bit of the auxiliary information are input into the embedding algorithm, i.e., formula (4), so as to hide the auxiliary information through the internal coefficient and obtain the marked internal coefficient
[0132] Formula (4):
[0133]
[0134] in, represents the i-th internal coefficient after marking; C i represents the i-th internal coefficient in the first target block; b represents the data of auxiliary information, which is a binary number, that is, b∈{0,1}; sign(C i ) is the sign function corresponding to the i-th internal coefficient.
[0135] The message bits of the auxiliary information are hidden one by one in turn. When each message bit in the auxiliary information has a corresponding marked internal coefficient C~ i , that is, after determining that all data in the auxiliary information are hidden, it is determined that the hiding of the auxiliary information is completed.
[0136] For example, if it is determined that the auxiliary information is 23 bits, the auxiliary information may be embedded into the first 23 internal coefficients starting from the first DCT coefficient block.
[0137] Step S806: Determine a DCT coefficient block into which the information to be embedded can be embedded as a second target block according to the pre-calculated conditional threshold and the number of zero AC coefficients in each DCT coefficient block.
[0138] It should be noted that the specific process of implementing step S806 includes the following steps:
[0139] Step S11: Calculate the number of zero AC coefficients in each DCT coefficient block.
[0140] In the specific implementation of step S11, after multiple experiments, it can be determined that in JPEG pictures with different quality factors, the AC coefficients with a value of "0" are concentrated in the high-frequency part of the picture. Therefore, it is necessary to count the number of AC coefficients with a value of "0" in each DCT coefficient block.
[0141] Step S12: Compare the number of AC coefficients with a value of zero in each DCT coefficient block with a pre-calculated conditional threshold. When it is determined that the number of AC coefficients with a value of zero in the DCT coefficient block is greater than the pre-calculated conditional threshold, execute step S13. When it is determined that the number of AC coefficients with a value of zero in the DCT coefficient block is less than or equal to the pre-calculated conditional threshold, determine that the DCT coefficient block is a non-embeddable block.
[0142] In the specific implementation of step S12, the number of AC coefficients with a value of "0" in each DCT coefficient block is compared with the conditional threshold T Z The size of the AC coefficients with a value of "0" is determined to be greater than the conditional threshold T Z When the number of AC coefficients with a value of "0" is determined to be less than or equal to the conditional threshold T, step S13 is executed; Z , the DCT coefficient block is determined to be a non-embeddable block and no changes are made to the block.
[0143] Step S13: Determine the DCT coefficient block as the second target block.
[0144] In the specific implementation process of step S13, the corresponding DCT coefficient block is set as an embeddable block, that is, a second target block.
[0145] Step S807: embedding the message bits of the information to be embedded into the second target block in sequence according to a second preset order based on an embedding algorithm.
[0146] Since there is a great connection between the pixels in the spatial domain of JPEG images and the quantized DCT coefficients, any modification of the quantized DCT coefficients may cause distortion of the image, so the selection of blocks for embedding information is as important as the selection of DCT coefficients. According to the frequency sensitivity of the human eye's visual characteristics, humans have a lower resolution for higher frequency parts, that is, they are less sensitive to modifications to high frequency parts. After JPEG compression, the high-frequency area contains the most DCT coefficients with a value of 0, which refers to AC coefficients. Intuitively describe the change process of the coefficients when the DCT coefficients are embedded. In this process, no coefficients are modified except for the internal coefficients, so most of the coefficients remain unchanged. The modified internal coefficients are expanded by at most one bit, so the visual quality of the hidden image is well guaranteed.
[0147] In an embodiment of the present application, when data is embedded in the DCT coefficient block, no coefficient is modified except the internal coefficient, that is, the original internal coefficient in the DCT coefficient block, that is, the non-zero AC coefficient with an amplitude within 2 is changed, and other coefficients remain unchanged when the data is hidden. In the specific implementation of step S807, the message bit of the embedded information is hidden based on each internal coefficient in the second target block, and the marked internal coefficient is determined, that is, the binary stream composed of 0 and 1 is sequentially embedded in the second target block in a zigzag manner; when it is determined that each message bit in the embedded information has a corresponding marked internal coefficient, it is determined that the embedding of the embedded information is completed.
[0148] Specifically, firstly, each AC coefficient is substituted into the above-mentioned formula (3) to calculate the corresponding sign function Sign(C).
[0149] Next, for the first second target block, each internal coefficient in the second target block and the message bit in the information to be embedded are sequentially input into the embedding algorithm, that is, substituted into the above-mentioned formula (4), so as to hide the message bit through the internal coefficient and obtain the marked internal coefficient
[0150] Formula (4):
[0151]
[0152] in, represents the i-th internal coefficient after marking; C i represents the i-th internal coefficient in the second target block; in this case, b represents the message bit of the embedded information, which is a binary number, that is, b∈{0,1}; sign(C i ) is the sign function corresponding to the i-th internal coefficient.
[0153] Finally, when each internal coefficient in the second target block has a corresponding marked internal coefficient C~ i That is, when it is determined that a message bit is hidden in each internal coefficient and the message bit in the embedded information has not been completely hidden, the remaining message bit information of the embedded information is hidden for each internal coefficient in the next second target block, and so on, until all the message bits are completely embedded.
[0154] For example: Fig. 9 As shown, the second target block A includes 5 AC coefficients, and C includes C1, C2, C3, C4 and C5 respectively. Among them, C1 = -2, C2 = -1, C3 = 0, C4-1, C5 = 2. Among them, the internal coefficients of the second target block A are C1, C2, C4 and C5. If the message bit b of the information to be embedded is 0, the internal coefficient C1 = -2, and it is substituted into the formula (4) shown above to obtain the marked internal coefficient If the message bit b of the information to be embedded is 1, the internal coefficient C1 is -2, and it is substituted into the formula (4) shown above to obtain the marked internal coefficient If the message bit b of the information to be embedded is 0, the internal coefficient C1 is -1, and it is substituted into the formula (4) shown above to obtain the marked internal coefficient If the message bit b of the information to be embedded is 1, the internal coefficient C1 is -1, which is substituted into the above formula (4) to hide the message bit through the internal coefficient, and the marked internal coefficient is obtained. If the message bit b of the information to be embedded is 0, the internal coefficient C1 is 1, and it is substituted into the formula (4) shown above to obtain the marked internal coefficient If the message bit b of the information to be embedded is 1, the internal coefficient C1 is 1, and it is substituted into the above-mentioned formula (4) to hide the message bit through the internal coefficient to obtain the marked internal coefficient If the message bit b of the information to be embedded is 0, the internal coefficient C1 is 2, and it is substituted into the formula (4) shown above to obtain the marked internal coefficient If the message bit b of the information to be embedded is 1, the internal coefficient C1 is 2, which is substituted into the above formula (4) to hide the message bit through the internal coefficient, and the marked internal coefficient is obtained.
[0155] Step S808: entropy coding is performed on the first target block embedded with auxiliary information, the second target block embedded with information to be embedded, and all remaining DCT coefficient blocks to generate a marked picture.
[0156] In the specific implementation process of step S808, entropy coding is performed on the AC coefficients after data hiding to generate a marked JPEG picture.
[0157] Optionally, compress the tagged image after generating it.
[0158] In the embodiment of the present application, the present application preferentially selects the coefficient block with less impact on the image for embedding operation through the conditional threshold calculated in advance, that is, determines the second target block. The message bits of the information to be embedded are sequentially embedded into the second target block through the embedding algorithm, that is, the information to be embedded is data hidden through the appropriate coefficients in the second target block, which can not only better balance the relationship between image quality and embedding capacity, and effectively control the length of the auxiliary message, but also avoid obvious visual loss in the picture and abnormal changes in the size of the picture file.
[0159] In the embodiment of the present application, when it is necessary to obtain hidden information, it is necessary to extract the data hidden in the image. Therefore, based on the reversible data hiding method based on histogram shift shown in the above embodiment of the present application, see Fig.10 The embodiment of the present application also shows a flow chart of another reversible data hiding method based on histogram shifting, the method comprising:
[0160] Step S1001: after receiving the marked picture, entropy decoding is performed on the picture to obtain the corresponding DCT coefficient block, and the number of zero AC coefficients in each DCT coefficient block is counted.
[0161] In the specific implementation process of step S1001, an entropy decoder is used to decode the marked JPEG picture file to obtain a quantized DCT coefficient block, and the number of zero AC coefficients in each DCT coefficient block is counted.
[0162] It should be noted that the size of the DCT coefficient block is 8*8.
[0163] Step S1002: Determine a first target block for storing auxiliary information based on the length of the auxiliary message bits and a preset ordering rule of the DCT coefficient block.
[0164] In the specific implementation of step S1002, the first target block for storing the auxiliary information is determined according to a preset sorting rule based on the length of the auxiliary message bits.
[0165] Step S1003: extracting auxiliary information in the first target block based on an extraction algorithm.
[0166] In the specific implementation of step S1003, each marked internal coefficient in the first target block is determined, and each marked internal coefficient is sequentially substituted into formula (5) to extract the message bit of the corresponding auxiliary information, that is, the auxiliary information.
[0167] Formula (5):
[0168]
[0169] Where b' represents the extracted message bit, Represents the i-th internal coefficient after labeling.
[0170] It can be seen from formula (5) that when the absolute value of the DCT coefficient of the hidden image is 1, the secret information bit can be extracted, that is, the message bit 0 of the information to be embedded; when the absolute value of the DCT coefficient of the hidden image is 2, the secret information bit can be extracted, that is, the message bit 1 of the information to be embedded.
[0171] Step S1004: Determine a second target block from the DCT coefficient block based on the threshold information in the auxiliary information and the number of zero AC coefficients in each DCT coefficient block.
[0172] In the specific implementation of step S1004, the auxiliary information, that is, the length and threshold of the file, is obtained from the marked image. The threshold is compared with the number of zero AC coefficients in each 8*8 DCT coefficient sub-block in the marked image, and the number of AC coefficients with a value of "0" is greater than or equal to the conditional threshold T. Z Set as the second target block, i.e., the embedding block, and the remaining sub-blocks are non-embeddable blocks.
[0173] It should be noted that the specific implementation process of step S1004 is the same as the specific implementation process of the above-mentioned step S806, and they can refer to each other.
[0174] Step S1005: extracting the message bits in the second target block based on the message bit length of the embedded information in the auxiliary information and the extraction algorithm.
[0175] In the specific implementation of step S1005, for each second target block, i.e., the embedded block, each marked internal coefficient in the embedded block is determined, and the message bit of the message to be embedded is extracted from each marked internal coefficient based on the extraction algorithm. That is, each marked internal coefficient is sequentially substituted into the above formula (5), i.e., the extraction algorithm, to extract the corresponding message bit of the message to be embedded. Then, the message bits, i.e., the message bits, are continuously extracted from the embedded block.
[0176] For example: Fig.11 As shown in FIG. 1 , a 8*8 DCT coefficient block is embedded with message bits. The shaded part is the expanded position, i.e., the marked internal coefficient. Each internal coefficient is input into formula (5), and a binary stream with values of (1,1,0,0,1,0,1,1,1,0,1,1) can be extracted in a zigzag order, i.e., the corresponding auxiliary information is extracted.
[0177] Step S1006: After extracting the message bits in all the second target blocks, entropy encoding is performed on all the DCT coefficient blocks to generate a JPEG picture.
[0178] In the specific implementation process of step S1006, after all secret message bits are extracted, the AC coefficients are entropy encoded again to generate the original picture.
[0179] In the embodiment of the present application, in the data hiding technology, it should be ensured that the embedded data can be effectively extracted, that is, reversible data. First, the image is entropy decoded from the marked JPEG image to obtain the corresponding DCT coefficient block. Based on the length of the auxiliary message bit and the preset sorting rule of the DCT coefficient block, the first target block storing the auxiliary information is determined, and the corresponding legal person auxiliary information is extracted from it; then, after determining the position of the second target block, it is extracted according to the extraction algorithm. It can not only better balance the relationship between image quality and embedding capacity, and effectively control the length of the auxiliary message, but also avoid obvious visual loss of the image and abnormal changes in the size of the image file.
[0180] Based on the above-mentioned reversible data hiding method based on histogram shifting shown in the embodiment of the present application, correspondingly, the embodiment of the present application also discloses a reversible data hiding device based on histogram shifting, such as Fig.12 , which is a structural diagram of a reversible data hiding device with histogram shifting according to an embodiment of the present application, and the device comprises:
[0181] The dividing unit 1201 is used to divide the original picture into multiple sub-blocks.
[0182] The first processing unit 1202 is used to perform entropy decoding processing on each of the sub-blocks to obtain a corresponding discrete cosine transform DCT coefficient block.
[0183] The first determination unit 1203 is used to determine the DCT coefficient block in which the auxiliary information can be embedded based on the order of each of the DCT coefficient blocks and the message bit of the auxiliary information when it is determined that the embedding capacity of the original image meets the embedding requirement of the information to be embedded, and set the DCT coefficient block as the first target block, wherein the order of each of the DCT coefficient blocks is sorted according to a preset ordering rule; and determine the DCT coefficient block in which the information to be embedded can be embedded as the second target block based on a pre-calculated conditional threshold and the number of zero AC coefficients in each DCT coefficient block.
[0184] The embedding processing unit 1204 is used to embed auxiliary information into the first target block according to a first preset order based on an embedding algorithm, wherein the auxiliary information includes a message bit length of the information to be embedded and a pre-calculated conditional threshold; and to embed the message bits of the information to be embedded into the second target block in sequence according to a second preset order based on the embedding algorithm.
[0185] The first generating unit 1205 is configured to perform entropy coding on the first target block embedded with auxiliary information, the second target block embedded with information to be embedded, and all remaining DCT coefficient blocks to generate a marked picture.
[0186] It should be noted that the specific principles and execution processes of each unit in the reversible data hiding based on histogram shift disclosed in the above-mentioned embodiment of the present application are the same as the reversible data hiding method based on histogram shift implemented in the above-mentioned present application. Please refer to the corresponding parts of the reversible data hiding method based on histogram shift disclosed in the above-mentioned embodiment of the present application, and no further details will be given here.
[0187] In the embodiment of the present application, the present application preferentially selects the coefficient block with less impact on the image for embedding operation through the conditional threshold calculated in advance, that is, determines the second target block. The message bits of the information to be embedded are sequentially embedded into the second target block through the embedding algorithm, that is, the information to be embedded is data hidden through the appropriate coefficients in the second target block, which can not only better balance the relationship between image quality and embedding capacity, and effectively control the length of the auxiliary message, but also avoid obvious visual loss in the picture and abnormal changes in the size of the picture file.
[0188] Optionally, based on the reversible data hiding device shown in the above-mentioned embodiment of the present invention, the first determination unit 1203 for determining whether the embedding capacity of the original image meets the embedding requirements of the information to be embedded is specifically used to: count the number of internal coefficients in each DCT coefficient block; determine whether the number of message bits of the message to be embedded is less than or equal to the number of internal coefficients; if less than or equal to, determine that the embedding capacity of the original image meets the embedding requirements of the information to be embedded; if greater than, determine that the embedding capacity of the original image does not meet the embedding requirements of the information to be embedded.
[0189] The first determination unit 1203, which determines that the DCT coefficient block in which the information to be embedded can be embedded is the second target block based on the pre-calculated conditional threshold and the number of zero AC coefficients in each DCT coefficient block, is specifically used to: calculate the number of zero AC coefficients in each DCT coefficient block; compare the number of zero AC coefficients in each DCT coefficient block with the pre-calculated conditional threshold; and when it is determined that the number of zero AC coefficients in the DCT coefficient block is greater than the pre-calculated conditional threshold, determine that the DCT coefficient block is the second target block.
[0190] Optionally, based on the reversible data hiding device shown in the above-mentioned embodiment of the present invention, an embedding processing unit 1204 embeds auxiliary information into the first target block in a first preset order based on an embedding algorithm, and is specifically used for: for each internal coefficient in the first target block, hiding each message bit of the auxiliary information based on the internal coefficient, and determining the marked internal coefficient; when it is determined that each message bit in the auxiliary information has a corresponding marked internal coefficient, determining that the embedding of the auxiliary information is completed.
[0191] Optionally, an embedding processing unit 1204 is used to embed the message bits of the information to be embedded in the second target block in sequence according to a second preset order based on an embedding algorithm, and is specifically used to: hide the message bits of the embedded information based on each internal coefficient in the second target block, and determine the marked internal coefficient; when it is determined that each message bit in the embedded information has a corresponding marked internal coefficient, it is determined that the embedding of the embedded information is completed.
[0192] Optionally, based on the reversible data hiding device shown in the above embodiment of the present invention, see Fig.13 , also shows a schematic diagram of another reversible data hiding device structure, the device comprises:
[0193] The second processing unit 1301 is used to perform entropy decoding processing on the marked picture after receiving the picture, obtain the corresponding DCT coefficient block, and count the number of zero AC coefficients in each DCT coefficient block.
[0194] The second determination unit 1302 is used to determine the first target block storing the auxiliary information based on the length of the auxiliary message bit and the preset sorting rule of the DCT coefficient block; based on the threshold information in the auxiliary information and the number of zero AC coefficients in each DCT coefficient block, determine the second target block storing the hidden information.
[0195] The extraction unit 1303 is used to extract the auxiliary information in the first target block based on the extraction algorithm; determine the second target block from the DCT coefficient block based on the threshold information in the auxiliary information and the number of zero AC coefficients in each DCT coefficient block; and extract the message bits in the second target block based on the message bit length of the embedded information in the auxiliary information and the extraction algorithm.
[0196] Optionally, the extraction unit 1303 for extracting the message bits in the second target block based on the extraction algorithm is specifically used to: determine each marked internal coefficient in the second target block for each of the second target blocks; and extract the message bits of the message to be embedded from each marked internal coefficient based on the extraction algorithm.
[0197] The second generating unit 1304 is used to perform entropy coding on all the DCT coefficient blocks after extracting the message bits in all the second target blocks to generate a JPEG picture.
[0198] It should be noted that the specific principles and execution processes of each unit in the reversible data hiding based on histogram shift disclosed in the above-mentioned embodiment of the present application are the same as the reversible data hiding method based on histogram shift implemented in the above-mentioned present application. Please refer to the corresponding parts of the reversible data hiding method based on histogram shift disclosed in the above-mentioned embodiment of the present application, and no further details will be given here.
[0199] In the embodiment of the present application, in the data hiding technology, it should be ensured that the embedded data can be effectively extracted, that is, reversible data. First, the image is entropy decoded from the marked JPEG image to obtain the corresponding DCT coefficient block. Based on the length of the auxiliary message bit and the preset sorting rule of the DCT coefficient block, the first target block storing the auxiliary information is determined, and the corresponding auxiliary information is extracted from it; then, after determining the position of the second target block, it is extracted according to the extraction algorithm. It can not only better balance the relationship between image quality and embedding capacity, and effectively control the length of the auxiliary message, but also avoid abnormal changes in the size of the image file.
[0200] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0201] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0202] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A reversible data hiding method based on histogram shifting, characterized in that: The method comprises: Dividing the original image into sub-blocks, where the number of the sub-blocks is multiple; Performing entropy decoding on each of the sub-blocks to obtain a corresponding discrete cosine transform (DCT) coefficient block; When it is determined that the embedding capacity of the original picture meets the embedding requirement of the information to be embedded, based on the order of each of the DCT coefficient blocks and the message bit of the auxiliary information, a DCT coefficient block in which the auxiliary information can be embedded is determined, and the DCT coefficient block is set as a first target block, wherein the order of each of the DCT coefficient blocks is sorted according to a preset ordering rule; the message bit of the auxiliary information is used to determine the number of bits of the internal coefficients used to embed the auxiliary information and the number of the first target blocks; the preset ordering rule is a natural order from left to right and from top to bottom; Embedding auxiliary information into each internal coefficient in the first target block according to a first preset order based on an embedding algorithm, wherein the auxiliary information includes a message bit length of the information to be embedded and a pre-calculated conditional threshold; the internal coefficient is a non-zero AC coefficient with an amplitude within 2; According to a pre-calculated conditional threshold and the number of zero AC coefficients in each DCT coefficient block, a DCT coefficient block in which the information to be embedded can be embedded is determined as a second target block; embedding the message bits of the information to be embedded into the internal coefficients in the second target block in sequence according to a second preset order based on an embedding algorithm; The first target block embedded with auxiliary information, the second target block embedded with information to be embedded, and all remaining DCT coefficient blocks are entropy encoded to generate a marked picture.
2. The method according to claim 1, characterized in that: Also includes: After receiving the marked picture, entropy decoding is performed on the picture to obtain the corresponding DCT coefficient block, and the number of zero AC coefficients in each DCT coefficient block is counted; Determining a first target block for storing the auxiliary information based on the length of the message bits of the auxiliary information and a preset sorting rule of the DCT coefficient block; extracting auxiliary information in the first target block based on an extraction algorithm; Determine a second target block from the DCT coefficient blocks based on the threshold information in the auxiliary information and the number of zero AC coefficients in each DCT coefficient block; extracting the message bits in the second target block based on the message bit length of the embedded information in the auxiliary information and the extraction algorithm; After extracting the message bits in all the second target blocks, all the DCT coefficient blocks are entropy encoded to generate a JPEG picture.
3. The method according to claim 1, characterized in that Determining that the embedding capacity of the original image meets the embedding requirements of the information to be embedded includes: Count the number of internal coefficients in each DCT coefficient block; Determining whether the number of message bits of the information to be embedded is less than or equal to the number of internal coefficients; If it is less than or equal to, determining that the embedding capacity of the original image meets the embedding requirement of the information to be embedded; If it is greater, it is determined that the embedding capacity of the original image does not meet the embedding requirement of the information to be embedded.
4. The method according to claim 1, characterized in that: The embedding of auxiliary information into the first target block according to a first preset order based on an embedding algorithm includes: For each internal coefficient in the first target block, hide each message bit of the auxiliary information based on the internal coefficient to determine a marked internal coefficient; When it is determined that each message bit in the auxiliary information has a corresponding marked internal coefficient, it is determined that the embedding of the auxiliary information is completed.
5. The method according to claim 1, characterized in that The method of determining, according to the pre-calculated conditional threshold and the number of zero AC coefficients in each DCT coefficient block, a DCT coefficient block in which the information to be embedded can be embedded as the second target block comprises: Calculate the number of zero AC coefficients in each DCT coefficient block; The number of zero AC coefficients in each DCT coefficient block is compared with a pre-calculated conditional threshold; When it is determined that the number of AC coefficients with values of zero in the DCT coefficient block is greater than a pre-calculated conditional threshold, the DCT coefficient block is determined to be a second target block.
6. The method according to claim 1, characterized in that The embedding of the message bits of the information to be embedded into the second target block in sequence according to a second preset order based on the embedding algorithm includes: hiding the message bit of the embedded information based on each internal coefficient in the second target block to determine the marked internal coefficient; When it is determined that each message bit in the embedded information has a corresponding marked internal coefficient, it is determined that the embedding of the embedded information is completed.
7. The method according to claim 2, characterized in that The extracting the message bits of the information to be embedded in the second target block based on the extraction algorithm comprises: For each of the second target blocks, determining each marked internal coefficient in the second target block; The message bits of the information to be embedded are extracted from each marked inner coefficient based on the extraction algorithm.
8. A reversible data hiding device based on histogram shift, characterized in that: The device comprises: A dividing unit, used for dividing the original picture into multiple sub-blocks; A first processing unit is used to perform entropy decoding processing on each of the sub-blocks to obtain a corresponding discrete cosine transform DCT coefficient block; A first determining unit is used to determine, when it is determined that the embedding capacity of the original picture meets the embedding requirements of the information to be embedded, based on the order of each of the DCT coefficient blocks and the message bit of the auxiliary information, a DCT coefficient block in which the auxiliary information can be embedded, and set the DCT coefficient block as a first target block, wherein the order of each of the DCT coefficient blocks is sorted according to a preset ordering rule; and according to a pre-calculated conditional threshold and the number of zero AC coefficients in each DCT coefficient block, determine the DCT coefficient block in which the information to be embedded can be embedded as a second target block; the message bit of the auxiliary information is used to determine the number of bits of the internal coefficients used to embed the auxiliary information and the number of the first target blocks; the preset ordering rule is a natural order from left to right and from top to bottom; an embedding processing unit, configured to embed auxiliary information into each internal coefficient in the first target block according to a first preset order based on an embedding algorithm, wherein the auxiliary information includes a message bit length of the information to be embedded and a pre-calculated conditional threshold; and to embed the message bits of the information to be embedded into each internal coefficient in the second target block in sequence according to a second preset order based on the embedding algorithm; wherein the internal coefficient is a non-zero AC coefficient with an amplitude within 2; The first generating unit is used to perform entropy coding on the first target block embedded with auxiliary information, the second target block embedded with information to be embedded, and all remaining DCT coefficient blocks to generate a marked picture.
9. The device according to claim 8, characterized in that Also includes: A second processing unit is used to perform entropy decoding on the marked picture after receiving the picture to obtain a corresponding DCT coefficient block, and count the number of zero AC coefficients in each DCT coefficient block; A second determining unit, configured to determine a first target block storing the auxiliary information based on a length of a message bit of the auxiliary information and a preset sorting rule of the DCT coefficient block; Determine a second target block for storing hidden information based on the threshold information in the auxiliary information and the number of zero AC coefficients in each DCT coefficient block; an extraction unit, configured to extract the auxiliary information in the first target block based on an extraction algorithm; and extract the message bits in the second target block based on the message bit length of the information embedded in the auxiliary information and the extraction algorithm; The second generating unit is used to perform entropy coding on all the DCT coefficient blocks to generate a JPEG picture after extracting the message bits in all the second target blocks.
10. The device according to claim 8, characterized in that The first determining unit for determining whether the embedding capacity of the original picture meets the embedding requirement of the information to be embedded is specifically configured to: count the number of internal coefficients in each DCT coefficient block; Determining whether the number of message bits of the information to be embedded is less than or equal to the number of internal coefficients; If it is less than or equal to, determining that the embedding capacity of the original image meets the embedding requirement of the information to be embedded; If it is greater, it is determined that the embedding capacity of the original image does not meet the embedding requirement of the information to be embedded.
Citation Information
Patent Citations
JPEG image reversible information hiding method based on two-dimensional histogram modification
CN108009975A
