CN112380551B - Reversible data hiding method and system based on double images - Google Patents
Reversible data hiding method and system based on double images Download PDFInfo
- Publication number
- CN112380551B CN112380551B CN202011292406.3A CN202011292406A CN112380551B CN 112380551 B CN112380551 B CN 112380551B CN 202011292406 A CN202011292406 A CN 202011292406A CN 112380551 B CN112380551 B CN 112380551B
- Authority
- CN
- China
- Prior art keywords
- turtle
- points
- point
- matrix
- tortoise
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Image Processing (AREA)
Abstract
The invention provides a reversible data hiding method and a reversible data hiding system based on double images, which are characterized in that a novel tortoise shell magic matrix is obtained by adding numerical values of '8' to element values of tortoise back points on the basis of the original tortoise shell magic matrix, the range of the element values in the matrix is expanded, the hidden quantity of hidden secret data of the matrix is increased, meanwhile, a novel reversible hiding algorithm is invented, the secret data are converted into hexadecimal numbers to be hidden in the novel tortoise shell magic matrix, and pairwise corresponding secret images are obtained; and in the stage of secret data extraction, a corresponding data extraction rule is formulated according to a novel reversible hiding algorithm to extract the secret data, and an original image is recovered. Compared with the traditional data hiding algorithm based on the image, the method has the advantage of ensuring the quality of the hidden image under the condition of higher storage capacity, so that the secret data can be hidden more safely.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a reversible data hiding method and system based on double images.
Background
With the popularization of network technology, people can conveniently communicate with other people and exchange data on the network. However, due to the open nature of the network, data transmitted on the network can be easily intercepted, tampered or destroyed by malicious persons. Therefore, in order to improve the security of data communication, a common solution is to encrypt the data to be transmitted. However, due to the complexity of the encryption algorithm, the encryption and decryption process takes a relatively long time, and the encrypted data is a pile of meaningless scratchlike things, which is more likely to cause suspicion of malicious persons. While malicious persons may not be able to crack the data directly, they may corrupt the data, causing loss of the data.
In addition to encryption techniques, data hiding is also an effective method of data protection. The data hiding algorithm may hide secret data into a medium, which may be an image, video, audio, text, etc. After the data is embedded in the image, the image and the original image are not greatly different from each other seen from naked eyes, so that the doubts of attackers are not easily caused, and the data transmission can be safely carried out. And after receiving the image hidden with the secret information, the receiver extracts the secret information according to an extraction algorithm.
Data hiding is divided into reversible data hiding and irreversible data hiding according to whether a data receiver can recover an original image. Generally, whether irreversible data hiding can hide more secret information or not is achieved, and conversely, reversible data hiding capacity is generally smaller. The advantage of reversible data hiding is that the original image can be fully restored.
The invention carries out reversible data hiding based on double images, and two images with hidden secret data can be generated after the original image is hidden with the secret data. The original image and the secret data cannot be extracted only by a single image storing the secret data, and if and only if two images storing the secret data are acquired by a receiving party together, the secret data and the original image can be completely recovered by the cooperation of the two images.
Disclosure of Invention
The invention provides a reversible data hiding method and system based on double images, which are used for solving the defects of the prior art.
In one aspect, the present invention provides a reversible data hiding method based on dual images, comprising the following steps:
s1: constructing a matrix with a horizontal and vertical coordinate range of [0, 255], enabling values of adjacent elements in the same row in the matrix to differ by 1 and sequentially increase progressively, enabling values of two adjacent even columns of elements in the same column to be more than 2 than those of odd columns and values of odd columns to be more than 3 than those of even columns, then performing modular 8 operation on the element values in the matrix to enable the element values to be between [0, 7], and finally covering the matrix with a plurality of connected and spliced hexagons to obtain a tortoise shell magic matrix, wherein points located at the edges of the hexagons in the matrix belong to tortoise edge points, points not located at the edges of the hexagons belong to tortoise back points, and adding a numerical value of 8 to each element located at the tortoise back points in the tortoise shell magic matrix to obtain a new tortoise shell magic matrix;
s2: converting the secret information to be hidden into a string of binary numbers, and converting every 4 binary numbers into a hexadecimal number;
s3: a pixel p is taken from the original image (p e 0, 255), expanded into a coordinate (p,
p) if said pixel isAnd isAcquiring a hexadecimal number which is marked as v from the secret information, determining a hiding range according to the position difference of the point (p, p) in the new tortoise-shell magic matrix, finding a coordinate (p1, p2) which enables the coordinate to correspond to a value of v in the hiding range, and moving the point with conflict of the coordinate (p1, p2) according to a moving rule;
s4: assigning p1 to a position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information to execute step S3 to obtain a first secret image, assigning p2 to a position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information to execute step S3 to obtain a second secret image.
The method enlarges the range of the element values in the new tortoise-shell magic matrix by adding the numerical value of 8 to the element values of the tortoise back points, thereby increasing the hidden quantity of the hidden secret data of the new tortoise-shell magic matrix, and well hiding the secret data and recovering the original image under the condition of less change to the original image by utilizing a novel reversible hiding algorithm.
In a specific embodiment, the hiding range is determined according to the difference of the positions of the points (p, p) in the new tortoise-shell magic matrix, and the specific steps include: recording a point with a larger vertical coordinate in the turtle back points as an upper turtle back point, recording a point with a smaller vertical coordinate in the turtle back points as a lower turtle back point, recording three points with a minimum vertical coordinate or a vertical coordinate equal to the upper turtle back point in the turtle side points as upper turtle side points, recording three points with a maximum vertical coordinate or a vertical coordinate equal to the lower turtle back point in the turtle side points as lower turtle side points, if the pixel p belongs to the upper turtle side points or the upper turtle back points, constructing a 4 x 5 block by taking a point with a coordinate (p, p) in the new turtle shell magic matrix as a lower right corner, deducting 4 elements of the upper right corner in the block, and using the remaining 16 elements to store a hexadecimal number; if the pixel p belongs to the lower turtle boundary point or the lower turtle back point, a 4 × 5 block is constructed by using (p, p) as the upper left corner, 4 elements in the lower left corner of the block are subtracted, and the remaining 16 elements are used to store one hexadecimal number.
In a specific embodiment, the movement rule specifically includes:
if the pixel p belongs to the upper turtle-edge point or the upper turtle-back point, moving the element bf of the last column of the first row and the element bs of the last column of the second row in the hidden range according to the following rule:
if the pixel p belongs to the lower turtle-edge point or the lower turtle-back point, the element lf of the first column of the last row and the element ls of the first column of the second last row in the hidden range are moved according to the following rule:
in a specific embodiment, in step S3, if the pixel p ∈ [0, 2] or p ∈ [253, 255], let p1 ═ p2
And directly performs step S4.
In a specific embodiment, the method further includes a step of extracting the secret information in the image, and specifically includes:
a1: executing the step S1 to obtain the new tortoise shell magic matrix;
a2: sequentially taking out the p1 and the p2 from the same position of the first secret image and the second secret image, and defining a difference value d which is p1-p 2;
a3: secret information extraction is performed according to the following rules:
(1) if d is 0 and p1 and p2 belong to edge points, no secret information is hidden in corresponding points in the first secret image and the second secret image; if d is 0 and p1 and p2 do not belong to the edge point, the hidden hexadecimal secret information v is the value of the new turtle shell magic matrix midpoint (p1, p 2);
(2) if d < 0, the hidden hexadecimal secret information v is obtained according to the following rule:
(3) if d > 0, the hidden hexadecimal secret information v is obtained according to the following rule:
wherein M (p1, p2) represents the value of the new turtle shell magic matrix midpoint (p1, p 2).
In a specific embodiment, the method further includes a step of recovering the original picture, specifically included in the step a1-
After a3, the following original picture restoration algorithm is performed:
(1) if d is 0, the original pixel p is p 1;
(2) if d < 0, p can be obtained by:
(3) if d > 0, p can be obtained by:
and restoring the pixel p at the corresponding position in the original image, thereby restoring the original image.
According to a second aspect of the present invention, a computer-readable storage medium is proposed, on which a computer program is stored, which computer program, when being executed by a computer processor, carries out the above-mentioned method.
According to a third aspect of the present invention, a reversible data hiding system based on dual images is proposed, the system comprising:
the new tortoise shell magic matrix construction module: configuring a matrix for constructing a horizontal and vertical coordinate range of [0, 255], enabling values of adjacent elements in the same row in the matrix to be different by 1 and sequentially increasing progressively, enabling values of even columns of adjacent two elements in the same column to be more than 2 than that of odd columns and values of odd columns to be more than 3 than that of even columns, then conducting modular 8 operation on the values of the elements in the matrix to enable the values of the elements to be between [0, 7], and finally covering the matrix with a plurality of connected and spliced hexagons to obtain a tortoise shell magic matrix, wherein points at the edges of the hexagons in the matrix belong to tortoise edge points, and points at the edges of the hexagons do not belong to tortoise edge points
Adding a numerical value of 8 to each element positioned at the turtle back point in the turtle shell magic matrix to obtain a new turtle shell magic matrix;
secret information preprocessing module: the device is configured to convert secret information to be hidden into a string of binary numbers, and then convert every 4 binary numbers into a hexadecimal number;
secret information hiding module: configured to take a pixel p (p e 0, 255) from the original image]) Expanding the pixel p to one coordinate (p, p) if the pixel p is a coordinate (p, p)And isObtaining a hexadecimal number, which is marked as v, from the secret information, determining a hiding range according to the position difference of the point (p, p) in the new tortoise-shell magic matrix, finding a coordinate (p1, p2) which leads the coordinate to correspond to a value of v in the hiding range, and matching the obtained coordinate with the new magic matrix according to a moving ruleMoving the point where the coordinates (p1, p2) conflict;
secret image generation module: is configured to assign p1 to the corresponding position of the pixel p in the original image,
traversing all pixels in the original image and all hexadecimal numbers in the secret information to operate the secret information hiding module to obtain a first secret image, assigning p2 to a position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information to operate the secret information hiding module to obtain a second secret image; hidden range determination module: the image processing method comprises the steps that points with larger ordinate in the turtle back points are configured and used for recording points with smaller ordinate in the turtle back points as upper turtle back points, three points with the smallest ordinate or the same ordinate in the turtle back points as upper turtle back points are recorded as lower turtle back points, three points with the largest ordinate or the same ordinate in the turtle back points as lower turtle back points are recorded as lower turtle back points, if a pixel p belongs to the upper turtle back points or the upper turtle back points, a 4 x 5 block is constructed by taking a point with coordinates (p, p) in a new turtle shell magic matrix as a lower right corner, 4 elements in the upper right corner of the block are deducted, and the remaining 16 elements are used for storing a hexadecimal number; if the pixel p belongs to the lower turtle edge point or the lower turtle back point, a 4 × 5 block is constructed by taking the point with the coordinate (p, p) as the upper left corner, 4 elements in the lower left corner of the block are subtracted, and the remaining 16 elements are used to store one hexadecimal number.
On the basis of the original tortoise-shell magic matrix, a new tortoise-shell magic matrix is constructed by adding numerical values of '8' to the element values of the tortoise back points, the range of the element values in the tortoise-shell magic matrix is expanded, the hidden quantity of hidden secret data of the new tortoise-shell magic matrix is increased, a novel reversible hiding algorithm is invented, the secret data are converted into hexadecimal numbers to be hidden in the new tortoise-shell magic matrix, and pairwise corresponding secret images are obtained; and in the stage of secret data extraction, a corresponding data extraction rule is formulated according to a novel reversible hiding algorithm to extract the secret data, and an original image is recovered. Compared with the traditional secret data hiding algorithm based on images, the secret data hiding method based on the image hiding algorithm has the advantage of ensuring the quality of the hidden images under the condition of higher hiding amount, so that the secret data can be hidden more safely.
Drawings
The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and together with the description serve to explain the principles of the invention. Other embodiments and many of the intended advantages of embodiments will be readily appreciated as they become better understood by reference to the following detailed description. Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is a flow chart of a method for reversible data hiding based on dual images according to an embodiment of the present invention;
figure 2 is a new tortoise shell magic matrix of one specific embodiment of the present invention;
figure 3 is a schematic diagram of a single turtle shell structure in a turtle shell magic matrix according to a specific embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating two secret information hiding manners based on 4 × 5 blocks according to an embodiment of the present invention;
FIG. 5 is a diagram of data embedding using a new tortoise shell magic matrix according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating the rule of movement of the conflict point according to one embodiment of the present invention;
FIG. 7 is a diagram illustrating possible value ranges of the difference d according to an embodiment of the present invention;
FIG. 8 is a block diagram of a two-image based reversible data hiding system according to an embodiment of the present invention;
FIG. 9 is a graph comparing maximum reserve values for various methods of an embodiment of the invention;
FIG. 10 is a graph showing a comparison of image quality values for different methods for maximum inventory in accordance with an embodiment of the invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows a flowchart of a reversible data hiding method based on two images according to an embodiment of the present invention. As shown in fig. 1, the method comprises the steps of:
s101: constructing a matrix with the horizontal and vertical coordinate range of [0, 255], enabling the difference between the values of adjacent elements in the same row in the matrix to be 1, sequentially increasing the values, enabling the values of two adjacent even columns of elements in the same column to be more than 2 than the values of odd columns of elements, enabling the values of odd columns of elements to be more than 3 than the values of even columns of elements, then carrying out modulo 8 operation on the element values in the matrix, enabling the element values to be between [0, 7], and finally covering the matrix with a plurality of connected and spliced hexagons to obtain the turtle shell magic matrix. The matrix is characterized in that the range of the horizontal and vertical coordinates is [0, 255], which corresponds to the value range of the pixel values of the gray level image; and sequentially adding 1 to two adjacent element values of the same row in the matrix from left to right, wherein the value of the even-numbered column of the two adjacent elements of the same column is 2 more than that of the odd-numbered column, the value of the odd-numbered column is 3 more than that of the even-numbered column, and finally, the element values in the matrix need to be subjected to modulo-8 operation to ensure that the element values are between [0 and 7 ].
In a specific embodiment, a point located at the edge of the hexagon in the tortoise shell magic matrix belongs to a tortoise-edge point, a point not located at the edge of the hexagon belongs to a tortoise-back point, an upper tortoise-back point is arranged in the tortoise-back point with a larger vertical coordinate, a lower tortoise-back point is arranged in the tortoise-back point with a smaller vertical coordinate, three points with a smallest vertical coordinate or a vertical coordinate equal to the upper tortoise-back point in the tortoise-back point are upper tortoise-edge points, and three points with a largest vertical coordinate or a vertical coordinate equal to the lower tortoise-back point in the tortoise-edge points are lower tortoise-edge points.
Fig. 3 shows a schematic diagram of a single tortoise shell structure in a magic matrix of a specific embodiment of the present invention, wherein points (311, 312, 314) are lower tortoise-side points, point (313) is a lower tortoise-back point, points (321, 322, 324) are upper tortoise-side points, and point (323) is an upper tortoise-back point.
According to the definition of the point in the tortoise-shell magic matrix shown in fig. 3, the element of the tortoise-shell magic matrix at the dorsum of the tortoise (313, 323) is added with a value of "8" to obtain a new tortoise-shell magic matrix as shown in fig. 2, wherein pi and pi +1 are the abscissa and ordinate of the new tortoise-shell magic matrix, respectively, and in this embodiment, the abscissa and ordinate are p1 and p 2.
S102: the secret information to be hidden is converted into a string of binary numbers, and every 4 binary numbers are converted into a hexadecimal number.
S103: taking a pixel p (p E [0, 255) from the original image]) Expanding the pixel p to one coordinate (p, p) if the pixel p isAnd isObtaining a hexadecimal number which is marked as v from the secret information, determining a hiding range according to the position difference of the point (p, p) in the new tortoise-shell magic matrix, finding a coordinate (p1, p2) which leads the coordinate to be corresponding to a value of v in the hiding range, and moving the point with conflict of the coordinate (p1, p2) according to a moving rule.
In a specific embodiment, the hiding range is determined according to the difference of the positions of the points (p, p) in the new tortoise-shell magic matrix, and the specific steps include: if the pixel p belongs to the upper turtle-side point (321, 322, 324) or the upper turtle-back point (323), a 4 × 5 block is constructed by taking the point with the coordinate (p, p) in the new turtle shell magic matrix as the lower right corner, 4 elements in the upper right corner in the block are deducted, and the rest 16 elements are used for hiding the hexadecimal number; if the pixel p belongs to the lower turtle edge point (311, 312, 314) or the lower turtle back point (313), a 4 × 5 block is constructed with (p, p) as the upper left corner, the 4 elements in the lower left corner of the block are subtracted, and the remaining 16 elements are used to hide the hexadecimal number.
According to the above method, a 4 × 5 block is arbitrarily drawn in the new tortoise-shell magic matrix shown in fig. 2 (as shown by the square box in fig. 2), then the elements therein must contain 0-15, and the 4 elements in the upper right corner and the lower left corner are repeated, as shown by the dotted circle in fig. 2. Thus, with 4 repeated elements subtracted, the remaining 16 element values must belong to [0, 15], and the 4 × 5 block plotted has two cases as in fig. 4:
fig. 4 shows two classified schemes of secret information hiding based on 4 × 5 blocks according to an embodiment of the present invention, one is a group of 4 upper right-hand elements (labeled t) and a group of the remaining 16 elements (labeled t1), as shown in fig. 401, if the pixel p belongs to the upper tortoise edge point (321, 322, 324) or the upper tortoise back point (323), the hexadecimal number is hidden by using the point in t 1. The other is a set of 4 elements in the lower left corner (labeled b) and 16 elements in the rest (labeled b1), and as shown in fig. 402, if the pixel p belongs to the lower turtle-edge point (311, 312, 314) or the lower turtle-back point (313), the hexadecimal number is hidden by the point in b 1.
Fig. 5 shows a schematic diagram of data embedding by using a new tortoise shell magic matrix according to a specific embodiment of the present invention, for example, if points (4, 4), (6, 6) and (8, 8) in fig. 5 belong to an upper tortoise side point or an upper tortoise back point, (p, p) is used as a lower right corner element to construct a 4 × 5 block, and 4 elements in the upper right corner of the block are subtracted, that is, 16 elements in t1 are used to embed a hexadecimal number; for example, points (3, 3), (5, 5) and (7, 7) in fig. 5 belong to the lower turtle-edge point or the lower turtle-back point, a 4 × 5 block is constructed with (p, p) as the upper left corner, and 4 elements in the lower left corner of the block are subtracted, i.e., 16 elements in b1 are used to embed a hexadecimal number.
In a specific embodiment, when different p bins the same number v, a position conflict problem may occur. For example, when positions (4, 4) and (6, 6) are both filled with the value v equal to 1, the elements of the two positions are both moved to (2, 6), which results in failure to correctly restore the original pixel. Therefore, a rule is set in the invention to move the points which can cause confusion.
Fig. 6 is a schematic diagram of a movement rule of a conflict point according to an embodiment of the present invention, where the movement rule specifically includes:
as shown in fig. 601, if the pixel p belongs to the upper tortoiseshell point (321, 322, 324) or the upper tortoise point (323), the element bf in the last column of the first row and the element bs in the last column of the second row in the hidden range are moved according to the following rule:
as shown in fig. 602, if the pixel p belongs to the lower turtle-edge point (311, 312, 314) or the lower turtle-back point (313), the element lf in the first column of the last row and the element ls in the first column of the second last row in the hidden range are moved according to the following rule:
in a specific embodiment, in step S3, if the pixel p ∈ [0, 2] or p ∈ [253, 255], let p1 ═ p2 ═ p, and the step S4 is directly performed.
S104: assigning p1 to the position corresponding to the pixel p in the original image, and traversing the original image
Performs step S3 on all the pixels in the secret information to obtain a first secret image, assigns p2 to a position in the original image corresponding to the pixel p, and performs step S3 on all the pixels in the original image and all the hexadecimal numbers in the secret information to obtain a second secret image.
In a specific embodiment, the method further includes a step of extracting the secret information in the image, and specifically includes:
a1: executing the step S1 to obtain the new tortoise shell magic matrix;
a2: sequentially taking out the p1 and the p2 from the same position of the first secret image and the second secret image, and defining a difference value d as p1-p2, wherein the possible value range of the difference value d is shown in fig. 7, the value range of d is known to be [ -8, 8], and if d > 0, it indicates that the original pixel p belongs to a lower turtle boundary point or a lower turtle back point; if d is less than 0, the original pixel p belongs to the upper turtle edge point or the upper turtle back point;
a3: secret information extraction is performed according to the following rules:
(1) if d is 0 and p1 and p2 belong to edge points, no secret information is hidden in corresponding points in the first secret image and the second secret image; if d is 0 and p1 and p2 do not belong to the edge point, the hidden hexadecimal secret information v is the value of the new turtle shell magic matrix midpoint (p1, p 2);
(2) if d < 0, the hidden hexadecimal secret information v is obtained according to the following rule:
(3) if d > 0, the hidden hexadecimal secret information v is obtained according to the following rule:
wherein M (p1, p2) represents the value of the new turtle shell magic matrix midpoint (p1, p 2).
In a specific embodiment, the method further includes a step of recovering the original picture, specifically included in the step a1-
After a3, the following original picture restoration algorithm is performed:
(1) if d is 0, the original pixel p is p 1;
(2) if d < 0, p can be obtained by:
(3) if d > 0, p can be obtained by:
and restoring the pixel p at the corresponding position in the original image, thereby restoring the original image.
FIG. 8 illustrates a block diagram of a two-image based reversible data hiding system, in accordance with an embodiment of the present invention. The system comprises a new tortoise-shell magic matrix construction module 801, a secret information preprocessing module 802, a secret information hiding module 803 and a secret image generation module 804.
In particular embodiments, the new tortoise-shell magic matrix construction module 801 is configured to construct a range of 0, 255 in abscissa and ordinate]The matrix of (1) is used for making the values of adjacent elements in the same row in the matrix differ by 1 and sequentially increase progressively, the value of even-numbered columns of two adjacent elements in the same column is more than 2 than that of odd-numbered columns, the value of odd-numbered columns is more than 3 than that of even-numbered columns, and then the element values in the matrix are subjected to modulo-8 operation to make the element values in [0, 7]]Finally, covering the matrix by using a plurality of continuous hexagons to obtain a turtle shell magic matrix, and adding a numerical value of 8 to elements positioned at turtle back points (313 and 323) in the turtle shell magic matrix to obtain a new turtle shell magic matrix; the secret information preprocessing module 802 is configured to convert secret information to be hidden into a string of binary numbers, and then convert every 4 binary numbers into a hexadecimal number; the secret information hiding module 803 is configured to take out one pixel p (p e [0, 255) from the original image]) Expanding the pixel p to one coordinate (p, p) if the pixel p is a coordinate (p, p)And isAcquiring a hexadecimal number which is marked as v from the secret information, determining a hiding range according to the position difference of the point (p, p) in the new tortoise-shell magic matrix, finding a coordinate (p1, p2) which enables the coordinate to correspond to a value of v in the hiding range, and moving the point with conflict of the coordinate (p1, p2) according to a moving rule; the secret image generation module 804 is configured to assign p1 to a position in the original image corresponding to the pixel p, run the secret information hiding module through all pixels in the original image and all hexadecimal numbers in the secret information to obtain a first secret image, assign p2 to a position in the original image corresponding to the pixel p, and run the secret information hiding module through all pixels in the original image and all hexadecimal numbers in the secret information to obtain a second secret image.
The method has the advantages that the element values of the turtle back points are added with the numerical value of 8 under the combined action of the modules, the range of the element values in the new turtle shell magic matrix is enlarged, the hidden quantity of the hidden secret data of the new turtle shell magic matrix is increased, a novel reversible hiding algorithm is executed, the hidden secret data can be well hidden and the original image can be recovered under the condition that the original image is slightly changed, and compared with the traditional secret data hiding algorithm based on the image, the method has the advantage that the quality of the hidden image is guaranteed under the condition that the hidden quantity is high.
In order to verify the reliability and beneficial effect of the invention, the inventor carries out a series of experiments, and the advantage of the algorithm of the invention compared with other traditional algorithms in the field is measured by using the hidden quantity (ER) and the image quality (PSNR) after secret data is hidden, and the larger the value of the two is, the better the algorithm is.
Wherein, the measurement unit of ER is bpp, that is, the bit number that a single pixel can be hidden, PSNR refers to the peak signal-to-noise ratio of the image, and the unit is dB, and is calculated by the following formula:
where H and W denote the width and height of the image, m and m1 denote the original image and the image hidden with secret data, and the subscript (i, j) denotes the position of the ith row and jth column.
In this embodiment, a method [1] for hiding reversible data of dual images based on a sudoku matrix, a method [2] for hiding reversible data of dual images based on an EMD matrix, a method [3] for hiding reversible data of dual images based on an original tortoise shell matrix, and a base are selected
The method is compared with the method of the invention by four methods [4] in a real-time double-image reversible data hiding method of a tortoise shell matrix.
Fig. 9 shows a comparison of maximum reserve values for different methods according to a specific embodiment of the invention, and it can be seen that, in addition to method [1], the method according to the invention achieves a higher reserve than the other methods.
Fig. 10 is a graph comparing image quality values of different methods in case of maximum reserve in an embodiment of the present invention, and fig. 10 is a comparison result of PSNR values of the present invention and other methods in case of maximum ER value. It can be seen that although method [1] achieves as high an ER value as the method of the present invention, the method of the present invention can maintain higher image quality, and compared to methods [2, 3, 4], the method of the present invention can achieve higher reserves than these methods although the method of the present invention has no advantage in PSNR.
Embodiments of the present invention also relate to a computer-readable storage medium having stored thereon a computer program which, when executed by a computer processor, implements the method above. The computer program comprises program code for performing the method illustrated in the flow chart. It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable medium or any combination of the two.
The invention provides a reversible data hiding method and a reversible data hiding system based on double images, which comprises the steps of obtaining a new tortoise shell magic matrix by adding numerical values of '8' to element values of tortoise back points on the basis of the original tortoise shell magic matrix, expanding the range of the element values in the matrix, increasing the hidden quantity of hidden secret data of the matrix, simultaneously inventing a novel reversible hiding algorithm, converting the secret data into hexadecimal numbers to be hidden in the new tortoise shell magic matrix, and obtaining pairwise corresponding secret images; and in the stage of secret data extraction, a corresponding data extraction rule is formulated according to a novel reversible hiding algorithm to extract the secret data, and an original image is recovered. Compared with the traditional data hiding algorithm based on images, the method has the advantage of simultaneously ensuring the quality of the hidden images under the condition of higher storage capacity, so that the secret data can be hidden more safely.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
Claims (7)
1. A reversible data hiding method based on double images is characterized by comprising the following steps:
s1: constructing a matrix with a horizontal and vertical coordinate range of [0, 255], enabling values of adjacent elements in the same row in the matrix to differ by 1 and sequentially increase progressively, enabling values of two adjacent even columns of elements in the same column to be more than 2 than those of odd columns and values of odd columns to be more than 3 than those of even columns, then performing modular 8 operation on the element values in the matrix to enable the element values to be between [0, 7], and finally covering the matrix with a plurality of connected and spliced hexagons to obtain a tortoise shell magic matrix, wherein points located at the edges of the hexagons in the matrix belong to tortoise edge points, points not located at the edges of the hexagons belong to tortoise back points, and adding a numerical value of 8 to each element located at the tortoise back points in the tortoise shell magic matrix to obtain a new tortoise shell magic matrix;
s2: converting the secret information to be hidden into a string of binary numbers, and converting every 4 binary numbers into a hexadecimal number;
s3: taking a pixel p (p E [0, 255) from the original image]) Expanding the pixel p into a coordinate point (p, p) if the pixel p is a coordinate point (p, p)And isAcquiring a hexadecimal number which is marked as v from the secret information, determining a hiding range according to the position difference of the coordinate point (p, p) in the new tortoise-shell magic matrix, finding a coordinate (p1, p2) which enables the coordinate corresponding to a value of v in the hiding range, and moving the point with conflict of the coordinate (p1, p2) according to a moving rule;
s4: assigning p1 to a position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information to execute step S3 to obtain a first secret image, assigning p2 to a position corresponding to the pixel p in the original image, traversing all pixels in the original image and all hexadecimal numbers in the secret information to execute step S3 to obtain a second secret image;
recording a point with a larger vertical coordinate in the turtle back points as an upper turtle back point, recording a point with a smaller vertical coordinate in the turtle back points as a lower turtle back point, recording three points with a minimum vertical coordinate or a vertical coordinate equal to the upper turtle back point in the turtle back points as upper turtle side points, recording three points with a maximum vertical coordinate or a vertical coordinate equal to the lower turtle back point in the turtle side points as lower turtle side points, if the pixel p belongs to the upper turtle side points or the upper turtle back points, constructing a 4 x 5 block by taking the point with the coordinate (p, p) in the new turtle shell magic matrix as the lower right corner, deducting the 4 elements of the upper right corner in the block, and using the remaining 16 elements to store a hexadecimal number; if the pixel p belongs to the lower turtle edge point or the lower turtle back point, a 4 × 5 block is constructed by taking the point with the coordinate (p, p) as the upper left corner, 4 elements in the lower left corner of the block are subtracted, and the remaining 16 elements are used to store one hexadecimal number.
2. The method according to claim 1, wherein the movement rules specifically include:
if the pixel p belongs to the upper turtle-edge point or the upper turtle-back point, moving the element bf of the last column of the first row and the element bs of the last column of the second row in the hidden range according to the following rule:
if the pixel p belongs to the lower turtle-edge point or the lower turtle-back point, the element lf of the first column of the last row and the element ls of the first column of the second last row in the hidden range are moved according to the following rule:
3. the method according to claim 1, wherein in step S3, if the pixel p e [0, 2] or p
E [253, 255], let p1 be p2 be p, and directly execute the step S4.
4. The method according to claim 1, further comprising the step of extracting the secret information in the image, in particular comprising:
a1: executing the step S1 to obtain the new tortoise shell magic matrix;
a2: sequentially taking out the p1 and the p2 from the same position of the first secret image and the second secret image, and defining a difference value d which is p1-p 2;
a3: secret information extraction is performed according to the following rules:
(1) if d is 0 and p1 and p2 belong to edge points, no secret information is hidden in the corresponding points in the first secret image and the second secret image; if d is 0 and p1 and p2 do not belong to the edge point, the hidden hexadecimal secret information v is the value of the new turtle shell magic matrix midpoint (p1, p 2);
(2) if d < 0, the hidden hexadecimal secret information v is obtained according to the following rule:
(3) if d > 0, the hidden hexadecimal secret information v is obtained according to the following rule:
wherein M (p1, p2) represents the value of the new turtle shell magic matrix midpoint (p1, p 2).
5. The method according to claim 4, further comprising a step of restoring the original picture, in particular comprising performing the following original picture restoration algorithm after said steps A1-A3:
(1) if d is 0, the original pixel p is p 1;
(2) if d < 0, p is obtained by:
(3) if d > 0, p is obtained by:
and restoring the pixel p at the corresponding position in the original image, thereby restoring the original image.
6. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a computer processor, carries out the method of any one of claims 1 to 5.
7. A bi-image based reversible data hiding system, comprising:
the new tortoise shell magic matrix construction module: configuring a matrix with a horizontal and vertical coordinate range of [0, 255], enabling values of adjacent elements in the same row in the matrix to differ by 1 and sequentially increase progressively, enabling values of two adjacent even columns of elements in the same column to be more than 2 than those of odd columns and values of odd columns to be more than 3 than those of even columns, then performing modular 8 operation on the element values in the matrix to enable the element values to be between [0, 7], and finally covering the matrix with a plurality of hexagons which are connected and spliced to obtain a tortoise-shell magic matrix, wherein points in the matrix at the edges of the hexagons belong to tortoise-edge points, points which are not at the edges of the hexagons belong to tortoise-back points, and adding a value of 8 to each element at the tortoise-back points in the tortoise-shell magic matrix to obtain a new tortoise-shell magic matrix;
secret information preprocessing module: the device is configured to convert secret information to be hidden into a string of binary numbers, and then convert every 4 binary numbers into a hexadecimal number;
secret information hiding module: configured to take a pixel p (p e 0, 255) from the original image]) The pixel p is expanded to a coordinate point (p,p) if said pixel isAnd isAcquiring a hexadecimal number which is marked as v from the secret information, determining a hiding range according to the position difference of the coordinate point (p, p) in the new tortoise-shell magic matrix, finding a coordinate (p1, p2) which enables the coordinate corresponding to a value of v in the hiding range, and moving the point with conflict of the coordinate (p1, p2) according to a moving rule;
a secret image generation module: the image processing method comprises the steps that p1 is assigned to a position corresponding to a pixel p in an original image, a secret information hiding module is operated by traversing all pixels in the original image and all hexadecimal numbers in secret information to obtain a first secret image, p2 is assigned to a position corresponding to the pixel p in the original image, and a secret information hiding module is operated by traversing all pixels in the original image and all hexadecimal numbers in the secret information to obtain a second secret image;
hidden range determination module: the image processing method comprises the steps that a point with a larger vertical coordinate in the turtle back points is configured and used for being recorded as an upper turtle back point, a point with a smaller vertical coordinate in the turtle back points is recorded as a lower turtle back point, three points with a smallest vertical coordinate or a vertical coordinate equal to the upper turtle back point in the turtle side points are recorded as upper turtle side points, three points with a largest vertical coordinate or a vertical coordinate equal to the lower turtle back point in the turtle side points are recorded as lower turtle side points, if a pixel p belongs to the upper turtle side points or the upper turtle back points, a point with a coordinate (p, p) in the new turtle shell magic matrix is used as a lower right corner to construct a 4 x 5 block, 4 elements in the upper right corner of the block are deducted, and the rest 16 elements are used for hiding a hexadecimal number; if the pixel p belongs to the lower turtle-side point or the lower turtle-back point, a 4 × 5 block is constructed by using the point with coordinates (p, p) as the upper left corner, 4 elements in the lower left corner of the block are subtracted, and the remaining 16 elements are used to embed a hexadecimal number.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011292406.3A CN112380551B (en) | 2020-11-18 | 2020-11-18 | Reversible data hiding method and system based on double images |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011292406.3A CN112380551B (en) | 2020-11-18 | 2020-11-18 | Reversible data hiding method and system based on double images |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112380551A CN112380551A (en) | 2021-02-19 |
CN112380551B true CN112380551B (en) | 2022-07-08 |
Family
ID=74584268
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011292406.3A Active CN112380551B (en) | 2020-11-18 | 2020-11-18 | Reversible data hiding method and system based on double images |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112380551B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107369186A (en) * | 2017-07-17 | 2017-11-21 | 西北工业大学 | A kind of information concealing method and device |
CN111161124A (en) * | 2019-12-30 | 2020-05-15 | 福建师范大学福清分校 | Image steganography method of reference matrix model based on mean square error evaluation |
-
2020
- 2020-11-18 CN CN202011292406.3A patent/CN112380551B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107369186A (en) * | 2017-07-17 | 2017-11-21 | 西北工业大学 | A kind of information concealing method and device |
CN111161124A (en) * | 2019-12-30 | 2020-05-15 | 福建师范大学福清分校 | Image steganography method of reference matrix model based on mean square error evaluation |
Non-Patent Citations (2)
Title |
---|
Data Hiding Based on a Two-Layer Turtle ShellMatrix;Xiao-Zhu Xie etc.;《symmetry》;20180213;1-14 * |
一种基于AES的图像篡改检测方案;张亦明 等;《物联网技术》;20160820(第8期);69-74 * |
Also Published As
Publication number | Publication date |
---|---|
CN112380551A (en) | 2021-02-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Qin et al. | Self-embedding fragile watermarking based on reference-data interleaving and adaptive selection of embedding mode | |
Yang et al. | A data hiding scheme using the varieties of pixel-value differencing in multimedia images | |
US8090146B2 (en) | Image watermarking | |
Hong et al. | An efficient reversible image authentication method using improved PVO and LSB substitution techniques | |
Zhang et al. | Self-embedding fragile watermarking based on DCT and fast fractal coding | |
CN105590297B (en) | Based on GF (27) significant (K, the N) image point of finite field and double authentication deposits reconstructing method | |
CN111898136A (en) | High-fidelity reversible information hiding method and device based on prediction error value sequencing | |
CN113344826B (en) | Image processing method, device, electronic equipment and storage medium | |
CN111353956B (en) | Image restoration method and device, computer equipment and storage medium | |
CN108805788B (en) | Reversible watermarking method based on image topological structure | |
Novozámský et al. | Detection of copy-move image modification using JPEG compression model | |
Hong et al. | A color image authentication scheme with grayscale invariance | |
Lin et al. | Pixel-based fragile image watermarking based on absolute moment block truncation coding | |
US20160275370A1 (en) | Methods and systems for determining a perceptual similarity between images | |
CN112380551B (en) | Reversible data hiding method and system based on double images | |
CN115802005B (en) | Security monitoring video storage method for residential building | |
CN108876691B (en) | Self-adaptive reversible watermarking method and system | |
Zhou et al. | An unsolvable pixel reduced authentication method for color images with grayscale invariance | |
JP2020003879A (en) | Information processing device, information processing method, watermark detection device, watermark detection method, and program | |
CN115527023A (en) | Image detection method, image detection device, electronic equipment and storage medium | |
Kunhu et al. | A novel reversible watermarking scheme based on sha3 for copyright protection and integrity of satellite imagery | |
Wu et al. | Image reversible visual transformation based on MSB replacement and histogram bin mapping | |
CN116824183B (en) | Image feature matching method and device based on multiple feature descriptors | |
Chroni et al. | Tamper Detection and Localization in Forensic Images | |
CN115002294B (en) | Secret image non-key extraction method and related equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |