WO2020093769A1 - Method and device for embedding information in image - Google Patents

Method and device for embedding information in image Download PDF

Info

Publication number
WO2020093769A1
WO2020093769A1 PCT/CN2019/103578 CN2019103578W WO2020093769A1 WO 2020093769 A1 WO2020093769 A1 WO 2020093769A1 CN 2019103578 W CN2019103578 W CN 2019103578W WO 2020093769 A1 WO2020093769 A1 WO 2020093769A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
information
frequency domain
coefficient
data
Prior art date
Application number
PCT/CN2019/103578
Other languages
French (fr)
Chinese (zh)
Inventor
韩胜辉
Original Assignee
京东数字科技控股有限公司
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 京东数字科技控股有限公司 filed Critical 京东数字科技控股有限公司
Publication of WO2020093769A1 publication Critical patent/WO2020093769A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process

Definitions

  • the embodiments of the present application relate to the field of computer technology, specifically to the field of image processing technology, and in particular, to a method and device for embedding information in a picture.
  • the embodiment of the present application proposes a method and device for embedding information in a picture.
  • an embodiment of the present application provides a method for embedding information in a picture.
  • the method includes: using a first transformation matrix to convert a space domain data matrix of a screenshot into an original frequency domain coefficient matrix; The matrix is rounded, quantized, and rounded to obtain the intermediate frequency domain coefficient matrix, where the rounding and the rounding respectively retain the integer part of the source data, and remove the fractional part of the source data; embed the information to be embedded Go to the DC coefficient of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information; use the second transformation matrix to convert the frequency domain coefficient matrix of the embedded information into the spatial data matrix of the embedded information; based on the embedded The spatial data matrix of information generates pictures with embedded information.
  • the data in the spatial data matrix of the screenshot includes brightness data and color data.
  • embedding the information to be embedded into the DC coefficients of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information includes: in response to determining the DC coefficients, the remainder after modulo 2 and the information to be embedded The bits are not the same, the sign bit of the DC coefficient remains unchanged, and the value of the DC coefficient value bit is subtracted by 1 to obtain the frequency domain coefficient matrix of the embedded information.
  • embedding the information to be embedded into the DC coefficients of the intermediate frequency domain coefficient matrix to obtain the frequency information coefficient matrix of the embedded information includes: converting the DC coefficients into binary data expressed in the form of original codes; responding to It is determined that the lowest bit of the DC coefficient is not the same as the information bit to be embedded, the sign bit of the DC coefficient is kept unchanged, and the value of the value bit of the DC coefficient is subtracted by 1 to obtain the frequency domain coefficient matrix of the embedded information.
  • the first transform matrix is used to convert the spatial domain data matrix of the screenshot to the original frequency domain coefficient matrix, which includes: matrix segmentation of the spatial domain data matrix of the screenshot; the discrete Fourier transform matrix is used for each A matrix block is converted, and the spatial data matrix of the screenshot is converted into the original frequency domain coefficient matrix.
  • the first transformation matrix is used to convert the screenshot spatial domain data matrix to the original frequency domain coefficient matrix, which includes: performing matrix division of the screenshot spatial domain data matrix; using a discrete cosine transform matrix, for each matrix The block is converted, and the spatial data matrix of the screenshot is converted into the original frequency domain coefficient matrix.
  • the second transform matrix is used to convert the frequency domain coefficient matrix of the embedded information into the spatial data matrix of the embedded information, including: using a quantization table to inverse the frequency domain coefficient matrix of the embedded information
  • the inverse transform matrix of the discrete Fourier transform is used to convert the frequency domain coefficient matrix of the embedded information after inverse quantization into the spatial data matrix of the embedded information.
  • the second transform matrix is used to convert the frequency domain coefficient matrix of the embedded information into the spatial data matrix of the embedded information, including: using a quantization table to inverse the frequency domain coefficient matrix of the embedded information
  • Inverse discrete cosine transform matrix is used to convert the inversely quantized frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information.
  • performing matrix division on the captured spatial domain data matrix includes: performing 4 * 4 or 8 * 8 or 16 * 16 matrix division on the captured spatial domain data matrix.
  • an embodiment of the present application provides an apparatus for embedding information in a picture.
  • the apparatus includes: a coefficient matrix conversion unit configured to convert the spatial domain data matrix of the screenshot into an original frequency domain coefficient matrix; a coefficient matrix optimization unit , Configured to perform one rounding, quantization, and second rounding on the original frequency domain coefficient matrix to obtain an intermediate frequency domain coefficient matrix, where the first rounding and the second rounding respectively retain the integer part of the source data, and remove the source data The fractional part of; the matrix information embedding unit, configured to embed the information to be embedded into the DC coefficients of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information; the data matrix conversion unit, configured to embed the embedded information The frequency domain coefficient matrix of is converted into a spatial data matrix with embedded information; the information picture generating unit is configured to generate a picture with embedded information based on the spatial data matrix with embedded information.
  • the data in the spatial domain data matrix captured in the coefficient matrix conversion unit includes brightness data and color data.
  • the matrix information embedding unit is further configured to: in response to determining that the remainder after the DC coefficient is modulo 2 is not the same as the information bit to be embedded, leave the sign bit of the DC coefficient unchanged, The value of is subtracted by 1 to obtain the frequency domain coefficient matrix with embedded information.
  • the matrix information embedding unit includes: a data conversion module configured to convert the DC coefficient into binary data expressed in original code; an information embedding module configured to respond to the determination of the lowest bit of the DC coefficient and the pending The embedded information bits are not the same, the sign bit of the DC coefficient remains unchanged, and the value of the DC coefficient value bit is subtracted by 1 to obtain the frequency domain coefficient matrix of the embedded information.
  • the coefficient matrix conversion unit includes: a first matrix division module configured to perform matrix division on the screenshot spatial domain data matrix; a discrete Fourier transform module configured to use the discrete Fourier transform matrix, Transform each matrix block, and transform the spatial data matrix of the screenshot into the original frequency domain coefficient matrix.
  • the coefficient matrix conversion unit includes: a second matrix division module configured to perform matrix division on the spatial data matrix of the screenshot; a discrete cosine transformation module configured to use the discrete cosine transformation matrix for each matrix The block is converted, and the spatial data matrix of the screenshot is converted into the original frequency domain coefficient matrix.
  • the data matrix conversion unit includes: a first inverse quantization module configured to inversely quantize the frequency domain coefficient matrix of the embedded information using a quantization table; an inverse transform module of discrete Fourier transform, It is configured to use the inverse transform matrix of discrete Fourier transform to convert the inversely quantized frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information.
  • the first matrix segmentation module is further configured to: perform 4 * 4 or 8 * 8 or 16 * 16 matrix segmentation on the screenshot spatial domain data matrix.
  • the data matrix conversion unit includes: a second inverse quantization module configured to use a quantization table to inversely quantize the frequency domain coefficient matrix of the embedded information; an inverse discrete cosine transform module configured to use The inverse discrete cosine transform matrix converts the inversely quantized frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information.
  • the second matrix segmentation module is further configured to: perform a 4 * 4 or 8 * 8 or 16 * 16 matrix segmentation on the captured spatial domain data matrix.
  • an embodiment of the present application provides an electronic device including: one or more processors; a storage device on which one or more programs are stored; when one or more programs are Executed by one processor, so that one or more processors implement the method as described in any one of the implementation manners of the first aspect.
  • an embodiment of the present application provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, a method as described in any implementation manner of the first aspect is implemented.
  • the method and device for embedding information in a picture provided by the embodiments of the present application, by converting the picture from the spatial domain to the frequency domain, the frequency domain coefficients are rounded, quantized, and rounded once.
  • the second rounding separately retains the integer part of the source data, removes the decimal part of the source data, and then embeds the information to be embedded into the DC coefficient, and finally converts the picture from the frequency domain to the spatial domain to generate a picture with embedded information.
  • the above-mentioned first rounding and second rounding can avoid data overflow errors and effectively embed information into pictures.
  • signal processing processes such as lossy compression, low-pass filtering, sub-sampling, interpolation, etc.
  • the protection of the DC coefficient is better than that of the AC coefficient.
  • the protection is better to avoid the loss of embedded information during transmission.
  • the information embedded in the DC coefficient is more robust during signal processing.
  • FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present application can be applied;
  • FIG. 2 is a flowchart of an embodiment of a method for embedding information in a picture according to the present application
  • FIG. 3 is a schematic diagram of an application scenario of a method for embedding information in a picture according to the present application
  • FIG. 4 is a flowchart of another embodiment of a method for embedding information in a picture according to the present application.
  • FIG. 5 is a schematic structural diagram of an embodiment of an apparatus for embedding information in a picture according to the present application
  • FIG. 6 is a schematic structural diagram of a computer system suitable for implementing a terminal device according to an embodiment of the present application.
  • FIG. 1 shows an exemplary system architecture 100 of an embodiment of an embodiment of a method for embedding information in a picture and a device for embedding information in a picture of the present application.
  • the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105.
  • the network 104 is a medium used to provide a communication link between the terminal devices 101, 102, 103 and the server 105.
  • the network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, and so on.
  • the user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, and so on.
  • Various client applications may be installed on the terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, and social platform software.
  • the terminal devices 101, 102, and 103 may be hardware or software.
  • the terminal devices 101, 102, and 103 may be various electronic devices with display screens and screenshots, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, and desktop computers, etc. Wait.
  • the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example to provide distributed services), or as a single software or software module. There is no specific limit here.
  • the server 105 may be a server that provides various services, for example, a client server that supports clients running on the terminal devices 101, 102, and 103.
  • the client server can customize the information to be embedded, and feed back customization requirements (for example, requirements for customizing network status information) to the terminal device, and the terminal device provides the information to be embedded.
  • the client server may also provide the information to be embedded, and send the information to the terminal device (for example, the information to be embedded is copyright flag information set by the client server).
  • the method for embedding information in pictures provided by the embodiments of the present application is generally performed by terminal devices 101, 102, and 103, and accordingly, the device for embedding information in pictures is generally provided in terminal devices 101, 102, and 103. in.
  • terminal devices, networks, and servers in FIG. 1 are only schematic. According to the implementation needs, there can be any number of terminal devices, networks and servers.
  • the method of embedding information in the picture includes the following steps:
  • step 201 the first transformation matrix is used to convert the space domain data matrix of the screenshot to the original frequency domain coefficient matrix.
  • the execution subject of the method of embedding information in the picture may use the first transformation matrix to convert the spatial domain data matrix of the screenshot to the original frequency domain coefficient matrix.
  • the spatial domain also known as image space, is a space composed of image pixels.
  • length is used as an independent variable to directly process pixel data.
  • the spatial domain data matrix is a matrix obtained by storing pixel data of each pixel according to the correspondence between each pixel and the coordinate position.
  • the above pixel data may include, but is not limited to, pixel data in RGB format, YUV format, and pixel data in other formats now known or developed in the future.
  • the pixel data in the YUV format may include, but is not limited to, pixel data in the Y'UV format, YUV format, YCbCr format, YPbPr format, and pixel data in other formats that are now known or developed in the future.
  • the frequency domain is an area that describes the characteristics of an image with frequency as its independent variable. It can decompose the spatial change of pixel data of an image into a linear superposition of simple vibration functions with different amplitudes, frequencies and phases. Frequency, amplitude, and phase describe all the information in the sinusoidal image.
  • the amplitude of the image characterizes the difference between the brightest and darkest peaks in the image, and the phase characterizes the offset of the waveform relative to the original waveform.
  • the frequency is an indicator of the intensity of the grayscale change in the image. Gradient of grayscale in plane space. The higher the frequency, the faster the original signal changes, and the lower the frequency, the smoother the original signal.
  • some masking characteristics of the human perception system can be more easily integrated into the process of information embedding. Decomposing and processing the frequency coefficients of the image in the frequency domain can effectively embed the information to be embedded into the picture .
  • the spatial and frequency domains of the image can be converted to each other. You can use the already mature transform domain technology to convert the image from the spatial domain to the frequency domain.
  • the first transform matrix When the first transform matrix is used to convert the captured spatial domain data matrix to the original frequency domain coefficient matrix, existing and future developed transform domain technologies that convert the image from the spatial domain to the frequency domain can be used.
  • using the first transformation matrix to convert the spatial domain data matrix of the screenshot to the original frequency domain coefficient matrix may include: performing matrix division of the spatial domain data matrix of the screenshot; using a discrete Fourier transform matrix, Convert the image from image space to frequency domain space, that is, transform the spatial data matrix of the screenshot into the original frequency domain coefficient matrix.
  • the above-mentioned transformation using discrete Fourier transform matrix can eliminate the spatial redundancy of the image and reduce the amount of calculation.
  • using the first transformation matrix to convert the spatial domain data matrix of the screenshot to the original frequency domain coefficient matrix may include: matrix partitioning the spatial domain data matrix of the screenshot; using a discrete cosine transform matrix, the The image is converted from image space to frequency domain space, that is, the spatial data matrix of the screenshot is converted into the original frequency domain coefficient matrix.
  • the amount of calculation is reduced by half, which improves the operation efficiency, and has a good decorrelation performance, which can effectively eliminate the image space Redundancy helps to further entropy encode the image.
  • the correlation means that since the changes between the pixels of the image are smoothly changed, each pixel and the adjacent pixels are related, which is not conducive to entropy encoding the image.
  • a 4 * 4 matrix division method may be used to perform matrix division on the spatial data matrix of the screenshot.
  • the use of the 4 * 4 matrix division method described above can reduce the complexity of the algorithm for converting the spatial domain and the frequency domain of the image, and improve the efficiency of the transform domain calculation.
  • an 8 * 8 matrix division method may be used to perform matrix division on the spatial data matrix of the screenshot.
  • the above 8 * 8 matrix division method can reduce the complexity of the algorithm of the spatial and frequency domain conversion of the image, improve the efficiency of the transform domain operation and reduce the image blocking effect, and ensure the continuity of the boundary of the block in the reconstructed image.
  • the above-mentioned image blocking effect means that the image has discontinuous defects at the boundary of the block.
  • a 16 * 16 matrix division method may be used to perform matrix division on the spatial data matrix of the screenshot.
  • the above 16 * 16 matrix segmentation method can significantly reduce the image blocking effect, ensure the continuity of the block boundaries in the reconstructed image, and improve the image fidelity.
  • Step 202 Perform primary rounding, quantization, and secondary rounding on the original frequency domain coefficient matrix to obtain an intermediate frequency domain coefficient matrix, where the primary rounding and secondary rounding respectively retain the integer part of the source data, and remove the source data. decimal part.
  • the above-mentioned execution subject may round the original frequency domain coefficient matrix once, where the rounding reserves the source once
  • the integer part of the data excluding the decimal part of the source data.
  • the source data rounded at one time is 75.9, then after one rounding, the data becomes 75. Ensure that the image pixel data does not exceed the critical value during the conversion of the spatial domain and the frequency domain to avoid the loss of embedded data.
  • Quantization is the operation of reducing the bit rate through the mapping relationship, that is, dividing the data in the original frequency domain coefficient matrix by the quantization coefficient at the corresponding position in the quantization table.
  • the quantization process is actually an optimization process for the frequency domain coefficients. It takes advantage of the insensitivity of the human eye to high-frequency components to achieve a substantial simplification of data.
  • quantization tables for example, the standard 8 * 8 quantization table used in the JPEG compression encoder shown in Table 1:
  • the original frequency domain coefficient matrix after rounding and quantization is rounded twice to obtain an intermediate frequency domain coefficient matrix, in which the rounding preserves the integer part of the source data and removes the fractional part of the source data.
  • the source data of the second rounding is 65.7, then after the second rounding, the data becomes 65.
  • the above rounding operation can ensure that the image pixel data does not exceed the critical value during the conversion of the spatial domain and the frequency domain, and avoid the loss of embedded data.
  • the above-mentioned first rounding and second rounding can avoid data overflow errors and ensure that the embedded information is more robust.
  • the source data is RGB format data, and its value is 255.
  • the integer part of the source data is retained, and the fractional part of the source data is removed.
  • Rounding operation instead of rounding, can avoid data overflow error when the image pixel data corresponding to the frequency coefficient exceeds the threshold range (that is, the RGB value exceeds 255) when the image is converted from the frequency domain to the spatial domain To effectively embed information into pictures.
  • Step 203 Embed the information to be embedded into the DC coefficient of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information.
  • the execution body of the method of embedding information in the picture may store the information to be embedded in advance, for example, the above-mentioned information to be embedded may be information such as model information, CPU information, etc. of the execution body.
  • the information to be embedded may also be information generated by the execution subject according to a preset rule, for example, the information may be information such as network status information and memory information of the execution subject when taking a screenshot.
  • the above-mentioned information to be embedded may also be information input by the user, such as user name information, password information, and the like.
  • the information to be embedded can be converted into binary data in order to embed the information in the picture more covertly.
  • the value of the DC coefficient is usually tens of times larger than the AC coefficient, or even hundreds of times. Therefore, embedding information into the DC coefficient has better invisibility. Because images embedded with information are easily shared by the client application in the process of signal processing such as lossy compression, low-pass filtering, sub-sampling, interpolation, etc. In these processes, the protection of the DC coefficient is compared to the AC coefficient The protection is better, therefore, the information embedded in the DC coefficient is more robust in the signal processing process.
  • the above embedding process may be a process of modifying the DC coefficient to embed the information to be embedded, that is, a process of replacing the value of the corresponding value bit of the DC coefficient with the information to be embedded.
  • the value of the least significant bit of the DC coefficient is replaced with the information to be embedded.
  • the least significant bit refers to the 0th bit (that is, the least significant bit) in a binary number.
  • the value of the random bit of the DC coefficient is replaced with the information to be embedded.
  • the second transform matrix is used to convert the frequency domain coefficient matrix of the embedded information into the spatial data matrix of the embedded information.
  • the above-mentioned execution subject first performs inverse quantization processing on the frequency domain coefficient matrix; then, performs transform domain processing on the image to convert the image from the frequency domain to the spatial domain.
  • the above step 204 is a step corresponding to the above step 202.
  • the corresponding relationship between the reverse quantization and the quantization uses the same quantization table, and the bit rate is increased through the mapping relationship, that is, the data in the original frequency domain coefficient matrix is multiplied by the quantization coefficient at the corresponding position in the quantization table.
  • the existing and future developed transform domain technology to convert the image from the frequency domain to the spatial domain can be used to fulfill.
  • using a second transformation matrix to convert the frequency-domain coefficient matrix of the embedded information into the spatial-domain data matrix of the embedded information may include: using the inverse transform matrix of the discrete Fourier transform to convert The frequency domain coefficient matrix of the embedded information is converted into the spatial domain data matrix of the embedded information.
  • the above-mentioned inverse transform matrix using discrete Fourier transform corresponds to the discrete Fourier transform matrix used in step 202 above.
  • the image is basically losslessly converted from the frequency domain to the spatial domain, which can improve the fidelity of the image and improve embedding. Concealment of information.
  • using a second transformation matrix to convert the frequency-domain coefficient matrix of the embedded information into the spatial-domain data matrix of the embedded information may include: using an inverse discrete cosine transform matrix to convert the frequency of the embedded information
  • the domain coefficient matrix is converted into a spatial data matrix with embedded information.
  • the inverse discrete cosine transform matrix used above corresponds to the discrete cosine transform matrix used in step 202 above.
  • the transformation using the inverse discrete cosine transform matrix uses a semi-periodic basis function, while the inverse discrete Fourier transform uses Is the basis function of the entire period. Since most pixel changes in the image are gradual, the use of the inverse discrete cosine transform matrix can better express the image, further improving the image fidelity and the concealment of embedded information.
  • Step 205 Based on the spatial data matrix of the embedded information, generate a picture of the embedded information.
  • the spatial data matrix with embedded information is a matrix obtained by storing pixel data of each pixel according to the correspondence between each pixel and the coordinate position. Based on the correspondence between the image pixel data and the image, a picture with embedded information is generated.
  • FIG. 3 is a schematic diagram of an application scenario of the method for embedding information in a picture according to this embodiment.
  • the user opens the login interface of an app program on the mobile phone, and there are three options of "mobile phone registration”, “WeChat login” and “QQ login”. The user clicks "WeChat login”, and the app pops up the message "I know the network error”.
  • the electronic device converts the screenshot from the spatial domain to the frequency domain, performs rounding, quantization, and rounding operations on the frequency domain coefficient matrix, and inserts the information to be embedded 302 "Huawei P9, CPU1.26G available / 3G , The network speed is 1.7M / s, and the memory 64G is embedded in the DC coefficient of the frequency domain coefficient matrix. Finally, the image is converted from the frequency domain to the spatial domain, and a picture 301 with embedded information is generated.
  • the picture 301 contains the relevant information 302 of the mobile phone at the time of the screenshot.
  • the user sends the screenshot to the relevant technician.
  • the technician can obtain the information 302 of the user ’s mobile phone at the time of the screenshot.
  • “Huawei P9, CPU1 .26G available / 3G, network speed 1.7M / s, memory 64G” The technician can easily determine that the user's network status is good, which can help the technician accurately locate the app problem.
  • the method provided by the above embodiment of the present application performs the rounding operation of retaining the integer part of the source data, removing the fractional part of the source data, and embedding the information to be embedded into the DC coefficients of the frequency domain coefficient matrix on the frequency domain coefficient matrix of the image , To achieve the effectiveness and stability of embedding information in the picture.
  • FIG. 4 shows a flow 400 of yet another embodiment of a method of embedding information in a picture.
  • the process 400 of the method for embedding information in a picture includes the following steps:
  • step 401 the first transformation matrix is used to convert the spatial data matrix of the screenshot into the original frequency domain coefficient matrix.
  • step 402 the original frequency domain coefficient matrix is rounded once, wherein the rounding preserves the integer part of the source data and removes the fractional part of the source data.
  • Step 403 the quantization table is used to quantize the original frequency domain coefficient matrix after rounding.
  • step 404 the quantized original frequency domain coefficient matrix is rounded twice, wherein the rounded part retains the integer part of the source data and removes the fractional part of the source data.
  • step 401 is the same as step 201 in the previous embodiment.
  • step 201 also applies to step 401.
  • steps 402, 403, and 404 are the same as step 202 in the previous embodiment.
  • step 202 in this article is also applicable to steps 402, 403, and 404, and is not repeated here.
  • Step 405 Embed the information to be embedded into the DC coefficient of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information.
  • embedding the information to be embedded into the DC coefficients of the intermediate frequency domain coefficient matrix may be a process of rewriting the DC coefficients according to certain rules, and may be implemented using existing and future information embedding technologies.
  • the information can be embedded according to the following steps:
  • the first step it is determined whether the remainder after the DC coefficient is modulo 2 is the same as the information bit to be embedded. For example, the DC coefficient is 32, and the information bit to be embedded is 0, then the remainder after 32-to-2 modulo is 0, which is the same as the information bit 0 to be embedded. For example, the DC coefficient is -31 and the remainder after modulo 2 is 1, and the information bit to be embedded is 0, the two are different.
  • the second step if the two are the same, do not reprogram the DC coefficient. For example, if the DC coefficient is 32 and the information bit to be embedded is 0, the remainder after 32-to-2 modulo is 0, which is the same as the information bit 0 to be embedded, and the information 0 is embedded into the DC coefficient without rewriting the DC coefficient .
  • the DC coefficient is rewritten.
  • the writing rule is to keep the sign bit of the DC coefficient unchanged, and subtract 1 from the value of the value of the DC coefficient.
  • the DC coefficient is -31
  • the information bit to be embedded is 0, the DC coefficient is -31 and the remainder after modulo 2 is 1, the information bit to be embedded is 0, the two are different, and the DC coefficient is rewritten.
  • the newly generated DC coefficient is -30.
  • the above process completes the process of embedding information 0 into the DC coefficient -31.
  • the sign bit of the above reserved DC coefficient remains unchanged, and the value of the value of the DC coefficient is subtracted by 1 to ensure that when the DC coefficient is converted to the spatial domain, the obtained image pixel data is within the threshold range to avoid data overflow errors and ensure Stability of embedded information.
  • information embedding may be performed according to the following steps:
  • the DC coefficient is converted into binary data expressed in the original code, and it is determined whether the lowest bit of the DC coefficient is the same as the information bit to be embedded, where the lowest bit refers to the 0th bit of the binary data.
  • the second step if the same, do not reprogram the DC coefficient.
  • the DC coefficient is re-programmed.
  • the writing rule is to keep the sign bit of the DC coefficient unchanged, and subtract 1 from the value of the DC coefficient.
  • the DC coefficient is -8, and the information bit to be embedded is 1, then -8 is converted to binary data 10001000 expressed in the original code. The lowest bit of the binary data is 0, which is different from the information bit 1 to be embedded.
  • DC coefficient Retain the sign bit of 10001000: 1, subtract 1 from the value of 10001000: 10001000, the value bit becomes: 0000111, the new DC coefficient generated is 10000111, that is, the DC coefficient changes from -8 to-after embedding information 1. 7.
  • the sign bit of the above reserved DC coefficient remains unchanged, and the value of the value of the DC coefficient is subtracted by 1 to ensure that when the DC coefficient is converted to the spatial domain, the obtained image pixel data is within the threshold range to avoid data overflow errors and ensure Stability of embedded information.
  • Step 406 Using the second transformation matrix, convert the frequency-domain coefficient matrix of the embedded information into the spatial-domain data matrix of the embedded information.
  • the above-mentioned execution subject first performs inverse vectorization processing on the frequency domain coefficient matrix; then, performs transform domain processing on the image to convert the image from the frequency domain to the spatial domain.
  • the above step 406 is a step corresponding to the above steps 401 and 403.
  • the existing and future developed transform domain technology to convert the image from the frequency domain to the spatial domain can be used to fulfill.
  • the inverse transform matrix of the discrete Fourier transform can be used, or the inverse discrete cosine transform matrix can also be used to transform the image from the frequency domain to the spatial domain.
  • Step 407 Based on the spatial data matrix of the embedded information, generate a picture of the embedded information.
  • the spatial data matrix with embedded information is a matrix obtained by storing pixel data of each pixel according to the correspondence between each pixel and the coordinate position. Based on the correspondence between the image pixel data and the image, a picture with embedded information is generated.
  • the process 400 of the method for embedding information in a picture in this embodiment refines the DC coefficient of embedding the information to be embedded into the coefficient matrix of the intermediate frequency domain In the step of obtaining the frequency domain coefficient matrix with embedded information.
  • the solution described in this embodiment can ensure that the information embedded in the picture is not lost, thereby enriching the data dimension of the picture, and ensuring the validity and stability of the embedded information.
  • the present application provides an embodiment of a device for embedding information in a picture, which corresponds to the method embodiment shown in FIG. 2,
  • the device can be specifically applied to various electronic devices.
  • the apparatus 500 for embedding information in a picture of this embodiment includes: a coefficient matrix conversion unit 501, a coefficient matrix optimization unit 502, a matrix information embedding unit 503, a data matrix conversion unit 504, and an information picture generating unit 505.
  • the coefficient matrix conversion unit 501 is configured to convert the screenshot spatial domain data matrix to the original frequency domain coefficient matrix; the coefficient matrix optimization unit 502 is configured to perform primary rounding, quantization, and secondary rounding on the original frequency domain coefficient matrix To obtain an intermediate frequency domain coefficient matrix, where the first rounding and the second rounding respectively retain the integer part of the source data and remove the fractional part of the source data; the matrix information embedding unit 503 is configured to embed the information to be embedded into the intermediate frequency domain Among the DC coefficients of the coefficient matrix, the frequency domain coefficient matrix of the embedded information is obtained; the data matrix conversion unit 504 is configured to convert the frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information; and the information picture generating unit 505 is configured to generate a picture of the embedded information based on the spatial data matrix of the embedded information.
  • the coefficient matrix conversion unit 501 of the device 500 for embedding information in the picture can convert the picture from the spatial domain to the frequency domain to obtain the original frequency domain coefficient matrix.
  • some masking characteristics of the human perception system can be more easily integrated into the process of information embedding. Decomposing and processing the frequency coefficients of the image in the frequency domain can effectively embed the information to be embedded into the picture .
  • the coefficient matrix optimization unit 502 can perform rounding, quantization, and second rounding on the original frequency domain coefficient matrix to obtain an intermediate frequency domain coefficient matrix, where the first rounding and the second rounding respectively retain the source
  • the integer part of the data excluding the decimal part of the source data.
  • the quantization process is actually an optimization process for frequency coefficients. It takes advantage of the insensitivity of the human eye to high-frequency parts to achieve a substantial simplification of data and improve computational efficiency.
  • the device 500 to embed information in the picture may store the information to be embedded in advance, and the information to be embedded may be some logo information, such as copyright declaration information, etc.
  • the information to be embedded may also be the device 500 to embed
  • the information generated by the set rule for example, the information to be embedded may be information reflecting the operating state of the device on which the device 500 is installed when the screenshot is taken, so as to record the operating state of the device.
  • the matrix information embedding unit 503 embeds the information to be embedded into the DC coefficient.
  • the above embedding process may be a process of modifying the DC coefficient to embed the information to be embedded, that is, replacing the corresponding value bits of the DC coefficient with the information to be embedded Numerical process. Make the information to be embedded hidden and stable embedded in the source picture data.
  • the above-mentioned data matrix conversion unit 504 may convert the picture from the frequency domain to the spatial domain.
  • the information picture generating unit 505 may generate a picture with embedded information according to the image pixel data in the spatial domain data matrix of the embedded information.
  • the units recorded in the device 500 may correspond to the various steps in the method described with reference to FIGS. 2 to 4. Therefore, the operations and features described above for the method are also applicable to the device 500 and the units contained therein, which will not be repeated here.
  • FIG. 6 shows a schematic structural diagram of a computer system 600 suitable for implementing the terminal device of the embodiment of the present application.
  • the terminal device shown in FIG. 6 is only an example, and should not bring any limitation to the functions and usage scope of the embodiments of the present application.
  • the computer system 600 includes a central processing unit (CPU) 601 that can be loaded into a random access memory (RAM) 603 from a program stored in a read-only memory (ROM) 602 or from a storage section 608 Instead, perform various appropriate actions and processing.
  • RAM random access memory
  • ROM read-only memory
  • various programs and data necessary for the operation of the system 600 are also stored.
  • the CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604.
  • An input / output (I / O) interface 605 is also connected to the bus 604.
  • the following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc .; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and speakers; ; And a communication section 609 including a network interface card such as a LAN card, a modem, etc.
  • the communication section 609 performs communication processing via a network such as the Internet.
  • the driver 610 is also connected to the I / O interface 605 as needed.
  • a removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed on the drive 610 as necessary, so that the computer program read out therefrom is installed into the storage section 608 as needed.
  • the process described above with reference to the flowchart may be implemented as a computer software program.
  • embodiments of the present disclosure include a computer program product that includes a computer program carried on a computer-readable medium, the computer program containing program code for performing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication section 609, and / or installed from the removable medium 611.
  • CPU central processing unit
  • the above-mentioned functions defined in the method of the present application are executed.
  • the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable removable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • the computer-readable signal medium may include a data signal that is propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried.
  • This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. .
  • the program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.
  • the computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, the programming languages including object-oriented programming languages such as Java, Smalltalk, C ++, as well as conventional Procedural programming language-such as "C" language or similar programming language.
  • the program code may be executed entirely on the user's computer, partly on the user's computer, as an independent software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, through an Internet service provider Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider Internet connection for example, AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of code that contains one or more logic functions Executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may actually be executed in parallel, and they may sometimes be executed in reverse order, depending on the functions involved.
  • each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts can be implemented with dedicated hardware-based systems that perform specified functions or operations Or, it can be realized by a combination of dedicated hardware and computer instructions.
  • the units described in the embodiments of the present application may be implemented in software or hardware.
  • the described unit may also be provided in the processor, for example, it may be described as: a processor includes a coefficient matrix conversion unit 501, a coefficient matrix optimization unit 502, a matrix information embedding unit 503, a data matrix conversion unit 504, and information picture generation Unit 505.
  • a processor includes a coefficient matrix conversion unit 501, a coefficient matrix optimization unit 502, a matrix information embedding unit 503, a data matrix conversion unit 504, and information picture generation Unit 505.
  • the names of these units do not constitute a limitation on the unit itself.
  • the coefficient matrix optimization unit can also be described as "a unit that obtains the coefficient matrix of the intermediate frequency domain.”
  • the present application also provides a computer-readable medium, which may be included in the device described in the foregoing embodiments; or may exist alone without being assembled into the device.
  • the above computer readable medium carries one or more programs.
  • the device is caused to: use the first transformation matrix to convert the spatial domain data matrix of the screenshot into the original frequency domain coefficient matrix ; Perform primary rounding, quantization and secondary rounding on the original frequency domain coefficient matrix to obtain the intermediate frequency domain coefficient matrix, where the primary rounding and secondary rounding respectively retain the integer part of the source data and remove the fractional part of the source data ; Embed the information to be embedded into the DC coefficient of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information; use the second transformation matrix to convert the frequency domain coefficient matrix of the embedded information into the spatial domain of the embedded information Data matrix; generate a picture of embedded information based on the spatial data matrix of the embedded information.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

Embodiments of the present application disclose a method and device for embedding information in an image. A specific embodiment of the method comprises: using a first transformation matrix to convert a space domain data matrix of a screenshot into an original frequency domain coefficient matrix; performing primary rounding, quantification, and secondary rounding on the original frequency domain coefficient matrix so as to acquire an intermediate frequency domain coefficient matrix, wherein an integer part of source data is maintained and a decimal part of the source data is removed during the primary rounding and the secondary rounding, respectively; embedding, in a direct current coefficient of the intermediate frequency domain coefficient matrix, information to be embedded so as to acquire a frequency domain coefficient matrix having embedded information; using a second transformation matrix to convert the frequency domain coefficient matrix having the embedded information into a space domain data matrix having the embedded information; and generating, on the basis of the space domain data matrix having the embedded information, an image having the embedded information. The embodiment ensures that information embedded in an image is valid and stable.

Description

在图片中嵌入信息的方法和装置Method and device for embedding information in pictures
本专利申请要求于2018年11月06日提交的、申请号为201811312281.9、发明名称为“在图片中嵌入信息的方法和装置”的中国专利申请的优先权,该申请的全文以引用的方式并入本申请中。This patent application requires the priority of a Chinese patent application filed on November 06, 2018 with the application number 201811312281.9 and the invention titled "Method and Device for Embedding Information in Pictures". The entire text of this application is incorporated by reference Into this application.
技术领域Technical field
本申请实施例涉及计算机技术领域,具体涉及图片处理技术领域,尤其涉及在图片中嵌入信息的方法和装置。The embodiments of the present application relate to the field of computer technology, specifically to the field of image processing technology, and in particular, to a method and device for embedding information in a picture.
背景技术Background technique
随着互联网技术的快速发展,用户以截图的方式向其他人传达信息成为一种常见的行为,但是截图所表达的信息并不全面,尤其是用户反馈app问题的时候经常是以截图辅以文字说明的方式来描述问题所在,截图中无法包括比如截图的瞬间用户所处的网络状态,网络下发的数据等等信息,从而导致技术人员难以根据截图准确定位app问题。With the rapid development of Internet technology, it has become a common behavior for users to convey information to others by taking screenshots, but the information expressed by screenshots is not comprehensive, especially when users feedback app problems. Screenshots are often supplemented by text The way to describe the problem is described in the description. The screenshot cannot include information such as the network status of the user at the moment of the screenshot, the data sent by the network, etc., which makes it difficult for the technician to accurately locate the app problem based on the screenshot.
目前,使用现有的在图片中嵌入信息的技术在客户端截图时无法有效植入信息,容易出现白屏等错误,并且在对嵌入信息后的图片进行压缩和经过通信工具进行分享的过程中,嵌入的信息容易错乱和丢失。At present, using the existing technology of embedding information in pictures can not effectively implant information when taking screenshots on the client, and it is prone to errors such as white screens, and in the process of compressing the pictures after embedding information and sharing them through communication tools , The embedded information is prone to confusion and loss.
发明内容Summary of the invention
本申请实施例提出了在图片中嵌入信息的方法和装置。The embodiment of the present application proposes a method and device for embedding information in a picture.
第一方面,本申请实施例提供了一种在图片中嵌入信息的方法,该方法包括:采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵;对原始频率域系数矩阵进行一次取整、量化以及二次取整,得到中间频率域系数矩阵,其中,一次取整及二次取整分 别保留源数据的整数部分,去除源数据的小数部分;将待嵌入信息嵌入到中间频率域系数矩阵的直流系数中,得到已嵌入信息的频率域系数矩阵;采用第二变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵;基于已嵌入信息的空间域数据矩阵,生成已嵌入信息的图片。In the first aspect, an embodiment of the present application provides a method for embedding information in a picture. The method includes: using a first transformation matrix to convert a space domain data matrix of a screenshot into an original frequency domain coefficient matrix; The matrix is rounded, quantized, and rounded to obtain the intermediate frequency domain coefficient matrix, where the rounding and the rounding respectively retain the integer part of the source data, and remove the fractional part of the source data; embed the information to be embedded Go to the DC coefficient of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information; use the second transformation matrix to convert the frequency domain coefficient matrix of the embedded information into the spatial data matrix of the embedded information; based on the embedded The spatial data matrix of information generates pictures with embedded information.
在一些实施例中,截图的空间域数据矩阵中的数据包括亮度数据和色彩数据。In some embodiments, the data in the spatial data matrix of the screenshot includes brightness data and color data.
在一些实施例中,将待嵌入信息嵌入到中间频率域系数矩阵的直流系数中,得到已嵌入信息的频率域系数矩阵,包括:响应于确定直流系数对2取模后的余数与待嵌入信息比特不相同,保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作,得到已嵌入信息的频率域系数矩阵。In some embodiments, embedding the information to be embedded into the DC coefficients of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information includes: in response to determining the DC coefficients, the remainder after modulo 2 and the information to be embedded The bits are not the same, the sign bit of the DC coefficient remains unchanged, and the value of the DC coefficient value bit is subtracted by 1 to obtain the frequency domain coefficient matrix of the embedded information.
在一些实施例中,将待嵌入信息嵌入到中间频率域系数矩阵的直流系数中,得到已嵌入信息的频率域系数矩阵,包括:将直流系数转化为以原码形式表示的二进制数据;响应于确定直流系数的最低位与待嵌入信息比特不相同,保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作,得到已嵌入信息的频率域系数矩阵。In some embodiments, embedding the information to be embedded into the DC coefficients of the intermediate frequency domain coefficient matrix to obtain the frequency information coefficient matrix of the embedded information includes: converting the DC coefficients into binary data expressed in the form of original codes; responding to It is determined that the lowest bit of the DC coefficient is not the same as the information bit to be embedded, the sign bit of the DC coefficient is kept unchanged, and the value of the value bit of the DC coefficient is subtracted by 1 to obtain the frequency domain coefficient matrix of the embedded information.
在一些实施例中,采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵,包括:将截图的空间域数据矩阵进行矩阵分割;采用离散傅里叶变换矩阵,对每个矩阵块进行转换,将截图的空间域数据矩阵转换为原始频率域系数矩阵。In some embodiments, the first transform matrix is used to convert the spatial domain data matrix of the screenshot to the original frequency domain coefficient matrix, which includes: matrix segmentation of the spatial domain data matrix of the screenshot; the discrete Fourier transform matrix is used for each A matrix block is converted, and the spatial data matrix of the screenshot is converted into the original frequency domain coefficient matrix.
在一些实施例中,采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵,包括:将截图的空间域数据矩阵进行矩阵分割;采用离散余弦变换矩阵,对每个矩阵块进行转换,将截图的空间域数据矩阵转换为原始频率域系数矩阵。In some embodiments, the first transformation matrix is used to convert the screenshot spatial domain data matrix to the original frequency domain coefficient matrix, which includes: performing matrix division of the screenshot spatial domain data matrix; using a discrete cosine transform matrix, for each matrix The block is converted, and the spatial data matrix of the screenshot is converted into the original frequency domain coefficient matrix.
在一些实施例中,采用第二变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵,包括:采用量化表,对已嵌入信息的频率域系数矩阵进行反向量化;采用离散傅里叶变换的逆变换矩阵,将经过反向量化的已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。In some embodiments, the second transform matrix is used to convert the frequency domain coefficient matrix of the embedded information into the spatial data matrix of the embedded information, including: using a quantization table to inverse the frequency domain coefficient matrix of the embedded information The inverse transform matrix of the discrete Fourier transform is used to convert the frequency domain coefficient matrix of the embedded information after inverse quantization into the spatial data matrix of the embedded information.
在一些实施例中,采用第二变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵,包括:采用量化表,对已嵌入信息的频率域系数矩阵进行反向量化;采用反离散余弦变换矩阵,将经过反向量化的已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。In some embodiments, the second transform matrix is used to convert the frequency domain coefficient matrix of the embedded information into the spatial data matrix of the embedded information, including: using a quantization table to inverse the frequency domain coefficient matrix of the embedded information Inverse discrete cosine transform matrix is used to convert the inversely quantized frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information.
在一些实施例中,将截图的空间域数据矩阵进行矩阵分割,包括:将截图的空间域数据矩阵进行4*4或8*8或16*16的矩阵分割。In some embodiments, performing matrix division on the captured spatial domain data matrix includes: performing 4 * 4 or 8 * 8 or 16 * 16 matrix division on the captured spatial domain data matrix.
第二方面,本申请实施例提供了一种在图片中嵌入信息的装置,装置包括:系数矩阵转换单元,被配置成将截图的空间域数据矩阵转换为原始频率域系数矩阵;系数矩阵优化单元,被配置成对原始频率域系数矩阵进行一次取整、量化以及二次取整,得到中间频率域系数矩阵,其中,一次取整及二次取整分别保留源数据的整数部分,去除源数据的小数部分;矩阵信息嵌入单元,被配置成将待嵌入信息嵌入到中间频率域系数矩阵的直流系数中,得到已嵌入信息的频率域系数矩阵;数据矩阵转换单元,被配置成将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵;信息图片生成单元,被配置成基于已嵌入信息的空间域数据矩阵,生成已嵌入信息的图片。In a second aspect, an embodiment of the present application provides an apparatus for embedding information in a picture. The apparatus includes: a coefficient matrix conversion unit configured to convert the spatial domain data matrix of the screenshot into an original frequency domain coefficient matrix; a coefficient matrix optimization unit , Configured to perform one rounding, quantization, and second rounding on the original frequency domain coefficient matrix to obtain an intermediate frequency domain coefficient matrix, where the first rounding and the second rounding respectively retain the integer part of the source data, and remove the source data The fractional part of; the matrix information embedding unit, configured to embed the information to be embedded into the DC coefficients of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information; the data matrix conversion unit, configured to embed the embedded information The frequency domain coefficient matrix of is converted into a spatial data matrix with embedded information; the information picture generating unit is configured to generate a picture with embedded information based on the spatial data matrix with embedded information.
在一些实施例中,系数矩阵转换单元中截图的空间域数据矩阵中的数据包括亮度数据和色彩数据。In some embodiments, the data in the spatial domain data matrix captured in the coefficient matrix conversion unit includes brightness data and color data.
在一些实施例中,矩阵信息嵌入单元进一步被配置成:响应于确定直流系数对2取模后的余数与待嵌入信息比特不相同,保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作,得到已嵌入信息的频率域系数矩阵。In some embodiments, the matrix information embedding unit is further configured to: in response to determining that the remainder after the DC coefficient is modulo 2 is not the same as the information bit to be embedded, leave the sign bit of the DC coefficient unchanged, The value of is subtracted by 1 to obtain the frequency domain coefficient matrix with embedded information.
在一些实施例中,矩阵信息嵌入单元包括:数据转化模块,被配置成将直流系数转化为以原码形式表示的二进制数据;信息嵌入模块,被配置成响应于确定直流系数的最低位与待嵌入信息比特不相同,保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作,得到已嵌入信息的频率域系数矩阵。In some embodiments, the matrix information embedding unit includes: a data conversion module configured to convert the DC coefficient into binary data expressed in original code; an information embedding module configured to respond to the determination of the lowest bit of the DC coefficient and the pending The embedded information bits are not the same, the sign bit of the DC coefficient remains unchanged, and the value of the DC coefficient value bit is subtracted by 1 to obtain the frequency domain coefficient matrix of the embedded information.
在一些实施例中,系数矩阵转换单元包括:第一矩阵分割模块,被配置成将截图的空间域数据矩阵进行矩阵分割;离散傅里叶变换模 块,被配置成采用离散傅里叶变换矩阵,对每个矩阵块进行转换,将截图的空间域数据矩阵转换为原始频率域系数矩阵。In some embodiments, the coefficient matrix conversion unit includes: a first matrix division module configured to perform matrix division on the screenshot spatial domain data matrix; a discrete Fourier transform module configured to use the discrete Fourier transform matrix, Transform each matrix block, and transform the spatial data matrix of the screenshot into the original frequency domain coefficient matrix.
在一些实施例中,系数矩阵转换单元包括:第二矩阵分割模块,被配置成将截图的空间域数据矩阵进行矩阵分割;离散余弦变换模块,被配置成采用离散余弦变换矩阵,对每个矩阵块进行转换,将截图的空间域数据矩阵转换为原始频率域系数矩阵。In some embodiments, the coefficient matrix conversion unit includes: a second matrix division module configured to perform matrix division on the spatial data matrix of the screenshot; a discrete cosine transformation module configured to use the discrete cosine transformation matrix for each matrix The block is converted, and the spatial data matrix of the screenshot is converted into the original frequency domain coefficient matrix.
在一些实施例中,数据矩阵转换单元包括:第一反向量化模块,被配置成采用量化表,对已嵌入信息的频率域系数矩阵进行反向量化;离散傅里叶变换的逆变换模块,被配置成采用离散傅里叶变换的逆变换矩阵,将经过反向量化的已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。In some embodiments, the data matrix conversion unit includes: a first inverse quantization module configured to inversely quantize the frequency domain coefficient matrix of the embedded information using a quantization table; an inverse transform module of discrete Fourier transform, It is configured to use the inverse transform matrix of discrete Fourier transform to convert the inversely quantized frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information.
在一些实施例中,第一矩阵分割模块进一步被配置成:将截图的空间域数据矩阵进行4*4或8*8或16*16的矩阵分割。In some embodiments, the first matrix segmentation module is further configured to: perform 4 * 4 or 8 * 8 or 16 * 16 matrix segmentation on the screenshot spatial domain data matrix.
在一些实施例中,数据矩阵转换单元包括:第二反向量化模块,被配置成采用量化表,对已嵌入信息的频率域系数矩阵进行反向量化;反离散余弦变换模块,被配置成采用反离散余弦变换矩阵,将经过反向量化的已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。In some embodiments, the data matrix conversion unit includes: a second inverse quantization module configured to use a quantization table to inversely quantize the frequency domain coefficient matrix of the embedded information; an inverse discrete cosine transform module configured to use The inverse discrete cosine transform matrix converts the inversely quantized frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information.
在一些实施例中,第二矩阵分割模块进一步被配置成:将截图的空间域数据矩阵进行4*4或8*8或16*16的矩阵分割。In some embodiments, the second matrix segmentation module is further configured to: perform a 4 * 4 or 8 * 8 or 16 * 16 matrix segmentation on the captured spatial domain data matrix.
第三方面,本申请实施例提供了一种电子设备,该电子设备包括:一个或多个处理器;存储装置,其上存储有一个或多个程序;当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中任一实现方式描述的方法。In a third aspect, an embodiment of the present application provides an electronic device including: one or more processors; a storage device on which one or more programs are stored; when one or more programs are Executed by one processor, so that one or more processors implement the method as described in any one of the implementation manners of the first aspect.
第四方面,本申请实施例提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现如第一方面中任一实现方式描述的方法。According to a fourth aspect, an embodiment of the present application provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, a method as described in any implementation manner of the first aspect is implemented.
本申请实施例提供的在图片中嵌入信息的方法和装置,通过将图片从空间域转换到频率域,对频率域系数进行一次取整、量化、二次取整,其中,一次取整及二次取整分别保留源数据的整数部分,去除 源数据的小数部分,而后将待嵌入信息嵌入到直流系数中,最后将图片从频率域转换到空间域,生成已嵌入信息的图片。上述一次取整以及二次取整,能够避免数据溢出错误,有效的将信息嵌入到图片中。嵌入信息的图像在经过客户端应用分享的过程中,容易遭遇到诸如有损压缩、低通滤波、次抽样、插值等信号处理过程,在这些过程中,对直流系数的保护比对交流系数的保护要好,可以避免嵌入的信息在传输的过程中丢失,嵌入到直流系数中的信息在信号处理过程中更加稳健。The method and device for embedding information in a picture provided by the embodiments of the present application, by converting the picture from the spatial domain to the frequency domain, the frequency domain coefficients are rounded, quantized, and rounded once. The second rounding separately retains the integer part of the source data, removes the decimal part of the source data, and then embeds the information to be embedded into the DC coefficient, and finally converts the picture from the frequency domain to the spatial domain to generate a picture with embedded information. The above-mentioned first rounding and second rounding can avoid data overflow errors and effectively embed information into pictures. In the process of sharing the image of the embedded information through the client application, it is easy to encounter signal processing processes such as lossy compression, low-pass filtering, sub-sampling, interpolation, etc. In these processes, the protection of the DC coefficient is better than that of the AC coefficient. The protection is better to avoid the loss of embedded information during transmission. The information embedded in the DC coefficient is more robust during signal processing.
附图说明BRIEF DESCRIPTION
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:By reading the detailed description of the non-limiting embodiments made with reference to the following drawings, other features, objects, and advantages of the present application will become more apparent:
图1是本申请的一个实施例可以应用于其中的示例性系统架构图;FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present application can be applied;
图2是根据本申请的在图片中嵌入信息的方法的一个实施例的流程图;2 is a flowchart of an embodiment of a method for embedding information in a picture according to the present application;
图3是根据本申请的在图片中嵌入信息的方法的一个应用场景的示意图;3 is a schematic diagram of an application scenario of a method for embedding information in a picture according to the present application;
图4是根据本申请的在图片中嵌入信息的方法的又一个实施例的流程图;4 is a flowchart of another embodiment of a method for embedding information in a picture according to the present application;
图5是根据本申请的在图片中嵌入信息的装置的一个实施例的结构示意图;5 is a schematic structural diagram of an embodiment of an apparatus for embedding information in a picture according to the present application;
图6是适于用来实现本申请实施例的终端设备的计算机系统的结构示意图。6 is a schematic structural diagram of a computer system suitable for implementing a terminal device according to an embodiment of the present application.
具体实施方式detailed description
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The present application will be described in further detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, but not to limit the invention. It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other if there is no conflict. The present application will be described in detail below with reference to the drawings and in conjunction with the embodiments.
图1示出了可以应用本申请的在图片中嵌入信息的方法和在图片中嵌入信息的装置的实施例的示例性系统架构100。FIG. 1 shows an exemplary system architecture 100 of an embodiment of an embodiment of a method for embedding information in a picture and a device for embedding information in a picture of the present application.
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is a medium used to provide a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, and so on.
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种客户端应用,例如网页浏览器应用、购物类应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等。The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, and so on. Various client applications may be installed on the terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, and social platform software.
终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是具有显示屏并且支持截图的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、膝上型便携计算机和台式计算机等等。当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务),也可以实现成单个软件或软件模块。在此不做具体限定。The terminal devices 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, and 103 are hardware, they may be various electronic devices with display screens and screenshots, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, and desktop computers, etc. Wait. When the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example to provide distributed services), or as a single software or software module. There is no specific limit here.
服务器105可以是提供各种服务的服务器,例如对终端设备101、102、103上运行的客户端提供支持的客户端服务器。客户端服务器可以定制待嵌入的信息,并将定制要求(例如定制网络状态信息的要求)反馈给终端设备,终端设备提供待嵌入的信息。客户端服务器也可以提供待嵌入的信息,并将该信息发送给终端设备(例如待嵌入信息为客户端服务器设定的版权标志信息)。The server 105 may be a server that provides various services, for example, a client server that supports clients running on the terminal devices 101, 102, and 103. The client server can customize the information to be embedded, and feed back customization requirements (for example, requirements for customizing network status information) to the terminal device, and the terminal device provides the information to be embedded. The client server may also provide the information to be embedded, and send the information to the terminal device (for example, the information to be embedded is copyright flag information set by the client server).
需要说明的是,本申请实施例所提供的在图片中嵌入信息的方法一般由终端设备101、102、103执行,相应地,在图片中嵌入信息的装置一般设置于终端设备101、102、103中。It should be noted that the method for embedding information in pictures provided by the embodiments of the present application is generally performed by terminal devices 101, 102, and 103, and accordingly, the device for embedding information in pictures is generally provided in terminal devices 101, 102, and 103. in.
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意 性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks, and servers in FIG. 1 are only schematic. According to the implementation needs, there can be any number of terminal devices, networks and servers.
继续参考图2,示出了根据本申请的在图片中嵌入信息的方法的一个实施例的流程200。该在图片中嵌入信息的方法,包括以下步骤:With continued reference to FIG. 2, a flow 200 of an embodiment of a method for embedding information in a picture according to the present application is shown. The method of embedding information in the picture includes the following steps:
步骤201,采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵。In step 201, the first transformation matrix is used to convert the space domain data matrix of the screenshot to the original frequency domain coefficient matrix.
在本实施例中,在图片中嵌入信息的方法的执行主体(例如图1所示的终端设备)可以采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵。In this embodiment, the execution subject of the method of embedding information in the picture (for example, the terminal device shown in FIG. 1) may use the first transformation matrix to convert the spatial domain data matrix of the screenshot to the original frequency domain coefficient matrix.
其中,空间域又称图像空间是由图像像素点组成的空间,在图像空间中以长度为自变量直接对像素数据进行处理。空间域数据矩阵是根据每一像素点与坐标位置的对应关系存储该像素点的像素数据得到的矩阵。Among them, the spatial domain, also known as image space, is a space composed of image pixels. In the image space, length is used as an independent variable to directly process pixel data. The spatial domain data matrix is a matrix obtained by storing pixel data of each pixel according to the correspondence between each pixel and the coordinate position.
上述像素数据可以包括但不限于RGB格式、YUV格式的像素数据以及其他现在已知或将来开发的格式的像素数据。其中,YUV格式的像素数据又可以包括但不限于Y'UV格式、YUV格式、YCbCr格式、YPbPr格式的像素数据以及其他现在已知或将来开发的格式的像素数据。The above pixel data may include, but is not limited to, pixel data in RGB format, YUV format, and pixel data in other formats now known or developed in the future. The pixel data in the YUV format may include, but is not limited to, pixel data in the Y'UV format, YUV format, YCbCr format, YPbPr format, and pixel data in other formats that are now known or developed in the future.
频率域是以频率为自变量描述图像的特征的区域,可以将一幅图像像素数据在空间上的变化分解为具有不同振幅、频率和相位的简振函数的线性叠加。频率、振幅、相位描述正弦图像中的所有信息。The frequency domain is an area that describes the characteristics of an image with frequency as its independent variable. It can decompose the spatial change of pixel data of an image into a linear superposition of simple vibration functions with different amplitudes, frequencies and phases. Frequency, amplitude, and phase describe all the information in the sinusoidal image.
在频率域中,图像的振幅表征图像中最明和最暗的峰值之间的差,相位表征相对于原始波形,这个波形的偏移量,频率是表征图像中灰度变化剧烈程度的指标,是灰度在平面空间上的梯度。频率越大说明原始信号变化速度越快,频率越小说明原始信号越平缓。在频率域中,人的感知系统的某些掩蔽特性可以更方便地结合到信息嵌入的过程中,在频率域中对图像的频率系数进行分解、处理能够有效的将待嵌入信息嵌入到图片中。In the frequency domain, the amplitude of the image characterizes the difference between the brightest and darkest peaks in the image, and the phase characterizes the offset of the waveform relative to the original waveform. The frequency is an indicator of the intensity of the grayscale change in the image. Gradient of grayscale in plane space. The higher the frequency, the faster the original signal changes, and the lower the frequency, the smoother the original signal. In the frequency domain, some masking characteristics of the human perception system can be more easily integrated into the process of information embedding. Decomposing and processing the frequency coefficients of the image in the frequency domain can effectively embed the information to be embedded into the picture .
图像的空间域与频率域可互相转换。可以引用已经很成熟的变换域技术,将图像由空间域转换到频率域。The spatial and frequency domains of the image can be converted to each other. You can use the already mature transform domain technology to convert the image from the spatial domain to the frequency domain.
在采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率 域系数矩阵时,可以采用现有的以及将来开发的将图像由空间域转换到频率域的变换域技术来实现。When the first transform matrix is used to convert the captured spatial domain data matrix to the original frequency domain coefficient matrix, existing and future developed transform domain technologies that convert the image from the spatial domain to the frequency domain can be used.
在一个具体的实施例中,采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵可以包括:将截图的空间域数据矩阵进行矩阵分割;采用离散傅里叶变换矩阵,将图像由图像空间转换到频域空间,即将截图的空间域数据矩阵转换为原始频率域系数矩阵。上述采用离散傅里叶变换矩阵进行变换可以消除图像的空间冗余,减少运算量。In a specific embodiment, using the first transformation matrix to convert the spatial domain data matrix of the screenshot to the original frequency domain coefficient matrix may include: performing matrix division of the spatial domain data matrix of the screenshot; using a discrete Fourier transform matrix, Convert the image from image space to frequency domain space, that is, transform the spatial data matrix of the screenshot into the original frequency domain coefficient matrix. The above-mentioned transformation using discrete Fourier transform matrix can eliminate the spatial redundancy of the image and reduce the amount of calculation.
在另一个具体的实施例中,采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵可以包括:将截图的空间域数据矩阵进行矩阵分割;采用离散余弦变换矩阵,将图像由图像空间转换到频域空间,即将截图的空间域数据矩阵转换为原始频率域系数矩阵。上述采用离散余弦变换矩阵进行变换与采用离散傅里叶变换矩阵进行变换相比运算量减少了一半,从而提高了运算效率,并且具有良好的去相关性的性能,能够更有效地消除图像的空间冗余,有助于对图像进一步熵编码。在这里,相关性是指由于图像的各个像素点之间的变化都是平滑变化的,所以每个像素点和相邻像素点之间都是相关的,不利于对图像进行熵编码。In another specific embodiment, using the first transformation matrix to convert the spatial domain data matrix of the screenshot to the original frequency domain coefficient matrix may include: matrix partitioning the spatial domain data matrix of the screenshot; using a discrete cosine transform matrix, the The image is converted from image space to frequency domain space, that is, the spatial data matrix of the screenshot is converted into the original frequency domain coefficient matrix. Compared with the use of discrete Fourier transform matrix for the above-mentioned transformation using discrete cosine transform matrix, the amount of calculation is reduced by half, which improves the operation efficiency, and has a good decorrelation performance, which can effectively eliminate the image space Redundancy helps to further entropy encode the image. Here, the correlation means that since the changes between the pixels of the image are smoothly changed, each pixel and the adjacent pixels are related, which is not conducive to entropy encoding the image.
在本实施例的一些可选的实现方式中,可以采用4*4矩阵分割方式对截图的空间域数据矩阵进行矩阵分割。上述采用4*4矩阵分割方式能够降低图像的空间域与频率域转换的算法的复杂程度,提高变换域运算的效率。In some optional implementations of this embodiment, a 4 * 4 matrix division method may be used to perform matrix division on the spatial data matrix of the screenshot. The use of the 4 * 4 matrix division method described above can reduce the complexity of the algorithm for converting the spatial domain and the frequency domain of the image, and improve the efficiency of the transform domain calculation.
在本实施例的一些可选的实现方式中,可以采用8*8矩阵分割方式对截图的空间域数据矩阵进行矩阵分割。上述采用8*8矩阵分割方式能够降低图像的空间域与频率域转换的算法的复杂程度,提高变换域运算的效率并且减少图像分块效应,确保重建图像中块的边界的连续性。上述图像分块效应是指图像在块的边界处出现不连续的缺陷。In some optional implementations of this embodiment, an 8 * 8 matrix division method may be used to perform matrix division on the spatial data matrix of the screenshot. The above 8 * 8 matrix division method can reduce the complexity of the algorithm of the spatial and frequency domain conversion of the image, improve the efficiency of the transform domain operation and reduce the image blocking effect, and ensure the continuity of the boundary of the block in the reconstructed image. The above-mentioned image blocking effect means that the image has discontinuous defects at the boundary of the block.
在本实施例的一些可选的实现方式中,可以采用16*16矩阵分割方式对截图的空间域数据矩阵进行矩阵分割。上述采用16*16矩阵分割方式可以明显减少图像分块效应,确保重建图像中块的边界的连续 性,提高图像的保真度。In some optional implementation manners of this embodiment, a 16 * 16 matrix division method may be used to perform matrix division on the spatial data matrix of the screenshot. The above 16 * 16 matrix segmentation method can significantly reduce the image blocking effect, ensure the continuity of the block boundaries in the reconstructed image, and improve the image fidelity.
步骤202,对原始频率域系数矩阵进行一次取整、量化以及二次取整,得到中间频率域系数矩阵,其中,一次取整及二次取整分别保留源数据的整数部分,去除源数据的小数部分。Step 202: Perform primary rounding, quantization, and secondary rounding on the original frequency domain coefficient matrix to obtain an intermediate frequency domain coefficient matrix, where the primary rounding and secondary rounding respectively retain the integer part of the source data, and remove the source data. decimal part.
在本实施例中,基于步骤201中得到的原始频率域系数矩阵,上述执行主体(例如图1所示的终端设备)可以对原始频率域系数矩阵进行一次取整,其中,一次取整保留源数据的整数部分,去除源数据的小数部分。例如一次取整的源数据为75.9,那么经过一次取整后,该数据变为75。确保图像在空间域与频率域转化的过程中,图像像素数据不超过临界值,避免嵌入的数据丢失。In this embodiment, based on the original frequency domain coefficient matrix obtained in step 201, the above-mentioned execution subject (such as the terminal device shown in FIG. 1) may round the original frequency domain coefficient matrix once, where the rounding reserves the source once The integer part of the data, excluding the decimal part of the source data. For example, the source data rounded at one time is 75.9, then after one rounding, the data becomes 75. Ensure that the image pixel data does not exceed the critical value during the conversion of the spatial domain and the frequency domain to avoid the loss of embedded data.
之后,采用量化表对经过一次取整的原始频率域系数矩阵进行量化处理。量化是通过映射关系,降低比特率的操作,即将原始频率域系数矩阵中的数据除以量化表中对应位置的量化系数。量化过程实际上就是对频率域系数的一个优化过程。它是利用了人眼对高频部分不敏感的特性来实现数据的大幅简化。上述量化表有许多种,例如如表1所示的JPEG压缩编码器中采用的标准8*8量化表:After that, a quantization table is used to quantize the original frequency domain coefficient matrix after rounding. Quantization is the operation of reducing the bit rate through the mapping relationship, that is, dividing the data in the original frequency domain coefficient matrix by the quantization coefficient at the corresponding position in the quantization table. The quantization process is actually an optimization process for the frequency domain coefficients. It takes advantage of the insensitivity of the human eye to high-frequency components to achieve a substantial simplification of data. There are many kinds of quantization tables, for example, the standard 8 * 8 quantization table used in the JPEG compression encoder shown in Table 1:
Figure PCTCN2019103578-appb-000001
Figure PCTCN2019103578-appb-000001
表1Table 1
又例如如表2所示的改进后的量化表:Another example is the improved quantization table shown in Table 2:
Figure PCTCN2019103578-appb-000002
Figure PCTCN2019103578-appb-000002
Figure PCTCN2019103578-appb-000003
Figure PCTCN2019103578-appb-000003
表2Table 2
最后,对经过一次取整、量化后的原始频率域系数矩阵进行二次取整,得到中间频率域系数矩阵,其中,二次取整保留源数据的整数部分,去除源数据的小数部分。例如二次取整的源数据为65.7,那么经过二次取整后,该数据变为65。上述取整操作可以确保图像在空间域与频率域转化的过程中,图像像素数据不超过临界值,避免嵌入的数据丢失。Finally, the original frequency domain coefficient matrix after rounding and quantization is rounded twice to obtain an intermediate frequency domain coefficient matrix, in which the rounding preserves the integer part of the source data and removes the fractional part of the source data. For example, the source data of the second rounding is 65.7, then after the second rounding, the data becomes 65. The above rounding operation can ensure that the image pixel data does not exceed the critical value during the conversion of the spatial domain and the frequency domain, and avoid the loss of embedded data.
上述一次取整以及二次取整,能够避免出现数据溢出错误,确保嵌入的信息更加稳健。例如源数据为RGB格式的数据,其数值为255,在对该数据对应的频率系数进行量化、取整以及变换域处理的过程中,采用保留源数据的整数部分,去除源数据的小数部分的取整操作,而不采用四舍五入的取整操作,能够避免当图像由频率域转换到空间域时,出现与该频率系数对应的图像像素数据超过阈值范围(即RGB值超过255)导致数据溢出错误的情况,从而有效的将信息嵌入到图片中。The above-mentioned first rounding and second rounding can avoid data overflow errors and ensure that the embedded information is more robust. For example, the source data is RGB format data, and its value is 255. In the process of quantizing, rounding, and transforming the frequency coefficients corresponding to the data, the integer part of the source data is retained, and the fractional part of the source data is removed. Rounding operation, instead of rounding, can avoid data overflow error when the image pixel data corresponding to the frequency coefficient exceeds the threshold range (that is, the RGB value exceeds 255) when the image is converted from the frequency domain to the spatial domain To effectively embed information into pictures.
步骤203,将待嵌入信息嵌入到中间频率域系数矩阵的直流系数中,得到已嵌入信息的频率域系数矩阵。Step 203: Embed the information to be embedded into the DC coefficient of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information.
在本实施例中,在图片中嵌入信息的方法的执行主体可以预先存储待嵌入信息,例如上述待嵌入信息可以是执行主体的型号信息、CPU信息等信息。上述待嵌入信息也可以是上述执行主体根据预设的规则生成的信息,例如上述信息可以是截图时执行主体的网络状态信息、内存信息等信息。上述待嵌入信息还可以是用户输入的信息,例如用户名信息、密码信息等信息。In this embodiment, the execution body of the method of embedding information in the picture may store the information to be embedded in advance, for example, the above-mentioned information to be embedded may be information such as model information, CPU information, etc. of the execution body. The information to be embedded may also be information generated by the execution subject according to a preset rule, for example, the information may be information such as network status information and memory information of the execution subject when taking a screenshot. The above-mentioned information to be embedded may also be information input by the user, such as user name information, password information, and the like.
在上述嵌入信息之前,可以将待嵌入信息转换为二进制数据,以便将信息更隐蔽的嵌入到图片中。上述直流系数是指频率域系数矩阵中,对应于u=0,v=0的系数,其余系数被称为交流系数。直流系数的值通常比交流系数值大几十倍,甚至上百倍。因此,将信息嵌入到直流系数中具有更好的不可见性。由于嵌入信息的图像在经过客户端应用分享的过程中,容易遭遇到诸如有损压缩、低通滤波、次抽样、 插值等信号处理过程,在这些过程中,对直流系数的保护比对交流系数的保护要好,因此,嵌入到直流系数中的信息在信号处理过程中更加稳健。Before embedding the above information, the information to be embedded can be converted into binary data in order to embed the information in the picture more covertly. The above DC coefficients refer to coefficients in the frequency domain coefficient matrix corresponding to u = 0 and v = 0, and the remaining coefficients are called AC coefficients. The value of the DC coefficient is usually tens of times larger than the AC coefficient, or even hundreds of times. Therefore, embedding information into the DC coefficient has better invisibility. Because images embedded with information are easily shared by the client application in the process of signal processing such as lossy compression, low-pass filtering, sub-sampling, interpolation, etc. In these processes, the protection of the DC coefficient is compared to the AC coefficient The protection is better, therefore, the information embedded in the DC coefficient is more robust in the signal processing process.
在本实施例中,上述嵌入过程可以是修改直流系数来嵌入待嵌入信息的过程,即用待嵌入信息替换直流系数的相应数值位的数值的过程。例如,用待嵌入信息替换直流系数的最低有效位的数值,上述最低有效位,是指一个二进制数字中的第0位(即最低位)。又例如,用待嵌入信息替换直流系数的随机位的数值。In this embodiment, the above embedding process may be a process of modifying the DC coefficient to embed the information to be embedded, that is, a process of replacing the value of the corresponding value bit of the DC coefficient with the information to be embedded. For example, the value of the least significant bit of the DC coefficient is replaced with the information to be embedded. The least significant bit refers to the 0th bit (that is, the least significant bit) in a binary number. For another example, the value of the random bit of the DC coefficient is replaced with the information to be embedded.
步骤204,采用第二变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。In step 204, the second transform matrix is used to convert the frequency domain coefficient matrix of the embedded information into the spatial data matrix of the embedded information.
在本实施例中,上述执行主体首先对频率域系数矩阵进行反向量化处理;接着,对图像进行变换域处理,将图像由频率域转换到空间域。上述步骤204是与上述步骤202相对应的步骤。上述对应关系例如:上述反向量化与上述量化采用相同的量化表,通过映射关系,提高比特率,即将原始频率域系数矩阵中的数据乘以量化表中对应位置的量化系数。In this embodiment, the above-mentioned execution subject first performs inverse quantization processing on the frequency domain coefficient matrix; then, performs transform domain processing on the image to convert the image from the frequency domain to the spatial domain. The above step 204 is a step corresponding to the above step 202. For example, the corresponding relationship between the reverse quantization and the quantization uses the same quantization table, and the bit rate is increased through the mapping relationship, that is, the data in the original frequency domain coefficient matrix is multiplied by the quantization coefficient at the corresponding position in the quantization table.
在采用第二变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵时,可以采用现有的以及将来开发的将图像由频率域转换到空间域的变换域技术来实现。When using the second transform matrix to convert the frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information, the existing and future developed transform domain technology to convert the image from the frequency domain to the spatial domain can be used to fulfill.
例如,在一个具体的实施例中,采用第二变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵可以包括:采用离散傅里叶变换的逆变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。上述采用离散傅里叶变换的逆变换矩阵与上述步骤202所采用的离散傅里叶变换矩阵相对应,基本无损的将图像从频率域转换到空间域,能够提高图像的保真度,提高嵌入信息的隐蔽性。For example, in a specific embodiment, using a second transformation matrix to convert the frequency-domain coefficient matrix of the embedded information into the spatial-domain data matrix of the embedded information may include: using the inverse transform matrix of the discrete Fourier transform to convert The frequency domain coefficient matrix of the embedded information is converted into the spatial domain data matrix of the embedded information. The above-mentioned inverse transform matrix using discrete Fourier transform corresponds to the discrete Fourier transform matrix used in step 202 above. The image is basically losslessly converted from the frequency domain to the spatial domain, which can improve the fidelity of the image and improve embedding. Concealment of information.
在另一个具体的实施例中,采用第二变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵可以包括:采用反离散余弦变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。上述采用的反离散余弦变换矩阵与上述步骤 202所采用的离散余弦变换矩阵相对应,采用反离散余弦变换矩阵的变换中使用了半周期的基函数,而离散傅里叶变换的逆变换使用的是整周期基函数。由于图像中大部分像素的变化都是渐变的,因此,采用反离散余弦变换矩阵的变换可以更好地表达图像,进一步提高图像的保真度以及嵌入信息的隐蔽性。In another specific embodiment, using a second transformation matrix to convert the frequency-domain coefficient matrix of the embedded information into the spatial-domain data matrix of the embedded information may include: using an inverse discrete cosine transform matrix to convert the frequency of the embedded information The domain coefficient matrix is converted into a spatial data matrix with embedded information. The inverse discrete cosine transform matrix used above corresponds to the discrete cosine transform matrix used in step 202 above. The transformation using the inverse discrete cosine transform matrix uses a semi-periodic basis function, while the inverse discrete Fourier transform uses Is the basis function of the entire period. Since most pixel changes in the image are gradual, the use of the inverse discrete cosine transform matrix can better express the image, further improving the image fidelity and the concealment of embedded information.
步骤205,基于已嵌入信息的空间域数据矩阵,生成已嵌入信息的图片。Step 205: Based on the spatial data matrix of the embedded information, generate a picture of the embedded information.
在本实施例中,已嵌入信息的空间域数据矩阵是根据每一像素点与坐标位置的对应关系存储该像素点的像素数据得到的矩阵。基于图像像素数据与图像的对应关系,生成已嵌入信息的图片。In this embodiment, the spatial data matrix with embedded information is a matrix obtained by storing pixel data of each pixel according to the correspondence between each pixel and the coordinate position. Based on the correspondence between the image pixel data and the image, a picture with embedded information is generated.
需要说明的是,基于已嵌入信息的空间域数据矩阵,生成已嵌入信息的图片是目前广泛研究和应用的公知技术,在此不再赘述。It should be noted that, based on the spatial domain data matrix of the embedded information, generating a picture of the embedded information is a well-known technology widely studied and applied at present, and will not be repeated here.
继续参见图3,图3是根据本实施例的在图片中嵌入信息的方法的应用场景的一个示意图。在图3的应用场景中,用户打开手机上一个app程序的登录界面,上面有“手机注册”、“微信登录”以及“QQ登陆”三种选项。用户点击“微信登录”,app弹出了“网络错误我知道了”的提示信息。用户对该界面截图时,电子设备将截图从空间域转换到频率域,对频率域系数矩阵进行取整、量化、取整操作,并将待嵌入信息302“华为P9,CPU1.26G可用/3G,网速1.7M/s,内存64G”嵌入到频率域系数矩阵的直流系数中,最后将图像从频率域转换到空间域,生成了已嵌入信息的图片301。3, FIG. 3 is a schematic diagram of an application scenario of the method for embedding information in a picture according to this embodiment. In the application scenario of FIG. 3, the user opens the login interface of an app program on the mobile phone, and there are three options of "mobile phone registration", "WeChat login" and "QQ login". The user clicks "WeChat login", and the app pops up the message "I know the network error". When the user takes a screenshot of the interface, the electronic device converts the screenshot from the spatial domain to the frequency domain, performs rounding, quantization, and rounding operations on the frequency domain coefficient matrix, and inserts the information to be embedded 302 "Huawei P9, CPU1.26G available / 3G , The network speed is 1.7M / s, and the memory 64G is embedded in the DC coefficient of the frequency domain coefficient matrix. Finally, the image is converted from the frequency domain to the spatial domain, and a picture 301 with embedded information is generated.
图片301中就包含截图时手机的相关信息302,用户将该截图发送给相关的技术人员,技术人员通过分析图片的信息,就可以得到上述用户的手机在截图时的信息302“华为P9,CPU1.26G可用/3G,网速1.7M/s,内存64G”。技术人员就可以很容易的判断出用户的网络状态良好,从而能帮助技术人员准确的定位app问题。The picture 301 contains the relevant information 302 of the mobile phone at the time of the screenshot. The user sends the screenshot to the relevant technician. By analyzing the information of the picture, the technician can obtain the information 302 of the user ’s mobile phone at the time of the screenshot. "Huawei P9, CPU1 .26G available / 3G, network speed 1.7M / s, memory 64G ". The technician can easily determine that the user's network status is good, which can help the technician accurately locate the app problem.
本申请的上述实施例提供的方法通过对图像的频率域系数矩阵进行保留源数据的整数部分、去除源数据的小数部分的取整操作以及将待嵌入信息嵌入到频率域系数矩阵的直流系数中,实现了在图片中嵌入信息的有效性和稳定性。The method provided by the above embodiment of the present application performs the rounding operation of retaining the integer part of the source data, removing the fractional part of the source data, and embedding the information to be embedded into the DC coefficients of the frequency domain coefficient matrix on the frequency domain coefficient matrix of the image , To achieve the effectiveness and stability of embedding information in the picture.
进一步参考图4,其示出了在图片中嵌入信息的方法的又一个实施例的流程400。该在图片中嵌入信息的方法的流程400,包括以下步骤:With further reference to FIG. 4, it shows a flow 400 of yet another embodiment of a method of embedding information in a picture. The process 400 of the method for embedding information in a picture includes the following steps:
步骤401,采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵。In step 401, the first transformation matrix is used to convert the spatial data matrix of the screenshot into the original frequency domain coefficient matrix.
步骤402,对原始频率域系数矩阵进行一次取整,其中,一次取整保留源数据的整数部分,去除源数据的小数部分。In step 402, the original frequency domain coefficient matrix is rounded once, wherein the rounding preserves the integer part of the source data and removes the fractional part of the source data.
步骤403,采用量化表对经过一次取整后的原始频率域系数矩阵进行量化。 Step 403, the quantization table is used to quantize the original frequency domain coefficient matrix after rounding.
步骤404,对经过量化的原始频率域系数矩阵进行二次取整,其中,二次取整保留源数据的整数部分,去除源数据的小数部分。In step 404, the quantized original frequency domain coefficient matrix is rounded twice, wherein the rounded part retains the integer part of the source data and removes the fractional part of the source data.
在本实施例中,上述步骤401与前述实施例中的步骤201一致,上文针对步骤201的描述也适用于步骤401,上述步骤402、403、404与前述实施例中的步骤202一致,上文针对步骤202的描述也适用于步骤402、403、404,此处不再赘述。In this embodiment, the above step 401 is the same as step 201 in the previous embodiment. The above description of step 201 also applies to step 401. The above steps 402, 403, and 404 are the same as step 202 in the previous embodiment. The description of step 202 in this article is also applicable to steps 402, 403, and 404, and is not repeated here.
步骤405,将待嵌入信息嵌入到中间频率域系数矩阵的直流系数中,得到已嵌入信息的频率域系数矩阵。Step 405: Embed the information to be embedded into the DC coefficient of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information.
在本实施例中,将待嵌入信息嵌入到中间频率域系数矩阵的直流系数中,可以是按照一定的规则重新编写直流系数的过程,可以采用现有的以及将来开发的信息嵌入技术来实现。In this embodiment, embedding the information to be embedded into the DC coefficients of the intermediate frequency domain coefficient matrix may be a process of rewriting the DC coefficients according to certain rules, and may be implemented using existing and future information embedding technologies.
在第一个实施例中,可以按照以下步骤进行信息嵌入:In the first embodiment, the information can be embedded according to the following steps:
第一步,判断直流系数对2取模后的余数与待嵌入信息比特是否相同。例如直流系数是32,待嵌入信息比特为0,则32对2取模后的余数为0,该数值与待嵌入信息比特0相同。例如直流系数是-31对2取模后的余数为1,待嵌入信息比特为0,则两者不相同。In the first step, it is determined whether the remainder after the DC coefficient is modulo 2 is the same as the information bit to be embedded. For example, the DC coefficient is 32, and the information bit to be embedded is 0, then the remainder after 32-to-2 modulo is 0, which is the same as the information bit 0 to be embedded. For example, the DC coefficient is -31 and the remainder after modulo 2 is 1, and the information bit to be embedded is 0, the two are different.
第二步,如果两者相同,则不重新编写直流系数。例如,直流系数是32,待嵌入信息比特为0,则32对2取模后的余数为0,该数值与待嵌入信息比特0相同,不用重新编写直流系数就将信息0嵌入到了直流系数当中。The second step, if the two are the same, do not reprogram the DC coefficient. For example, if the DC coefficient is 32 and the information bit to be embedded is 0, the remainder after 32-to-2 modulo is 0, which is the same as the information bit 0 to be embedded, and the information 0 is embedded into the DC coefficient without rewriting the DC coefficient .
第三步,如果两者不相同,则重新编写直流系数,编写规则为保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作。例如直流系数是-31,待嵌入信息比特为0,直流系数是-31对2取模后的余数为1,待嵌入信息比特为0,则两者不相同,重新编写直流系数。保留直流系数-31的符号位,负号,将直流系数-31的数值位的数值31进行减1操作,得到直流系数的数值位的数值为30,那么新生成的直流系数就为-30。上述过程完成了将信息0嵌入到直流系数-31中的过程。In the third step, if the two are not the same, the DC coefficient is rewritten. The writing rule is to keep the sign bit of the DC coefficient unchanged, and subtract 1 from the value of the value of the DC coefficient. For example, the DC coefficient is -31, the information bit to be embedded is 0, the DC coefficient is -31 and the remainder after modulo 2 is 1, the information bit to be embedded is 0, the two are different, and the DC coefficient is rewritten. Retain the sign bit of the DC coefficient -31 and the minus sign. Subtract 1 from the value 31 of the DC coefficient value -31 to obtain the value of the DC coefficient value of 30. Then the newly generated DC coefficient is -30. The above process completes the process of embedding information 0 into the DC coefficient -31.
上述保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作,能够确保直流系数转换到空间域时,得到的图像像素数据在阈值范围内,避免出现数据溢出错误,确保嵌入信息的稳定性。The sign bit of the above reserved DC coefficient remains unchanged, and the value of the value of the DC coefficient is subtracted by 1 to ensure that when the DC coefficient is converted to the spatial domain, the obtained image pixel data is within the threshold range to avoid data overflow errors and ensure Stability of embedded information.
又例如,在第二个实施例中,可以按照以下步骤进行信息嵌入:For another example, in the second embodiment, information embedding may be performed according to the following steps:
第一步,将直流系数转换为以原码形式表示的二进制数据,判断直流系数的最低位的比特是否与待嵌入信息比特相同,其中最低位是指二进制数据的第0位。In the first step, the DC coefficient is converted into binary data expressed in the original code, and it is determined whether the lowest bit of the DC coefficient is the same as the information bit to be embedded, where the lowest bit refers to the 0th bit of the binary data.
第二步,如果相同,不重新编写直流系数。The second step, if the same, do not reprogram the DC coefficient.
第三步,如果不相同,则重新编写直流系数,编写规则为保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作。例如直流系数是-8,待嵌入信息比特为1,则将-8转换为以原码形式表示的二进制数据10001000,该二进制数据的最低位为0与待嵌入信息比特1不同,那么需要重新编写直流系数。保留10001000的符号位:1,对10001000的数值位:0001000进行减1操作,数值位变为:0000111,生成的新的直流系数就为10000111,即嵌入信息1后直流系数由-8变为了-7。In the third step, if they are not the same, the DC coefficient is re-programmed. The writing rule is to keep the sign bit of the DC coefficient unchanged, and subtract 1 from the value of the DC coefficient. For example, the DC coefficient is -8, and the information bit to be embedded is 1, then -8 is converted to binary data 10001000 expressed in the original code. The lowest bit of the binary data is 0, which is different from the information bit 1 to be embedded. DC coefficient. Retain the sign bit of 10001000: 1, subtract 1 from the value of 10001000: 10001000, the value bit becomes: 0000111, the new DC coefficient generated is 10000111, that is, the DC coefficient changes from -8 to-after embedding information 1. 7.
上述保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作,能够确保直流系数转换到空间域时,得到的图像像素数据在阈值范围内,避免出现数据溢出错误,确保嵌入信息的稳定性。The sign bit of the above reserved DC coefficient remains unchanged, and the value of the value of the DC coefficient is subtracted by 1 to ensure that when the DC coefficient is converted to the spatial domain, the obtained image pixel data is within the threshold range to avoid data overflow errors and ensure Stability of embedded information.
步骤406,采用第二变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。Step 406: Using the second transformation matrix, convert the frequency-domain coefficient matrix of the embedded information into the spatial-domain data matrix of the embedded information.
在本实施例中,上述执行主体首先对频率域系数矩阵进行反向量 化处理;接着,对图像进行变换域处理,将图像由频率域转换到空间域。上述步骤406是与上述步骤401、403相对应的步骤。In this embodiment, the above-mentioned execution subject first performs inverse vectorization processing on the frequency domain coefficient matrix; then, performs transform domain processing on the image to convert the image from the frequency domain to the spatial domain. The above step 406 is a step corresponding to the above steps 401 and 403.
在采用第二变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵时,可以采用现有的以及将来开发的将图像由频率域转换到空间域的变换域技术来实现。可以采用离散傅里叶变换的逆变换矩阵,也可以采用反离散余弦变换矩阵将图像由频率域转换到空间域。When using the second transform matrix to convert the frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information, the existing and future developed transform domain technology to convert the image from the frequency domain to the spatial domain can be used to fulfill. The inverse transform matrix of the discrete Fourier transform can be used, or the inverse discrete cosine transform matrix can also be used to transform the image from the frequency domain to the spatial domain.
步骤407,基于已嵌入信息的空间域数据矩阵,生成已嵌入信息的图片。Step 407: Based on the spatial data matrix of the embedded information, generate a picture of the embedded information.
在本实施例中,已嵌入信息的空间域数据矩阵是根据每一像素点与坐标位置的对应关系存储该像素点的像素数据得到的矩阵。基于图像像素数据与图像的对应关系,生成已嵌入信息的图片。In this embodiment, the spatial data matrix with embedded information is a matrix obtained by storing pixel data of each pixel according to the correspondence between each pixel and the coordinate position. Based on the correspondence between the image pixel data and the image, a picture with embedded information is generated.
从图4中可以看出,与图2对应的实施例相比,本实施例中的在图片中嵌入信息的方法的流程400细化了将待嵌入信息嵌入到中间频率域系数矩阵的直流系数中,得到已嵌入信息的频率域系数矩阵的步骤。由此,本实施例描述的方案可以确保嵌入图片中的信息不丢失,从而丰富了图片的数据维度,并且确保了嵌入信息的有效性和稳定性。As can be seen from FIG. 4, compared with the embodiment corresponding to FIG. 2, the process 400 of the method for embedding information in a picture in this embodiment refines the DC coefficient of embedding the information to be embedded into the coefficient matrix of the intermediate frequency domain In the step of obtaining the frequency domain coefficient matrix with embedded information. Thus, the solution described in this embodiment can ensure that the information embedded in the picture is not lost, thereby enriching the data dimension of the picture, and ensuring the validity and stability of the embedded information.
进一步参考图5,作为对上述各图所示方法的实现,本申请提供了一种在图片中嵌入信息的装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。With further reference to FIG. 5, as an implementation of the method shown in the above figures, the present application provides an embodiment of a device for embedding information in a picture, which corresponds to the method embodiment shown in FIG. 2, The device can be specifically applied to various electronic devices.
如图5所示,本实施例的在图片中嵌入信息的装置500包括:系数矩阵转换单元501、系数矩阵优化单元502、矩阵信息嵌入单元503、数据矩阵转换单元504和信息图片生成单元505。其中,系数矩阵转换单元501被配置成将截图的空间域数据矩阵转换为原始频率域系数矩阵;系数矩阵优化单元502被配置成对原始频率域系数矩阵进行一次取整、量化以及二次取整,得到中间频率域系数矩阵,其中,一次取整及二次取整分别保留源数据的整数部分,去除源数据的小数部分;矩阵信息嵌入单元503被配置成将待嵌入信息嵌入到中间频率域系数矩阵的直流系数中,得到已嵌入信息的频率域系数矩阵;数据矩阵转换单元504被配置成将已嵌入信息的频率域系数矩阵转换为已嵌入信 息的空间域数据矩阵;而信息图片生成单元505被配置成基于已嵌入信息的空间域数据矩阵,生成已嵌入信息的图片。As shown in FIG. 5, the apparatus 500 for embedding information in a picture of this embodiment includes: a coefficient matrix conversion unit 501, a coefficient matrix optimization unit 502, a matrix information embedding unit 503, a data matrix conversion unit 504, and an information picture generating unit 505. The coefficient matrix conversion unit 501 is configured to convert the screenshot spatial domain data matrix to the original frequency domain coefficient matrix; the coefficient matrix optimization unit 502 is configured to perform primary rounding, quantization, and secondary rounding on the original frequency domain coefficient matrix To obtain an intermediate frequency domain coefficient matrix, where the first rounding and the second rounding respectively retain the integer part of the source data and remove the fractional part of the source data; the matrix information embedding unit 503 is configured to embed the information to be embedded into the intermediate frequency domain Among the DC coefficients of the coefficient matrix, the frequency domain coefficient matrix of the embedded information is obtained; the data matrix conversion unit 504 is configured to convert the frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information; and the information picture generating unit 505 is configured to generate a picture of the embedded information based on the spatial data matrix of the embedded information.
在本实施例中,在图片中嵌入信息的装置500的系数矩阵转换单元501可以将图片由空间域转换到频率域,得到原始频率域系数矩阵。在频率域中,人的感知系统的某些掩蔽特性可以更方便地结合到信息嵌入的过程中,在频率域中对图像的频率系数进行分解、处理能够有效的将待嵌入信息嵌入到图片中。In this embodiment, the coefficient matrix conversion unit 501 of the device 500 for embedding information in the picture can convert the picture from the spatial domain to the frequency domain to obtain the original frequency domain coefficient matrix. In the frequency domain, some masking characteristics of the human perception system can be more easily integrated into the process of information embedding. Decomposing and processing the frequency coefficients of the image in the frequency domain can effectively embed the information to be embedded into the picture .
在本实施例中,系数矩阵优化单元502可以对原始频率域系数矩阵进行一次取整、量化以及二次取整,得到中间频率域系数矩阵,其中,一次取整及二次取整分别保留源数据的整数部分,去除源数据的小数部分。量化过程实际上就是对频率系数的一个优化过程。它是利用了人眼对高频部分不敏感的特性来实现数据的大幅简化,提高计算效率。In this embodiment, the coefficient matrix optimization unit 502 can perform rounding, quantization, and second rounding on the original frequency domain coefficient matrix to obtain an intermediate frequency domain coefficient matrix, where the first rounding and the second rounding respectively retain the source The integer part of the data, excluding the decimal part of the source data. The quantization process is actually an optimization process for frequency coefficients. It takes advantage of the insensitivity of the human eye to high-frequency parts to achieve a substantial simplification of data and improve computational efficiency.
在本实施例中,在图片中嵌入信息的装置500上可以预先存储待嵌入信息,这些待嵌入信息可以是一些标志信息,例如版权声明信息等,上述待嵌入信息也可以是上述装置500根据预设的规则生成的信息,例如待嵌入信息可以是反映截图时安装上述装置500的设备的运行状态信息,以便将设备的运行状态记录下来。In this embodiment, the device 500 to embed information in the picture may store the information to be embedded in advance, and the information to be embedded may be some logo information, such as copyright declaration information, etc. The information to be embedded may also be the device 500 to embed The information generated by the set rule, for example, the information to be embedded may be information reflecting the operating state of the device on which the device 500 is installed when the screenshot is taken, so as to record the operating state of the device.
在本实施例中,矩阵信息嵌入单元503将待嵌入信息嵌入到直流系数中,上述嵌入过程可以是修改直流系数来嵌入待嵌入信息的过程,即用待嵌入信息替换直流系数的相应数值位的数值的过程。使待嵌入信息隐蔽、稳定的嵌入到源图片数据中。根据图片变换域的对应关系,上述数据矩阵转换单元504可以将图片由频率域转换到空间域。In this embodiment, the matrix information embedding unit 503 embeds the information to be embedded into the DC coefficient. The above embedding process may be a process of modifying the DC coefficient to embed the information to be embedded, that is, replacing the corresponding value bits of the DC coefficient with the information to be embedded Numerical process. Make the information to be embedded hidden and stable embedded in the source picture data. According to the corresponding relationship of the picture transformation domain, the above-mentioned data matrix conversion unit 504 may convert the picture from the frequency domain to the spatial domain.
在本实施例中,上述信息图片生成单元505可以根据上述已嵌入信息的空间域数据矩阵里面的图像像素数据,生成已嵌入信息的图片。In this embodiment, the information picture generating unit 505 may generate a picture with embedded information according to the image pixel data in the spatial domain data matrix of the embedded information.
应当理解,装置500中记载的诸单元可以与参考图2-图4描述的方法中的各个步骤相对应。由此,上文针对方法描述的操作和特征同样适用于装置500及其中包含的单元,在此不再赘述。It should be understood that the units recorded in the device 500 may correspond to the various steps in the method described with reference to FIGS. 2 to 4. Therefore, the operations and features described above for the method are also applicable to the device 500 and the units contained therein, which will not be repeated here.
下面参考图6,其示出了适于用来实现本申请实施例的终端设备 的计算机系统600的结构示意图。图6示出的终端设备仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。6, which shows a schematic structural diagram of a computer system 600 suitable for implementing the terminal device of the embodiment of the present application. The terminal device shown in FIG. 6 is only an example, and should not bring any limitation to the functions and usage scope of the embodiments of the present application.
如图6所示,计算机系统600包括中央处理单元(CPU)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储部分608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有系统600操作所需的各种程序和数据。CPU 601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in FIG. 6, the computer system 600 includes a central processing unit (CPU) 601 that can be loaded into a random access memory (RAM) 603 from a program stored in a read-only memory (ROM) 602 or from a storage section 608 Instead, perform various appropriate actions and processing. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
以下部件连接至I/O接口605:包括键盘、鼠标等的输入部分606;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分607;包括硬盘等的存储部分608;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分609。通信部分609经由诸如因特网的网络执行通信处理。驱动器610也根据需要连接至I/O接口605。可拆卸介质611,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器610上,以便于从其上读出的计算机程序根据需要被安装入存储部分608。The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc .; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and speakers; ; And a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. The driver 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed on the drive 610 as necessary, so that the computer program read out therefrom is installed into the storage section 608 as needed.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分609从网络上被下载和安装,和/或从可拆卸介质611被安装。在该计算机程序被中央处理单元(CPU)601执行时,执行本申请的方法中限定的上述功能。需要说明的是,本申请所述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读 存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product that includes a computer program carried on a computer-readable medium, the computer program containing program code for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the method of the present application are executed. It should be noted that the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable removable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing. In this application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In this application, the computer-readable signal medium may include a data signal that is propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. . The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。The computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, the programming languages including object-oriented programming languages such as Java, Smalltalk, C ++, as well as conventional Procedural programming language-such as "C" language or similar programming language. The program code may be executed entirely on the user's computer, partly on the user's computer, as an independent software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In situations involving remote computers, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, through an Internet service provider Internet connection).
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时 也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the drawings illustrate the possible implementation architecture, functions, and operations of the system, method, and computer program product according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, program segment, or part of code that contains one or more logic functions Executable instructions. It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may actually be executed in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented with dedicated hardware-based systems that perform specified functions or operations Or, it can be realized by a combination of dedicated hardware and computer instructions.
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括系数矩阵转换单元501、系数矩阵优化单元502、矩阵信息嵌入单元503、数据矩阵转换单元504和信息图片生成单元505。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,系数矩阵优化单元还可以被描述为“得到中间频率域系数矩阵的单元”。The units described in the embodiments of the present application may be implemented in software or hardware. The described unit may also be provided in the processor, for example, it may be described as: a processor includes a coefficient matrix conversion unit 501, a coefficient matrix optimization unit 502, a matrix information embedding unit 503, a data matrix conversion unit 504, and information picture generation Unit 505. In some cases, the names of these units do not constitute a limitation on the unit itself. For example, the coefficient matrix optimization unit can also be described as "a unit that obtains the coefficient matrix of the intermediate frequency domain."
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的装置中所包含的;也可以是单独存在,而未装配入该装置中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该装置执行时,使得该装置:采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵;对原始频率域系数矩阵进行一次取整、量化以及二次取整,得到中间频率域系数矩阵,其中,一次取整及二次取整分别保留源数据的整数部分,去除源数据的小数部分;将待嵌入信息嵌入到中间频率域系数矩阵的直流系数中,得到已嵌入信息的频率域系数矩阵;采用第二变换矩阵,将已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵;基于已嵌入信息的空间域数据矩阵,生成已嵌入信息的图片。As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the foregoing embodiments; or may exist alone without being assembled into the device. The above computer readable medium carries one or more programs. When the above one or more programs are executed by the device, the device is caused to: use the first transformation matrix to convert the spatial domain data matrix of the screenshot into the original frequency domain coefficient matrix ; Perform primary rounding, quantization and secondary rounding on the original frequency domain coefficient matrix to obtain the intermediate frequency domain coefficient matrix, where the primary rounding and secondary rounding respectively retain the integer part of the source data and remove the fractional part of the source data ; Embed the information to be embedded into the DC coefficient of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information; use the second transformation matrix to convert the frequency domain coefficient matrix of the embedded information into the spatial domain of the embedded information Data matrix; generate a picture of embedded information based on the spatial data matrix of the embedded information.
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only the preferred embodiment of the present application and the explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solution formed by the specific combination of the above technical features, but should also cover the above technical features or without departing from the above inventive concept. Other technical solutions formed by arbitrary combinations of equivalent features. For example, a technical solution formed by replacing the above features with technical features disclosed in this application (but not limited to) but having similar functions.

Claims (21)

  1. 一种在图片中嵌入信息的方法,包括:A method of embedding information in a picture, including:
    采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵;The first transformation matrix is used to convert the spatial data matrix of the screenshot to the original frequency domain coefficient matrix;
    对所述原始频率域系数矩阵进行一次取整、量化以及二次取整,得到中间频率域系数矩阵,其中,所述一次取整及所述二次取整分别保留源数据的整数部分,去除源数据的小数部分;Perform primary rounding, quantization and secondary rounding on the original frequency domain coefficient matrix to obtain an intermediate frequency domain coefficient matrix, wherein the primary rounding and the secondary rounding respectively retain the integer part of the source data and remove Decimal part of source data;
    将待嵌入信息嵌入到所述中间频率域系数矩阵的直流系数中,得到已嵌入信息的频率域系数矩阵;Embedding the information to be embedded into the DC coefficient of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information;
    采用第二变换矩阵,将所述已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵;以及Using a second transformation matrix to convert the frequency information coefficient matrix of the embedded information into a spatial data matrix of the embedded information; and
    基于所述已嵌入信息的空间域数据矩阵,生成已嵌入信息的图片。Based on the spatial data matrix of the embedded information, a picture of the embedded information is generated.
  2. 根据权利要求1所述的方法,其中,所述截图的空间域数据矩阵中的数据包括亮度数据和色彩数据。The method according to claim 1, wherein the data in the spatial domain data matrix of the screenshot includes brightness data and color data.
  3. 根据权利要求1所述的方法,其中,所述将待嵌入信息嵌入到所述中间频率域系数矩阵的直流系数中,得到所述已嵌入信息的频率域系数矩阵,包括:The method according to claim 1, wherein the embedding the information to be embedded into the DC coefficient of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information includes:
    响应于确定直流系数对2取模后的余数与待嵌入信息比特不相同,保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作,得到所述已嵌入信息的频率域系数矩阵。In response to determining that the remainder after modulo 2 modulo 2 of the DC coefficient is different from the information bit to be embedded, the sign bit of the DC coefficient remains unchanged, and the value of the value bit of the DC coefficient is subtracted by 1 to obtain the frequency of the embedded information Domain coefficient matrix.
  4. 根据权利要求1所述的方法,其中,所述将待嵌入信息嵌入到所述中间频率域系数矩阵的直流系数中,得到所述已嵌入信息的频率域系数矩阵,包括:The method according to claim 1, wherein the embedding the information to be embedded into the DC coefficient of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information includes:
    将直流系数转化为以原码形式表示的二进制数据;以及Convert the DC coefficient to binary data expressed in original code; and
    响应于确定直流系数的最低位与待嵌入信息比特不相同,保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作,得 到所述已嵌入信息的频率域系数矩阵。In response to determining that the lowest bit of the DC coefficient is not the same as the information bit to be embedded, the sign bit of the DC coefficient is kept unchanged, and the value of the value bit of the DC coefficient is subtracted by 1 to obtain the frequency domain coefficient matrix of the embedded information.
  5. 根据权利要求1-4之一所述的方法,其中,所述采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵,包括:The method according to any one of claims 1 to 4, wherein the first transform matrix is used to convert the space domain data matrix of the screenshot to the original frequency domain coefficient matrix, including:
    将所述截图的空间域数据矩阵进行矩阵分割;以及Perform matrix division on the spatial data matrix of the screenshot; and
    采用离散傅里叶变换矩阵,对每个矩阵块进行转换,将所述截图的空间域数据矩阵转换为原始频率域系数矩阵。A discrete Fourier transform matrix is used to transform each matrix block, and the spatial domain data matrix of the screenshot is converted into the original frequency domain coefficient matrix.
  6. 根据权利要求1-4之一所述的方法,其中,所述采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵,包括:The method according to any one of claims 1 to 4, wherein the first transform matrix is used to convert the space domain data matrix of the screenshot to the original frequency domain coefficient matrix, including:
    将所述截图的空间域数据矩阵进行矩阵分割;以及Perform matrix division on the spatial data matrix of the screenshot; and
    采用离散余弦变换矩阵,对每个矩阵块进行转换,将所述截图的空间域数据矩阵转换为原始频率域系数矩阵。A discrete cosine transform matrix is used to transform each matrix block, and the spatial domain data matrix of the screenshot is converted into the original frequency domain coefficient matrix.
  7. 根据权利要求5所述的方法,其中,所述采用第二变换矩阵,将所述已嵌入信息的频率域系数矩阵转换为所述已嵌入信息的空间域数据矩阵,包括:The method according to claim 5, wherein the second transform matrix is used to convert the frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information, including:
    采用量化表,对所述已嵌入信息的频率域系数矩阵进行反向量化;以及Using a quantization table to inversely quantize the frequency domain coefficient matrix of the embedded information; and
    采用离散傅里叶变换的逆变换矩阵,将经过反向量化的所述已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。The inverse transform matrix of the discrete Fourier transform is used to convert the inversely quantized frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information.
  8. 根据权利要求6所述的方法,其中,所述采用第二变换矩阵,将所述已嵌入信息的频率域系数矩阵转换为所述已嵌入信息的空间域数据矩阵,包括:The method according to claim 6, wherein the second transform matrix is used to convert the frequency domain coefficient matrix of the embedded information into the spatial domain data matrix of the embedded information, including:
    采用量化表,对所述已嵌入信息的频率域系数矩阵进行反向量化;以及Using a quantization table to inversely quantize the frequency domain coefficient matrix of the embedded information; and
    采用反离散余弦变换矩阵,将经过反向量化的所述已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。An inverse discrete cosine transform matrix is used to convert the inversely quantized frequency domain coefficient matrix of the embedded information into a spatial domain data matrix of the embedded information.
  9. 根据权利要求6所述的方法,其中,所述将所述截图的空间域数据矩阵进行矩阵分割,包括:The method according to claim 6, wherein the matrix division of the spatial data matrix of the screenshot includes:
    将所述截图的空间域数据矩阵进行4*4或8*8或16*16的矩阵分割。The spatial data matrix of the screenshot is divided into 4 * 4, 8 * 8, or 16 * 16 matrices.
  10. 一种在图片中嵌入信息的装置,包括:A device for embedding information in a picture, including:
    系数矩阵转换单元,被配置成采用第一变换矩阵,将截图的空间域数据矩阵转换为原始频率域系数矩阵;The coefficient matrix conversion unit is configured to use the first transformation matrix to convert the screenshot spatial domain data matrix to the original frequency domain coefficient matrix;
    系数矩阵优化单元,被配置成对所述原始频率域系数矩阵进行一次取整、量化以及二次取整,得到中间频率域系数矩阵,其中,所述一次取整及所述二次取整分别保留源数据的整数部分,去除源数据的小数部分;The coefficient matrix optimization unit is configured to perform primary rounding, quantization, and secondary rounding on the original frequency domain coefficient matrix to obtain an intermediate frequency domain coefficient matrix, wherein the primary rounding and the secondary rounding are respectively Keep the integer part of the source data and remove the fractional part of the source data;
    矩阵信息嵌入单元,被配置成将待嵌入信息嵌入到所述中间频率域系数矩阵的直流系数中,得到已嵌入信息的频率域系数矩阵;The matrix information embedding unit is configured to embed the information to be embedded into the DC coefficients of the intermediate frequency domain coefficient matrix to obtain the frequency domain coefficient matrix of the embedded information;
    数据矩阵转换单元,被配置成采用第二变换矩阵,将所述已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵;以及A data matrix conversion unit configured to use a second transformation matrix to convert the frequency domain coefficient matrix of the embedded information into a spatial domain data matrix of the embedded information; and
    信息图片生成单元,被配置成基于所述已嵌入信息的空间域数据矩阵,生成已嵌入信息的图片。The information picture generating unit is configured to generate a picture of embedded information based on the spatial data matrix of the embedded information.
  11. 根据权利要求10所述的装置,其中,所述系数矩阵转换单元中所述截图的空间域数据矩阵中的数据包括亮度数据和色彩数据。The apparatus according to claim 10, wherein the data in the spatial domain data matrix of the screenshot in the coefficient matrix conversion unit includes luminance data and color data.
  12. 根据权利要求10所述的装置,其中,所述矩阵信息嵌入单元进一步被配置成:The apparatus according to claim 10, wherein the matrix information embedding unit is further configured to:
    响应于确定直流系数对2取模后的余数与待嵌入信息比特不相同,保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作,得到所述已嵌入信息的频率域系数矩阵。In response to determining that the remainder after modulo 2 modulo 2 of the DC coefficient is different from the information bit to be embedded, the sign bit of the DC coefficient remains unchanged, and the value of the value bit of the DC coefficient is subtracted by 1 to obtain the frequency of the embedded information Domain coefficient matrix.
  13. 根据权利要求10所述的装置,其中,所述矩阵信息嵌入单元包括:The apparatus according to claim 10, wherein the matrix information embedding unit comprises:
    数据转化模块,被配置成将直流系数转化为以原码形式表示的二进制数据;以及A data conversion module configured to convert the DC coefficient into binary data expressed in original code; and
    信息嵌入模块,被配置成响应于确定直流系数的最低位与待嵌入信息比特不相同,保留直流系数的符号位不变,对直流系数的数值位的数值进行减1操作,得到所述已嵌入信息的频率域系数矩阵。The information embedding module is configured to, in response to determining that the lowest bit of the DC coefficient is not the same as the information bit to be embedded, leave the sign bit of the DC coefficient unchanged, and subtract 1 from the value of the DC coefficient value to obtain the embedded Information frequency coefficient matrix.
  14. 根据权利要求10-13之一所述的装置,其中,所述系数矩阵转换单元包括:The apparatus according to any one of claims 10-13, wherein the coefficient matrix conversion unit includes:
    第一矩阵分割模块,被配置成将所述截图的空间域数据矩阵进行矩阵分割;以及A first matrix segmentation module configured to perform matrix segmentation on the spatial data matrix of the screenshot; and
    离散傅里叶变换模块,被配置成采用离散傅里叶变换矩阵,对每个矩阵块进行转换,将所述截图的空间域数据矩阵转换为原始频率域系数矩阵。The discrete Fourier transform module is configured to use a discrete Fourier transform matrix to convert each matrix block, and convert the spatial data matrix of the screenshot into the original frequency domain coefficient matrix.
  15. 根据权利要求10-13之一所述的装置,其中,所述系数矩阵转换单元包括:The apparatus according to any one of claims 10-13, wherein the coefficient matrix conversion unit includes:
    第二矩阵分割模块,被配置成将所述截图的空间域数据矩阵进行矩阵分割;以及A second matrix segmentation module configured to perform matrix segmentation on the spatial data matrix of the screenshot; and
    离散余弦变换模块,被配置成采用离散余弦变换矩阵,对每个矩阵块进行转换,将所述截图的空间域数据矩阵转换为原始频率域系数矩阵。The discrete cosine transform module is configured to use the discrete cosine transform matrix to convert each matrix block, and convert the spatial data matrix of the screenshot into the original frequency domain coefficient matrix.
  16. 根据权利要求14所述的装置,其中,所述数据矩阵转换单元包括:The apparatus according to claim 14, wherein the data matrix conversion unit comprises:
    第一反向量化模块,被配置成采用量化表,对所述已嵌入信息的频率域系数矩阵进行反向量化;以及A first inverse quantization module configured to inversely quantize the frequency domain coefficient matrix of the embedded information using a quantization table; and
    离散傅里叶变换的逆变换模块,被配置成采用离散傅里叶变换的逆变换矩阵,将经过反向量化的所述已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。The inverse transform module of the discrete Fourier transform is configured to use the inverse transform matrix of the discrete Fourier transform to convert the frequency domain coefficient matrix of the embedded information after inverse quantization into the spatial domain data matrix of the embedded information .
  17. 根据权利要求14所述的装置,其中,所述第一矩阵分割模块进一步被配置成:The apparatus of claim 14, wherein the first matrix division module is further configured to:
    将所述截图的空间域数据矩阵进行4*4或8*8或16*16的矩阵分割。The spatial data matrix of the screenshot is divided into 4 * 4, 8 * 8, or 16 * 16 matrices.
  18. 根据权利要求15所述的装置,其中,所述数据矩阵转换单元包括:The apparatus according to claim 15, wherein the data matrix conversion unit comprises:
    第二反向量化模块,被配置成采用量化表,对所述已嵌入信息的频率域系数矩阵进行反向量化;以及A second inverse quantization module configured to inversely quantize the frequency domain coefficient matrix of the embedded information using a quantization table; and
    反离散余弦变换模块,被配置成采用反离散余弦变换矩阵,将经过反向量化的所述已嵌入信息的频率域系数矩阵转换为已嵌入信息的空间域数据矩阵。The inverse discrete cosine transform module is configured to use an inverse discrete cosine transform matrix to convert the inversely quantized frequency domain coefficient matrix of the embedded information into a spatial domain data matrix of the embedded information.
  19. 根据权利要求15所述的装置,其中,所述第二矩阵分割模块进一步被配置成:The apparatus of claim 15, wherein the second matrix division module is further configured to:
    将所述截图的空间域数据矩阵进行4*4或8*8或16*16的矩阵分割。The spatial data matrix of the screenshot is divided into 4 * 4, 8 * 8, or 16 * 16 matrices.
  20. 一种电子设备,包括:An electronic device, including:
    一个或多个处理器;One or more processors;
    存储装置,用于存储一个或多个程序;Storage device for storing one or more programs;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-9中任一所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-9.
  21. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述程序被处理器执行时实现如权利要求1-9中任一所述的方法。A computer-readable storage medium on which a computer program is stored, wherein when the program is executed by a processor, the method according to any one of claims 1-9 is implemented.
PCT/CN2019/103578 2018-11-06 2019-08-30 Method and device for embedding information in image WO2020093769A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811312281.9 2018-11-06
CN201811312281.9A CN111147864B (en) 2018-11-06 2018-11-06 Method and device for embedding information in picture

Publications (1)

Publication Number Publication Date
WO2020093769A1 true WO2020093769A1 (en) 2020-05-14

Family

ID=70516064

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103578 WO2020093769A1 (en) 2018-11-06 2019-08-30 Method and device for embedding information in image

Country Status (2)

Country Link
CN (1) CN111147864B (en)
WO (1) WO2020093769A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115955534A (en) * 2023-03-12 2023-04-11 江西财经大学 Secret embedding and sharing method, system, terminal and medium based on compressed sensing

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112040337B (en) * 2020-09-01 2022-04-15 腾讯科技(深圳)有限公司 Video watermark adding and extracting method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050074139A1 (en) * 2003-10-02 2005-04-07 Seo Yong Seok Method for embedding and extracting digital watermark on lowest wavelet subband
CN102547297A (en) * 2012-02-28 2012-07-04 中国传媒大学 MPEG2 (Moving Picture Experts Group 2) video watermarking realization method based on DC (Discrete Cosine) coefficient
CN103366336A (en) * 2013-07-12 2013-10-23 陕西理工学院 Image watermarking method based on human eye contrast ratio sensitivity visual characteristics
CN104021516A (en) * 2014-06-09 2014-09-03 河海大学 Image watermarking method based on DCT direct-current coefficients of Weibull model
CN106648424A (en) * 2016-11-23 2017-05-10 广州华多网络科技有限公司 Screenshot method and apparatus

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000151973A (en) * 1998-11-10 2000-05-30 Canon Inc Information processor, information processing method and storage medium
KR100624751B1 (en) * 2003-04-25 2006-09-19 (주)마크텍 A method for embedding watermark into an image and digital video recoreder using said method
US7792377B2 (en) * 2007-04-25 2010-09-07 Huper Laboratories Co., Ltd. Method of image authentication and restoration
CN102014239A (en) * 2009-09-08 2011-04-13 周岩 High-capacity steganographic method based on JPEG (Joint Photographic Experts Group) digital image
US8774451B2 (en) * 2011-04-28 2014-07-08 King Abdul Aziz City for Science and Technology (KACST) Method and apparatus for embedding a watermark image in a host image
CN105426709B (en) * 2015-11-12 2016-10-12 福建北卡科技有限公司 Private information communication means based on jpeg image Information hiding and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050074139A1 (en) * 2003-10-02 2005-04-07 Seo Yong Seok Method for embedding and extracting digital watermark on lowest wavelet subband
CN102547297A (en) * 2012-02-28 2012-07-04 中国传媒大学 MPEG2 (Moving Picture Experts Group 2) video watermarking realization method based on DC (Discrete Cosine) coefficient
CN103366336A (en) * 2013-07-12 2013-10-23 陕西理工学院 Image watermarking method based on human eye contrast ratio sensitivity visual characteristics
CN104021516A (en) * 2014-06-09 2014-09-03 河海大学 Image watermarking method based on DCT direct-current coefficients of Weibull model
CN106648424A (en) * 2016-11-23 2017-05-10 广州华多网络科技有限公司 Screenshot method and apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WANG XIANGZANG ET AL: "A novel image watermarking algorithm in DCT domain", NATURAL SCIENCE EDITION, vol. 28, no. 1, 31 March 2005 (2005-03-31), XP009520993, ISSN: 1000-1735 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115955534A (en) * 2023-03-12 2023-04-11 江西财经大学 Secret embedding and sharing method, system, terminal and medium based on compressed sensing

Also Published As

Publication number Publication date
CN111147864A (en) 2020-05-12
CN111147864B (en) 2022-07-05

Similar Documents

Publication Publication Date Title
US20210034696A1 (en) Bezier volume representation of point cloud attributes
CN111670441B (en) System and method for embedding data in remote session display
US20190188836A1 (en) Method and apparatus for processing image
JP7123910B2 (en) Quantizer with index coding and bit scheduling
CN108090885B (en) Method and apparatus for processing image
WO2020093769A1 (en) Method and device for embedding information in image
WO2023050829A1 (en) Video frame processing method and apparatus, and electronic device and storage medium
US8155457B2 (en) Robust encoding of metadata in lossy encoded images
CN113411660B (en) Video data processing method and device and electronic equipment
CN111311486A (en) Method and apparatus for processing image
CN110891195B (en) Method, device and equipment for generating screen image and storage medium
US20120005587A1 (en) Performing Remoting Operations For Different Regions Of A Display Surface At Different Rates
CN110751251A (en) Method and device for generating and transforming two-dimensional code image matrix
US10609368B2 (en) Multiple image storage compression tree
KR20160082521A (en) Chroma down-conversion and up-conversion processing
CN112330760A (en) Picture transcoding method, device, equipment and storage medium
CN111967001A (en) Decoding and coding safety isolation method based on double containers
US20240144425A1 (en) Image compression augmented with a learning-based super resolution model
CN113419776B (en) Application compatibility method, computer device, and storage medium
JP2019165434A (en) Method and apparatus for generating hdr image with reduced clipped area
CN112215774B (en) Model training and image defogging methods, apparatus, devices and computer readable media
US11503341B1 (en) Perceptually motivated video pre-filter
WO2023231710A1 (en) Picture processing method and related device
US11882301B2 (en) Modified quantizer
CN110430175B (en) Encryption protocol implanting method, device and equipment based on AC35 platform

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19882485

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.08.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19882485

Country of ref document: EP

Kind code of ref document: A1