Document Content Integrity Anti-Counterfeiting Verification Method Based on Multi-Page QR Code Technology

The document is processed in blocks and iteratively through multi-page QR code technology, and the reasonable watermark embedding location is selected, which solves the problem of document watermarks being easily erased or distorted, and achieves high-accurate anti-counterfeiting verification.

CN120012053BActive Publication Date: 2025-07-04国投云网数字科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510101653.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-07-04
Estimated Expiration
2045-01-22

AI Technical Summary

Technical Problem

The existing document watermarking technology is incorrectly selected when the embedded position is selected, which is easily erased by the attacker or caused by the document distortion, affecting the accuracy of anti-counterfeiting verification.

Method used

Using multi-page QR code technology, the document image is blocked, the text loss and loss consistency coefficient is calculated, the optimal embedding position is selected, and iterative calculation is performed to embed QR code image as watermark, and anti-counterfeiting verification is performed after printing.

Benefits of technology

It improves the accuracy of anti-counterfeiting verification of document content, reduces the possibility of document distortion, and enhances the recognition of text and watermarks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120012053B_ABST
    Figure CN120012053B_ABST
Patent Text Reader

Abstract

This application relates to the field of document anti-counterfeiting security verification technology, and specifically relates to a method for anti-counterfeiting verification of document content integrity based on multi-page two-dimensional code technology. The method includes: scanning the current page of the electronic document to obtain a document image, converting the obtained original bit sequence into a two-dimensional code image to obtain a watermark embedding image; calculating the text loss and loss consistency coefficient; obtaining the target embedding block; obtaining the bit extraction sequence, bit information loss, and loss function; performing iterative calculation on the loss function to obtain the document image after watermark embedding, printing the document image after watermark embedding, and by identifying the content of the two-dimensional code image in the printed document, comparing the consistency between the recognition result and the original bit sequence to perform anti-counterfeiting verification on the document content. This application can reasonably select the position of watermark embedding, reduce the possibility of document distortion, improve the distinguishability of text and watermark in the document, and is conducive to improving the accuracy of anti-counterfeiting verification of document content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of document anti-counterfeiting security verification, and specifically relates to a method for anti-counterfeiting verification of document content integrity based on multi-page two-dimensional code technology. Background Art

[0002] With the popularization of informatization, all enterprises have achieved paperless office for the entire process, and all documents have adopted electronic processes such as drafting, approval, circulation, and archiving; however, printed paper documents are still required in many business scenarios. The popularization of electronic office has increased the proportion of document information in digital form. With the increasing demand for information protection, document watermarking technology provides traceable evidence by embedding anti-counterfeiting information, meeting the requirements of information security.

[0003] However, the position where the document watermark is embedded needs to be reasonably selected. If the watermark is embedded in the blank area at the edge of the document, then attackers can erase the watermark through simple image transformation and cropping methods, so that the document watermark cannot achieve the purpose of anti-counterfeiting; and if the position where the watermark is embedded highly overlaps with the text area in the document, it will cause document distortion, reduce the recognition rate of the text and the watermark in the document, resulting in difficulties in document recognition, and further affecting the accuracy of anti-counterfeiting verification of document content. Summary of the Invention

[0004] In order to solve the above technical problems, a method for anti-counterfeiting verification of document content integrity based on multi-page two-dimensional code technology is provided to solve the existing problems.

[0005] The solution of this application to solve the technical problems is to provide a method for anti-counterfeiting verification of document content integrity based on multi-page two-dimensional code technology, including the following steps:

[0006] Scan the electronic document of the current page to obtain a document image, and obtain the original bit sequence by acquiring the document content of the current page and the printing information for printing the document.

[0007] Convert the original bit sequence into a two-dimensional code image, use the two-dimensional code image as a watermark, and embed it into the document image to obtain a watermark-embedded image.

[0008] Divide the document image into multiple blocks; analyze the brightness difference between each pixel point in each block and the pixel point at the corresponding position in the watermark-embedded image, as well as the brightness difference of each pixel point in each block, and calculate the text loss of each block in the document image.

[0009] Determine the loss consistency coefficient of each block in the document image based on the proximity of the text loss of each block in the document image to the text loss of the remaining adjacent blocks.

[0010] Based on the loss consistency coefficient, all blocks in the document image are screened to obtain target embedding blocks; by performing watermark extraction on the watermark-embedded image, a bit extraction sequence is obtained; the difference between the bit extraction sequence and the original bit sequence is analyzed to determine the bit information loss of the document image;

[0011] Based on the bit information loss and the text loss of all blocks, the loss function of the document image is determined;

[0012] The QR code image is used as a watermark and embedded in the target embedding blocks, and the loss function of the document image is iteratively calculated to obtain the watermark-embedded document image. The watermark-embedded document image is printed, and by identifying the content of the QR code image in the printed document and comparing the consistency between the recognition result and the original bit sequence, the anti-counterfeiting verification of the document content is performed.

[0013] Preferably, the process of obtaining the original bit sequence is as follows:

[0014] Taking the content of the electronic document on the current page and the printing information as inputs, a hash value is calculated using a hash function and converted into a binary bit stream to form the original bit sequence, where the printing information includes the printing time, the printer, and the number of copies printed.

[0015] Preferably, the process of obtaining the watermark-embedded image is as follows:

[0016] The document image is converted from the RGB space to the YUV space, the Y-channel value in the document image is transformed by a wavelet transform algorithm, and the QR code image is used as a watermark and embedded into the document image to obtain the watermark-embedded image.

[0017] Preferably, calculating the text loss of each block in the document image includes:

[0018] The difference between the Y-channel value of each pixel point in each block of the document image and the Y-channel value of the corresponding pixel point in the watermark-embedded image is recorded as the pixel difference;

[0019] Through the value range of the Y-channel value in the YUV space, the maximum Y-channel value is obtained; the difference between the maximum Y-channel value and the Y-channel value of each pixel point in each block of the document image is calculated, and the ratio of the difference to the maximum Y-channel value is recorded as the color loss weight;

[0020] Based on the color loss weight, the pixel differences of all pixel points in each block of the document image are weighted and summed, and the square root of the weighted sum result is used as the text loss of each block in the document image.

[0021] Preferably, the loss consistency coefficient is the reciprocal of the product of the mean and standard deviation of the text losses of each block and multiple adjacent blocks thereof.

[0022] Preferably, the obtaining of the target embedding block includes: selecting the block corresponding to the minimum loss consistency coefficient and denoting it as the target embedding block.

[0023] Preferably, the process of obtaining the bit extraction sequence is as follows:

[0024] Extract the watermark from the watermark-embedded image through the inverse wavelet transform algorithm, and decode the watermark of the extracted QR code image to obtain the bit extraction sequence.

[0025] Preferably, the calculation formula for the bit information loss of the document image is: where L seq is the bit information loss of the document image, N is the length of the original bit sequence, A is the original bit sequence, A ′ is the bit extraction sequence, and d() is to calculate the Hamming distance.

[0026] Preferably, the determination of the loss function of the document image is specifically: where F is the loss function of the document image, L seq is the bit information loss of the document image, L m is the text loss of the m-th block in the document image, M is the number of all blocks in the document image, and exp() is the exponential function with the natural constant as the base.

[0027] Preferably, the anti-counterfeiting verification of the document content includes: if the recognition result is inconsistent with the original bit sequence, the document content has been tampered with or forged; otherwise, the document content has not been tampered with or forged.

[0028] This application has at least the following beneficial effects:

[0029] In this application, the electronic document content of the current page and the printing information are subjected to hash calculation to obtain the original bit sequence, which is converted into a QR code image. The QR code image is embedded into the document image as a watermark through the wavelet transform algorithm to obtain the watermark-embedded image. The difference in the Y-channel values of the pixel points at the same position between the document image and the watermark-embedded image is analyzed to calculate the text loss. The beneficial effect is that by encrypting the document content and printing information, converting them into a QR code, and considering the brightness change of the pixel points at the same position in the document image before and after watermark embedding, the text loss situation when the watermark is embedded near or overlaps with the text is reflected, thereby indicating the influence of watermark embedding on the text in the document image. Secondly, the loss consistency coefficient is calculated, and all blocks in the document image are screened to obtain the target embedding blocks. The beneficial effect is that it considers the consistency of the text loss between each block and the remaining blocks around it, thereby indicating that the watermark of the QR code image should be embedded in the block with the smallest text loss and the positions where the text loss of the remaining blocks around is also small. By extracting the watermark in the watermark-embedded image to obtain the bit extraction sequence and calculating the bit information loss, the beneficial effect is that it considers the difference between the bit information contained in the document image after watermark embedding and the original bit information to reflect the possible situation of the watermark being embedded near or overlapping with the text. The loss function is calculated to reflect the loss situation of the document image after each watermark embedding. The QR code image is embedded as a watermark in the target embedding blocks in the document image, the loss function of the document image is calculated and then iteratively operated to make the loss function reach the minimum. The QR code image is embedded as a watermark in the target embedding blocks screened in the last iteration, so as to obtain the final watermark-embedded document image. The final watermark-embedded document image is printed out, the content in the document is recognized by a QR code reading tool, and the recognition result is compared with the original bit sequence to verify the anti-counterfeiting of the document content. The beneficial effect is that it can reasonably select the watermark embedding position, reduce the possibility of document distortion, improve the recognition rate of the text and the watermark in the document, and thus contribute to improving the accuracy of anti-counterfeiting verification of the document content. Description of the Drawings

[0030] The following further elaborates in detail on the method for anti-counterfeiting verification of document content integrity based on multi-page QR code technology of this application with reference to the accompanying drawings.

[0031] Figure 1 It is the flowchart of the steps of the method for anti-counterfeiting verification of document content integrity based on multi-page QR code technology provided by the embodiment of this application;

[0032] Figure 2 It is the flowchart of the steps of the method for obtaining the text loss of each block in the document image provided by the embodiment of this application. Detailed Embodiment

[0033] In order to make the objectives, technical solutions, and advantages of this application more clear and understandable, the following further elaborates in detail on the method for anti-counterfeiting verification of document content integrity based on multi-page QR code technology proposed in this application in combination with the accompanying drawings and implementation examples. It should be understood that the specific implementation examples described herein are only used to explain this application and are not used to limit this application.

[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs.

[0035] Please refer to Figure 1 , which shows the flowchart of the steps of the method for anti-counterfeiting verification of document content integrity based on multi-page QR code technology provided by an embodiment of this application. The method includes the following steps:

[0036] Step 1: Scan the electronic document of the current page to obtain a document image, and obtain the original bit sequence by acquiring the document content of the current page and the printing information for printing the document.

[0037] In the information age, traditional paper documents are gradually being replaced by electronic documents. However, in many business scenarios, paper documents still need to be printed. To ensure the integrity and security of document content, anti-counterfeiting information is embedded in the document through document watermark technology to achieve the purpose of anti-counterfeiting. Therefore, the printer converts the electronic document content into a format that the printer can understand and performs raster processing. Since the printer is a dot matrix printer, the dot density accuracy of its individual pixel points is limited. It converts the continuous tone image into a halftone image through halftone processing to adapt to the dot density of the printer and prints the rasterized dot matrix image onto the paper. The conversion process of converting the continuous tone image into a halftone image will cause image distortion due to information loss.

[0038] Convert the electronic document of the current page into an image, denoted as the document image. Therefore, perform a Gamma correction operation on the document image to optimize the brightness distribution of the document image and ensure that the details and shadows of the fonts in the document image are accurately expressed in the printing result. Crop and perform a perspective transformation on the document image to remove most of the blank areas around the text area in the document image to avoid insufficient anti-counterfeiting reliability when the watermark is embedded in these areas. Secondly, use the Gaussian blur algorithm to denoise the document image.

[0039] It should be noted that Gamma correction, the Gaussian blur algorithm, cropping, and perspective transformation are well-known technologies and will not be elaborated herein.

[0040] Secondly, taking the content of the electronic document on the current page, as well as information such as the printing time, printer, and printing batch as input, calculate the hash value using a hash function, convert the hash value into a binary bit stream, and form the original bit sequence;

[0041] In this embodiment, the SHA1 hash function is used to calculate the hash value. Among them, the SHA1 hash function is a well-known technology and will not be elaborated here. As other implementation manners, implementers can adopt other methods of existing technologies, such as the SHA256 hash function, etc. This embodiment does not make special restrictions on this. Among them, the hash value calculated in this embodiment is 32 bits. As other implementation manners, implementers can set it by themselves according to the actual situation; By using a hash function for the content of the electronic document, as well as information such as the printing time, printer, and printing batch, the document content and printing information are encrypted to facilitate subsequent comparison and verification of the printed document content with the original electronic document content.

[0042] So far, the document image and the original bit sequence are obtained.

[0043] Step 2, convert the original bit sequence into a QR code image, use the QR code image as a watermark, and embed it into the document image to obtain a watermark-embedded image; divide the document image into multiple blocks; analyze the difference in brightness between each pixel point in each block and the pixel points at the corresponding positions in the watermark-embedded image, as well as the brightness difference of each pixel point in each block, and calculate the text loss of each block in the document image.

[0044] To ensure the integrity and security of the document content, anti-counterfeiting information can be embedded into the document through the watermark. To avoid a significant reduction in the image quality after embedding the watermark, an optimal embedding position is found through iterative operations, and then the embedding and extraction of the watermark are realized. First:

[0045] Convert the original bit sequence into a QR code image through the QR code image generation algorithm, convert the document image from the RGB space to the YUV space, perform a transformation on the Y channel value in the document image through the wavelet transform algorithm, and embed the QR code image as a watermark into the document image to obtain a watermark-embedded image;

[0046] It should be noted that the QR code image generation algorithm is a well-known technology and will not be elaborated here; since the Y channel represents brightness and is directly related to the grayscale value, it can be used to measure the brightness change of the document image. The Y channel value of the document image is transformed from the spatial domain to the wavelet domain, and the watermark of the QR code image is embedded by modifying the wavelet transform coefficients to obtain a watermark-embedded image; among them, the process of embedding the watermark by the wavelet transform algorithm is a well-known technology and will not be elaborated here. In this embodiment, the wavelet function of the wavelet transform algorithm uses the Haar wavelet function.

[0047] Furthermore, when embedding a watermark into a document image, it is necessary to select the embedding position of the watermark. The document image can be roughly divided into a text area and a background blank area. Through the cropping process in Step 1, the background blank area is removed. When embedding a digital watermark into a document image, if it is embedded near or overlaps with the text, it will cause document distortion, reduce the distinguishability between the text and the document watermark, and increase the difficulty of extracting the document watermark in the subsequent process.

[0048] Secondly, the text in the document image usually exists in black when printed. Moreover, when people read a document, they will focus on the text rather than the white paper part. Therefore, if the pixel value of the document image is closer to black, it is less desirable to embed the watermark in this area. By analyzing the difference in the Y-channel values of the document image before and after watermark embedding, the text loss is calculated to reflect the distortion of the text in the document image after the watermark of the QR code image is embedded compared to before embedding. The flowchart of the steps for obtaining the text loss of each block in the document image provided by the embodiments of the present application is as Figure 2 shown, and specifically includes:

[0049] Divide the document image evenly into multiple blocks;

[0050] In this embodiment, the document image is evenly divided into 120 blocks of the same size. As other implementation manners, the implementer can set it according to the actual situation.

[0051] Record the difference between the Y-channel value of each pixel point in each block of the document image and the Y-channel value of the corresponding pixel point in the watermark-embedded image as the pixel difference;

[0052] In this embodiment, record the square of the difference between the Y-channel value of each pixel point in each block of the document image and the Y-channel value of the corresponding pixel point in the watermark-embedded image as the pixel difference.

[0053] Obtain the maximum Y-channel value through the value range of the Y-channel value in the YUV color space;

[0054] It should be noted that in the YUV color space, the value range of the Y-channel value is 0 to 255. Therefore, the maximum Y-channel value is 255.

[0055] Calculate the difference between the maximum Y-channel value and the Y-channel value of each pixel point in each block of the document image, and record the ratio of the difference to the maximum Y-channel value as the color loss weight;

[0056] Based on the color loss weight, perform a weighted sum of the pixel differences of all pixel points in each block of the document image, and take the square root of the result of the weighted sum as the text loss of each block in the document image.

[0057] In this embodiment, taking the m-th block in the document image as an example, the calculation formula for its text loss is as follows:

[0058]

[0059] where L m is the text loss of the m-th block in the document image, Y m,i is the Y-channel value of the i-th pixel in the m-th block of the document image, and Y ′ m,i is the Y-channel value of the i-th pixel in the m-th block of the watermark-embedded image, Y max is the maximum Y-channel value, and N m is the number of all pixels in the m-th block of the document image; secondly, (Y m,i - Y ′ m,i ) 2 is the pixel difference, is the color loss weight.

[0060] It should be noted that the greater the pixel difference, the greater the difference in the Y-channel values of the pixels between the document image and the watermark-embedded image, and the greater the impact of watermark embedding on the image, so the text loss of this pixel is greater; the smaller the color loss weight, the closer the Y-channel value of this pixel is to black. If a certain pixel is black, then the Y-channel value of this pixel is the maximum Y-channel value and the color loss weight is 0, and the color component has no impact on the text loss. The greater the color loss weight, the farther the Y-channel value of this pixel is from black, and the greater the resulting text loss. After embedding the watermark at this pixel in the corresponding block of the text image, the resulting text loss is greater. For pixels with Y-channel values close to black, the text loss is calculated with a smaller weight, so that the watermark of the QR code image can be embedded in brighter areas later. These areas have less impact on vision and can better maintain the concealment of the watermark at the same time.

[0061] Thus, the text loss of each block in the document image is obtained.

[0062] Step 3: Determine the loss consistency coefficient of each block in the document image based on the proximity of the text loss of each block in the document image to the text losses of the remaining adjacent blocks; based on the loss consistency coefficient, screen all the blocks in the document image to obtain the target embedding blocks; extract the watermark from the watermark-embedded image to obtain the bit extraction sequence; analyze the difference between the bit extraction sequence and the original bit sequence to determine the bit information loss of the document image.

[0063] Furthermore, based on the text loss of each block in the document image corresponding to the block after embedding the watermark, the watermark of the QR code image should be embedded in the block with the minimum text loss. However, it is unreasonable to only select the block with the minimum text loss because there may be a situation where the text loss of this block is the minimum while the text loss of its surrounding blocks is relatively large. For example, in some blank cells in a table in the document, embedding the watermark in such blank areas may interfere with the text.

[0064] Based on the above analysis, the watermark should be embedded in the area corresponding to the block with relatively small text loss and relatively small text loss of its surrounding blocks. Therefore, for the text loss between each block and the remaining blocks around it, calculate the loss consistency coefficient, specifically:

[0065] Calculate the mean of the text losses of each block and multiple adjacent blocks thereof, calculate the standard deviation of the text losses of each block and multiple adjacent blocks thereof, and take the reciprocal of the product of the mean and the standard deviation as the loss consistency coefficient of each block in the document image;

[0066] In this embodiment, calculate the mean and standard deviation of the text losses of each block and 4 adjacent blocks thereof.

[0067] It should be noted that the smaller the standard deviation, the smaller the difference in the text losses of each block and multiple adjacent blocks thereof. The smaller the mean, the smaller the text loss caused by embedding the watermark in the entire area where each block and multiple adjacent blocks are located. The larger the obtained loss consistency coefficient, the more consistent the text losses of the corresponding block and its surrounding blocks.

[0068] Select the block corresponding to the minimum loss consistency coefficient and denote it as the target embedding block;

[0069] It should be noted that the target embedding block is the position with the minimum text loss after embedding the watermark in the document image.

[0070] Furthermore, the document watermark is a binary bit stream in encoding. If, when embedding the watermark in the document image, it is embedded near or overlaps with the text, that is, the greater the text loss, then when extracting the watermark from the document image, the difference between the bit extraction sequence and the original bit sequence will be greater. Therefore, calculate the bit information loss, specifically:

[0071] Extract the watermark from the watermark-embedded image through the inverse wavelet transform algorithm, and decode the watermark of the extracted QR code image to obtain the bit extraction sequence;

[0072] It should be noted that the method for decoding the QR code image and the inverse wavelet transform algorithm are well-known technologies and will not be elaborated here.

[0073] The calculation formula for the bit information loss of the document image is as follows:

[0074]

[0075] Among them, L seq is the bit information loss of the document image, N is the length of the original bit sequence, A is the original bit sequence, A ′ is the bit extraction sequence, and d() is to calculate the Hamming distance.

[0076] It should be noted that the smaller d(A, A ′ ), the smaller the obtained bit information loss, indicating that the original bit sequence and the bit extraction sequence are more similar, and the smaller the bit information loss means that the two sequences are more similar, then the degree of bit information loss of the sequence is smaller.

[0077] Step 4, based on the bit information loss and the text loss of all blocks, determine the loss function of the document image; embed the QR code image as a watermark in the target embedding block, perform iterative calculation on the loss function of the document image, obtain the document image after watermark embedding, print the document image after watermark embedding, identify the content of the QR code image in the printed document, compare the consistency of the recognition result with the original bit sequence, and perform anti-counterfeiting verification on the document content.

[0078] Furthermore, based on the bit information loss and the text loss, determine the loss function of the document image, specifically:

[0079]

[0080] Among them, F is the loss function of the document image, L seq is the bit information loss of the document image, L m is the text loss of the m-th block in the document image, M is the number of all blocks in the document image, and exp() is the exponential function with the natural constant as the base.

[0081] It should be noted that when L seq is equal to 0, it indicates that the original bit sequence and the bit extraction sequence are exactly the same, and the bit information loss L seq is at least 1, indicating that the information loss of the encoded bit stream is smaller; if the text loss is smaller, it indicates that the text loss of the corresponding block position after watermark embedding is smaller, and the obtained loss function is smaller, indicating that the quality of the document image after watermark embedding is higher.

[0082] Embed the QR code image as a watermark into the target embedding block in the document image, calculate the loss function of the document image, and continuously perform iterative calculations to minimize the loss function of the document image until the value of the loss function tends to a stable value or reaches the preset number of iterations, then stop the iteration. Embed the QR code image as a watermark into the target embedding block selected in the last iteration to obtain the final document image with the watermark embedded;

[0083] In this embodiment, the preset number of iterations is 30 times. As other implementation manners, the implementer can set it according to the actual situation.

[0084] The text receiving end obtains the final document image with the watermark embedded through the above method, prints out the document image with the watermark embedded, and sends the original bit sequence to the user receiving end. The receiving end uses a QR code reading tool to scan and identify the content of the QR code in the document. If the QR code data cannot be recognized or the content after recognition is inconsistent with the original bit sequence, it indicates that the document content has been tampered with or forged. Otherwise, the document content has not been tampered with or forged.

[0085] It should be understood that although Figure 1 the steps in the flowchart of Figure 1 are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover,

[0086] at least a part of the steps in

[0087] may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps. The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contain contradictions, it should be considered as the scope recorded in this specification.

[0087] The above-described embodiments only represent several implementation manners of the present application. Their descriptions are relatively specific and detailed, but they should not be construed as a limitation to the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made. Therefore, any simple modification, equivalent change, and modification made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application shall fall within the protection scope of the technical solution of the present application.

Claims

1. A method for anti-counterfeiting verification of the integrity of document content based on multi-page two-dimensional code technology, characterized in that, The method includes the following steps: Scan the electronic document of the current page to obtain a document image, and obtain an original bit sequence by acquiring the document content of the current page and the printing information for printing the document; Convert the original bit sequence into a QR code image, use the QR code image as a watermark, and embed it into the document image to obtain a watermark-embedded image; Divide the document image into multiple blocks; analyze the brightness difference between each pixel point in each block and the pixel point at the corresponding position in the watermark-embedded image, as well as the brightness difference of each pixel point in each block, and calculate the text loss of each block in the document image; Determine the loss consistency coefficient of each block in the document image according to the proximity of the text loss of each block in the document image to the remaining adjacent blocks; Based on the loss consistency coefficient, screen all the blocks in the document image to obtain target embedding blocks; obtain a bit extraction sequence by performing watermark extraction on the watermark-embedded image; analyze the difference between the bit extraction sequence and the original bit sequence to determine the bit information loss of the document image; Determine the loss function of the document image based on the bit information loss and the text loss of all blocks; Embed the QR code image as a watermark in the target embedding blocks, perform iterative calculation on the loss function of the document image to obtain the watermark-embedded document image, print the watermark-embedded document image, identify the content of the QR code image in the printed document, compare the consistency between the recognition result and the original bit sequence, and perform anti-counterfeiting verification on the document content.

2. The method for anti-counterfeiting verification of document content integrity based on multi-page two-dimensional code technology according to claim 1, wherein The process of obtaining the original bit sequence is as follows: Take the electronic document content and printing information of the current page as input, calculate the hash value using a hash function, convert it into a binary bit stream, and form the original bit sequence, where the printing information includes the printing time, the printer, and the number of printed copies.

3. The method for anti-counterfeiting verification of document content integrity based on multi-page two-dimensional code technology according to claim 1, characterized in that, The process of obtaining the watermark-embedded image is as follows: Convert the document image from the RGB space to the YUV space, perform a transformation on the Y channel value in the document image through a wavelet transform algorithm, and embed the QR code image as a watermark into the document image to obtain a watermark-embedded image.

4. The method for anti-counterfeiting verification of document content integrity based on multi-page two-dimensional code technology according to claim 3, characterized in that The calculation of the text loss of each block in the document image includes: Record the difference between the Y channel value of each pixel point in each block in the document image and the Y channel value of the corresponding pixel point in the watermark-embedded image as the pixel difference; Obtain the maximum Y channel value through the value range of the Y channel value in the YUV space; calculate the difference between the maximum Y channel value and the Y channel value of each pixel point in each block in the document image, and record the ratio of the difference to the maximum Y channel value as the color loss weight; Based on the color loss weight, perform a weighted sum of the pixel differences of all pixel points in each block in the document image, and take the square root of the result of the weighted sum as the text loss of each block in the document image.

5. The method for anti-counterfeiting verification of document content integrity based on multi-page two-dimensional code technology according to claim 1, characterized in that The loss consistency coefficient is the reciprocal of the product of the mean and standard deviation of the text losses of each block and its neighboring multiple blocks.

6. The method for anti-counterfeiting verification of document content integrity based on multi-page two-dimensional code technology according to claim 1, characterized in that The obtaining of the target embedding block includes: selecting the block corresponding to the minimum loss consistency coefficient and recording it as the target embedding block.

7. The method for anti-counterfeiting verification of document content integrity based on multi-page two-dimensional code technology according to claim 1, characterized in that The process of obtaining the bit extraction sequence is as follows: Extract the watermark from the watermark-embedded image through the inverse wavelet transform algorithm, and decode the watermark of the extracted QR code image to obtain the bit extraction sequence.

8. The method for anti-counterfeiting verification of document content integrity based on multi-page two-dimensional code technology according to claim 1, wherein The calculation formula for the bit information loss of the document image is as follows: Where L seq is the bit information loss of the document image, N is the length of the original bit sequence, A is the original bit sequence, A ′ is the bit extraction sequence, and d() is to calculate the Hamming distance.

9. The method for anti-counterfeiting verification of document content integrity based on multi-page QR code technology according to claim 1, wherein, The loss function for determining the document image is specifically as follows: where F is the loss function of the document image, and L seq is the bit information loss of the document image, and L m is the text loss of the m-th block in the document image, M is the number of all blocks in the document image, and exp() is the exponential function with the natural constant as the base.

10. The method for anti-counterfeiting verification of document content integrity based on multi-page QR code technology according to claim 1, wherein, The anti-counterfeiting verification of the document content includes: if the recognition result is inconsistent with the original bit sequence, the document content has been tampered with or forged; otherwise, the document content has not been tampered with or forged.

Citation Information

Patent Citations

  • Chinese character complexity-based printing and scanning prevention text watermarking algorithm

    CN104778650A

  • Digital watermark algorithm based on text document protection

    CN107688731A