A reversible information hiding method based on row label compression

By blocking and encoding the image based on row label compression, the problem of small embedding capacity in the prior art is solved, and efficient information hiding and image recovery are achieved.

CN114969671BActive Publication Date: 2024-12-31MOYI MENGCHENG (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210561709.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2024-12-31
Estimated Expiration
2042-05-23

AI Technical Summary

Technical Problem

In the existing reversible information hiding technology, the embedded capacity is small, making it difficult to meet the needs of information hiding.

Method used

The reversible information hiding method based on row label compression is adopted. By blocking the images, the bit plane block is compressed using row label encoding, and the classification block is compressible and incompressible blocks, and the compression space is improved by using Huffman coding. Implement information embedding and extraction.

Benefits of technology

Significantly increase the capacity of information concealment, enabling efficient embedding and extraction of secret information while losslessly restoring the original image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114969671B_ABST
    Figure CN114969671B_ABST
Patent Text Reader

Abstract

The present invention discloses a reversible information hiding method based on row label compression, which is characterized by comprising the following steps: 1) bit plane coding based on row labels; 2) reversible information hiding based on row label coding; 3) information extraction and image restoration. Bit plane blocks are compressed using bit plane coding based on row labels to obtain the compression space of each block, thereby realizing reversible information hiding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of image processing and information security, and in particular to a reversible information hiding method based on row label compression. Background Art

[0002] With the continuous development of information technology, information sharing in the network environment has gradually become an indispensable part of people's daily social life, and the information security issues brought about by this cannot be ignored. Information hiding technology is to embed secret information into carrier files in a specific way to achieve the purpose of covert communication and copyright protection. Reversible information hiding technology can not only accurately extract secret information, but also restore the original image without loss. It has great application value. In recent years, it has been widely used in medical experiments, judicial imaging, military communications and other fields. It can be combined with some cutting-edge technologies, such as reversible adversarial samples and visual conversion.

[0003] Reversible information hiding can be roughly divided into three categories: reversible information hiding technology based on lossless compression, reversible information hiding technology based on difference expansion, and reversible information hiding technology based on histogram shift. The main idea of ​​the lossless compression technology is to compress part of the information of the carrier image to free up a certain amount of space to embed the secret information; the main idea of ​​the difference expansion technology is to calculate the difference between two adjacent pixels, expand the difference, and add the secret information to be embedded to complete the information embedding; the main idea of ​​the histogram shift technology is to obtain the histogram of pixel values ​​by counting the frequency of each pixel in the original image, and shift the peak point and zero point of the carrier image pixel histogram to complete the information embedding.

[0004] Among the existing types of reversible information hiding algorithms, although they can all achieve reversible hiding of secret information, their embedding capacity is generally small. Summary of the invention

[0005] The purpose of the present invention is to provide a reversible information hiding method based on row label compression to address the deficiencies of the prior art.

[0006] The technical solution for achieving the purpose of the present invention is:

[0007] A reversible information hiding method based on row label compression includes the following steps:

[0008] 1) Bit plane coding based on row labels: Assume that for a bit plane block B of size s1×s2, let n be the total number of pixels in the block, n=s1*s2, n1 is the number of elements with value 1 in the block, and let the element in the i-th row and j-th column be c i,j , the sum of the elements in the i-th row is h i , where 1<i≤s1,1<j≤s2, then:

[0009]

[0010] When h i =0, then all elements in the i-th row are 0, otherwise not all elements in the i-th row are 0, let:

[0011]

[0012] make:

[0013]

[0014] For the bit plane block, m is the number of rows in which all elements in the bit plane block are not 0. The blocks are classified according to n1 and m, recorded as (n1:m). The block coding method of row labels is used to compress the (n1:m) blocks. The block coding of row labels consists of four parts, namely:

[0015] The encoding of n1 is [row label][row distribution encoding][row encoding],

[0016] In the (n1:m) blocks for different situations, the [] items can be omitted.

[0017] The specific coding is as follows:

[0018] 1-1) Encoding of n1:

[0019] The encoding of n1 is the number of bits required to record the value of n1, let the length be p;

[0020] For the (0:0) block, that is, the block with all bit plane values ​​​​being 0, only the number of bits occupied by n1, p, needs to be recorded, and the other 3 parts are omitted;

[0021] For a (1:1) block, that is, a bit plane block with only one element being 1, the number of bits occupied by n1, p, and the row and column numbers of the element being 1 are recorded, and the other two parts are omitted;

[0022] 1-2) Row labels:

[0023] The row label records whether there is an element with a value of 1 in each row. The length is s1 bits. Let the row label be Q, then:

[0024]

[0025] For a (n1:m) block, there are m values ​​in Q that are 1, and f i =1 means that the i-th row is not all zeros;

[0026] 1-3) Row distribution coding:

[0027] Row distribution coding is the distribution of elements with a value of "1" in each of the m rows. For each (n1:m) block, there are cases of the row distribution of elements with a value of "1", so row distribution coding is needed for differentiation. When it means that the elements with a value of 1 in the current block are distributed in one row, which can be determined based on the row label, so row distribution coding is not required. When let the number of bits to be recorded for the row distribution of elements with a value of 1 in the current block be b, then there is

[0028] 1-4) Row coding:

[0029] Row coding is to code the m rows that are not all 0 in the (n1:m) block to determine the data of each row. For the rows that are not all 0, scan the elements in the row from left to right. The row coding is from the first element in the row to the last element with a value of 1. Let the length of the i-th row coding of the (n1:m) block be l i , and the total row coding length l, then there is:

[0030]

[0031] 2) Reversible information hiding based on row label coding:

[0032] 2-1) Compression of image blocks based on row label coding: Divide the λ consecutive high-order planes in the image I into blocks, and let the block be B r , the size of the block is s1×s2, the t-th bit plane of B r is B r,t , the number of 1s in B r,t is n1, and the number of 0s is n0. When n0 < n1, it means that the number of 1s in this block is more than the number of 0s, and it is a block with a majority of 1s. Swap 1 and 0 to convert it into a block with a majority of 0s. Mark the blocks with a majority of 0s and a majority of 1s. When compressing the blocks with row label coding, divide the blocks into compressible blocks and non-compressible blocks, and mark these blocks. The compressible blocks with a majority of 1s are marked as 00, the compressible blocks with a majority of 0s are marked as 01, and the non-compressible blocks are marked as 1.

[0033] Compress the bit plane blocks where n1 ∈ [0, i], 1 ≤ i ≤ n / 2. Let the compression capacity of the bit plane blocks where n1 ∈ [0, i] be v i , starting from 1 to n / 2, calculate the compression capacity of each i, and find the integer T a in [0, i] such that the compression space of all blocks where n1 ∈ [0, i] is the largest. The formula is as follows:

[0034] T a =argmax(v0, v1, …, v n / 2 ),

[0035] When n1∈[0,T a ], the block is defined as a compressible block; when n1∈[T a ,n / 2], the block is defined as an incompressible block.

[0036] After compressing the image block using the bit plane coding based on the row label, the distribution of n1 in the compressible block is counted, and Huffman coding is performed to obtain the number of bits p for different n1 values ​​to further improve the compression space. For the compressible block, 2 bits are required to record the block type identifier, the number of bits p occupied by n1, the length s1 of the row label Q, the length b of the row distribution code and the row code length l. Suppose the available space C of each compressible bit plane block is i ,but:

[0037] C i =s1×s2-p-s1-bl-2,

[0038] Compress each block in the above manner. Assuming there are t compressible bit plane blocks and u incompressible blocks, the total compression space EC is:

[0039]

[0040] 2-1) Information embedding: Compress the blocks of the image by row label encoding for the λ consecutive high-order planes to obtain the total compressed space. Use the one-dimensional array Tag to record the block tags, seq1 to record the compressed code, and seq2 to record the data of the uncompressed block. The information hiding steps are as follows:

[0041] 2-1-1) Scan all blocks sequentially and perform compression encoding based on row labels on all blocks;

[0042] 2-1-2) Save the block identification order in Tag. If it is a compressed block, save the row label encoding order in seq1. If it is an uncompressed block, store the original data in seq2.

[0043] 2-1-3) Concatenate Tag, seq1 and seq2 to obtain compressed data RD;

[0044] 2-1-4) Record the length of Tag and seq1 and embed the secret information as auxiliary information;

[0045] 2-1-5) In the continuous λ high bit planes, the auxiliary information length and the auxiliary information are first embedded, then the bit plane compressed data RD is embedded, and finally the secret information is embedded;

[0046] 3) Information extraction and image restoration: First, the image is divided into blocks according to the block sizes s1 and s2, and auxiliary information is extracted from λ consecutive high-order planes of the image to obtain the compressed data RD and the length of the secret information. Then, according to RD and the length of the secret information, the embedded secret information and the compressed data RD are extracted. Finally, RD is decompressed to obtain the block identifier Tag and seq1 and seq2. According to the block identifier, if it is a compressed block, the original data of the block is restored in seq1. If it is an incompressible block, the original data is directly extracted from seq2 to finally obtain the original image.

[0047] The technical solution divides the image into blocks, compresses the bit plane blocks using bit plane coding based on row labels, obtains the compression space of each block, and realizes reversible information hiding. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 This is a schematic diagram of the highest bit plane of an original image of size 8×8 in an embodiment;

[0049] Figure 2 This is a schematic diagram of compression based on row label encoding of block 1 in the embodiment;

[0050] Figure 3 This is a schematic diagram of compression based on row label coding of block 2 in the embodiment;

[0051] Figure 4 This is a schematic diagram of compression based on row label coding of block 3 in the embodiment;

[0052] Figure 5 This is a schematic diagram of compression based on row label coding of block 4 in the embodiment;

[0053] Figure 6 Schematic diagram of the highest bit plane of the original image after encoding and compression in the embodiment. DETAILED DESCRIPTION

[0054] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments, but the present invention is not limited thereto.

[0055] Example:

[0056] A reversible information hiding method based on row label compression includes the following steps:

[0057] 1) Bit plane coding based on row labels: Assume that for a bit plane block B of size s1×s2, let n be the total number of pixels in the block, n=s1*s2, n1 is the number of elements with value 1 in the block, and let the element in the i-th row and j-th column be c i,j , the sum of the elements in the i-th row is h i , where 1<i≤s1,1<j≤s2, then:

[0058]

[0059] When h i =0, then all elements in the i-th row are 0, otherwise not all elements in the i-th row are 0, let:

[0060]

[0061] make:

[0062]

[0063] For the bit plane block, m is the number of rows in which all elements in the bit plane block are not 0. The blocks are classified according to n1 and m, recorded as (n1:m). The block coding method of row labels is used to compress the (n1:m) blocks. The block coding of row labels consists of four parts, namely:

[0064] The encoding of n1 is [row label][row distribution encoding][row encoding],

[0065] In the (n1:m) blocks for different situations, the [] items can be omitted.

[0066] The specific coding is as follows:

[0067] 1-1) Encoding of n1:

[0068] The encoding of n1 is the number of bits required to record the value of n1, let the length be p;

[0069] For the (0:0) block, that is, the block with all bit plane values ​​​​being 0, only the number of bits occupied by n1, p, needs to be recorded, and the other 3 parts are omitted;

[0070] For a (1:1) block, that is, a bit plane block with only one element being 1, the number of bits occupied by n1, p, and the row and column numbers of the element being 1 are recorded, and the other two parts are omitted;

[0071] 1-2) Row labels:

[0072] The row label records whether there is an element with a value of 1 in each row. The length is s1 bits. Let the row label be Q, then:

[0073]

[0074] For a (n1:m) block, there are m values ​​in Q that are 1, and f i =1 means that the i-th row is not all zeros;

[0075] 1-3) Row distribution coding:

[0076] The row distribution code is the distribution of elements with value "1" in each row in m rows. For each (n1:m) block, the row distribution of elements with value "1" is Therefore, row distribution coding is needed to distinguish them. When , it means that the elements with the current block value of 1 are distributed in one row, which can be determined based on the row label, so there is no need for row distribution encoding. , assuming that the number of bits required to record the row distribution of elements with the current block value of 1 is b, then

[0077] 1-4) Line encoding:

[0078] Row coding is to encode the m rows in the (n1:m) block that are not all zeros, determine the data of each row, and for rows that are not all zeros, scan the elements in the row from left to right. The first element to the last element with a value of 1 in the row is the row code. Let the length of the i-th row code of the (n1:m) block be l i , the total row encoding length l, then:

[0079]

[0080] In this example, the highest bit plane of an 8×8 image is selected, which is divided into four 4×4 blocks, such as Figure 1 As shown, the optimal parameter T for a 4×4 block is a =3;

[0081] In this example, the image block is divided into 4 small blocks of size 4×4, which are defined as block 1, block 2, block 3, and block 4 from left to right and from top to bottom. The number of 1s in the block is n1, and the number of 0s is n0. The 4 small blocks are divided into blocks and image block compression is performed based on row label coding:

[0082] Block 1 belongs to the (0:0) block, that is, the block with all bit plane values ​​​​being 0. It is a compressible block with most of the values ​​​​being 0. The first two bits of the block type are marked as "01". The block structure encoding only needs;

[0083] Block 2 belongs to the (4:3) block, where n1>3, and is an incompressible block. The first bit of the block type is marked as "1". In addition, all the data of the block needs to be recorded. The specific encoding is as follows: Figure 3 As shown;

[0084] Block 3 belongs to the (3:1) block, which is a compressible block with most of the values ​​being 0. The first two block types are marked as "01". The block structure code includes the code of n1, the row label, the row distribution code, and the row code. The number of bits p occupied by record n1 occupies 2 bits, represented by "11", the row label Q occupies 4 bits, represented by "1000", and the row code occupies 3 bits, represented by "111". Since the row distribution of elements with a value of "1" is unique, row distribution coding is not required. The specific coding is as follows: Figure 4 As shown;

[0085] Block 4 belongs to a (1:1) block, that is, a bit-plane block with only one element being 1, which is a compressible block with most elements being 0. The first two block type tags are marked as "01". The block structure encoding includes the encoding of n1 and the row numbers and column numbers of the elements being 1. Among them, the number of bits p occupied by n1 is recorded as 2 bits, represented by "01", and the row numbers and column numbers of the elements being 1 occupy 4 bits, represented by "1010". The specific encoding is as Figure 5 shown;

[0086] 2) Reversible information hiding based on row label encoding:

[0087] 2-1) Compression of image blocks based on row label encoding: The λ consecutive high-order bit-planes in image I are segmented. Let the block be B r , the size of the block is s1×s2, and the t-th bit-plane of B r is B r,t , and the number of 1s in B r,t is n1, and the number of 0s is n0. When n0 < n1, it means that the number of 1s in this block is more than the number of 0s, which is a block with most elements being 1. Swap 1 and 0 to convert it into a block with most elements being 0. Mark the blocks with most elements being 0 and most elements being 1. When compressing the block with row label encoding, the block is divided into compressible blocks and non-compressible blocks and marked. The compressible block with most elements being 1 is marked as 00, the compressible block with most elements being 0 is marked as 01, and the non-compressible block is marked as 1.

[0088] Compress the bit-plane blocks where n1 ∈ [0, i], 1 ≤ i ≤ n / 2. Let the compression capacity of the bit-plane blocks where n1 ∈ [0, i] be v i , starting from 1 to n / 2, calculate the compression capacity of each i, and find the integer T a in [0, i] such that the compression space of all blocks where n1 ∈ [0, i] is the largest. The formula is as follows:

[0089] T a = argmax(v0, v1, …, v n / 2 ),

[0090] When n1 ∈ [0, T a , define this block as a compressible block; when n1 ∈ [T a , n / 2], define this block as a non-compressible block.

[0091] After compressing the image block using row label-based bit-plane encoding, count the distribution of n1 in the compressible blocks, perform Huffman encoding to obtain the number of bits p for different n1 values, and further improve the compression space. For compressible blocks, 2 bits are required to record the block type identifier, the number of bits p occupied by n1, the length s1 of the row label Q, the length b of the row distribution encoding, and the length l of the row encoding. Let the available space C i of each compressible bit-plane block be, then:

[0092] C i =s1×s2-p-s1-bl-2,

[0093] Compress each block in the above manner. Assuming there are t compressible bit plane blocks and u incompressible blocks, the total compression space EC is:

[0094]

[0095] 2-1) Information embedding: Compress the blocks of the image by row label encoding for the λ consecutive high-order planes to obtain the total compressed space. Use the one-dimensional array Tag to record the block tags, seq1 to record the compressed code, and seq2 to record the data of the uncompressed block. The information hiding steps are as follows:

[0096] 2-1-1) Scan all blocks sequentially and perform compression encoding based on row labels on all blocks;

[0097] 2-1-2) Save the block identification order in Tag. If it is a compressed block, save the row label encoding order in seq1. If it is an uncompressed block, store the original data in seq2.

[0098] 2-1-3) Concatenate Tag, seq1 and seq2 to obtain compressed data RD;

[0099] 2-1-4) Record the length of Tag and seq1 and embed the secret information as auxiliary information;

[0100] 2-1-5) In the continuous λ high bit planes, the auxiliary information length and the auxiliary information are first embedded, then the bit plane compressed data RD is embedded, and finally the secret information is embedded;

[0101] In this example, the highest bit plane of the 8×8 image is coded and compressed, and the compressed information is concatenated to obtain the compressed data RD. The remaining space is used to embed the secret information, such as Figure 6 As shown, the length of the compressed bit stream is 40 bits, and the highest bit plane of the original 8×8 image has 64 bits, so 24 bits can be freed up for embedding secret information;

[0102] 3) Information extraction and image restoration: First, the image is divided into blocks according to the block sizes s1 and s2, and auxiliary information is extracted from λ consecutive high-order planes of the image to obtain the compressed data RD and the length of the secret information. Then, according to RD and the length of the secret information, the embedded secret information and the compressed data RD are extracted. Finally, the compressed data RD is used to obtain the block identifier Tag and seq1 and seq2. According to the block identifier, if it is a compressed block, the original data of the block is restored in seq1. If it is an incompressible block, the original data is directly extracted from seq2, and finally the original image is obtained.

[0103] In this example, the image is first divided into blocks according to the block size to obtain 4 4×4 blocks, and auxiliary information is extracted from λ consecutive high-order planes of the image to obtain compressed data RD and the length of the secret information. Then, based on RD and the length of the secret information, the embedded secret information and the compressed data RD are extracted. According to the block identifier, it can be seen that block 1, block 3 and block 4 are compressible blocks. The original data of the block is restored in seq1. Block 2 is an incompressible block. The original data is directly extracted from seq2 to finally obtain the original image.

Claims

1. A reversible information hiding method based on row label compression, characterized in that: The steps include: 1) Bit plane coding based on row labels: Assume that for a bit plane block B of size s1×s2, let n be the total number of pixels in the block, n=s1*s2, n1 is the number of elements with value 1 in the block, and let the element in the i-th row and j-th column be c i,j , the sum of the elements in the i-th row is h i , where 1<i≤s1,1<j≤s2, then: When h i =0, then all elements in the i-th row are 0, otherwise not all elements in the i-th row are 0, let: make: For the bit plane block, m is the number of rows in which all elements in the bit plane block are not 0. The blocks are classified according to n1 and m, recorded as (n1:m). The block coding method of row labels is used to compress the (n1:m) blocks. The block coding of row labels consists of four parts, namely: The encoding of n1 is [row label][row distribution encoding][row encoding], Among them, for different situations of (n1:m) blocks, the [] items can be omitted. The specific coding is as follows: 1-1) Encoding of n1: The encoding of n1 is the number of bits required to record the value of n1, let the length be p; For the (0:0) block, that is, the block with all bit plane values ​​​​being 0, only the number of bits occupied by n1, p, needs to be recorded, and the other 3 parts are omitted; For a (1:1) block, that is, a bit plane block with only one element being 1, the number of bits occupied by n1, p, and the row and column numbers of the element being 1 are recorded, and the other two parts are omitted; 1-2) Row labels: The row label records whether there is an element with a value of 1 in each row. The length is s1 bits. Let the row label be Q, then: For a (n1:m) block, there are m values ​​in Q that are 1, and f i =1 means that the i-th row is not all zeros; 1-3) Row distribution coding: The row distribution code is the distribution of elements with value "1" in each row in m rows. For each (n1:m) block, the row distribution of elements with value "1" is In this case, row distribution coding is used to distinguish When , it means that the elements with the current block value of 1 are distributed in one row, which can be determined based on the row label, and no row distribution encoding is required. , assuming that the number of bits required to record the row distribution of elements with the current block value of 1 is b, then 1-4) Line encoding: Row coding is to encode the m rows in the (n1:m) block that are not all zeros, determine the data of each row, and for rows that are not all zeros, scan the elements in the row from left to right. The first element to the last element with a value of 1 in the row is the row code. Let the length of the i-th row code of the (n1:m) block be l i , the total row encoding length l, then: 2) Reversible information hiding based on row label encoding: 2-1) Image block compression based on row label coding: Divide the λ consecutive high-order planes in image I into blocks, and let block B r , the block size is s1×s2, B r The tth bit plane of r,t , B r,t The number of 1s is n1, and the number of 0s is n0. When n0<n1, it means that the number of 1s in the block is greater than the number of 0s, and it is a block with mostly 1s. 1s and 0s are interchanged to convert it into a block with mostly 0s. The blocks with mostly 0s and mostly 1s are marked. When the blocks are compressed using row label encoding, the blocks are divided into compressible blocks and incompressible blocks. These blocks are marked. The compressible blocks with mostly 1s are marked as 00, the compressible blocks with mostly 0s are marked as 01, and the incompressible blocks are marked as 1. Compress the bit plane block n1∈[0,i], 1≤i≤n / 2, and let the compression capacity of the bit plane block n1∈[0,i] be v i , starting from 1 to n / 2, calculate the compression capacity of each i, and find an integer T between [0,i] a , so that the block compression space of all n1∈[0,i] is the largest, the formula is as follows: T a =argmax(v0,v1,…,v n / 2 ), When n1∈[0,T a ], the block is defined as a compressible block; when n1∈[T a ,n / 2], the block is defined as an incompressible block. After compressing the image block using the bit plane coding based on the row label, the distribution of n1 in the compressible block is counted, and Huffman coding is performed to obtain the number of bits p for different n1 values. For the compressible block, 2 bits are required to record the block type identifier, the number of bits p occupied by n1, the length s1 of the row label Q, the length b of the row distribution code and the row code length l. Assume that the available space C of each compressible bit plane block is i ,but: C i =s1×s2-p-s1-bl-2, Compress each block in the above manner. Assuming there are t compressible bit plane blocks and u incompressible blocks, the total compression space EC is: 2-1) Information embedding: Compress the blocks of the image by row label encoding for the λ consecutive high-order planes to obtain the total compressed space. Use the one-dimensional array Tag to record the block tags, seq1 to record the compressed code, and seq2 to record the data of the uncompressed block. The information hiding steps are as follows: 2-1-1) Scan all blocks sequentially and perform compression encoding based on row labels on all blocks; 2-1-2) Save the block identification order in Tag. If it is a compressed block, save the row label encoding order in seq1. If it is an uncompressed block, store the original data in seq2. 2-1-3) Concatenate Tag, seq1 and seq2 to obtain compressed data RD; 2-1-4) Record the length of Tag and seq1 and embed the secret information as auxiliary information; 2-1-5) In the continuous λ high bit planes, the auxiliary information length and the auxiliary information are first embedded, then the bit plane compressed data RD is embedded, and finally the secret information is embedded; 3) Information extraction and image restoration: First, the image is divided into blocks according to the block sizes s1 and s2, and auxiliary information is extracted from λ consecutive high-order planes of the image to obtain the compressed data RD and the length of the secret information. Then, according to RD and the length of the secret information, the embedded secret information and the compressed data RD are extracted. Finally, the block identifier Tag and seq1 and seq2 are obtained by decompressing RD. According to the block identifier, if it is a compressed block, the original data of the block is restored in seq1. If it is an incompressible block, the original data is directly extracted from seq2 to finally obtain the original image.