CN109145610B - Picture hiding method and device, picture restoring method and device and terminal equipment - Google Patents

Picture hiding method and device, picture restoring method and device and terminal equipment Download PDF

Info

Publication number
CN109145610B
CN109145610B CN201710465432.3A CN201710465432A CN109145610B CN 109145610 B CN109145610 B CN 109145610B CN 201710465432 A CN201710465432 A CN 201710465432A CN 109145610 B CN109145610 B CN 109145610B
Authority
CN
China
Prior art keywords
picture
hidden
data
hiding
auxiliary
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
Application number
CN201710465432.3A
Other languages
Chinese (zh)
Other versions
CN109145610A (en
Inventor
康辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL High-Tech Development Co Ltd
Original Assignee
Shenzhen TCL High-Tech Development Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL High-Tech Development Co Ltd filed Critical Shenzhen TCL High-Tech Development Co Ltd
Priority to CN201710465432.3A priority Critical patent/CN109145610B/en
Publication of CN109145610A publication Critical patent/CN109145610A/en
Application granted granted Critical
Publication of CN109145610B publication Critical patent/CN109145610B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/606Protecting data by securing the transmission between two devices or processes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/106Enforcing content protection by specific content processing
    • G06F21/1066Hiding content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes

Abstract

The invention is suitable for the technical field of information security, and provides a picture hiding method and device, a picture restoring method and device and terminal equipment, wherein the method comprises the following steps: dividing the pixel points of the read privacy pictures into blocks with specified sizes; performing DCT on the blocks with the specified size; respectively extracting a preset number of data to be hidden from all DCT transformed blocks with specified sizes to obtain data columns of all the data to be hidden; calculating the size of the data column; calculating the hiding capacity of the read auxiliary picture according to a preset hiding strategy; comparing the size of the data column with the hiding capacity of the auxiliary picture to judge whether the hiding capacity of the auxiliary picture meets the hiding requirement; if yes, generating a bar code according to the width and the height of the auxiliary picture; replacing the to-be-hidden data of the data column with the same number of pixel values in the auxiliary picture to obtain a first hidden picture; and superposing the bar code on the first hidden picture to obtain a second hidden picture. The method can effectively realize the hiding of the picture.

Description

Picture hiding method and device, picture restoring method and device and terminal equipment
Technical Field
The invention belongs to the technical field of information security, and particularly relates to a picture hiding method and device, a picture restoring method and device and terminal equipment.
Background
With the development of network technologies and instant messaging tools (e.g., wechat, QQ, etc.), the instant messaging tools are capable of transmitting more and more information, such as text, file, picture, etc., but a large part of the transmitted pictures are related to personal privacy, such as bank card pictures, identification card pictures, etc. The user does not want to be seen by a third party in the network when transmitting the pictures, and even if the user is seen and copied by the third party, the user also wants that the privacy content included in the pictures cannot be seen by the third party, which requires that the pictures are specially processed before transmission so that others cannot see the content after interception.
In the prior art, 2 methods are generally adopted to process pictures before transmission: the 1 st type is that before transmission, pixel points of the picture are encrypted, and then the picture after the pixel points are encrypted is transmitted; the 2 nd type is to encrypt the picture in a file manner and then transmit the encrypted picture. When the processing method 1 is adopted, in the transmission process, a plurality of transmission tools perform secondary compression on the picture for the purpose of saving bandwidth or other purposes, and the encrypted picture cannot be decrypted after the secondary compression, or the quality of the decrypted picture is seriously reduced, so that it is difficult for a picture receiver to effectively obtain the privacy content included in the picture. When the processing method 2 is adopted, because the instant messaging tool cannot transmit files under certain conditions, such as iphone version WeChat, only media text contents such as videos and pictures can be transmitted, and the pictures can only be used as a file format instead of a picture format after being encrypted in a file manner, the encrypted pictures cannot be transmitted.
Therefore, a new method is needed to solve the above technical problems.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for hiding an image, a method and an apparatus for restoring an image, and a terminal device, so as to solve the problem in the prior art that it is difficult to effectively hide an image.
A first aspect of an embodiment of the present invention provides a method for hiding an image, including:
reading a privacy picture to be hidden;
dividing pixel points of the privacy picture into blocks with specified sizes;
performing Discrete Cosine Transform (DCT) on the blocks with the specified size;
respectively extracting a preset number of data to be hidden from all DCT-transformed blocks with specified sizes to obtain a data column consisting of all the data to be hidden;
calculating the size of the data column;
reading an auxiliary picture, and calculating the hiding capacity of the auxiliary picture according to a preset hiding strategy;
comparing the size of the data column with the hiding capacity of the auxiliary picture to judge whether the hiding capacity of the auxiliary picture meets the hiding requirement;
when the hiding capacity of the auxiliary picture is judged to meet the hiding requirement, generating a bar code according to the width and the height of the auxiliary picture;
replacing the same number of pixel values in the auxiliary picture by the data to be hidden of the data column according to a preset hiding strategy to obtain a first hidden picture;
and superposing the bar code on the first hidden picture to obtain a second hidden picture.
A second aspect of the embodiments of the present invention provides a picture extraction method, including:
reading a bar code of a second hidden picture, and acquiring the width and the height of the auxiliary picture from the bar code, wherein the second hidden picture is obtained by superposing the bar code on the first hidden picture;
scaling the first hidden picture according to the width and the height of the obtained auxiliary picture;
extracting a data column consisting of all data to be hidden from the zoomed first hidden picture according to a preset hiding strategy;
dividing all the data to be hidden into blocks with specified sizes, wherein each block with the specified size consists of a preset number of data to be hidden and filling values;
respectively carrying out inverse DCT (discrete cosine transform) conversion on the blocks with the specified sizes to obtain pixel points of the privacy pictures;
and restoring the privacy picture according to the pixel points of the privacy picture.
A third aspect of an embodiment of the present invention provides an image hiding device, including:
the privacy picture reading unit is used for reading a privacy picture to be hidden;
the pixel point segmentation unit is used for segmenting the pixel points of the privacy picture into blocks with specified sizes;
the pixel block processing unit is used for performing Discrete Cosine Transform (DCT) on the block with the specified size;
the device comprises a to-be-hidden data extraction unit, a data storage unit and a data processing unit, wherein the to-be-hidden data extraction unit is used for extracting a preset number of to-be-hidden data from all DCT transformed blocks with specified sizes respectively to obtain a data column consisting of all to-be-hidden data;
a data column size calculation unit for calculating the size of the data column;
the auxiliary picture reading unit is used for reading an auxiliary picture and calculating the hiding capacity of the auxiliary picture according to a preset hiding strategy;
a determination unit for determining whether the hiding requirement is satisfied, configured to compare the size of the data column with the hiding capacity of the auxiliary picture, so as to determine whether the hiding capacity of the auxiliary picture satisfies the hiding requirement;
the bar code generating unit is used for generating a bar code according to the width and the height of the auxiliary picture when the hiding capacity of the auxiliary picture is judged to meet the hiding requirement;
the first hidden picture generation unit is used for replacing the to-be-hidden data of the data column with the same number of pixel values in the auxiliary picture according to a preset hiding strategy to obtain a first hidden picture;
and the second hidden picture generating unit is used for superposing the bar code on the first hidden picture to obtain a second hidden picture.
A fourth aspect of the embodiments of the present invention provides an image extraction device, including:
the bar code reading unit is used for reading a bar code of a second hidden picture, and acquiring the width and the height of the auxiliary picture from the bar code, wherein the bar code of the second hidden picture is superposed on the first hidden picture to obtain the second hidden picture;
a first hidden picture scaling unit, configured to scale the first hidden picture according to the width and height of the acquired auxiliary picture;
the data column extraction unit is used for extracting a data column consisting of all the data to be hidden from the zoomed first hidden picture according to a preset hiding strategy;
a to-be-hidden data dividing unit, configured to divide all the to-be-hidden data into blocks of specified sizes, where each block of the specified size is composed of a preset number of to-be-hidden data and a padding value;
the pixel point obtaining unit is used for respectively carrying out inverse DCT (discrete cosine transform) conversion on the blocks with the specified sizes to obtain pixel points of the privacy pictures;
and the privacy picture restoration unit is used for restoring the privacy picture according to the pixel points of the privacy picture.
A fifth aspect of the embodiments of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of any one of the methods as the picture hiding method when executing the computer program.
A sixth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method as in any one of the picture hiding methods.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the data column of the data to be hidden is extracted from the privacy picture, the extracted data to be hidden is used for replacing the same number of pixel values in the auxiliary picture, and the bar code is generated according to the width and the height of the auxiliary picture to generate a second hidden picture, so that the privacy picture can be hidden in the auxiliary picture to realize the hiding of the privacy picture. And then the transmission of the privacy picture can be realized by transmitting the second hidden picture, the second hidden picture does not need to be encrypted, and the privacy picture also does not need to be encrypted in a file mode, so that the transmission of the privacy picture is greatly facilitated.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of a method for hiding an image according to an embodiment of the present invention;
fig. 2a is an exemplary diagram of a privacy picture provided by an embodiment of the present invention;
fig. 2b is an exemplary diagram of a picture obtained by extracting all data to be hidden from 8 × 8 blocks of a privacy picture after DCT transformation and then performing inverse DCT transformation reduction according to an embodiment of the present invention;
fig. 2c is an exemplary diagram of a picture obtained by extracting 15 data to be hidden from 8 × 8 blocks of a privacy picture after DCT transformation and then performing inverse DCT transformation reduction according to an embodiment of the present invention;
fig. 2d is an exemplary diagram of a picture obtained by extracting 10 data to be hidden from 8 × 8 blocks of a privacy picture after DCT transformation and then performing inverse DCT transformation reduction according to an embodiment of the present invention;
fig. 2e is an exemplary diagram of a picture obtained by extracting 6 data to be hidden from 8 × 8 blocks of a privacy picture after DCT transformation and then performing inverse DCT transformation reduction according to an embodiment of the present invention;
FIG. 3 is an exemplary diagram of a bar code generated from the width and height of an auxiliary picture provided by an embodiment of the present invention;
FIG. 4a is a diagram illustrating an auxiliary picture according to an embodiment of the present invention;
fig. 4b is an exemplary diagram of a second hidden picture according to an embodiment of the present invention;
fig. 5 is a flowchart of a method for extracting an image according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a picture hiding apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an image capturing apparatus according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Fig. 1 shows a flowchart of an image hiding method provided in an embodiment of the present invention, which is detailed as follows:
step S101, reading a privacy picture to be hidden.
Specifically, when the privacy picture is read, the width and the height of the privacy picture are acquired.
Step S102, dividing pixel points of the privacy picture into blocks with specified sizes.
Wherein, the block of the specified size may be a block of 8 × 8 size, and when the width and height of the privacy picture are not multiples of 8, the supplementary block is multiples of 8, since each pixel point is composed of three values of Red (Red, R), Green (Green, G) and Blue (Blue, B), each value is represented by one byte, i.e. an 8-bit binary number, and therefore, the supplementary pixel values are all filled with 0, i.e. black, in the 8-bit binary number.
Alternatively, when the privacy picture is not a picture in RGB format, it may be converted into RGB format and then processed.
Step S103, performing discrete cosine transform DCT on the block with the specified size.
The privacy image is subjected to Discrete Cosine Transform (DCT), after the privacy image is subjected to DCT, main energy (namely content information of the privacy image) is concentrated in a low-frequency part of a DCT coefficient of the privacy image, and high-frequency or even medium-frequency data can be abandoned under the condition that the identification of human eyes on the image quality is not influenced.
To reduce the complexity of the DCT transform, the private image is divided into matrices of a specified size (e.g., 8 x 8), and each matrix block is DCT transformed, and the transformed coefficient distribution can be represented as the following table 1:
table 1:
DC AC0 AC4 AC5 AC13 AC14 AC26 AC27
AC1 AC3 AC6 AC12 AC15 AC25 AC28 AC41
AC2 AC7 AC11 AC16 AC24 AC29 AC40 AC42
AC8 AC10 AC17 AC23 AC30 AC39 AC43 AC52
AC9 AC18 AC22 AC31 AC38 AC44 AC51 AC53
AC19 AC21 AC32 AC37 AC45 AC50 AC54 AC59
AC20 AC33 AC36 AC56 AC49 AC55 AC58 AC60
AC34 AC35 AC47 AC48 A56 A57 AC61 AC62
in table 1, the top left corner of the DCT coefficient is the DC coefficient, the energy is the largest, the image information is the most, and the low frequency, the intermediate frequency, and the high frequency data are sequentially from the top left corner to the bottom right corner, which means that the energy of the privacy image is mainly concentrated in the top left corner.
Step S104, extracting a preset number of data to be hidden from all DCT transformed blocks with specified sizes respectively to obtain a data column composed of all the data to be hidden.
In order to reduce the data amount of the data to be hidden as much as possible without affecting the readability of the private picture, only part of the data of the private picture is extracted from the blocks of the designated size after the DCT is changed to serve as the data to be hidden, and according to the analysis, the main energy of the private picture is concentrated in the low-frequency part of the DCT coefficient, so that the preset amount of data to be hidden is extracted from the low-frequency part of the DCT coefficient.
In step S104, a preset number of data to be hidden are sequentially extracted from each DCT-transformed block of a specified size, and all the extracted data to be hidden are sequentially arranged into a data column.
Optionally, since the low frequency part of the DCT coefficient is more, the amount of data to be hidden to be extracted may be determined by comprehensively considering the quality of the restored privacy picture and the readability of the restored privacy picture, where the step S104 includes:
a1, receiving the estimated quality requirement of the restored picture. Specifically, the sender of the privacy picture inputs the estimated quality requirement of the restored privacy picture according to the actual situation.
And A2, when the estimated quality requirement is greater than or equal to a first preset quality requirement, respectively extracting a first preset number of data to be hidden from all DCT-transformed blocks with specified sizes to obtain a data column consisting of all the data to be hidden. Wherein, when the block of the specified size is an 8 x 8 block, the first preset number may be the first 15 of the low frequency part of the DCT coefficients, i.e., DC, AC0, AC1 …, AC 13.
And A3, when the estimated quality requirement is less than the first preset quality requirement and is greater than or equal to a second preset quality requirement, respectively extracting a second preset number of data to be hidden from all DCT-transformed blocks with specified sizes to obtain a data column consisting of all the data to be hidden. Wherein, when the block of the specified size is an 8 x 8 block, the second preset number may be the first 10 of the low frequency part of the DCT coefficients, i.e., DC, AC0, AC1 …, AC 9.
And A4, when the estimated quality requirement is less than or equal to the second preset quality requirement and is greater than or equal to the third preset quality requirement, respectively extracting a third preset number of data to be hidden from all DCT-transformed blocks with specified sizes to obtain a data column consisting of all the data to be hidden. Wherein, when the block of the specified size is an 8 x 8 block, the third preset number may be the first 6 of the low frequency part of the DCT coefficients, i.e., DC, AC0, AC1 …, AC 4.
When the privacy picture is the picture shown in fig. 2a, fig. 2b, fig. 2c, fig. 2d, and fig. 2e respectively show pictures obtained by extracting all data to be hidden, 15 data to be hidden, 10 data to be hidden, and 6 data to be hidden from 8 × 8 blocks after DCT transformation of the privacy picture, and then restoring the data through DCT inverse transformation.
Step S105, calculating the size of the data column.
Specifically, the data volume size of a data column composed of all the extracted data to be hidden is calculated.
And step S106, reading the auxiliary picture, and calculating the hiding capacity of the auxiliary picture according to a preset hiding strategy.
For better concealment, the auxiliary picture to be read is usually a picture with a complex texture, so that when the pixel value of the auxiliary picture changes, the change is more difficult for human eyes to perceive.
Wherein, the step S106 specifically includes:
and B1, reading the auxiliary picture.
B2, when the preset hiding strategy is the first hiding strategy: for 3 matrixes formed by pixel values of red R, green G and blue B of each pixel point of the auxiliary picture, when only 1 data to be hidden is hidden in a block with a specified size of each matrix, the hiding capacity of the auxiliary picture is as follows: and T is W H3/designated size, wherein W is the width of the picture, and H is the height of the picture. When the block of the specified size is a block of 8 × 8, the above formula is specifically T ═ W × H3/8.
B3, when the preset hiding strategy is the second hiding strategy: for 3 matrixes formed by pixel values of red R, green G and blue B of each pixel point of the auxiliary picture, when only 2 data to be hidden are hidden in a block with a specified size of each matrix, the hiding capacity of the auxiliary picture is as follows: t' ═ W × H3/(2 × designated size), where W is the width of the picture and H is the height of the picture. When a block of the specified size is a block of 8 × 8, the above formula is specifically T' ═ W × H3/(2 × 8).
Step S107, comparing the size of the data column with the hiding capacity of the auxiliary picture to determine whether the hiding capacity of the auxiliary picture meets the hiding requirement.
Optionally, the step S107 includes:
c1, comparing the size of the data column with the hiding capacity of the auxiliary picture, and determining whether the hiding capacity of the auxiliary picture is larger than the sum of the size of the data column and a specified number of bytes, where the specified number of bytes is used to store the size of the data column, for example, selecting the hiding capacity of the specified number of bytes from the hiding capacity of the auxiliary picture used to hide the data to be hidden to hide the size of the data column. The specified number of bytes can be set to 4 bytes, and at this time, it needs to determine whether the hidden capacity of the auxiliary picture is greater than (the size of the data column + 4).
And C2, when the hiding capacity of the auxiliary picture is larger than the sum of the size of the data column and the specified byte number, judging that the hiding capacity of the auxiliary picture meets the hiding requirement, otherwise, judging that the hiding capacity of the auxiliary picture does not meet the hiding requirement. Optionally, when the hiding capacity of the auxiliary picture does not meet the hiding requirement, the read auxiliary picture cannot be taken as the auxiliary picture, and the user is advised to select a picture with larger capacity as the auxiliary picture.
And S108, when the hiding capacity of the auxiliary picture is judged to meet the hiding requirement, generating a bar code according to the width and the height of the auxiliary picture.
Since the picture hiding the privacy picture needs to be restored to the original size when the privacy picture is hidden (i.e. the auxiliary picture) when the privacy picture is restored, and the picture hiding the privacy picture is likely to be enlarged or reduced during transmission, the original size (width and height) of the auxiliary picture can be stored in the bar code for subsequent use when the bar code is enlarged or reduced by utilizing the characteristic that the content of the bar code can be correctly read.
Specifically, the bar code is generated according to the width and the height of the auxiliary picture, and the width and the height of the auxiliary picture are contained in the bar code. For example, the width and height of the auxiliary picture are: width: width 1920 and height 1080, the generated barcode may be: 1920 x 1080, as shown in detail in fig. 3.
Step S109, replacing the same number of pixel values in the auxiliary picture with the to-be-hidden data in the data column according to a preset hiding policy, to obtain a first hidden picture.
After each picture is decoded, each pixel point of the picture consists of three component values of the RBG, each component value is represented by one byte, namely an 8-bit binary number, and taking the R component value as an example, the binary number of one byte can be represented as:
R7、R6、R5、R4、R3、R2、R1、R0
any one of the bits R7 to R0 is a binary bit, and its value is 0 or 1, and assuming that R is 100, the corresponding binary is:
R7、R6、R5、R4、R3、R2、R1、R0
0 1 1 0 0 1 0 0
r101, corresponding to a binary:
R7、R6、R5、R4、R3、R2、R1、R0
0 1 1 0 0 1 0 1
in practical situations, the difference in color change corresponding to adjacent values is hardly noticeable to the human eye. For example, the human eye cannot perceive the change of the colors 100 and 101 when viewing, but as the numerical interval becomes larger, the human eye's ability to distinguish gradually increases, i.e., the upper bits of the 8-bit binary number cannot be selected to hide the data to be hidden.
Meanwhile, the pixel value of the image is slightly changed after the image is zoomed and secondarily compressed, and the change is not large, because the change generated by the zooming and the secondary compression of the image does not influence the watching of human eyes, namely, the low-order hidden data to be hidden in the 8-order binary number cannot be selected.
In summary, when the pixel value changes less, the lower bits of the pixel point, such as R0 and R1, may change, and the higher bits and the middle bits, such as R7 to R3, do not change, because the higher the change, the larger the difference between the pixel value and the original pixel value will be, and the viewing of the picture will be affected. In addition, since the auxiliary picture is only used as a carrier, the content of the auxiliary picture is not noticed, and therefore, the R3 th bit value and/or the R4 th bit value (i.e. the median value of the pixel values) of the pixel R can be changed, i.e. the R3 th bit value and/or the R4 th bit value are/is replaced by the binary value of the data to be hidden, so as to achieve the purpose of storing the data to be hidden in the auxiliary picture. When the value of R3 is changed, the corresponding value of R may be increased by 8 or decreased by 8, and the change of the value belonging to the adjacent value has a certain effect on the quality of the additional picture, but the effect is not very large.
The specific storage method comprises the following steps:
the data column formed by the extracted data to be hidden can be regarded as a binary sequence:
cx, (x ═ 0,1, … …, (N-1)). N is the length of the binary bits of data to be obscured (i.e., the size of the data column).
The data to be hidden as in Cx is:
0110101100010011, N is 16.
The purpose of hiding the privacy picture is achieved by replacing the R3 bit in the R component value with Cx.
For example:
before storing the data to be hidden: the value of pixel R is:
R7、R6、R5、R4、R3、R2、R1、R0
after storing Cx: the value of pixel R is:
R7、R6、R5、R4、Cx、R2、R1、R0
of course, Cx storage data may also be stored in R4 for greater auxiliary picture capacity and better resistance to the effects of secondary encoding and compression on pixel values during additional picture transmission.
Optionally, in order to further enhance security, the data to be hidden may be encrypted and then replaced with the same number of pixel values in the auxiliary picture.
Step S110, superimposing the barcode on the first hidden picture to obtain a second hidden picture.
Optionally, after the step S110, the method includes:
transmitting the second hidden picture.
Assuming that fig. 4a is an auxiliary picture and fig. 2a is a private picture, the second hidden picture obtained by the above method is shown in fig. 4 b.
In the embodiment of the invention, a privacy picture to be hidden is read, pixel points of the privacy picture are divided into blocks with specified size, DCT is carried out on the blocks with the specified size, a preset number of data to be hidden are respectively extracted from all the blocks with the specified size after DCT conversion, data columns of all the data to be hidden are obtained, the size of the data columns is calculated, an auxiliary picture is read, the hiding capacity of the auxiliary picture is calculated according to a preset hiding strategy, the size of the data columns is compared with the hiding capacity of the auxiliary picture to judge whether the hiding capacity of the auxiliary picture meets the hiding requirement or not, when the hiding capacity of the auxiliary picture is judged to meet the hiding requirement, barcodes are generated according to the width and height of the auxiliary picture, the data to be hidden of the data columns are replaced by the same number of pixel values in the auxiliary picture, and obtaining a first hidden picture, and superposing the bar code on the first hidden picture to obtain a second hidden picture. The data column of the data to be hidden is extracted from the privacy picture, the extracted data to be hidden is used for replacing the same number of pixel values in the auxiliary picture, and the bar code is generated according to the width and the height of the auxiliary picture to generate a second hidden picture, so that the privacy picture can be hidden in the auxiliary picture to realize the hiding of the privacy picture. And then the transmission of the privacy picture can be realized by transmitting the second hidden picture, the second hidden picture does not need to be encrypted, and the privacy picture also does not need to be encrypted in a file mode, so that the transmission of the privacy picture is greatly facilitated.
Corresponding to the image hiding method provided in the above embodiment, fig. 5 shows a flowchart of an image extracting method provided in the embodiment of the present invention, which is detailed as follows:
step 501, reading a bar code of a second hidden picture, and acquiring the width and the height of the auxiliary picture from the bar code, wherein the second hidden picture is obtained by superposing the bar code on the first hidden picture.
Step 502, scaling the first hidden picture according to the width and height of the obtained auxiliary picture.
Step 503, extracting a data column composed of all the data to be hidden from the zoomed first hidden picture according to a preset hiding strategy.
Step 504, dividing all the data to be hidden into blocks with specified size, wherein each block with specified size is composed of a preset number of data to be hidden and filling values.
And 505, performing inverse DCT (discrete cosine transform) on the blocks with the specified sizes respectively to obtain pixel points of the privacy pictures.
And 506, restoring the privacy picture according to the pixel points of the privacy picture.
When the size of the data column is hidden in the auxiliary picture, the private picture extracting process is as follows:
a. reading the bar code of the second hidden picture, and acquiring the width and the height of the auxiliary picture;
b. scaling the first hidden picture according to the width and the height;
c. acquiring a pixel value of a first hidden picture;
d. the size of the data column is extracted according to the obtained pixel values (e.g. if the data column size is hidden in the first 4 bytes of the pixel value of the first hidden picture when hiding the data column, the size of the data column is extracted in the first 4 bytes of the pixel value of the first hidden picture, e.g. when hiding the data to be hidden when adopting the first hiding strategy, one R3, i.e. one bit, 1 byte, 8 bits, 4 bytes in common: 8 x 3 ═ 32 bits, i.e. the first 32 pixels of the first hidden picture are read to obtain the sequence size, when extracting the picture).
e. Continuing to read the next pixel value R after the pixel value for which the size of the data column was extracted, R3 (and/or R4, depending on the concealment strategy in particular) in R is extracted.
f. And extracting all the data to be hidden according to the size of the data column.
g. All data to be hidden is divided into blocks of a specified size (e.g., 8 × 8 blocks), each block of the specified size consisting of a preset number of data to be hidden and padding values. That is, when the preset number of data to be concealed is smaller than the data amount of a block of a specified size, the insufficient portion is composed of a padding value, which is usually 0.
h. And performing inverse DCT (discrete cosine transform) on the block with the specified size to obtain pixel points of the privacy picture.
i. And restoring the privacy picture according to the pixel points of the privacy picture.
When the privacy pictures are extracted from the second hidden pictures, firstly reading the content of the bar code, acquiring the width and the height of the auxiliary pictures, and then scaling the first hidden picture in the received second hidden pictures to the size equal to the width and the height according to the width and the height. Decoding the first hidden picture, obtaining a pixel value of the first hidden picture, extracting data to be hidden of the first hidden picture in three components of RGB (red, green and blue) (for example, when extracting data to be hidden of R component, if the data to be hidden is hidden at R3 bit, extracting the data to be hidden from the R3 bit), sorting the data according to a block with a specified size (the size of the block divided by pixel points of the privacy picture is the same, for example, the block is 8 × 8), and performing inverse DCT (discrete cosine transformation) to obtain the pixel value of the privacy picture, thereby generating the privacy picture.
Fig. 6 is a schematic structural diagram of a picture hiding apparatus according to an embodiment of the present invention, and for convenience of description, only the parts related to the embodiment of the present invention are shown.
The picture hiding device 6 includes:
the privacy picture reading unit 601 is configured to read a privacy picture to be hidden.
A pixel point segmentation unit 602, configured to segment the pixel points of the privacy picture into blocks of a specified size.
Wherein, the block of the specified size may be a block of 8 × 8 size, and when the width and height of the privacy picture are not multiples of 8, the supplementary block is multiples of 8, since each pixel point is composed of three values of Red (Red, R), Green (Green, G) and Blue (Blue, B), each value is represented by one byte, i.e. an 8-bit binary number, and therefore, the supplementary pixel values are all filled with 0, i.e. black, in the 8-bit binary number.
A pixel block processing unit 603, configured to perform discrete cosine transform DCT on the block with the specified size.
The to-be-hidden data extracting unit 604 is configured to extract a preset number of to-be-hidden data from all DCT-transformed blocks of a specified size, respectively, to obtain a data column formed by all the to-be-hidden data.
Wherein the preset amount of data to be hidden is extracted from the low frequency part of the DCT coefficients.
Optionally, the to-be-hidden data extracting unit 604 includes:
and the estimated quality requirement receiving module is used for receiving the estimated quality requirement of the restored picture.
And the first preset number of data to be hidden extraction modules are used for extracting the first preset number of data to be hidden from all DCT-transformed blocks with the specified size respectively to obtain a data column consisting of all data to be hidden when the estimated quality requirement is greater than or equal to the first preset quality requirement.
And the second preset number of data to be hidden extraction modules are used for extracting a second preset number of data to be hidden from all DCT-transformed blocks with the specified size respectively to obtain a data column consisting of all data to be hidden when the estimated quality requirement is less than the first preset quality requirement and is greater than or equal to the second preset quality requirement.
And the third preset number of data to be hidden extraction modules are used for extracting the third preset number of data to be hidden from all the DCT-transformed blocks with the specified size respectively to obtain a data column consisting of all the data to be hidden when the estimated quality requirement is less than or equal to the second preset quality requirement and is greater than or equal to the third preset quality requirement.
A data column size calculation unit 605, configured to calculate the size of the data column.
An auxiliary picture reading unit 606, configured to read an auxiliary picture, and calculate a hiding capacity of the auxiliary picture according to a preset hiding policy.
For better concealment, the auxiliary picture to be read is usually a picture with a complex texture, so that when the pixel value of the auxiliary picture changes, the change is more difficult for human eyes to perceive.
Optionally, the auxiliary picture reading unit 606 includes:
and the auxiliary picture reading module is used for reading the auxiliary picture.
A first hidden capacity calculation module, configured to, when the preset hidden policy is a first hidden policy: for 3 matrixes formed by pixel values of red R, green G and blue B of each pixel point of the auxiliary picture, when only 1 data to be hidden is hidden in a block with a specified size of each matrix, the hiding capacity of the auxiliary picture is as follows: and T is W H3/designated size, wherein W is the width of the picture, and H is the height of the picture. When the block of the specified size is a block of 8 × 8, the above formula is specifically T ═ W × H3/8.
A second hidden capacity calculation module, configured to, when the preset hidden policy is a second hidden policy: for 3 matrixes formed by pixel values of red R, green G and blue B of each pixel point of the auxiliary picture, when only 2 data to be hidden are hidden in a block with a specified size of each matrix, the hiding capacity of the auxiliary picture is as follows: t' ═ W × H3/(2 × designated size), where W is the width of the picture and H is the height of the picture. When a block of the specified size is a block of 8 × 8, the above formula is specifically T' ═ W × H3/(2 × 8).
The whether the hiding requirement meets the determining unit 607 is configured to compare the size of the data column with the hiding capacity of the auxiliary picture to determine whether the hiding capacity of the auxiliary picture meets the hiding requirement.
Optionally, the determining unit 607 for determining whether the hiding requirement is met includes:
and comparing the size of the data column with the hiding capacity of the auxiliary picture, and judging whether the hiding capacity of the auxiliary picture is larger than the sum of the size of the data column and the specified byte number, wherein the specified byte number is used for storing the size of the data column. The specified number of bytes can be set to 4 bytes, and at this time, it needs to determine whether the hidden capacity of the auxiliary picture is greater than (the size of the data column + 4).
And when the hiding capacity of the auxiliary picture is larger than the sum of the size of the data column and the specified byte number, judging that the hiding capacity of the auxiliary picture meets the hiding requirement, otherwise, judging that the hiding capacity of the auxiliary picture does not meet the hiding requirement. Optionally, when the hiding capacity of the auxiliary picture does not meet the hiding requirement, the read auxiliary picture cannot be taken as the auxiliary picture, and the user is advised to select a picture with larger capacity as the auxiliary picture.
And a barcode generating unit 608, configured to generate a barcode according to the width and height of the auxiliary picture when it is determined that the hiding capacity of the auxiliary picture meets the hiding requirement.
The first hidden picture generating unit 609 is configured to replace, according to a preset hiding policy, the same number of pixel values in the auxiliary picture with the data to be hidden in the data column, so as to obtain a first hidden picture.
Specifically, taking R as an example, the R3 th bit value and/or the R4 th bit value (i.e. the median value of the pixel values) of the pixel R may be changed, i.e. the R3 th bit value and/or the R4 th bit value are replaced by the binary value of the data to be hidden, so as to achieve the purpose of storing the data to be hidden in the auxiliary picture. Of course, the processing of the G, B pixel values is the same as for R and will not be described here.
The second hidden picture generating unit 610 is configured to superimpose the barcode on the first hidden picture to obtain a second hidden picture.
Optionally, the picture hiding apparatus includes:
and the second hidden picture transmission unit is used for transmitting the second hidden picture.
In the embodiment of the invention, the data column of the data to be hidden is extracted from the privacy picture, the extracted data to be hidden is used for replacing the same number of pixel values in the auxiliary picture, and the bar code is generated according to the width and the height of the auxiliary picture to generate the second hidden picture, so that the privacy picture can be hidden in the auxiliary picture to realize the hiding of the privacy picture. And then the transmission of the privacy picture can be realized by transmitting the second hidden picture, the second hidden picture does not need to be encrypted, and the privacy picture also does not need to be encrypted in a file mode, so that the transmission of the privacy picture is greatly facilitated.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 7 is a schematic structural diagram of an image extraction device corresponding to the image extraction method, and only shows portions related to the embodiment of the present invention for convenience of description.
The picture extraction device 7 includes: the device comprises a bar code reading unit 701, a first hidden picture scaling unit 702, a data column extraction unit 703, a to-be-hidden data dividing unit 704, a pixel point acquisition unit 705 and a privacy picture restoration unit 706. Wherein:
the barcode reading unit 701 is configured to read a barcode of a second hidden picture, and obtain the width and height of the auxiliary picture from the barcode, where the barcode is superimposed on the first hidden picture to obtain the second hidden picture.
A first hidden picture scaling unit 702, configured to scale the first hidden picture according to the width and height of the obtained auxiliary picture.
A data column extracting unit 703, configured to extract a data column composed of all the data to be hidden from the scaled first hidden picture according to a preset hiding policy.
A to-be-hidden data dividing unit 704, configured to divide all the to-be-hidden data into blocks of specified sizes, where each block of specified size is composed of a preset number of to-be-hidden data and padding values.
A pixel point obtaining unit 705, configured to perform inverse DCT transformation on the blocks of the specified size, respectively, to obtain pixel points of the privacy picture.
The privacy picture restoration unit 706 is configured to restore the privacy picture according to the pixel point of the privacy picture.
Fig. 8 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 8, the terminal device 8 of this embodiment includes: a processor 80, a memory 81 and a computer program 82 stored in said memory 81 and executable on said processor 80. The processor 80 executes the computer program 82 to implement the steps in the above-mentioned embodiments of the picture hiding method, such as the steps S101 to S110 shown in fig. 1. Alternatively, the processor 80, when executing the computer program 82, implements the functions of each module/unit in each device embodiment described above, for example, the functions of the units 601 to 610 shown in fig. 6.
Illustratively, the computer program 82 may be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 82 in the terminal device 8. For example, the computer program 82 may be divided into a privacy picture reading unit, a pixel point dividing unit, a pixel block processing unit, a to-be-hidden data extracting unit, a data column size calculating unit, an auxiliary picture reading unit, a unit for determining whether the hidden requirement is met, a barcode generating unit, a first hidden picture generating unit, and a second hidden picture generating unit, where the specific functions of the units are as follows:
the privacy picture reading unit is used for reading a privacy picture to be hidden;
the pixel point segmentation unit is used for segmenting the pixel points of the privacy picture into blocks with specified sizes;
the pixel block processing unit is used for performing Discrete Cosine Transform (DCT) on the block with the specified size;
the device comprises a to-be-hidden data extraction unit, a data storage unit and a data processing unit, wherein the to-be-hidden data extraction unit is used for extracting a preset number of to-be-hidden data from all DCT transformed blocks with specified sizes respectively to obtain a data column consisting of all to-be-hidden data;
a data column size calculation unit for calculating the size of the data column;
the auxiliary picture reading unit is used for reading an auxiliary picture and calculating the hiding capacity of the auxiliary picture according to a preset hiding strategy;
a determination unit for determining whether the hiding requirement is satisfied, configured to compare the size of the data column with the hiding capacity of the auxiliary picture, so as to determine whether the hiding capacity of the auxiliary picture satisfies the hiding requirement;
the bar code generating unit is used for generating a bar code according to the width and the height of the auxiliary picture when the hiding capacity of the auxiliary picture is judged to meet the hiding requirement;
the first hidden picture generation unit is used for replacing the to-be-hidden data of the data column with the same number of pixel values in the auxiliary picture according to a preset hiding strategy to obtain a first hidden picture;
and the second hidden picture generating unit is used for superposing the bar code on the first hidden picture to obtain a second hidden picture.
The terminal device 8 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 80, a memory 81. Those skilled in the art will appreciate that fig. 8 is merely an example of a terminal device 8 and does not constitute a limitation of terminal device 8 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 80 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 81 may be an internal storage unit of the terminal device 8, such as a hard disk or a memory of the terminal device 8. The memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 8. Further, the memory 81 may also include both an internal storage unit and an external storage device of the terminal device 8. The memory 81 is used for storing the computer program and other programs and data required by the terminal device. The memory 81 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A picture hiding method is characterized by comprising the following steps:
reading a privacy picture to be hidden;
dividing pixel points of the privacy picture into blocks with specified sizes;
performing Discrete Cosine Transform (DCT) on the blocks with the specified size;
respectively extracting a preset number of data to be hidden from all DCT-transformed blocks with specified sizes to obtain a data column consisting of all the data to be hidden;
calculating the size of the data column;
reading an auxiliary picture, and calculating the hiding capacity of the auxiliary picture according to a preset hiding strategy;
comparing the size of the data column with the hiding capacity of the auxiliary picture to judge whether the hiding capacity of the auxiliary picture meets the hiding requirement;
when the hiding capacity of the auxiliary picture is judged to meet the hiding requirement, generating a bar code according to the width and the height of the auxiliary picture;
replacing the to-be-hidden data of the data column with the same number of pixel values in the auxiliary picture according to a preset hiding strategy to obtain a first hidden picture, wherein the preset hiding strategy is to replace the median of the same number of pixel values in the auxiliary picture with the binary value of the to-be-hidden data;
and superposing the bar code on the first hidden picture to obtain a second hidden picture.
2. The method for hiding the picture according to claim 1, wherein after the superimposing the barcode on the first hidden picture to obtain a second hidden picture, the method comprises:
transmitting the second hidden picture.
3. The method of claim 1, wherein the step of extracting a predetermined number of data to be hidden from all DCT-transformed blocks of a specified size to obtain a data sequence of all data to be hidden comprises:
receiving an estimated quality requirement for the restored picture;
when the estimated quality requirement is greater than or equal to a first preset quality requirement, respectively extracting a first preset number of data to be hidden from all DCT-transformed blocks with specified sizes to obtain a data column consisting of all the data to be hidden;
when the estimated quality requirement is smaller than a first preset quality requirement and is larger than or equal to a second preset quality requirement, respectively extracting a second preset number of data to be hidden from all DCT-transformed blocks with specified sizes to obtain a data column consisting of all data to be hidden;
and when the estimated quality requirement is less than or equal to a second preset quality requirement and is greater than or equal to a third preset quality requirement, respectively extracting a third preset number of data to be hidden from all DCT-transformed blocks with specified sizes to obtain a data column consisting of all the data to be hidden.
4. The method for hiding the picture according to claim 1, wherein the reading the auxiliary picture and calculating the hiding capacity of the auxiliary picture according to a preset hiding policy comprises:
reading the auxiliary picture;
when the preset hiding strategy is the first hiding strategy: for 3 matrixes formed by pixel values of red R, green G and blue B of each pixel point of the auxiliary picture, when only 1 data to be hidden is hidden in a block with a specified size of each matrix, the hiding capacity of the auxiliary picture is as follows: t ═ W × H × 3/designated size, where W is the width of the picture and H is the height of the picture;
when the preset hiding strategy is a second hiding strategy: for 3 matrixes formed by pixel values of red R, green G and blue B of each pixel point of the auxiliary picture, when only 2 data to be hidden are hidden in a block with a specified size of each matrix, the hiding capacity of the auxiliary picture is as follows: t' ═ W × H3/(2 × designated size), where W is the width of the picture and H is the height of the picture.
5. The method for hiding the pictures according to claim 1, wherein the comparing the size of the data column with the hiding capacity of the auxiliary picture to determine whether the hiding capacity of the auxiliary picture meets the hiding requirement comprises:
comparing the size of the data column with the hiding capacity of the auxiliary picture, and judging whether the hiding capacity of the auxiliary picture is larger than the sum of the size of the data column and the specified byte number, wherein the specified byte number is used for storing the size of the data column;
and when the hiding capacity of the auxiliary picture is larger than the sum of the size of the data column and the specified byte number, judging that the hiding capacity of the auxiliary picture meets the hiding requirement, otherwise, judging that the hiding capacity of the auxiliary picture does not meet the hiding requirement.
6. An image extraction method is characterized by comprising the following steps:
reading a bar code of a second hidden picture, and acquiring the width and the height of the auxiliary picture from the bar code, wherein the second hidden picture is obtained by superposing the bar code on the first hidden picture;
scaling the first hidden picture according to the width and the height of the obtained auxiliary picture;
extracting a data column consisting of all the data to be hidden from the zoomed first hidden picture according to a preset hiding strategy, wherein the preset hiding strategy is to replace the median of the same number of pixel values in the auxiliary picture with a binary value of the data to be hidden;
dividing all the data to be hidden into blocks with specified sizes, wherein each block with the specified size consists of a preset number of data to be hidden and filling values;
respectively carrying out inverse DCT (discrete cosine transform) conversion on the blocks with the specified sizes to obtain pixel points of the privacy pictures;
and restoring the privacy picture according to the pixel points of the privacy picture.
7. A picture concealment apparatus, comprising:
the privacy picture reading unit is used for reading a privacy picture to be hidden;
the pixel point segmentation unit is used for segmenting the pixel points of the privacy picture into blocks with specified sizes;
the pixel block processing unit is used for performing Discrete Cosine Transform (DCT) on the block with the specified size;
the device comprises a to-be-hidden data extraction unit, a data storage unit and a data processing unit, wherein the to-be-hidden data extraction unit is used for extracting a preset number of to-be-hidden data from all DCT transformed blocks with specified sizes respectively to obtain a data column consisting of all to-be-hidden data;
a data column size calculation unit for calculating the size of the data column;
the auxiliary picture reading unit is used for reading an auxiliary picture and calculating the hiding capacity of the auxiliary picture according to a preset hiding strategy, wherein the preset hiding strategy is to replace the median of the same number of pixel values in the auxiliary picture with the binary value of the data to be hidden;
a determination unit for determining whether the hiding requirement is satisfied, configured to compare the size of the data column with the hiding capacity of the auxiliary picture, so as to determine whether the hiding capacity of the auxiliary picture satisfies the hiding requirement;
the bar code generating unit is used for generating a bar code according to the width and the height of the auxiliary picture when the hiding capacity of the auxiliary picture is judged to meet the hiding requirement;
the first hidden picture generation unit is used for replacing the to-be-hidden data of the data column with the same number of pixel values in the auxiliary picture according to a preset hiding strategy to obtain a first hidden picture;
and the second hidden picture generating unit is used for superposing the bar code on the first hidden picture to obtain a second hidden picture.
8. An image extraction device, comprising:
the bar code reading unit is used for reading a bar code of a second hidden picture, and acquiring the width and the height of the auxiliary picture from the bar code, wherein the bar code of the second hidden picture is superposed on the first hidden picture to obtain the second hidden picture;
a first hidden picture scaling unit, configured to scale the first hidden picture according to the width and height of the acquired auxiliary picture;
a data column extraction unit, configured to extract a data column composed of all data to be hidden from the zoomed first hidden picture according to a preset hiding policy, where the preset hiding policy is to replace median values of the same number of pixel values in the auxiliary picture with binary values of the data to be hidden;
a to-be-hidden data dividing unit, configured to divide all the to-be-hidden data into blocks of specified sizes, where each block of the specified size is composed of a preset number of to-be-hidden data and a padding value;
the pixel point obtaining unit is used for respectively carrying out inverse DCT (discrete cosine transform) conversion on the blocks with the specified sizes to obtain pixel points of the privacy pictures;
and the privacy picture restoration unit is used for restoring the privacy picture according to the pixel points of the privacy picture.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN201710465432.3A 2017-06-19 2017-06-19 Picture hiding method and device, picture restoring method and device and terminal equipment Active CN109145610B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710465432.3A CN109145610B (en) 2017-06-19 2017-06-19 Picture hiding method and device, picture restoring method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710465432.3A CN109145610B (en) 2017-06-19 2017-06-19 Picture hiding method and device, picture restoring method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN109145610A CN109145610A (en) 2019-01-04
CN109145610B true CN109145610B (en) 2020-07-14

Family

ID=64804361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710465432.3A Active CN109145610B (en) 2017-06-19 2017-06-19 Picture hiding method and device, picture restoring method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN109145610B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382452B (en) * 2020-02-25 2021-12-14 南通大学 Encryption method for converting Chinese characters into pictures

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104063731A (en) * 2014-04-28 2014-09-24 长沙佐世网络科技有限公司 Two-dimension code anti-counterfeiting printing and verification method adopting digital watermark technology
CN105976304A (en) * 2016-05-30 2016-09-28 北京奇艺世纪科技有限公司 Image watermark embedding detecting method and image watermark embedding detecting device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030046435A (en) * 2001-07-10 2003-06-12 교와 가부시키가이샤 Electronic watermark embedding method and extraction method and apparatus for them

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104063731A (en) * 2014-04-28 2014-09-24 长沙佐世网络科技有限公司 Two-dimension code anti-counterfeiting printing and verification method adopting digital watermark technology
CN105976304A (en) * 2016-05-30 2016-09-28 北京奇艺世纪科技有限公司 Image watermark embedding detecting method and image watermark embedding detecting device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"DCT Domain Encryption in LSB Steganography";Rajib Biswas et. al.;《2013 5th International Conference on Computational Intelligence and Communication Networks》;20131111;405-408 *
"基于DCT 变换的彩色图像隐藏算法";周刚 等;《海军航空工程学院学报》;20110430;第26卷(第4期);437-440 *

Also Published As

Publication number Publication date
CN109145610A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
Chang et al. Reversible hiding in DCT-based compressed images
Molina-Garcia et al. An effective fragile watermarking scheme for color image tampering detection and self-recovery
Zhou et al. Image encryption using P-Fibonacci transform and decomposition
Hajduk et al. Image steganography with using QR code and cryptography
Hu et al. An improved VLC-based lossless data hiding scheme for JPEG images
CN106791882B (en) image coding and encrypting method and device
Houssein et al. An image steganography algorithm using haar discrete wavelet transform with advanced encryption system
CN115002293B (en) Privacy confidentiality method, system and storage medium based on thumbnail format reservation
CN110830808A (en) Video frame reconstruction method and device and terminal equipment
CN110913219A (en) Video frame prediction method and device and terminal equipment
Bai et al. A data hiding scheme based on the difference of image interpolation algorithms
Sultana et al. A modified filtering approach of LSB image steganography using stream builder along with AES encryption
CN111083478A (en) Video frame reconstruction method and device and terminal equipment
CN109145610B (en) Picture hiding method and device, picture restoring method and device and terminal equipment
CN110913230A (en) Video frame prediction method and device and terminal equipment
CN110634096A (en) Self-adaptive multi-mode information hiding method and device
Dhaka et al. A novel algorithm for image steganography based on effective channel selection technique
CN115314601B (en) Lossy format data steganography method and device
CN112017097A (en) Watermark adding method, device, terminal and computer readable storage medium
CN112929669B (en) Image encoding and decoding method and device
Liang et al. Invertible color-to-grayscale conversion using lossy compression and high-capacity data hiding
CN111083494A (en) Video coding method and device and terminal equipment
CN110944212A (en) Video frame reconstruction method and device and terminal equipment
Patra et al. Improved CRT-based DCT domain watermarking technique with robustness against JPEG compression for digital media authentication
CN111325652A (en) Information embedding method, information extracting method, information embedding device, information extracting device, information embedding equipment and computer readable storage medium

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