Reversible information hiding method based on feature block coding
Through the reversible information hiding method based on feature block encoding, the problem of embedding additional information in image encryption in cloud storage environment is solved, the correct extraction of secret information and lossless recovery of the original image are achieved, and the embedding capacity is improved.
Patent Information
- Application Number
- CN202310406590.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-17
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2043-04-17
AI Technical Summary
The prior art is difficult to effectively embed additional information in encrypted images in cloud storage environments and ensure the correct extraction of secret information and lossless recovery of original images.
The reversible information hiding method based on feature block encoding is adopted. By determining the size and shape of feature blocks, the image is compressed using Huffman encoding, bit plane blocks are constructed and encoded and compressed, and secret information is embedded.
The correct extraction of secret information and lossless recovery of the original image are achieved, and a large performance improvement in embedding capacity is achieved.
Smart Images

Figure CN116489383B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of image processing and information security, and in particular to a reversible information hiding method based on feature block coding. Background Art
[0002] As the cloud computing industry continues to mature, more and more cloud service providers are providing users with convenient and fast cloud storage services so that users can access their digital information anytime, anywhere. However, while cloud storage technology brings convenience to users, it also creates a series of problems. For example, users want to encrypt images before uploading them to the cloud to protect their privacy. In order to facilitate file management and retrieval, copyright protection, etc., cloud service providers usually need to embed additional information in images. However, encrypted images have less redundant space, making it difficult to embed additional information. In response to the characteristics of this cloud storage scenario, researchers have integrated image encryption technology and RDH technology to propose a reversible information hiding technology for encrypted images called RDHEI (RDH In Encrypted Images, abbreviated as RDHEI). In the application scenarios of this technology, there are usually three roles: content owner, information embedder, and receiver. The content owner encrypts the image, and the information embedder embeds additional information in the encrypted image. The receiver can choose to restore the carrier image or extract the secret information based on the key situation: if only the image decryption key is possessed, only the ciphertext image can be decrypted and the plaintext image can be obtained; if only the information extraction key is possessed, only the additional information can be extracted but no carrier image content can be obtained; only when both the decryption key and the information extraction key are possessed can the image be restored and the additional information extracted.
[0003] The increasingly severe cybersecurity situation and people's growing awareness of privacy protection have put forward higher requirements for ensuring information security. As an effective method for ensuring information security in cloud environments, the technology of reversible information hiding in encrypted images has important theoretical value and practical significance. Summary of the Invention
[0004] The present invention aims to address the shortcomings of existing technologies by providing a reversible information hiding method based on feature block coding. This method not only ensures the correct extraction of secret information and lossless restoration of the original image, but also achieves a significant performance improvement in embedding capacity, thus achieving reversible information hiding.
[0005] The technical solution for achieving the purpose of the present invention is:
[0006] A reversible information hiding method based on feature block coding comprises the following steps:
[0007] 1) Determine the feature blocks and their values: Nature is rich and colorful, so the features of images are diverse, some are smooth, some have complex textures, and many images have both smooth areas and textured areas. Therefore, feature blocks are selected to compress image I. Since the bit plane needs to be divided into blocks during compression, and each block is composed of feature blocks, the feature blocks are first encoded. When determining the feature blocks, the size and shape of the feature blocks need to be considered. If each feature block has n elements and the value of each element is 0 or 1, the larger n is, the more codes there are. If the number of codes is too large, the compression effect will be affected. If the value of n is small, the number of codes is small, but the number of feature blocks is also small, which cannot better reflect the characteristics of the image. There are 2 feature blocks with n elements. n codes. When n>4, there are more codes. When n is an odd number, it is not easy to form image blocks. Therefore, the size of the feature block is determined to be 4. Combined with the smoothness and texture features of image I, 5 feature blocks are determined. When the feature block constitutes a bit plane block, the feature block needs to be translated or rotated. After translation and rotation, the feature block is of the same type as the original feature block. In order to facilitate encoding, the elements in the feature block are numbered to determine the order of the 4 elements in the feature block. The value of each element in the feature block is 0 or 1. The element values are arranged in the order of the numbers, and a total of 16 different sequences from "0000" to "1111" are obtained. The binary number of each sequence is the value of the feature block, and d is used. i (i=0,1,…,15) represents, and 0≤d i ≤15;
[0008] 2) Composition of bit plane blocks: When compressing the bit plane, each bit plane block is composed of feature blocks, and the type and number of feature blocks are the same. Since the size of the five types of feature blocks is 4, and the feature blocks and the feature blocks after translation and rotation have a maximum of 4 elements in a row or column, the minimum size of the bit plane block is 4×4. Each bit plane block is composed of 4 feature blocks. There are at most 3 types of feature blocks that make up the bit plane block. If there are more than 3 types, a 4×4 bit plane block cannot be formed. Assume that the 4 feature blocks that make up the bit plane block are B1, B2, B3, and B4, and the number of types of feature blocks in the bit plane block is m, m = 1, 2, 3, and the maximum compression space of each type is C m ,but:
[0009] 2-1) Single-type feature block: There are 9 types of bit plane blocks composed of a single-type feature block, i.e., m=1;
[0010] 2-2) Two types of feature blocks: A 4×4 bit plane block is composed of two types of feature blocks, i.e., m=2, with a total of 26 possible combinations. Each bit plane block has two feature blocks of each type. B1 and B2 are the same feature block, and B3 and B4 are the same feature block.
[0011] 2-3) Three types of feature blocks: When there are three types of feature blocks, that is, m = 3, forming a 4×4 bit plane block, there are a total of 8 combinations. Each bit plane block has two feature blocks of the fifth feature block type, B1 and B2 are the same feature block, there is no feature block of the first type, and the other types each have one feature block;
[0012] 3) Bit plane block coding compression: Divide the continuous λ high bit planes in image I into blocks to obtain 4×4 non-overlapping bit plane blocks s, then:
[0013] 3-1) When m=1, the bit plane block consists of a single feature block, and 4s feature block values d are counted for all bit plane blocks. i The frequency h(k), 0≤k≤15, then:
[0014] h(k)=#{0≤k≤15:k=d i} (1),
[0015] According to h(k), Huffman coding is used to obtain the code T of all values of the feature block. When the bit plane block is compressed, if the block can be compressed, it is marked with 1, and if the block cannot be compressed, it is marked with 0. Let the compression capacity of the μ-th bit plane block composed of a single feature block be Q μ , 1≤μ≤s, feature block B in the bit plane block j , j=1,2,3,4 in T have corresponding code lengths of l μ,j ,but:
[0016]
[0017] Q μ When ≥0, the bit plane block is a compressible block, otherwise it is an incompressible block. Assume that there are Y compressible blocks in the bit plane block and the total compression space is Q, then:
[0018]
[0019] Similarly, find 9 compression spaces of bit plane blocks composed of single feature blocks. Let the compression capacity be Q1, Q2, ..., Q9, and let:
[0020] t1=argmax(Q1, Q2,...,Q9) (4),
[0021] From this we can get:
[0022]
[0023] 3-2) When m = 2, the bit plane block consists of two types of feature blocks, B1 and B2 are the same type of feature blocks, and B3 and B4 are the same type of feature blocks. The frequencies h1(k) and h2(k) of the 2s feature blocks B1 and B2 and B3 and B4 are counted respectively, 0≤k≤15. Huffman coding is used according to h1(k) and h2(k) to obtain two independent codes T1 and T2. Let the compression capacity of the r-th bit plane block composed of two types of feature blocks be Q r , 1≤r≤s, the encoding length of the feature blocks B1, B2 in the bit plane block in T1 is l 1 r,1 ,l 1 r,2 , in T2, the code length corresponding to B3 and B4 is l 2 r,1 ,l 2 r,2 ,but:
[0024]
[0025] Assume that there are N compressible blocks in the bit plane block and the total compression space is D, then
[0026]
[0027] Similarly, find 26 compression spaces of bit plane blocks composed of 2 types of feature blocks, and assume that their compression capacities are D1, D2, ..., D 26 ,make:
[0028] t2=argmax(D1,D2,...,D 26 ) (8),
[0029] From this we can get:
[0030]
[0031] 3-3) When m = 3, the bit plane block is composed of three types of feature blocks. B1 and B2 are feature blocks of the same type, B3 is a feature block of one type, and B4 is a feature block of another type. The frequency h1(k) of the 2s feature blocks B1 and B2, the frequency h2(k) of the s feature blocks B3, and the frequency h3(k) of the s feature blocks B4 are counted respectively. 0≤k≤15. Based on h1(k), h2(k), and h3(k), three independent codes T4, T5, and T6 are obtained through Huffman coding. Let the compression capacity of the v-th bit plane block composed of three types of feature blocks be Q v , 1≤v≤s, the encoding length of the feature blocks B1, B2 in the bit plane block in T1 is l 1 v,1 ,l 1 v,2, the encoding length corresponding to B3 in T2 is l 2 v,1 , in T3, the code length corresponding to B4 is l 3 v,1 ,but:
[0032]
[0033] Assume there are p compressible blocks in the bit plane block, and the total compression space is E:
[0034]
[0035] Similarly, find out the compression spaces of 8 bit plane blocks composed of three types of feature blocks. Let the compression capacity be E1, E2, ..., E8, and let:
[0036] t3=argmax(E1,E2,...,E8) (12),
[0037] From this we can get:
[0038]
[0039] Compress λ consecutive high-order plane blocks according to the characteristic block construction method of steps 3-1) to 3-3), assuming that the maximum compression space is C, and let:
[0040] mt=argmax(C1,C2,C3) (14),
[0041] From this we can get:
[0042] C=C mt (15);
[0043] 3-4) When mt = 1, the bit plane block composed of a single feature block has the largest compression space. Among the nine methods of forming a single feature block, the method of forming a single feature block of the t1th type has the maximum compression space according to formula (4) and formula (5). Therefore, the bit plane composed of this single feature block is used to compress and hide information.
[0044] 3-5) When mt=2, the compression space of the bit plane block composed of two characteristic blocks is the largest. According to formulas (8) and (9), the t2th method of compressing the bit plane composed of two characteristic blocks is adopted. Therefore, the bit plane composed of this characteristic block is used to compress and hide information;
[0045] 3-6) When mt=3, according to formula (12) and formula (13), the t3th compression method using three types of feature blocks to form a bit plane can obtain the maximum compression space to hide information;
[0046] 4) Reversible information hiding based on bit plane block coding compression: The bit plane blocks of the continuous λ high bit planes of image I are compressed according to different feature block composition codes to obtain the maximum compression space. The value of mt is obtained based on the maximum compression space. According to the value of mt, the bit plane composition type and the corresponding compression coding table are used. A one-dimensional array Tag is used to record whether the block can be compressed, and seq records the corresponding data. The process is as follows:
[0047] 4-1) If the bit-plane block is a compressible block, store 1 in Tag:
[0048] 4-1-1) When mt = 1, compression is performed using the t1th single feature block composition method. Based on the values of B1, B2, B3, and B4, the corresponding codes of B1, B2, B3, and B4 are obtained from the single feature block code table T;
[0049] 4-1-2) When mt = 2, compression is performed using the t2th type consisting of two blocks of characteristic types. The codes for B1 and B2 are obtained from code table T1, and the codes for B3 and B4 are obtained from T2.
[0050] 4-1-3) When mt = 3, compression is performed using the t3th method consisting of three blocks of characteristic blocks. The codes for B1 and B2 are obtained from code table T3, the code for B3 is obtained from T4, and the code for B4 is obtained from T5. The codes for B1, B2, B3, and B4 are combined in order to obtain the compressed code for the block, which is stored in sequence in seq.
[0051] 4-2) If the bit plane block is an incompressible block, store 0 in the tag, scan the data in the bit plane block from left to right and from top to bottom, and store them in sequence in seq;
[0052] 4-3) The secret information and auxiliary information are stored in the redundant space, specifically:
[0053] 4-3-1) Scan all blocks of the λ high bit planes in sequence. If the block is compressible, store 1 in Tag and store the B1, B2, B3, and B4 codes in sequence in seq. Otherwise, store 0 in Tag and store the original data in the bit plane block in seq.
[0054] 4-3-2) Concatenate Tag and seq to obtain compressed data RD;
[0055] 4-3-3) The length of Tag and seq, the length of the compressed code table, and the length of the compressed code table embedded in the secret information are used as auxiliary information;
[0056] 4-3-4) In the consecutive λ high bit planes, first embed the auxiliary information length and auxiliary information, then embed the bit plane compressed data RD, and finally embed the secret information. The value of the high bit plane λ, the type mt of the maximum compression space, and the compression method t1, t2, or t3 of the bit plane are used as the key for transmission;
[0057] 5) Secret information extraction and image restoration: Auxiliary information is extracted from λ consecutive high-order planes of image I to obtain the compressed data RD, the length of the tag and seq, the compression code table length and the compression code table, and the secret information length. The encoding method of the feature block constitutes the bit plane. The block identifier Tag and the compression code seq are obtained by compressing the data RD. The block identifier is obtained according to the data in the tag in the hidden order. If the block identifier is 1, it is a compressible block:
[0058] 5-1) When mt = 1, there is only one code table T. The codes of B1, B2, B3, and B4 are extracted from seq. The values of the four feature blocks are obtained according to the code table. The bit plane structure of the single feature block is obtained according to the value of t1. The original data in the bit plane block is restored from the bit plane structure of the single feature block and the value of the feature block;
[0059] 5-2) When mt = 2, there are two code tables T1 and T2. The codes of B1 and B2 are extracted from seq. The values of B1 and B2 are obtained according to code table T1. The codes of B3 and B4 are extracted from seq. The values of B3 and B4 are obtained according to code table T2. The two types of feature block bit plane configurations are obtained according to the value of t2. The original data in the bit plane block is restored from the two types of feature block bit plane configurations and the values of the feature blocks.
[0060] 5-3) When mt = 3, there are three code tables T3, T4, and T5. The codes of B1 and B2 are extracted from seq. The values of B1 and B2 are obtained according to code table T3. The code of B3 is extracted from seq. The value of B3 is obtained according to code table T4. The code of B4 is extracted from seq. The value of B4 is obtained according to code table T5. The three types of feature block bit plane configurations are obtained according to the value of t3. The original data in the bit plane block is restored from the three types of feature block bit plane configurations and the values of the feature blocks.
[0061] 5-4) If the block identifier is 0, it is an incompressible block. 16 binary data are directly extracted from seq to restore the original data in the block in order from left to right and from top to bottom to obtain the original image. The location of the embedded secret information is determined by the length of the tag and seq, the length of the compression code table, and the compression code table. The embedded secret information is extracted based on the length of the embedded secret information.
[0062] This method not only ensures the correct extraction of secret information and lossless restoration of the original image, but also achieves a significant performance improvement in embedding capacity and realizes reversible information hiding. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 Schematic diagram of characteristic blocks in the embodiment;
[0064] Figure 2 A schematic diagram of the numbering of characteristic blocks in the embodiment;
[0065] Figure 3 A schematic diagram of a bit plane block composed of a single feature block in an embodiment;
[0066] Figure 4 Schematic diagram of a bit plane block composed of two types of feature blocks in an embodiment;
[0067] Figure 5 Schematic diagram of a bit plane block composed of three types of feature blocks in the embodiment. DETAILED DESCRIPTION
[0068] The present invention will be further described below with reference to the accompanying drawings and embodiments, but the present invention is not limited thereto.
[0069] Example:
[0070] A reversible information hiding method based on feature block coding comprises the following steps:
[0071] 1) Determine the feature blocks and their values: Nature is rich and colorful, so the features of images are diverse, some are smooth, some have complex textures, and many images have both smooth areas and textured areas. Therefore, feature blocks are selected to compress image I. Since the bit plane needs to be divided into blocks during compression, and each block is composed of feature blocks, the feature blocks are first encoded. When determining the feature blocks, the size and shape of the feature blocks need to be considered. If each feature block has n elements and the value of each element is 0 or 1, the larger n is, the more codes there are. If the number of codes is too large, the compression effect will be affected. If the value of n is small, the number of codes is small, but the number of feature blocks is also small, which cannot better reflect the characteristics of the image. There are 2 feature blocks with n elements. n codes. When n>4, there are more codes. When n is an odd number, it is not easy to form image blocks. Therefore, the size of the feature block is determined to be 4. Combined with the smoothness and texture features of image I, 5 feature blocks are determined. When the feature block constitutes a bit plane block, the feature block needs to be translated or rotated. After translation and rotation, the feature block is of the same type as the original feature block. In order to facilitate encoding, the elements in the feature block are numbered to determine the order of the 4 elements in the feature block. The value of each element in the feature block is 0 or 1. The element values are arranged in the order of the numbers, and a total of 16 different sequences from "0000" to "1111" are obtained. The binary number of each sequence is the value of the feature block, and d is used. i (i=0,1,…,15) represents, and 0≤d i ≤15;
[0072] 2) Composition of bit plane blocks: When compressing the bit plane, each bit plane block is composed of feature blocks, and the type and number of feature blocks are the same. Since the size of the five types of feature blocks is 4, and the feature blocks and the feature blocks after translation and rotation have a maximum of 4 elements in a row or column, the minimum size of the bit plane block is 4×4. Each bit plane block is composed of 4 feature blocks. There are at most 3 types of feature blocks that make up the bit plane block. If there are more than 3 types, a 4×4 bit plane block cannot be formed. Assume that the 4 feature blocks that make up the bit plane block are B1, B2, B3, and B4, and the number of types of feature blocks in the bit plane block is m, m = 1, 2, 3, and the maximum compression space of each type is C m ,but:
[0073] 2-1) Single-type feature block: There are 9 types of bit plane blocks composed of a single-type feature block, i.e., m=1;
[0074] 2-2) Two types of feature blocks: A 4×4 bit plane block is composed of two types of feature blocks, i.e., m=2, with a total of 26 possible combinations. Each bit plane block has two feature blocks of each type. B1 and B2 are the same feature block, and B3 and B4 are the same feature block.
[0075] 2-3) Three types of feature blocks: When there are three types of feature blocks, that is, m = 3, forming a 4×4 bit plane block, there are a total of 8 combinations. Each bit plane block has two feature blocks of the fifth feature block type, B1 and B2 are the same feature block, there is no feature block of the first type, and the other types each have one feature block;
[0076] 3) Bit plane block coding compression: Divide the continuous λ high bit planes in image I into blocks to obtain 4×4 non-overlapping bit plane blocks s, then:
[0077] 3-1) When m=1, the bit plane block consists of a single feature block, and 4s feature block values d are counted for all bit plane blocks. i The frequency h(k), 0≤k≤15, then:
[0078] h(k)=#{0≤k≤15:k=d i} (1),
[0079] According to h(k), Huffman coding is used to obtain the code T of all values of the feature block. When the bit plane block is compressed, if the block can be compressed, it is marked with 1, and if the block cannot be compressed, it is marked with 0. Let the compression capacity of the μ-th bit plane block composed of a single feature block be Q μ , 1≤μ≤s, feature block B in the bit plane block j , j=1,2,3,4 in T have corresponding code lengths of l μ,j ,but:
[0080]
[0081] Q μ When ≥0, the bit plane block is a compressible block, otherwise it is an incompressible block. Assume that there are Y compressible blocks in the bit plane block and the total compression space is Q, then:
[0082]
[0083] Similarly, find 9 compression spaces of bit plane blocks composed of single feature blocks. Let the compression capacity be Q1, Q2, ..., Q9, and let:
[0084] t1=argmax(Q1, Q2,...,Q9) (4),
[0085] From this we can get:
[0086]
[0087] 3-2) When m = 2, the bit plane block consists of two types of feature blocks, B1 and B2 are the same type of feature blocks, and B3 and B4 are the same type of feature blocks. The frequencies h1(k) and h2(k) of the 2s feature blocks B1 and B2 and B3 and B4 are counted respectively, 0≤k≤15. Huffman coding is used according to h1(k) and h2(k) to obtain two independent codes T1 and T2. Let the compression capacity of the r-th bit plane block composed of two types of feature blocks be Q r , 1≤r≤s, the encoding length of the feature blocks B1, B2 in the bit plane block in T1 is l 1 r,1 ,l 1 r,2 , in T2, the code length corresponding to B3 and B4 is l 2 r,1 ,l 2 r,2 ,but:
[0088]
[0089] Assume that there are N compressible blocks in the bit plane block and the total compression space is D, then
[0090]
[0091] Similarly, find 26 compression spaces of bit plane blocks composed of 2 types of feature blocks, and assume that their compression capacities are D1, D2, ..., D 26 ,make:
[0092] t2=argmax(D1,D2,...,D 26 ) (8),
[0093] From this we can get:
[0094]
[0095] 3-3) When m = 3, the bit plane block is composed of three types of feature blocks. B1 and B2 are feature blocks of the same type, B3 is a feature block of one type, and B4 is a feature block of another type. The frequency h1(k) of the 2s feature blocks B1 and B2, the frequency h2(k) of the s feature blocks B3, and the frequency h3(k) of the s feature blocks B4 are counted respectively. 0≤k≤15. Based on h1(k), h2(k), and h3(k), three independent codes T4, T5, and T6 are obtained through Huffman coding. Let the compression capacity of the v-th bit plane block composed of three types of feature blocks be Q v , 1≤v≤s, the encoding length of the feature blocks B1, B2 in the bit plane block in T1 is l 1 v,1 ,l 1 v,2 , the encoding length corresponding to B3 in T2 is l 2 v,1 , in T3, the code length corresponding to B4 is l 3 v,1 ,but:
[0096]
[0097] Assume there are p compressible blocks in the bit plane block, and the total compression space is E:
[0098]
[0099] Similarly, find out the compression spaces of 8 bit plane blocks composed of three types of feature blocks. Let the compression capacity be E1, E2, ..., E8, and let:
[0100] t3=argmax(E1,E2,...,E8) (12),
[0101] From this we can get:
[0102]
[0103] Compress λ consecutive high-order plane blocks according to the characteristic block construction method of steps 3-1) to 3-3), assuming that the maximum compression space is C, and let:
[0104] mt=argmax(C1,C2,C3) (14),
[0105] From this we can get:
[0106] C= C mt (15);
[0107] 3-4) When mt = 1, the bit plane block composed of a single feature block has the largest compression space. Among the nine methods of forming a single feature block, the method of forming a single feature block of the t1th type has the maximum compression space according to formula (4) and formula (5). Therefore, the bit plane composed of this single feature block is used to compress and hide information.
[0108] 3-5) When mt=2, the compression space of the bit plane block composed of two characteristic blocks is the largest. According to formulas (8) and (9), the t2th method of compressing the bit plane composed of two characteristic blocks is adopted. Therefore, the bit plane composed of this characteristic block is used to compress and hide information;
[0109] 3-6) When mt=3, according to formula (12) and formula (13), the t3th compression method using three types of feature blocks to form a bit plane can obtain the maximum compression space to hide information;
[0110] 4) Reversible information hiding based on bit plane block coding compression: The bit plane blocks of the continuous λ high bit planes of image I are compressed according to different feature block composition codes to obtain the maximum compression space. The value of mt is obtained based on the maximum compression space. According to the value of mt, the bit plane composition type and the corresponding compression coding table are used. A one-dimensional array Tag is used to record whether the block can be compressed, and seq records the corresponding data. The process is as follows:
[0111] 4-1) If the bit-plane block is a compressible block, store 1 in Tag:
[0112] 4-1-1) When mt = 1, compression is performed using the t1th single feature block composition method. Based on the values of B1, B2, B3, and B4, the corresponding codes of B1, B2, B3, and B4 are obtained from the single feature block code table T;
[0113] 4-1-2) When mt = 2, compression is performed using the t2th type consisting of two blocks of characteristic type. The codes for B1 and B2 are obtained from code table T1, and the codes for B3 and B4 are obtained from T2.
[0114] 4-1-3) When mt = 3, compression is performed using the t3th method consisting of three blocks of characteristic blocks. The codes for B1 and B2 are obtained from code table T3, the code for B3 is obtained from T4, and the code for B4 is obtained from T5. The codes for B1, B2, B3, and B4 are combined in order to obtain the compressed code for the block, which is stored in sequence in seq.
[0115] 4-2) If the bit plane block is an incompressible block, store 0 in the tag, scan the data in the bit plane block from left to right and from top to bottom, and store them in sequence in seq;
[0116] 4-3) The secret information and auxiliary information are stored in the redundant space, specifically:
[0117] 4-3-1) Scan all blocks of the λ high bit planes in sequence. If the block is compressible, store 1 in Tag and store the B1, B2, B3, and B4 codes in sequence in seq. Otherwise, store 0 in Tag and store the original data in the bit plane block in seq.
[0118] 4-3-2) Concatenate Tag and seq to obtain compressed data RD;
[0119] 4-3-3) The length of Tag and seq, the length of the compressed code table, and the length of the compressed code table embedded in the secret information are used as auxiliary information;
[0120] 4-3-4) In the consecutive λ high bit planes, first embed the auxiliary information length and auxiliary information, then embed the bit plane compressed data RD, and finally embed the secret information. The value of the high bit plane λ, the type mt of the maximum compression space, and the compression method t1, t2, or t3 of the bit plane are used as the key for transmission;
[0121] 5) Secret information extraction and image restoration: Auxiliary information is extracted from λ consecutive high-order planes of image I to obtain the compressed data RD, the length of the tag and seq, the compression code table length and the compression code table, and the secret information length. The encoding method of the feature block constitutes the bit plane. The block identifier Tag and the compression code seq are obtained by compressing the data RD. The block identifier is obtained according to the data in the tag in the hidden order. If the block identifier is 1, it is a compressible block:
[0122] 5-1) When mt = 1, there is only one code table T. The codes of B1, B2, B3, and B4 are extracted from seq. The values of the four feature blocks are obtained according to the code table. The bit plane structure of the single feature block is obtained according to the value of t1. The original data in the bit plane block is restored from the bit plane structure of the single feature block and the value of the feature block;
[0123] 5-2) When mt = 2, there are two code tables T1 and T2. The codes of B1 and B2 are extracted from seq. The values of B1 and B2 are obtained according to code table T1. The codes of B3 and B4 are extracted from seq. The values of B3 and B4 are obtained according to code table T2. The two types of feature block bit plane configurations are obtained according to the value of t2. The original data in the bit plane block is restored from the two types of feature block bit plane configurations and the values of the feature blocks.
[0124] 5-3) When mt = 3, there are three code tables T3, T4, and T5. The codes of B1 and B2 are extracted from seq. The values of B1 and B2 are obtained according to code table T3. The code of B3 is extracted from seq. The value of B3 is obtained according to code table T4. The code of B4 is extracted from seq. The value of B4 is obtained according to code table T5. The three types of feature block bit plane configurations are obtained according to the value of t3. The original data in the bit plane block is restored from the three types of feature block bit plane configurations and the values of the feature blocks.
[0125] 5-4) If the block identifier is 0, it is an incompressible block. 16 binary data are directly extracted from seq to restore the original data in the block in order from left to right and from top to bottom to obtain the original image. The location of the embedded secret information is determined by the length of the tag and seq, the length of the compression code table, and the compression code table. The embedded secret information is extracted based on the length of the embedded secret information.
Claims
1. A reversible information hiding method based on feature block coding, characterized in that: The steps include: 1) Determine the feature blocks and their values: Select the feature blocks to compress the image I. When compressing, the bit plane needs to be divided into blocks, and each block is composed of feature blocks. First, encode the feature blocks. If each feature block has n elements and the value of each element is 0 or 1, there are 2 feature blocks with n elements. n Codes, when n>4, there are many codes, and when n is an odd number, it is not easy to form image blocks. The size of the feature block is determined to be 4. Combined with the smoothness and texture characteristics of image I, 5 feature blocks are determined. When the feature block constitutes a bit plane block, the feature block needs to be translated or rotated. After translation and rotation, the feature block is of the same type as the original feature block. The elements in the feature block are numbered to determine the order of the 4 elements in the feature block. The value of each element in the feature block is 0 or 1. The element values are arranged in the order of the numbers to obtain 16 different sequences from "0000" to "1111". The binary number of each sequence is the value of the feature block. Use d i (i=0,1,…,15) represents, and 0≤d i ≤15; 2) Bit plane block Composition: When compressing the bit plane, each bit plane block is composed of feature blocks, and the type and number of feature blocks are the same. Since the size of the five types of feature blocks is 4, and the feature blocks and the feature blocks after translation and rotation have a maximum of 4 elements in a row or column, the minimum size of the bit plane block is 4×4. Each bit plane block is composed of 4 feature blocks. There are at most 3 types of feature blocks that make up the bit plane block. If there are more than 3 types, a 4×4 bit plane block cannot be formed. Assume that the 4 feature blocks that make up the bit plane block are B1, B2, B3, and B4, and the number of types of feature blocks in the bit plane block is m, m = 1, 2, 3, and the maximum compression space of each type is C m ,but: 2-1) Single-type feature block: There are 9 types of bit plane blocks composed of a single-type feature block, i.e., m=1; 2-2) Two types of feature blocks: A 4×4 bit plane block is composed of two types of feature blocks, i.e., m=2, with a total of 26 possible combinations. Each bit plane block has two feature blocks of each type. B1 and B2 are the same feature block, and B3 and B4 are the same feature block. 2-3) Three types of feature blocks: When there are three types of feature blocks, that is, m = 3, forming a 4×4 bit plane block, there are a total of 8 combinations. Each bit plane block has two feature blocks of the fifth feature block type, B1 and B2 are the same feature block, there is no feature block of the first type, and the other types each have one feature block; 3) Bit plane block coding compression: Divide the continuous λ high bit planes in image I into blocks to obtain 4×4 non-overlapping bit plane blocks s, then: 3-1) When m=1, the bit plane block consists of a single feature block, and 4s feature block values d are counted for all bit plane blocks. i The frequency h(k), 0≤k≤15, then: h(k)=#{0≤k≤15:k=d i } (1), According to h(k), Huffman coding is used to obtain the code T of all values of the feature block. When the bit plane block is compressed, if the block can be compressed, it is marked with 1, and if the block cannot be compressed, it is marked with 0. Let the compression capacity of the μ-th bit plane block composed of a single feature block be Q μ , 1≤μ≤s, feature block B in the bit plane block j , j=1,2,3,4 in T have corresponding code lengths of l μ,j ,but: Q μ When ≥0, the bit plane block is a compressible block, otherwise it is an incompressible block. Assume that there are Y compressible blocks in the bit plane block and the total compression space is Q, then: Similarly, find 9 compression spaces of bit plane blocks composed of single feature blocks. Let the compression capacity be Q1, Q2, ..., Q9, and let: t1=argmax(Q1, Q2,...,Q9) (4), From this we can get: 3-2) When m = 2, the bit plane block consists of two types of feature blocks, B1 and B2 are the same type of feature blocks, and B3 and B4 are the same type of feature blocks. The frequencies h1(k) and h2(k) of the 2s feature blocks B1 and B2 and B3 and B4 are counted respectively, 0≤k≤15. Huffman coding is used according to h1(k) and h2(k) to obtain two independent codes T1 and T2. Let the compression capacity of the r-th bit plane block composed of two types of feature blocks be Q r , 1≤r≤s, the encoding length of the feature blocks B1, B2 in the bit plane block in T1 is l 1 r,1 ,l 1 r,2 , in T2, the code length corresponding to B3 and B4 is l 2 r,1 ,l 2 r,2 ,but: Assume that there are N compressible blocks in the bit plane block and the total compression space is D, then Similarly, find 26 compression spaces of bit plane blocks composed of 2 types of feature blocks, and assume that their compression capacities are D1, D2, ..., D 26 ,make: <h2 style=";text-align:left;direction:ltr">t2 = argmax(D1,D2,...,D)<h2 style=";text-align:left;direction:ltr"> 26 <h2 style=";text-align:left;direction:ltr"> (8) From this we can get: 3-3) When m=3, the bit plane block is composed of three types of feature blocks, B1 and B2 are the same type of feature blocks, B3 is a type of feature block, and B4 is a type of feature block. The frequency h1(k) of the 2s feature blocks B1 and B2 values, the frequency h2(k) of the s feature blocks B3 values, and the frequency h3(k) of the s feature blocks B4 values are counted respectively, 0≤k≤15. According to h1(k), h2(k) and h3(k), three independent codes T4, T5 and T are obtained through Huffman coding. 6; Assume that the compression capacity of the vth bit plane block composed of three types of feature blocks is Q v , 1≤v≤s, the encoding length of the feature blocks B1, B2 in the bit plane block in T1 is l 1 v,1 ,l 1 v,2 , the encoding length corresponding to B3 in T2 is l 2 v,1 , in T3, the code length corresponding to B4 is l 3 v,1 ,but: Assume there are p compressible blocks in the bit plane block, and the total compression space is E: Similarly, find out the compression spaces of 8 bit plane blocks composed of three types of feature blocks. Let the compression capacity be E1, E2, ..., E8, and let: t3=argmax(E1,E2,...,E8) (12), From this we can get: Compress λ consecutive high-order plane blocks according to the characteristic block construction method of steps 3-1) to 3-3), assuming that the maximum compression space is C, and let: mt=argmax(C1,C2,C3) (14), From this we can get: C=C mt (15); 3-4) When mt = 1, the compression space of the bit plane block composed of a single feature block is the largest. Among the nine methods of forming a single feature block, the t1th method of forming a single feature block obtains the maximum compression space according to formulas (4) and (5); 3-5) When mt=2, the compression space of the bit plane block composed of two characteristic blocks is the largest. According to formulas (8) and (9), the t2th method of compressing the bit plane composed of two characteristic blocks is adopted; 3-6) When mt=3, the t3th compression method using three types of feature blocks to form a bit plane is used according to formulas (12) and (13), which can obtain the maximum compression space to hide information; 4) Reversible information hiding based on bit plane block coding compression: The bit plane blocks of the continuous λ high bit planes of image I are compressed according to different feature block composition codes to obtain the maximum compression space. The value of mt is obtained based on the maximum compression space. According to the value of mt, the bit plane composition type and the corresponding compression coding table are used. A one-dimensional array Tag is used to record whether the block can be compressed, and seq records the corresponding data. The process is as follows: 4-1) If the bit-plane block is a compressible block, store 1 in Tag: 4-1-1) When mt = 1, compression is performed using the t1th single feature block composition method. Based on the values of B1, B2, B3, and B4, the corresponding codes of B1, B2, B3, and B4 are obtained from the single feature block code table T; 4-1-2) When mt = 2, compression is performed using the t2th type consisting of two blocks of characteristic type. The codes for B1 and B2 are obtained from code table T1, and the codes for B3 and B4 are obtained from T2. 4-1-3) When mt = 3, compression is performed using the t3th method consisting of three blocks of characteristic blocks. The codes for B1 and B2 are obtained from code table T3, the code for B3 is obtained from T4, and the code for B4 is obtained from T5. The codes for B1, B2, B3, and B4 are combined in order to obtain the compressed code for the block, which is stored in sequence in seq. 4-2) If the bit plane block is an incompressible block, store 0 in the tag, scan the data in the bit plane block from left to right and from top to bottom, and store them in sequence in seq; 4-3) The secret information and auxiliary information are stored in the redundant space, specifically: 4-3-1) Scan all blocks of the λ high bit planes in sequence. If the block is compressible, store 1 in Tag and store the B1, B2, B3, and B4 codes in sequence in seq. Otherwise, store 0 in Tag and store the original data in the bit plane block in seq. 4-3-2) Concatenate Tag and seq to obtain compressed data RD; 4-3-3) The length of Tag and seq, the length of the compressed code table, and the length of the compressed code table embedded in the secret information are used as auxiliary information; 4-3-4) In the consecutive λ high bit planes, first embed the auxiliary information length and auxiliary information, then embed the bit plane compressed data RD, and finally embed the secret information. The value of the high bit plane λ, the type mt of the maximum compression space, and the compression method t1, t2, or t3 of the bit plane are used as the key for transmission; 5) Secret information extraction and image restoration: Auxiliary information is extracted from λ consecutive high-order planes of image I to obtain the compressed data RD, the length of the tag and seq, the compression code table length and the compression code table, and the secret information length. The encoding method of the feature block constitutes the bit plane. The block identifier Tag and the compression code seq are obtained by compressing the data RD. The block identifier is obtained according to the data in the tag in the hidden order. If the block identifier is 1, it is a compressible block: 5-1) When mt = 1, there is only one code table T. The codes of B1, B2, B3, and B4 are extracted from seq. The values of the four feature blocks are obtained according to the code table. The bit plane structure of the single feature block is obtained according to the value of t1. The original data in the bit plane block is restored from the bit plane structure of the single feature block and the value of the feature block. 5-2) When mt = 2, there are two code tables T1 and T2. The codes of B1 and B2 are extracted from seq. The values of B1 and B2 are obtained according to code table T1. The codes of B3 and B4 are extracted from seq. The values of B3 and B4 are obtained according to code table T2. The two types of feature block bit plane configurations are obtained according to the value of t2. The original data in the bit plane block is restored from the two types of feature block bit plane configurations and the values of the feature blocks. 5-3) When mt = 3, there are three code tables T3, T4, and T5. The codes of B1 and B2 are extracted from seq, and the values of B1 and B2 are obtained according to code table T3. The code of B3 is extracted from seq, and the value of B3 is obtained according to code table T4. The code of B4 is extracted from seq, and the value of B4 is obtained according to code table T5. The three types of feature block bit plane configurations are obtained according to the value of t3. The original data in the bit plane block is restored from the three types of feature block bit plane configurations and the values of the feature blocks. 5-4) If the block identifier is 0, it is an incompressible block. 16 binary data are directly extracted from seq to restore the original data in the block in order from left to right and from top to bottom to obtain the original image. The location of the embedded secret information is determined by the length of the tag and seq, the length of the compression code table, and the compression code table. The embedded secret information is extracted based on the length of the embedded secret information.
Citation Information
Patent Citations
Reversible information hiding method for bit plane compressed encrypted image
CN113382128A
Reversible information hiding method based on row coding
CN114915698A