CN110084733B - Text image watermark embedding method and system and text image watermark extracting method and system - Google Patents

Text image watermark embedding method and system and text image watermark extracting method and system Download PDF

Info

Publication number
CN110084733B
CN110084733B CN201910317711.4A CN201910317711A CN110084733B CN 110084733 B CN110084733 B CN 110084733B CN 201910317711 A CN201910317711 A CN 201910317711A CN 110084733 B CN110084733 B CN 110084733B
Authority
CN
China
Prior art keywords
watermark
coefficient matrix
text image
block
embedded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910317711.4A
Other languages
Chinese (zh)
Other versions
CN110084733A (en
Inventor
关虎
王玉莹
张树武
牛保宁
黄樱
张桂煊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Automation of Chinese Academy of Science
Original Assignee
Institute of Automation of Chinese Academy of Science
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 Institute of Automation of Chinese Academy of Science filed Critical Institute of Automation of Chinese Academy of Science
Priority to CN201910317711.4A priority Critical patent/CN110084733B/en
Publication of CN110084733A publication Critical patent/CN110084733A/en
Application granted granted Critical
Publication of CN110084733B publication Critical patent/CN110084733B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2201/00General purpose image data processing
    • G06T2201/005Image watermarking
    • G06T2201/0062Embedding of the watermark in text images, e.g. watermarking text documents using letter skew, letter distance or row distance

Abstract

The invention provides a text image watermark embedding method and system, and a text image watermark extracting method and system, wherein the embedding method comprises the following steps: after the input watermark is encrypted for the second time, the watermark to be embedded is obtained through error correction coding; performing two-stage discrete wavelet transform on the text image to obtain four first frequency band coefficient matrixes; carrying out block discrete cosine transform on the first frequency band coefficient matrix to obtain a corresponding first block coefficient matrix; selecting an intermediate frequency coefficient for each first block coefficient matrix, and embedding a watermark by modifying the coefficient to obtain each first block coefficient matrix embedded with the watermark; and performing inverse discrete cosine transform and inverse discrete wavelet transform on each first block coefficient matrix after the watermark is embedded to obtain a text image embedded with the watermark. The embodiment of the invention improves the robustness of resisting the attacks such as compression, noise, shearing and the like and the algorithm safety of the watermark on the premise of ensuring the invisibility of the watermark.

Description

Text image watermark embedding method and system and text image watermark extracting method and system
Technical Field
The invention belongs to the field of digital media copyright protection, and particularly relates to a text image watermark embedding method and system, and a text image watermark extracting method and system.
Background
With the development of internet technology and the rapid popularization of digital information, the spread of digital media is increasingly wide, and the digital media has the characteristics of easy spread, low cost and the like. People are also at risk of pirating and tampering the digital media content while conveniently acquiring the digital media. Therefore, the digital media needs to be properly processed before being released, and the digital watermarking technology is an effective digital media copyright protection technology, can verify piracy and tampering behaviors, and realizes copyright protection of digital works. The research on the watermarking technology of the text as a common digital medium is also continuously in depth. The text digital watermark refers to digital information with identification permanently embedded in the text, and the embedded watermark should not influence the usability of the text. The text digital watermark has the characteristics of robustness, invisibility, safety, large capacity and the like. The text digital watermarking algorithm is mainly divided into an editing environment text watermarking algorithm and a text image watermarking algorithm. The text watermarking algorithm of the editing environment needs to embed the watermark into the control code of the specific format of the document by means of an editor according to the specific format of the editing environment. The algorithm needs a special editing environment and has small application range. The data content using text image as carrier is the main part of digital text transmission, and the text image is mostly gray scale image and binary image, and its format includes black and white picture, document, signature, check, contract, certificate and seal, etc. The text image watermarking algorithm utilizes the characteristics of rich texture, uniform distribution and the like of a text image to embed watermarks by improving and applying the traditional image watermarking algorithm.
The text image watermarking algorithm is divided into a spatial domain algorithm and a transform domain algorithm according to an embedding position. The spatial domain algorithm mainly comprises algorithms of line shift, word shift, character characteristics, semantics and the like, and the algorithms are characterized in that watermark information is directly embedded into pixels of a text image without preprocessing, the operation is simple, but the resistance to attacks such as rotation, scaling, noise addition, shaking and the like is poor, and the actual requirements cannot be met. The transform domain algorithm is to transform the text image pixels to a certain frequency domain, and then modify the frequency domain coefficients according to a certain rule to achieve the purpose of embedding the watermark. Compared with a spatial domain algorithm, although the execution process of the transform domain algorithm is more complex, the performance in the aspects of noise resistance, compression resistance and the like is better, and the method is a more practical algorithm. The transforms commonly used in transform domain algorithms include discrete cosine transform, discrete wavelet transform, discrete fourier transform, singular value decomposition, and the like. The watermarking algorithm of a single transform domain generally only applies a matrix transform, and then embeds the watermark into regions with higher energy of the text image, the regions concentrate main content characteristics of the text image, and the embedded watermark can cause interference to the text image, so that the invisibility and the robustness of the watermark are influenced to a certain extent. Moreover, the various transform domain algorithms have different resistance to the same kind of attacks, and cannot meet the requirement of better resistance to various kinds of attacks. In the process of network propagation, if the text image is interfered by an attack, the accuracy rate of extracting the watermark is further reduced, and the robustness is not high. The watermark should ensure that an illegal or malicious attacker cannot acquire important information from the text image or tamper and forge the text image. In order to ensure the security of the watermark, the watermark needs to be scrambled and encrypted before being embedded, but once the encryption algorithm is disclosed, the secret key is easy to crack, and the security of the watermark cannot be guaranteed.
Disclosure of Invention
In order to solve the above problems in the prior art, that is, to solve the problems of invisibility, robustness and algorithm security of the watermark, the invention provides a method and a system for embedding a text image watermark, and correspondingly provides a method and a system for extracting a text image watermark.
In a first aspect of the present invention, a method for embedding a text image watermark is provided, where the method includes the following steps:
carrying out secondary encryption on the input watermark to obtain a secondary encrypted watermark;
carrying out error correction coding on the secondary encrypted watermark to obtain a watermark to be embedded;
performing two-level discrete wavelet transform on the text image to be embedded with the watermark to obtain four first frequency band coefficient matrixes; carrying out block discrete cosine transform on the first frequency band coefficient matrix to obtain a corresponding first block coefficient matrix;
selecting an intermediate frequency coefficient for each first block coefficient matrix, and embedding a watermark by modifying the coefficient to obtain each first block coefficient matrix embedded with the watermark;
and performing inverse discrete cosine transform and inverse discrete wavelet transform on each first block coefficient matrix after the watermark is embedded to obtain a text image embedded with the watermark.
In some preferred embodiments, the "twice encrypting the input watermark to obtain a twice encrypted watermark" includes:
scrambling and encrypting the input watermark to obtain a primary encrypted watermark;
performing one-level discrete wavelet transform on the text image to be embedded with the watermark to obtain LL1A subgraph coefficient matrix; for the LL1And carrying out global discrete cosine transform on the sub-image coefficient matrix to obtain a first discrete cosine transform coefficient matrix.
Constructing a characteristic vector based on the first discrete cosine transform coefficient matrix, and extracting a first characteristic sequence; and carrying out bitwise XOR on the first characteristic sequence and each column of the primary encrypted watermark to obtain a secondary encrypted watermark.
In some preferred embodiments, before the "one-level discrete wavelet transform of the text image to be embedded with the watermark", the method further comprises a step of resizing the text image to be embedded with the watermark:
when G is<N × 32 or H<When Nx 32, the text image to be embedded with the watermark is amplified in small scale until the height H is obtained1Width of G1The enlarged text image of (a);
g, H represents the width and height of the text image to be embedded with watermark, NXN represents the size of the watermark image, and G represents the total size of the text image1、H1Are all divisible by 8, are respectively equal to or greater than G, H, and G1≥N×32、H1The minimum positive integer of more than or equal to Nx 32.
In some preferred embodiments, the method for "constructing a feature vector based on a first discrete cosine transform coefficient matrix and extracting a first feature sequence" includes:
rearranging the shape of the coefficients in the first matrix of discrete cosine transform from the low frequency component to the high frequency component;
taking out the first S multiplied by N low-frequency coefficients except the direct-current component according to the arrangement sequence to form a coefficient sequence MLL(ii) a Wherein S is odd and satisfies 3 ≤ S ≤ ((G × G/4-1)/N), 3 ≤ S ≤ ((H × H/4-1)/N, MLL=[u0,u1,u2…uS×N-1];
According to a preset threshold value, the coefficient sequence MLLWherein each coefficient is represented by 0 or 1 to give a sequence M'LL
N is length pair M'LLDividing to obtain S eigenvectors with the length of N, wherein the eigenvector group is U ═ U0,U1,…Ui,…,US-1]Wherein, Ui=[u′0,u1′,…u′j,…u′N-1];
And traversing U, and taking a mode value from the feature values with the same subscript in each feature vector to obtain a first feature sequence V with the calculated mode value as a feature value, wherein the length of the first feature sequence V is N.
In some preferred embodiments, the method for performing block discrete cosine transform on the first frequency band coefficient matrix to obtain a corresponding first block coefficient matrix includes:
for each first band coefficient matrix, performing the steps of:
according to a preset size R multiplied by R, a first frequency band coefficient matrix is partitioned into O coefficient blocks which do not overlap with each other, wherein O is L multiplied by N, L is N + k, k is a detection bit number in error correction coding, and N multiplied by N is the size of a watermark image;
performing discrete cosine transform on each coefficient block to obtain O transform coefficient matrix blocks, and using Di,jRepresents where i ∈ { i |1 ∈<i<L},j∈{j|1<j<N};
And splicing the O transformation coefficient matrix blocks in sequence to obtain a first block coefficient matrix.
In some preferred embodiments, "for each first block coefficient matrix, selecting an intermediate frequency coefficient, and embedding a watermark by modifying the coefficient to obtain each first block coefficient matrix after embedding the watermark", the method includes:
for each transform coefficient matrix block D of each first block coefficient matrixi,jSelecting two intermediate frequency coefficients Di,j(a, b) and Di,j(b, a) wherein a ∈ [1, R ]],b∈[1,R];
Reading the watermark W to be embedded bit by bitHEmbedding the watermark according to the following rules:
if WH(i, j) ═ 0 andDi,j(a,b)<Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(a,b)-Di,j(b,a)<When t is, let Di,j(a,b)=Di,j(a,b)+(t/2)、Di,j(b,a)=Di,j(b, a) - (t/2); if WH(i, j) ═ 1 and Di,j(a,b)>Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(b,a)-Di,j(a,b)<When t is, let Di,j(b,a)=Di,j(b,a)+(t/2)、Di,j(a,b)=Di,j(a,b)-(t/2);
Or
If WH(i, j) ═ 1 and Di,j(a,b)<Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(a,b)-Di,j(b,a)<When t is, let Di,j(a,b)=Di,j(a,b)+(t/2)、Di,j(b,a)=Di,j(b, a) - (t/2); if WH(i, j) ═ 0 and Di,j(a,b)>Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(b,a)-Di,j(a,b)<When t is, let Di,j(b,a)=Di,j(b,a)+(t/2)、Di,j(a,b)=Di,j(a,b)-(t/2);
Wherein t is the watermark embedding strength, and satisfies t>|Di,j(a,b)-Di,j(b,a)|;WH(i, j) is a binary representation of the ith row and the jth column of the watermark to be embedded.
In a second aspect of the present invention, a method for extracting a text image watermark is provided, where the method includes the following steps:
performing two-level discrete wavelet transform on the text image of the watermark to be extracted to obtain four second frequency band coefficient matrixes; performing block discrete cosine transform on the second frequency band coefficient matrix to determine a corresponding second block coefficient matrix;
selecting an extraction coefficient based on the second block coefficient matrix, and extracting the watermark to obtain the watermark to be decoded;
carrying out error correction decoding processing on the watermark to be decoded to obtain the watermark to be decrypted;
and carrying out secondary decryption on the watermark to be decrypted to obtain finally extracted watermark information.
In some preferred embodiments, the method of selecting an extraction coefficient based on the second block coefficient matrix to perform watermark extraction to obtain a watermark to be decoded includes:
acquiring watermark information corresponding to each second frequency band coefficient matrix through the following formula:
Figure BDA0002033653850000061
or
Figure BDA0002033653850000062
Wherein the content of the first and second substances,
Figure BDA0002033653850000063
two intermediate frequency coefficients in one transformation coefficient matrix block in the second block coefficient matrix; n is the serial number of the second frequency band coefficient matrix, and n is 1,2,3, 4; a is an element of [1, R ∈],b∈[1,R]The R multiplied by R is a preset size, and the second frequency band coefficient matrix is partitioned into a plurality of coefficient blocks which do not overlap with each other according to the preset size;
reading the W bit by bit* H1,W* H2,W* H3,W* H4The data values of the same subscript in the four watermark information are taken as the data values of the subscript corresponding to the extracted watermark, and the watermark W to be decoded is obtained* H
In some preferred embodiments, the "performing secondary decryption on the watermark to be decrypted to obtain finally extracted watermark information" specifically includes:
performing one-level discrete wavelet transform on the text image of the watermark to be extracted to obtain
Figure BDA0002033653850000064
Subgraph coefficient matrix, obtained by
Figure BDA0002033653850000065
Carrying out global discrete cosine transform on the sub-image coefficient matrix to obtain a corresponding second discrete cosine transform coefficient matrix;
constructing a characteristic vector based on the second discrete cosine transform coefficient matrix, and extracting a second characteristic sequence; performing bitwise XOR on the second characteristic sequence and the watermark to be decrypted to obtain the watermark subjected to primary decryption;
and scrambling and decrypting the watermark subjected to the primary decryption by adopting a method opposite to the embedding process to obtain decrypted watermark information.
The third aspect of the invention provides an embedding system of a text image watermark, which comprises a secondary encryption watermark acquisition unit, a watermark acquisition unit to be embedded, a first block coefficient matrix acquisition unit, a watermark embedding unit and a matrix inverse transformation unit;
the secondary encryption watermark obtaining unit is configured to perform secondary encryption on the input watermark to obtain a secondary encryption watermark;
the to-be-embedded watermark acquisition unit is configured to perform error correction coding on the secondary encrypted watermark to obtain the to-be-embedded watermark;
the first block coefficient matrix obtaining unit is configured to perform two-level discrete wavelet transform on the text image to be embedded with the watermark to obtain four first frequency band coefficient matrices; carrying out block discrete cosine transform on the first frequency band coefficient matrix to obtain a corresponding first block coefficient matrix;
the watermark embedding unit is configured to select an intermediate frequency coefficient for each first block coefficient matrix, and obtain each first block coefficient matrix after embedding the watermark by modifying the coefficient to embed the watermark;
and the matrix inverse transformation unit is configured to perform inverse discrete cosine transformation and inverse discrete wavelet transformation on each first block coefficient matrix after the watermark is embedded, so as to obtain a text image embedded with the watermark.
The fourth aspect of the invention provides a system for extracting a text image watermark, which comprises a second block coefficient matrix acquisition unit, a watermark acquisition unit to be decoded, a watermark acquisition unit to be decrypted and a watermark decryption unit;
the second block coefficient matrix acquisition unit is configured to perform two-level discrete wavelet transform on the text image of the watermark to be extracted to obtain four second frequency band coefficient matrices; performing block discrete cosine transform on the second frequency band coefficient matrix to determine a corresponding second block coefficient matrix;
the watermark acquisition unit to be decoded is configured to select an extraction coefficient based on the second block coefficient matrix, and extract the watermark to obtain the watermark to be decoded;
the watermark acquisition unit to be decrypted is configured to perform error correction decoding processing on the watermark to be decoded to obtain the watermark to be decrypted;
and the watermark decryption unit is configured to decrypt the watermark to be decrypted for the second time to obtain the finally extracted watermark information.
The invention has the beneficial effects that:
the invention combines the scrambling encryption and the characteristic sequence to carry out secondary encryption, utilizes the scrambling encryption algorithm to carry out primary encryption on the input watermark, extracts the stable characteristic sequence of the text image and carries out secondary encryption on the primary encrypted watermark, thereby improving the security of embedding the watermark and reducing the risk that the watermark is identified and maliciously erased. The encrypted watermark is subjected to error correction coding and decoding, and the accuracy of watermark extraction can be improved.
According to the texture distribution characteristics of the text image, the text image to be embedded with the watermark is processed by utilizing the combined transformation of the discrete wavelet transformation and the discrete cosine transformation, the hidden embedding and blind extraction of the text image watermark are realized by combining the multi-scale and multi-resolution analysis characteristics of the discrete wavelet transformation and the energy concentration and decorrelation capabilities of the discrete cosine transformation, meanwhile, the invisibility of the watermark and the robustness of resisting the attacks such as shearing, noise, JPEG (joint photographic experts group) compression and the like are improved, and the problems of copyright protection, infringement authentication and the like of the text image in the transmission and use process are solved to a certain extent.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments with reference to the attached drawings in which:
fig. 1 is a flowchart illustrating a method of embedding a text image watermark according to an exemplary embodiment;
fig. 2 is an exemplary diagram illustrating a binary watermark image of 26 × 26 size according to an exemplary embodiment;
FIG. 3a is a diagram illustrating an example of a text image prior to embedding a watermark in accordance with one illustrative embodiment;
FIG. 3b is a diagram illustrating an example of a text image after embedding a watermark in accordance with an illustrative embodiment;
FIG. 3c is a diagram illustrating an exemplary distribution of coefficient matrices and blocking during text image embedding or extraction, according to an illustrative embodiment;
FIG. 3d is a block coefficient matrix and an example of selecting intermediate frequency coefficients in a text image embedding or extraction process, according to an example embodiment;
FIG. 4 is a flowchart illustrating a method of extracting a watermark from a text image according to an exemplary embodiment;
FIG. 5 is a diagram illustrating an example of the results of an experiment performed on the watermarked text image shown in FIG. 3b after JPEG compression at a quality factor of 30% to 90%, according to an example embodiment;
FIG. 6 is an exemplary graph illustrating the results of a Gaussian noise test with a mean of 0 and a variance of 0.001 to 0.025 on the text image of FIG. 3b in accordance with one illustrative embodiment;
FIG. 7 is an exemplary graph illustrating experimental results after passing Salt & Pepper noise with energy of 0.005 to 0.05 for the text image shown in FIG. 3b in accordance with one illustrative embodiment;
FIG. 8 illustrates an exemplary diagram of the text image of FIG. 3b clipped via the top left corner 1/4 in accordance with one illustrative embodiment;
FIG. 9a is an exemplary diagram illustrating a watermark extracted from the text image shown in FIG. 3b by a correct key according to one exemplary embodiment;
FIG. 9b is an exemplary diagram illustrating a watermark extracted from the text image shown in FIG. 3b by an Arnold transformation error key in accordance with one illustrative embodiment;
fig. 9c is an exemplary diagram illustrating a watermark extracted from the text image shown in fig. 3b by a secondary decryption error key according to an exemplary embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
The invention discloses a method for embedding a text image watermark, which comprises the following steps:
carrying out secondary encryption on the input watermark to obtain a secondary encrypted watermark;
carrying out error correction coding on the secondary encrypted watermark to obtain a watermark to be embedded;
performing two-level discrete wavelet transform on the text image to be embedded with the watermark to obtain four first frequency band coefficient matrixes; carrying out block discrete cosine transform on the first frequency band coefficient matrix to obtain a corresponding first block coefficient matrix;
selecting an intermediate frequency coefficient for each first block coefficient matrix, and embedding a watermark by modifying the coefficient to obtain each first block coefficient matrix embedded with the watermark;
and performing inverse discrete cosine transform and inverse discrete wavelet transform on each first block coefficient matrix after the watermark is embedded to obtain a text image embedded with the watermark.
The invention discloses a method for extracting a text image watermark, which comprises the following steps:
performing two-level discrete wavelet transform on the text image of the watermark to be extracted to obtain four second frequency band coefficient matrixes; performing block discrete cosine transform on the second frequency band coefficient matrix to determine a corresponding second block coefficient matrix;
selecting an extraction coefficient based on the second block coefficient matrix, and extracting the watermark to obtain the watermark to be decoded;
carrying out error correction decoding processing on the watermark to be decoded to obtain the watermark to be decrypted;
and carrying out secondary decryption on the watermark to be decrypted to obtain finally extracted watermark information.
In order to more clearly illustrate the present invention, the steps of one embodiment of the present invention are described in detail below with reference to the accompanying drawings.
In an embodiment of the present invention, as shown in fig. 1, the method for embedding a text image watermark includes steps S100 to S140:
and step S100, carrying out secondary encryption on the input watermark to obtain a secondary encrypted watermark.
Here, the watermark is a watermark image representing copyright information, and refers to a binary image composed of only 0 and 1, and fig. 2 exemplarily shows a binary image of 26 × 26 size as a watermark image. The watermark embedding is performed using a text image shown in fig. 3a that is 1024 in width and height.
By carrying out secondary encryption operation on the watermark in the step, the energy information represented by the watermark can be more secret, so that invisibility and robustness of the watermark can be embodied.
Specifically, the step may include: step S101 to step S103.
Step S101, scrambling and encrypting the input watermark to obtain a primary encrypted watermark.
The Arnold scrambling transformation can well realize the scrambling encryption processing of the watermark. The encryption algorithm based on Arnold transformation completes encryption through pixel position transformation, has good information hiding effect, and is the most common watermark encryption algorithm. Watermark scrambling is performed according to the following formula:
Figure BDA0002033653850000111
wherein x and y are coordinates of pixel points to be embedded with watermarks; x 'and y' are coordinates of the pixel points after iterative operation scrambling; n is the size, also referred to as the order, of the watermark image to be embedded. After multiple iterations, the iteration times are saved as key keys, and the key keys are set, so that the algorithm safety is improved, and correct watermark information cannot be decrypted under the condition of using wrong keys; the original watermark is restored by the inverse transformation formula through the corresponding iteration times. In the preferred embodiment, the number of iterations is set to 10, which is stored as the encryption key. In other embodiments, other similar scrambling encryption methods, such as Logistic chaotic scrambling encryption, may also be used.
Step S102, carrying out one-level discrete wavelet transform on the text image to be embedded with the watermark to obtain LL1A subgraph coefficient matrix; for the LL1And carrying out global discrete cosine transform on the sub-image coefficient matrix to obtain a first discrete cosine transform coefficient matrix.
In this embodiment, the size of the watermark image is N × N, the width of the text image to be embedded with the watermark is G, the height of the text image to be embedded with the watermark is H, and the scale of the text image to be embedded with the watermark is adjusted according to the following rules:
if G meets the condition that G is more than or equal to Nx 32 and H meets the condition that H is more than or equal to Nx 32, performing one-level discrete wavelet transform on the text image to be embedded with the watermark to obtain LL1Subgraph coefficient matrix, pair LL1Carrying out global discrete cosine transform on the sub-image coefficient matrix to obtain a first discrete cosine transform coefficient matrix;
if G is not more than G and not less than Nx 32, or H is not more than H and not more than Nx 32, the text image to be embedded with the watermark needs to be amplified in a small scale until the height H is obtained1Width of G1The amplified text image to be embedded with the watermark; wherein the height H1And width G1Is the smallest positive integer that satisfies the following condition: the height H1And width G1All of which can be evenly divided by 8 and are respectively more than or equal to the height H and the width G; performing one-level discrete wavelet transform on the small-scale amplified text image to be embedded with the watermark to obtain LL1Subgraph coefficient matrix, pair LL1And carrying out global discrete cosine transform on the sub-image coefficient matrix to obtain a first discrete cosine transform coefficient matrix.
Step S103, constructing a characteristic vector based on the first discrete cosine transform coefficient matrix, and extracting a first characteristic sequence; and carrying out bitwise XOR on the first characteristic sequence and each column of the primary encrypted watermark to obtain a secondary encrypted watermark.
All coefficients in the first matrix of discrete cosine transform coefficients are arranged in a zigzag order with low frequency components preceding and high frequency components succeeding.
Taking out the first S multiplied by N low-frequency coefficients except the direct-current component according to the arrangement sequence to form a coefficient sequence MLL(ii) a Wherein S is an odd number, S is more than or equal to 3 and less than or equal to ((GXG/4-1)/N), S is more than or equal to 3 and less than or equal to ((HXH/4-1)/N), G and H are respectively the width and height of a text image to be embedded with a watermark after small-scale amplification (if any), N is the size of the watermark image, G is more than or equal to NX 32, H is more than or equal to NX 32, the values of G and H in the embodiment are 1024, and the value of N is 26.
According to the coefficient sequence MLLWherein each coefficient is represented by "0" or "1" to give a sequence M'LL. M 'is obtained by comparing with a preset threshold value in the embodiment'LLThe formula is as follows:
Figure BDA0002033653850000131
or
Figure BDA0002033653850000132
Wherein M isLLiRepresents MLLCoefficient of the ith, M'LLiRepresents M'LLThe ith coefficient.
N is length pair M'LLDividing to obtain S eigenvectors with the length of N, and recording the S eigenvectors as U, wherein U is [ U ═ U0,U1,…Ui,…,US-1],Ui=[u′0,u′1,…u′j,…u′N-1],u′j∈{0,1},i=0,1,...,S-1,j=0,1,...,N-1。
And simultaneously traversing the S eigenvectors U, taking a mode value of the eigenvalues with the same subscript in the eigenvectors (namely obtaining the eigenvalue with the largest occurrence frequency in the terms with the same subscript in each eigenvector), and taking the mode value as the eigenvalue of the subscript corresponding to the eigenvalue of the eigenvector to obtain a first eigenvector V with the length of N. E.g. u'0If the eigenvalues in the eigenvectors are 0, 1, 0, respectively, then the eigenvalue of the term with index 0 in the first sequence of features V is 0.
And carrying out bitwise XOR on the extracted first characteristic sequence V and each column of the watermark after the primary encryption to obtain a secondary encrypted watermark.
And step S110, carrying out error correction coding on the secondary encrypted watermark to obtain the watermark to be embedded.
Hamming code error control encoding can well realize error correction processing on watermarks. In this embodiment, the hamming code error control code is a linear block code that can detect and correct a bit error by adding a plurality of check bit data to the original data and establishing a linear relationship by an algorithm, which can be through inverse operation. If the size of the watermark image is nxn, each column of the watermark image is a binary sequence with the length of N, and in order to enable each binary sequence with the length of N to have the error correction capability, each binary sequence needs to be subjected to error correctionAnd k detection bits are added after the sequence to form an N + k sequence. Then, the newly added detection bit number k should satisfy: 2k≥N+k+1。
The Hamming code error control coding can improve the accuracy of extracting the watermark by carrying out error coding and error correction decoding on the watermark information, thereby improving the robustness. The original data and the watermark information mentioned in this step are the secondary encrypted watermark. Determining a watermark image W to be embedded through Hamming code error control codingH(size is L × N, L ═ N + k, k is the number of detection bits in hamming coding, k is 6 in the preferred embodiment, and the size of the watermark to be embedded is 32 × 26).
Step S120, performing two-level discrete wavelet transform on the text image to be embedded with the watermark to obtain four first frequency band coefficient matrixes; and carrying out block discrete cosine transform on the first frequency band coefficient matrix to obtain a corresponding first block coefficient matrix.
The method comprises performing first discrete wavelet transform on a text image to be embedded with watermark, selecting a quarter region at the upper left corner of the image obtained after the transform, and performing second discrete wavelet transform on the region to obtain four different first frequency band coefficient matrixes LL2、LH2、HL2、HH2
Respectively carrying out blocking and blocking discrete cosine transform on four first frequency band coefficient matrixes obtained after two-stage discrete wavelet transform to obtain a LL matrix2Taking the first band coefficient matrix as an example, LL is2The first frequency band coefficient matrix is cut into O coefficient blocks (O is L multiplied by N; L is N + k, k is the detection digit number in error correction coding, 1 is more than or equal to k is less than or equal to (G/4/8-N), 1 is more than or equal to k is less than or equal to (H/4/8-N)) with the size of R multiplied by R (8 multiplied by 8 in the embodiment) which are not overlapped with each other; NxN is the size of the original watermark image; in a preferred embodiment 32 x 32 image blocks are available.
Performing discrete cosine transform on each coefficient block to obtain O transform coefficient matrix blocks, and using Di,jRepresents where i ∈ { i |1 ∈<i<L},j∈{j|1<j<N }; and splicing the O transformation coefficient matrix blocks in sequence to obtain a first block coefficient matrix.
For LH2、HL2、HH2The first band coefficient matrix performs the same processing as above.
As shown in fig. 3c, each first frequency band coefficient matrix is subjected to block discrete cosine transform to obtain an 8 × 8DCT (discrete cosine transform) coefficient block, i.e., an 8 × 8DCT block coefficient matrix.
Step S130, selecting an intermediate frequency coefficient for each first block coefficient matrix, and embedding a watermark by modifying the coefficient to obtain each first block coefficient matrix after embedding the watermark.
When the watermark is embedded, two coefficients are modified in each transformation coefficient matrix block, a 1-bit watermark is embedded, and the whole watermark image can be embedded into the whole first block coefficient matrix. With LL2Take the first block coefficient matrix of (1) as an example, from LL2Each transform coefficient matrix block D of the first block coefficient matrix ofi,jTwo intermediate frequency coefficients D are selectedi,j(a, b) and Di,j(b, a) wherein a ∈ [1, R ]],b∈[1,R](in this embodiment, R ═ 8), as shown in fig. 3d, the intermediate frequency coefficient is selected in each transform coefficient matrix block of each first block coefficient matrix to embed a watermark bit, and in the preferred embodiment of the method, the values of a and b are 2 and 7, respectively.
Reading the watermark W to be embedded bit by bitHEmbedding the watermark according to the following rules:
if WH(i, j) ═ 0 and Di,j(a,b)<Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(a,b)-Di,j(b,a)<When t is, let Di,j(a,b)=Di,j(a,b)+(t/2)、Di,j(b,a)=Di,j(b, a) - (t/2); if WH(i, j) ═ 1 and Di,j(a,b)>Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(b,a)-Di,j(a,b)<When t is, let Di,j(b,a)=Di,j(b,a)+(t/2)、Di,j(a,b)=Di,j(a, b) - (t/2); otherwise, no operation of exchanging or modifying values is performed;
or
If WH(i, j) ═ 1 and Di,j(a,b)<Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(a,b)-Di,j(b,a)<When t is, let Di,j(a,b)=Di,j(a,b)+(t/2)、Di,j(b,a)=Di,j(b, a) - (t/2); if WH(i, j) ═ 0 and Di,j(a,b)>Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(b,a)-Di,j(a,b)<When t is, let Di,j(b,a)=Di,j(b,a)+(t/2)、Di,j(a,b)=Di,j(a, b) - (t/2); otherwise no operation of exchanging or modifying values is performed.
According to the above steps, WHAnd is simultaneously embedded into the first block coefficient matrix of each first band coefficient matrix.
In order to describe the above rule more clearly, the following exemplary description of the programming language:
Figure BDA0002033653850000161
or:
Figure BDA0002033653850000162
Figure BDA0002033653850000171
wherein if () is used to determine whether the parenthesized condition is satisfied, swap (D)i,j(a,b),Di,j(b, a)) represents exchange Di,j(a, b) and Di,jThe value of (b, a). t is watermark embedding strength and satisfies t>|Di,j(a,b)-Di,j(b, a) |, the larger the value of t, the better the robustness of the watermark, but the worse the invisibility, and the value of the embedding strength t in the preferred embodiment of the method is 20. WH(i, j) is a binarized representation of the ith row and jth column of the watermark to be embedded (i.e., a binary representation of the ith row and jth column of the watermark to be embedded)0 or 1).
For the LH2、HL2、HH2The respective first block coefficient matrixes are processed in the same way as above to obtain the watermark information WHAnd simultaneously embedding the block coefficients into the first block coefficient matrixes of the four first frequency band coefficient matrixes, and determining the corresponding block coefficient matrixes after the watermarks are embedded.
Step S140, performing inverse discrete cosine transform and inverse discrete wavelet transform on each first block coefficient matrix after embedding the watermark to obtain a text image embedded with the watermark.
And respectively carrying out block inverse discrete cosine transform on the four block coefficient matrixes after the watermark is embedded, and determining a first discrete wavelet transform coefficient matrix after the watermark is embedded.
And performing inverse discrete wavelet transform on the first discrete wavelet transform coefficient matrix to obtain a second discrete wavelet transform coefficient matrix. And performing inverse discrete wavelet transform on the second discrete wavelet transform coefficient matrix so as to determine the text image embedded with the watermark. Fig. 3b exemplarily shows a watermarked text image having a size of 1024 × 1024.
In the method for extracting a text image watermark according to an embodiment of the present invention, as shown in fig. 4, the method includes steps S200 to S230.
Step S200, performing two-stage discrete wavelet transform on the text image of the watermark to be extracted to obtain a second frequency band coefficient matrix; and carrying out block discrete cosine transform on the second frequency band coefficient matrix, and determining a corresponding second block coefficient matrix.
Determining a corresponding second block coefficient matrix by the same method as the text image watermark embedding process, wherein each transformation coefficient matrix block uses D* i,jRepresents where i ∈ { i |1 ∈<i<L},j∈{j|1<j<N}。
And step S210, selecting an extraction coefficient based on the second block coefficient matrix, and extracting the watermark to obtain the watermark to be decoded.
Based on the corresponding second block coefficient matrix to
Figure BDA0002033653850000181
For example, two intermediate frequency coefficients in each transform coefficient matrix block are compared
Figure BDA0002033653850000182
And
Figure BDA0002033653850000183
the magnitude relationship of (1). Obtaining watermark information W* H1. Extracting the watermark according to the following rules:
Figure BDA0002033653850000184
or
Figure BDA0002033653850000185
Wherein D is* i,j(a,b)、D* i,j(b, a) two intermediate frequency coefficients in one transform coefficient matrix block in the second partition coefficient matrix, respectively; a is an element of [1, R ∈],b∈[1,R]R × R is a preset size (in this embodiment, R ═ 8), and the second band coefficient matrix may be partitioned into a plurality of coefficient blocks that do not overlap with each other according to the preset size;
it should be noted that: here the intermediate frequency coefficient D* i,j(a, b) and D* i,j(b, a) magnitude relationship (D)* i,j(a,b)>D* i,j(b, a) or D* i,j(a,b)<D* i,j(b, a)) and watermark component (0 or 1) are determined by the specific embedding rule of the watermark in the embodiment of the embedding method of the text image watermark. If the watermark is embedded by adopting the opposite rule in the embodiment of the method for embedding the watermark in the text image, the intermediate frequency coefficient D in the embodiment of the method for extracting the watermark in the text image* i,j(a, b) and D* i,jThe size relationship of (b, a) and the corresponding relationship of watermark information should be just opposite.
For LH* 2、HL* 2、HH* 2The respective second block coefficient matrixes are processed in the same way to obtain watermark information W* H1,W* H2,W* H3,W* H4
Reading W bitwise* H1,W* H2,W* H3,W* H4The data values of the same subscript in the four watermark information are taken as the data values of the subscript corresponding to the extracted watermark, and the watermark W to be decoded is obtained* H
Step S220, performing error correction decoding processing on the watermark to be decoded to obtain the watermark to be decrypted.
And performing error correction decoding processing on the extracted watermark to be decoded by adopting decoding operation of an error correction method which is the same as that in the embedding process, wherein in the embodiment, Hamming code error control decoding is adopted to obtain the watermark to be decrypted.
And step S230, carrying out secondary decryption on the watermark to be decrypted to obtain finally extracted watermark information.
This step may be subdivided into steps S231 to S233.
Step S231: performing one-level discrete wavelet transform on the text image of the watermark to be extracted to obtain
Figure BDA0002033653850000191
Subgraph coefficient matrix (same as watermark encryption process in watermark embedding method), pair
Figure BDA0002033653850000192
And carrying out global discrete cosine transform on the sub-image coefficient matrix to obtain a second discrete cosine transform coefficient matrix.
Step S232: and constructing a characteristic vector by adopting the same method as the embedding process based on the second discrete cosine transform coefficient matrix, extracting a characteristic sequence, and carrying out primary decryption on the watermark to be decrypted.
And sequentially traversing S feature vectors U (the U calculation formula is the same as the U calculation formula in the embodiment of the text image watermark embedding method), taking a mode value of the feature values with the same subscripts in the feature vectors, and taking the mode value as the feature value of the subscript corresponding to the feature sequence to obtain a feature sequence V, wherein the length of the feature sequence V is N. And carrying out bitwise XOR on the extracted characteristic sequence V and the watermark to be decrypted to obtain the watermark subjected to primary decryption.
Step S233: and scrambling and decrypting the watermark subjected to the primary decryption by adopting a method opposite to the embedding process to obtain decrypted watermark information.
And carrying out secondary decryption on the watermark subjected to the primary decryption by adopting a decryption operation of a scrambling encryption method which is the same as the embedding process. In the embodiment, Arnold scrambling and decryption processing is carried out on the watermark subjected to the primary decryption according to the key, secondary decryption is completed on the watermark, and watermark information is determined.
The Peak Signal to Noise Ratio (PSNR) is used as an objective evaluation criterion of the watermark invisibility, and two text images before and after embedding the watermark shown in fig. 3a and 3b are calculated, and the PSNR is known to be 34.15dB, which indicates that the text image with the watermark generated by the embodiment of the present invention has no obvious visual difference from the original text image, and the watermark invisibility is good. The PSNR calculation method comprises the following steps:
Figure BDA0002033653850000201
wherein, I (I, j) represents the gray value of a pixel point with coordinates (I, j) in the original text image; i' (I, j) represents the gray value of a pixel point with the coordinate (I, j) in the text image embedded with the watermark; m and P represent the height and width of the text image, respectively; max (I, j)) is the maximum value of the gray-scale values of all pixels in the text image, and is typically taken to be 255.
The text image shown in fig. 3b is subjected to watermark extraction using the method of watermark extraction and the parameter settings described above. Here, a Normalized Correlation coefficient (NC) between the original watermark sequence W and the extracted watermark sequence W' is calculated according to the following formula:
Figure BDA0002033653850000202
wherein, W represents the original watermark, W' represents the extracted watermark, and the comparison between the original watermark sequence and the extracted watermark sequence shows that the watermark can be completely and correctly extracted (NC ═ 1).
The invention discloses an embedding system of a text image watermark, which comprises a secondary encryption watermark acquisition unit, a watermark acquisition unit to be embedded, a first block coefficient matrix acquisition unit, a watermark embedding unit and a matrix inverse transformation unit, wherein the secondary encryption watermark acquisition unit is used for acquiring a primary encryption watermark;
the secondary encryption watermark obtaining unit is configured to perform secondary encryption on the input watermark to obtain a secondary encryption watermark;
the to-be-embedded watermark acquisition unit is configured to perform error correction coding on the secondary encrypted watermark to obtain the to-be-embedded watermark;
the first block coefficient matrix obtaining unit is configured to perform two-level discrete wavelet transform on the text image to be embedded with the watermark to obtain four first frequency band coefficient matrices; carrying out block discrete cosine transform on the first frequency band coefficient matrix to obtain a corresponding first block coefficient matrix;
the watermark embedding unit is configured to select an intermediate frequency coefficient for each first block coefficient matrix, and obtain each first block coefficient matrix after embedding the watermark by modifying the coefficient to embed the watermark;
and the matrix inverse transformation unit is configured to perform inverse discrete cosine transformation and inverse discrete wavelet transformation on each first block coefficient matrix after the watermark is embedded, so as to obtain a text image embedded with the watermark.
The extraction system of the text image watermark of an embodiment of the invention comprises a second block coefficient matrix acquisition unit, a watermark acquisition unit to be decoded, a watermark acquisition unit to be decrypted and a watermark decryption unit;
the second block coefficient matrix acquisition unit is configured to perform two-level discrete wavelet transform on the text image of the watermark to be extracted to obtain four second frequency band coefficient matrices; performing block discrete cosine transform on the second frequency band coefficient matrix to determine a corresponding second block coefficient matrix;
the watermark acquisition unit to be decoded is configured to select an extraction coefficient based on the second block coefficient matrix, and extract the watermark to obtain the watermark to be decoded;
the watermark acquisition unit to be decrypted is configured to perform error correction decoding processing on the watermark to be decoded to obtain the watermark to be decrypted;
and the watermark decryption unit is configured to decrypt the watermark to be decrypted for the second time to obtain the finally extracted watermark information.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process and related description of the system described above may refer to the corresponding process in the foregoing method embodiments, and will not be described herein again.
It should be noted that, the system for embedding a text image watermark and the system for extracting a text image watermark provided in the foregoing embodiment are only illustrated by dividing the functional modules, and in practical applications, the functions may be allocated to different functional modules according to needs, that is, the modules or steps in the embodiments of the present invention are further decomposed or combined, for example, the modules in the foregoing embodiments may be combined into one module, or may be further split into multiple sub-modules, so as to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing the modules or steps, and are not to be construed as unduly limiting the present invention.
The embodiment of the method for extracting the watermark of the text image is used for extracting the watermark of the text image subjected to the JPEG compression attack with the quality factor of 30-90% and comparing the watermark with the original watermark to obtain respective NC values as shown in FIG. 5, wherein the horizontal axis is the JPEG compression quality factor, the vertical axis is the NC value, the NC value is gradually increased along with the continuous improvement of the compression strength, when the compression strength is 30%, the NC value is 0.93, and when the compression strength is more than or equal to 60%, the NC is 1.
The text image subjected to the Gauss noise attack with the mean value of 0 and the variance of 0.001 to 0.025 is subjected to watermark extraction and is compared with the original watermark to obtain respective NC values as shown in fig. 6, wherein the horizontal axis is the Gauss noise variance, the vertical axis is the NC value, the NC value is gradually reduced along with the increase of the Gauss noise variance, and when the noise variance is 0.001, the NC is 1.
In the embodiment of the method for extracting the text image watermark, the text image which is attacked by the Salt & Pepper noise with the energy of 0.005 to 0.05 is subjected to watermark extraction and is compared with the original watermark to obtain respective NC values as shown in fig. 7, wherein the horizontal axis is the Salt & Pepper noise energy, the vertical axis is the NC value, when the noise energy is 0.005 to 0.02, the NC is 1, and then as the noise energy is increased, the NC value is continuously reduced, and when the noise variance is 0.05, the NC is 0.94.
The embodiment of the method for extracting the text image watermark extracts the watermark of the text image subjected to the median filtering attack of 3 multiplied by 3 and compares the watermark with the original watermark to obtain NC (numerical control) 0.82.
Fig. 8 is a schematic diagram illustrating the watermarked text image shown in fig. 3b cut through an upper left corner 1/4 according to an example embodiment. The text image subjected to the cutting attack of the upper left corner 1/4 is subjected to watermark extraction by using the text image watermark extraction method embodiment, and is compared with the original watermark to obtain NC (0.92).
Meanwhile, fig. 9a is a schematic diagram illustrating a watermark extracted from the text image shown in fig. 3b by a correct key according to an exemplary embodiment; FIG. 9b is a diagram illustrating a watermark extracted by subjecting the text image shown in FIG. 3b to an Arnold transformation error key in accordance with an illustrative embodiment; FIG. 9c is a diagram illustrating a watermark extracted from the text image of FIG. 3b by a secondary decryption error key, in accordance with an illustrative embodiment; by comparison, the key-based position transformation and the feature sequence extraction and encryption and decryption based on the joint transformation domain provided by the invention play a crucial role in improving the algorithm security.
Those of skill in the art would appreciate that the various illustrative modules, method steps, and modules described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that programs corresponding to the software modules, method steps may be located in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. To clearly illustrate this interchangeability of electronic hardware and software, various illustrative components and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as electronic hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The terms "first," "second," and the like are used for distinguishing between similar elements and not necessarily for describing or implying a particular order or sequence.
The terms "comprises," "comprising," or any other similar term are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
So far, the technical solutions of the present invention have been described in connection with the preferred embodiments shown in the drawings, but it is easily understood by those skilled in the art that the scope of the present invention is obviously not limited to these specific embodiments. Equivalent changes or substitutions of related technical features can be made by those skilled in the art without departing from the principle of the invention, and the technical scheme after the changes or substitutions can fall into the protection scope of the invention.

Claims (9)

1. A method for embedding a watermark in a text image, the method comprising the steps of:
the input watermark is encrypted for the second time to obtain a secondary encrypted watermark, and the method comprises the following steps: scrambling and encrypting the input watermark to obtain a primary encrypted watermark; performing one-level discrete wavelet transform on the text image to be embedded with the watermark to obtain LL1A subgraph coefficient matrix; for the LL1Carrying out global discrete cosine transform on the sub-image coefficient matrix to obtain a first discrete cosine transform coefficient matrix; constructing a characteristic vector based on the first discrete cosine transform coefficient matrix, and extracting a first characteristic sequence; performing bitwise XOR on the first characteristic sequence and each row of the primary encrypted watermark to obtain a secondary encrypted watermark;
carrying out error correction coding on the secondary encrypted watermark to obtain a watermark to be embedded;
performing two-level discrete wavelet transform on a text image to be embedded with a watermark to obtain four first frequency band coefficient matrixes; carrying out block discrete cosine transform on the first frequency band coefficient matrix to obtain a corresponding first block coefficient matrix;
selecting an intermediate frequency coefficient for each first block coefficient matrix, and embedding a watermark by modifying the coefficient to obtain each first block coefficient matrix embedded with the watermark;
and performing inverse discrete cosine transform and inverse discrete wavelet transform on each first block coefficient matrix after the watermark is embedded to obtain a text image embedded with the watermark.
2. The method for embedding a text image watermark according to claim 1, wherein the step of scaling the text image to be embedded with the watermark further comprises, before the step of performing the two-stage discrete wavelet transform on the text image to be embedded with the watermark:
when G is less than Nx 32 or H is less than Nx 32, the text image to be embedded with the watermark is amplified in small scale until the height H is obtained1Width of G1The enlarged text image of (a);
g, H represents the width and height of the text image to be embedded with watermark, NXN represents the size of the watermark image, and G represents the total size of the text image1、H1Are each divisible by 8, is not less than G, H, and G1≥N×32、H1The minimum positive integer of more than or equal to Nx 32.
3. The method for embedding a text image watermark according to claim 2, wherein the method for constructing the feature vector and extracting the first feature sequence based on the first discrete cosine transform coefficient matrix comprises:
rearranging the shape of the coefficients in the first matrix of discrete cosine transform from the low frequency component to the high frequency component;
taking out the first S multiplied by N low-frequency coefficients except the direct-current component according to the arrangement sequence to form a coefficient sequence MLL(ii) a Wherein S is odd and satisfies 3 ≤ S ≤ ((G × G/4-1)/N), 3 ≤ S ≤ ((H × H/4-1)/N, MLL=[u0,u1,u2…uS×N-1];
According to a preset threshold value, the coefficient sequence MLLWherein each coefficient is represented by 0 or 1 to give a sequence M'LL
N is length pair M'LLDividing to obtain S eigenvectors with the length of N, wherein the eigenvector group is U ═ U0,U1,…Ui,...,US-1]Wherein, Ui=[u′0,u′1,…u′j,…u′N-1];
And traversing U, and taking a mode value from the feature values with the same subscript in each feature vector to obtain a first feature sequence V with the calculated mode value as a feature value, wherein the length of the first feature sequence V is N.
4. The method for embedding a text image watermark according to claim 1, wherein the method for performing block discrete cosine transform on the first frequency band coefficient matrix to obtain the corresponding first block coefficient matrix comprises:
for each first band coefficient matrix, performing the steps of:
according to a preset size R multiplied by R, a first frequency band coefficient matrix is partitioned into O coefficient blocks which do not overlap with each other, wherein O is L multiplied by N, L is N + k, k is a detection bit number in error correction coding, and N multiplied by N is the size of a watermark image;
performing discrete cosine transform on each coefficient block to obtain O transform coefficient matrix blocks, and using Di,jRepresenting that i belongs to { i |1 < i < L }, and j belongs to { j |1 < j < N };
and splicing the O transformation coefficient matrix blocks in sequence to obtain a first block coefficient matrix.
5. The method for embedding a text image watermark according to claim 4, wherein the method comprises, for each first block coefficient matrix, selecting an intermediate frequency coefficient and obtaining each first block coefficient matrix after embedding the watermark by modifying the coefficient to embed the watermark, and comprises:
for each transform coefficient matrix block D in each first block coefficient matrixi,jSelecting two intermediate frequency coefficients Di,j(a, b) and Di,j(b, a) wherein a ∈ [1, R ]],b∈[1,R]R × R is a preset size;
reading the watermark W to be embedded bit by bitHEmbedding the watermark according to the following rules:
if WH(i, j) ═ 0 and Di,j(a,b)<Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(a,b)-Di,jWhen (b, a) < t, let Di,j(a,b)=Di,j(a,b)+(t/2)、Di,j(b,a)=Di,j(b, a) - (t/2); if WH(i, j) ═ 1 and Di,j(a,b)>Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(b,a)-Di,jWhen (a, b) < t, let Di,j(b,a)=Di,j(b,a)+(t/2)、Di,j(a,b)=Di,j(a,b)-(t/2);
Or
If WH(i, j) ═ 1 and Di,j(a,b)<Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(a,b)-Di,jWhen (b, a) < t, let Di,j(a,b)=Di,j(a,b)+(t/2)、Di,j(b,a)=Di,j(b, a) - (t/2); if WH(i, j) ═ 0 and Di,j(a,b)>Di,j(b, a), then exchange Di,j(a, b) and Di,jThe value of (b, a) and at Di,j(b,a)-Di,jWhen (a, b) < t, let Di,j(b,a)=Di,j(b,a)+(t/2)、Di,j(a,b)=Di,j(a,b)-(t/2);
Wherein t is watermark embedding strength, and t > D is satisfiedi,j(a,b)-Di,j(b,a)|;WH(i, j) is a binary representation of the ith row and the jth column of the watermark to be embedded;
w is to beHAnd is embedded into each first band coefficient matrix.
6. A method for extracting a text image watermark is characterized by comprising the following steps:
performing two-level discrete wavelet transform on the text image of the watermark to be extracted to obtain four second frequency band coefficient matrixes; performing block discrete cosine transform on the second frequency band coefficient matrix to determine a corresponding second block coefficient matrix;
selecting an extraction coefficient based on the second block coefficient matrix, and extracting the watermark to obtain the watermark to be decoded;
carrying out error correction decoding processing on the watermark to be decoded to obtain the watermark to be decrypted;
and carrying out secondary decryption on the watermark to be decrypted to obtain finally extracted watermark information, wherein the method comprises the following steps: performing one-level discrete wavelet transform on the text image of the watermark to be extracted to obtain LL* 1Sub-picture coefficient matrix, for the obtained LL* 1Carrying out global discrete cosine transform on the sub-image coefficient matrix to obtain a corresponding second discrete cosine transform coefficient matrix; constructing a characteristic vector based on the second discrete cosine transform coefficient matrix, and extracting a second characteristic sequence; performing bitwise XOR on the second characteristic sequence and the watermark to be decrypted to obtain the watermark subjected to primary decryption; and scrambling and decrypting the watermark subjected to the primary decryption by adopting a method opposite to the embedding process to obtain decrypted watermark information.
7. The method for extracting a text image watermark according to claim 6, wherein the method comprises the steps of selecting an extraction coefficient based on the second block coefficient matrix, and extracting the watermark to obtain the watermark to be decoded:
acquiring watermark information corresponding to each second frequency band coefficient matrix through the following formula:
Figure FDA0002725825070000041
or
Figure FDA0002725825070000051
Wherein D is* i,j(a,b)、D* i,j(b, a) two intermediate frequency coefficients in one transform coefficient matrix block in the second partition coefficient matrix; n is the serial number of the second frequency band coefficient matrix, and n is 1,2,3, 4; a is an element of [1, R ∈],b∈[1,R]The R multiplied by R is a preset size, and the second frequency band coefficient matrix is partitioned into a plurality of coefficient blocks which do not overlap with each other according to the preset size;
reading W bitwise* H1,W* H2,W* H3,W* H4The data values of the same subscript in the four watermark information are taken as the data values of the subscript corresponding to the extracted watermark, and the watermark W to be decoded is obtained* H
8. A text image watermark embedding system is characterized by comprising a secondary encrypted watermark acquisition unit, a watermark to be embedded acquisition unit, a first block coefficient matrix acquisition unit, a watermark embedding unit and a matrix inverse transformation unit;
the secondary encryption watermark obtaining unit is configured to perform secondary encryption on the input watermark to obtain a secondary encryption watermark, and the method comprises the following steps: to pairInputting a watermark to carry out scrambling encryption processing to obtain a primary encrypted watermark; performing one-level discrete wavelet transform on the text image to be embedded with the watermark to obtain LL1A subgraph coefficient matrix; for the LL1Carrying out global discrete cosine transform on the sub-image coefficient matrix to obtain a first discrete cosine transform coefficient matrix; constructing a characteristic vector based on the first discrete cosine transform coefficient matrix, and extracting a first characteristic sequence; performing bitwise XOR on the first characteristic sequence and each row of the primary encrypted watermark to obtain a secondary encrypted watermark;
the to-be-embedded watermark acquisition unit is configured to perform error correction coding on the secondary encrypted watermark to obtain the to-be-embedded watermark;
the first block coefficient matrix obtaining unit is configured to perform two-level discrete wavelet transform on the text image to be embedded with the watermark to obtain four first frequency band coefficient matrices; carrying out block discrete cosine transform on the first frequency band coefficient matrix to obtain a corresponding first block coefficient matrix;
the watermark embedding unit is configured to select an intermediate frequency coefficient for each first block coefficient matrix, and obtain each first block coefficient matrix after embedding the watermark by modifying the coefficient to embed the watermark;
and the matrix inverse transformation unit is configured to perform inverse discrete cosine transformation and inverse discrete wavelet transformation on each first block coefficient matrix after the watermark is embedded, so as to obtain a text image embedded with the watermark.
9. A system for extracting a text image watermark is characterized by comprising a second block coefficient matrix acquisition unit, a watermark acquisition unit to be decoded, a watermark acquisition unit to be decrypted and a watermark decryption unit;
the second block coefficient matrix acquisition unit is configured to perform two-level discrete wavelet transform on the text image of the watermark to be extracted to obtain four second frequency band coefficient matrices; performing block discrete cosine transform on the second frequency band coefficient matrix to determine a corresponding second block coefficient matrix;
the watermark acquisition unit to be decoded is configured to select an extraction coefficient based on the second block coefficient matrix, and extract the watermark to obtain the watermark to be decoded;
the watermark acquisition unit to be decrypted is configured to perform error correction decoding processing on the watermark to be decoded to obtain the watermark to be decrypted;
the watermark decryption unit is configured to decrypt the watermark to be decrypted for the second time to obtain the finally extracted watermark information, and the method comprises the following steps: performing one-level discrete wavelet transform on the text image of the watermark to be extracted to obtain LL* 1Sub-picture coefficient matrix, for the obtained LL* 1Carrying out global discrete cosine transform on the sub-image coefficient matrix to obtain a corresponding second discrete cosine transform coefficient matrix; constructing a characteristic vector based on the second discrete cosine transform coefficient matrix, and extracting a second characteristic sequence; performing bitwise XOR on the second characteristic sequence and the watermark to be decrypted to obtain the watermark subjected to primary decryption; and scrambling and decrypting the watermark subjected to the primary decryption by adopting a method opposite to the embedding process to obtain decrypted watermark information.
CN201910317711.4A 2019-04-19 2019-04-19 Text image watermark embedding method and system and text image watermark extracting method and system Active CN110084733B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910317711.4A CN110084733B (en) 2019-04-19 2019-04-19 Text image watermark embedding method and system and text image watermark extracting method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910317711.4A CN110084733B (en) 2019-04-19 2019-04-19 Text image watermark embedding method and system and text image watermark extracting method and system

Publications (2)

Publication Number Publication Date
CN110084733A CN110084733A (en) 2019-08-02
CN110084733B true CN110084733B (en) 2021-02-02

Family

ID=67415663

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910317711.4A Active CN110084733B (en) 2019-04-19 2019-04-19 Text image watermark embedding method and system and text image watermark extracting method and system

Country Status (1)

Country Link
CN (1) CN110084733B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210203994A1 (en) * 2015-06-12 2021-07-01 Shaoher Pan Encoding data in a source image with watermark image codes
CN112580329B (en) * 2019-09-30 2024-02-20 北京国双科技有限公司 Text noise data identification method, device, computer equipment and storage medium
CN111158322A (en) * 2019-12-30 2020-05-15 上海煤气第二管线工程有限公司 On-site management system based on enterprise WeChat
CN111223035B (en) * 2020-01-07 2022-04-05 鲁东大学 Color blind watermarking method based on Hamming code, eigenvalue decomposition and image correction
CN111489278B (en) * 2020-04-07 2023-05-16 贵州大学 Text watermark embedding and extracting method based on scrambling diffusion
CN111625786B (en) * 2020-05-07 2022-03-01 清华四川能源互联网研究院 Time sequence data watermarking method based on discrete cosine transform
CN111768328B (en) * 2020-07-07 2021-08-13 中国科学院自动化研究所 Text image watermark embedding method and system and text image watermark extracting method and system
CN111966974B (en) * 2020-08-18 2022-04-05 哈尔滨工业大学(威海) Safe and reversible relational database copyright protection method
CN112150339A (en) * 2020-09-25 2020-12-29 南京师范大学 Vector geographic data watermark encryption and decryption method and system
CN112669361A (en) * 2020-12-11 2021-04-16 山东省科学院海洋仪器仪表研究所 Method for rapidly decomposing underwater image of seawater
CN112907428A (en) * 2021-02-10 2021-06-04 海南大学 Encrypted image watermark processing method and system based on stripe transformation processing
CN113222804B (en) * 2021-06-02 2022-03-15 景德镇陶瓷大学 Ceramic process-oriented up-sampling ceramic watermark model training method and embedding method
CN113538200B (en) * 2021-07-05 2023-11-17 西安电子科技大学 Fast robust watermarking method, system and application for color image
CN113627567B (en) * 2021-08-24 2024-04-02 北京达佳互联信息技术有限公司 Picture processing method, text processing method, related device and storage medium
CN114140310B (en) * 2021-12-07 2024-02-13 合肥工业大学 Digital watermark hardware circuit based on DCT transformation
CN116362953B (en) * 2023-05-30 2023-08-01 南京师范大学 High-precision map watermarking method based on invisible characters

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750660A (en) * 2012-06-08 2012-10-24 北京京北方信息技术有限公司 Method and device for embedding and extracting digital watermarking

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699508B (en) * 2009-09-03 2012-01-11 中兴通讯股份有限公司 Image digital watermark embedding and extracting method and system
US8064102B1 (en) * 2010-07-01 2011-11-22 Xerox Corporation Embedding frequency modulation infrared watermark in digital document
CN102938133A (en) * 2012-11-20 2013-02-20 海南大学 Robust watermarking method for medical images on basis of Arnold scrambling transformation and DWT (discrete wavelet transform)-DFT (discrete Fourier transform)
CN103049682B (en) * 2013-01-28 2015-04-01 上海理工大学 Character pitch encoding-based dual-watermark embedded text watermarking method
CN103208288A (en) * 2013-03-13 2013-07-17 漳州职业技术学院 Dual encryption based discrete wavelet transform-discrete cosine transform (DWT-DCT) domain audio public watermarking algorithm
CN103279919A (en) * 2013-06-21 2013-09-04 海南大学 Volume data watermarking method based on three-dimensional DWT-DCT and chaos scrambling
CN106097237B (en) * 2016-05-25 2019-11-15 中国科学院自动化研究所 The embedding grammar of image watermark and extracting method and associated method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750660A (en) * 2012-06-08 2012-10-24 北京京北方信息技术有限公司 Method and device for embedding and extracting digital watermarking

Also Published As

Publication number Publication date
CN110084733A (en) 2019-08-02

Similar Documents

Publication Publication Date Title
CN110084733B (en) Text image watermark embedding method and system and text image watermark extracting method and system
Tao et al. Robust image watermarking theories and techniques: A review
Ernawan et al. An improved image watermarking by modifying selected DWT-DCT coefficients
CN109300078B (en) Image spread spectrum watermark embedding method with self-adaptive embedding strength
CN109191361B (en) Image watermark embedding method, image watermark extracting method and related method
Malik et al. Recovery based high capacity reversible data hiding scheme using even-odd embedding
Liu et al. Robust blind image watermarking based on chaotic mixtures
Parah et al. Realisation and robustness evaluation of a blind spatial domain watermarking technique
PVSSR Adaptive, robust and blind digital watermarking using Bhattacharyya distance and bit manipulation
Rinki et al. A novel matrix multiplication based LSB substitution mechanism for data security and authentication
CN111882477A (en) Self-adaptive zero-watermarking method combining visual password and enhanced singular value decomposition
Lu et al. Multiple Watermark Scheme based on DWT-DCT Quantization for Medical Images.
Bekkouch et al. Robust and reversible image watermarking scheme using combined DCT-DWT-SVD transforms
Begum et al. Implementation of secured and robust DFT-based image watermark through hybridization with decomposition algorithm
Shehzad et al. LSB image steganography based on blocks matrix determinant method
Mehraj et al. RBWCI: robust and blind watermarking framework for cultural images
Shahadi et al. A novel robust approach for image copyright protection based on concentric rectangles
Zeng et al. Blind watermarking algorithm combining NSCT, DWT, SVD, and HVS
Khalil et al. Two-layer fragile watermarking method secured with chaotic map for authentication of digital holy Quran
Su Color image watermarking: algorithms and technologies
Mashhadi et al. A (t, n)-Secret image sharing with steganography based on Rook polynomial and LWE problem
Sajeer et al. Recent advances in transform and hybrid domain digital watermarking techniques—a survey
Dutta et al. An efficient and secure digital image watermarking using features from iris image
Devi et al. Dual image watermarking scheme based on singular value decomposition and visual cryptography in discrete wavelet transform
Jani Anbarasi et al. Robust watermarking scheme using Weber Law for 3D mesh models

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant