Document content integrity anti-counterfeiting verification method based on multi-page two-dimensional code technology

By embedding multi-page QR code watermarks in documents and optimizing the embedding position, the problem of existing document watermark technology in the selection of embedded locations is solved, achieving higher accuracy and security of document content anti-counterfeiting verification.

CN120012053AActive Publication Date: 2025-05-16国投云网数字科技有限公司 +1

Patent Information

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

AI Technical Summary

Technical Problem

The existing document watermarking technology has problems in selecting embedded locations, which are easily erased by attackers through image transformation and other methods, or the embedded location overlaps with the text, causing the document to be distorted, affecting the accuracy of anti-counterfeiting verification.

Method used

The document content integrity anti-counterfeiting verification method based on multi-page QR code technology is adopted. By scanning and printing information on electronic documents, the original bit sequence is generated, and converted into a QR code image as a watermark, embedded in the document image, embedded and extracted through a wavelet transformation algorithm, text loss and bit information loss are calculated, and the loss function is iteratively calculated to optimize the watermark embedding position.

Benefits of technology

It effectively avoids the risk of watermark being erased by attackers, reduces the possibility of document distortion, improves the recognition of text and watermarks in the document, and thus enhances the accuracy of anti-counterfeiting verification of document content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120012053A_ABST
    Figure CN120012053A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of document anti-counterfeiting security verification, in particular to a multi-page two-dimensional code technology-based document content integrity anti-counterfeiting verification method, which comprises the following steps of: scanning an electronic document of a current page to obtain a document image, and converting an obtained original bit sequence into a two-dimensional code image to obtain a watermark embedded image; calculating text loss and a loss consistency coefficient; obtaining a target embedded block; obtaining a bit extraction sequence, bit information loss and a loss function; and carrying out iterative calculation on the loss function to obtain a watermark-embedded document image, printing the watermark-embedded document image, identifying the content of the two-dimensional code image in the printed document, comparing the consistency of the identification result and the original bit sequence, and carrying out anti-counterfeiting verification on the document content. According to the method and the device, the watermark embedding position can be reasonably selected, the possibility of document distortion is reduced, the distinguishing degree of characters and watermarks in the document is improved, and the accuracy of anti-counterfeiting verification of the document content is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the popularization of informatization, all enterprises have achieved paperless office in the whole process, and all documents are managed by electronic drafting, approval, circulation, archiving and other processes; however, many business scenarios still require the use of printed paper documents. The popularity of electronic office has led to an increasing proportion of document information in digital form. As the demand for information protection increases, document watermarking technology provides traceable evidence by embedding anti-counterfeiting information, meeting information security requirements.

[0003] However, the location where the document watermark is embedded needs to be chosen reasonably. If the watermark is embedded in the blank area at the edge of the document, the attacker can erase the watermark through simple image transformation and cropping methods, so the document watermark cannot achieve the purpose of anti-counterfeiting. If the location where the watermark is embedded highly overlaps with the text area in the document, it will cause document distortion, reduce the recognition of the text and watermark in the document, make it difficult to identify the document, and thus affect the accuracy of the anti-counterfeiting verification of the document content. Summary of the invention

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

[0005] The solution to the technical problem of this application is to provide a document content integrity anti-counterfeiting verification method based on multi-page QR 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 of printing the document;

[0007] Converting the original bit sequence into a two-dimensional code image, taking the two-dimensional code image as a watermark, and embedding it into a document image to obtain a watermark-embedded image;

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

[0009] Determining a 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 remaining adjacent blocks;

[0010] Based on the loss consistency coefficient, all blocks in the document image are screened to obtain the target embedded block; a bit extraction sequence is obtained by performing watermark extraction on the watermark embedded image; and 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] Determining a loss function of the document image based on the bit information loss and the text loss of all blocks;

[0012] The two-dimensional code image is embedded as a watermark in the target embedding block, the loss function of the document image is iteratively calculated, the document image after the watermark is embedded is obtained, the document image after the watermark is embedded is printed, and the content of the two-dimensional code image in the printed document is recognized, and the consistency of the recognition result and the original bit sequence is compared to perform anti-counterfeiting verification on the document content.

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

[0014] The electronic document content of the current page and the printing information are taken as input, and the hash value is calculated using a hash function and converted into a binary bit stream to form an original bit sequence, wherein the printing information includes the printing time, the printer, and the number of copies.

[0015] Preferably, the process of acquiring the watermark embedded image is:

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

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

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

[0019] 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 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;

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

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

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

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

[0024] The watermark is extracted from the watermark-embedded image by using the inverse wavelet transform algorithm, and the watermark of the extracted two-dimensional code image is decoded to obtain a bit extraction sequence.

[0025] Preferably, the calculation formula for the bit information loss of the document image is: 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, and A ′ is the bit extraction sequence, and d() is the calculated Hamming distance.

[0026] Preferably, the loss function for determining the document image is specifically: 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 mth block in the document image, M is the number of all blocks in the document image, and exp() is an exponential function with a 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] The present application performs hash calculation on the electronic document content and print information of the current page to obtain the original bit sequence, converts it into a two-dimensional code image, embeds the two-dimensional code image as a watermark into the document image through a wavelet transform algorithm to obtain a watermark-embedded image, analyzes the difference in the Y channel values ​​of the pixels at the same position between the document image and the watermark-embedded image, and calculates the text loss. The beneficial effect is that the document content and print information are encrypted and converted into a two-dimensional code, and the brightness change of the pixels at the same position in the document image before and after the watermark is embedded is considered, thereby reflecting the loss of the text when the watermark is embedded near the text or overlaps with the text, thereby explaining the impact of the watermark embedding on the text in the document image; secondly, the loss consistency coefficient is calculated, all blocks in the document image are screened, and the target embedded block is obtained. The beneficial effect is that the consistency of the text loss of each block with the rest of the blocks around it is considered, thereby explaining that the watermark of the two-dimensional code image should be embedded in the block with the smallest text loss and the position where the text loss of the rest of the blocks around it is also small; by extracting the watermark embedding image The watermark in the image is extracted to obtain a bit extraction sequence, and the bit information loss is calculated. The beneficial effect is that the difference between the bit information contained in the document image after the watermark is embedded and the original bit information is taken into account to reflect the possible situation that the watermark is embedded near the text or overlaps with the text; the loss function is calculated to reflect the loss of the document image after each watermark is embedded, and the two-dimensional code image is embedded as a watermark in the target embedding block in the document image, and the loss function of the document image is calculated and then it is iterated to minimize the loss function, and the two-dimensional code image is embedded as a watermark in the target embedding block selected in the last iteration, so as to obtain the final document image after the watermark is embedded, and the final document image after the watermark is embedded is printed out, and the content in the document is identified by a two-dimensional code reading tool, and the identification result is compared with the original bit sequence, and the document content is verified for anti-counterfeiting. The beneficial effect is that the position of watermark embedding can be reasonably selected, the possibility of document distortion can be reduced, and the recognition of text and watermark in the document can be improved, which is conducive to improving the accuracy of anti-counterfeiting verification of the document content. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The document content integrity anti-counterfeiting verification method based on multi-page QR code technology of the present application is further described in detail below in conjunction with the accompanying drawings.

[0031] Figure 1 A flowchart of the steps of the document content integrity anti-counterfeiting verification method based on multi-page QR code technology provided in an embodiment of the present application;

[0032] Figure 2 A flowchart of the steps of a method for obtaining text loss in each block within a document image provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the document content integrity anti-counterfeiting verification method based on multi-page QR code technology proposed in the present application is further described in detail below in conjunction with the accompanying drawings and implementation examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.

[0034] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0035] See also Figure 1 , which shows a flowchart of a method for document content integrity anti-counterfeiting verification based on multi-page QR code technology provided by an embodiment of the present application, the method comprising 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 of the document.

[0037] In the information age, traditional paper documents are gradually being replaced by electronic documents, but paper documents still need to be printed in many business scenarios. To ensure the integrity and security of the document content, anti-counterfeiting information is embedded in the document through document watermarking 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 single pixel 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 on paper. The conversion process of the continuous tone image into a halftone image will cause image distortion due to information loss.

[0038] The electronic document of the current page is converted into an image and recorded as a document image. Therefore, a gamma correction operation is performed on the document image to optimize the brightness distribution of the document image to ensure that the details and shadows of the fonts in the document image are accurately expressed in the printed result. The document image is cropped and perspective transformed to remove most of the blank areas around the text area in the document image to avoid insufficient anti-counterfeiting reliability when watermarks are embedded in these areas. Secondly, a Gaussian blur algorithm is used to denoise the document image.

[0039] It should be noted that Gamma correction, Gaussian blur algorithm, cropping and perspective transformation are well-known technologies and will not be described in detail here.

[0040] Secondly, the electronic document content of the current page and information such as printing time, printer, and printing batch are used as input, and a hash function is used to calculate a hash value, and the hash value is converted into a binary bit stream to form an original bit sequence;

[0041] In this embodiment, the SHA1 hash function is used to calculate the hash value, wherein the SHA1 hash function is a well-known technology and will not be described in detail here. As other implementation methods, the implementer can adopt other methods of the prior art, such as the SHA256 hash function, etc., and this embodiment does not impose special restrictions on this. The hash value calculated in this embodiment is 32 bits, and as other implementation methods, the implementer can set it according to actual conditions. By using the hash function on the electronic document content and information such as the printing time, the printer, and the printing batch, the document content and the printing information are encrypted so that the printed document content can be compared with the original electronic document content for subsequent verification.

[0042] At this point, the document image and the original bit sequence are obtained.

[0043] Step 2, converting the original bit sequence into a two-dimensional code image, taking the two-dimensional code image as a watermark, embedding it into a document image to obtain a watermark-embedded image; dividing the document image into multiple blocks; analyzing the brightness difference between each pixel in each block and the pixel at the corresponding position in the watermark-embedded image, as well as the brightness difference between each pixel in each block, and calculating 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 watermarking. In order to avoid a significant reduction in the image quality after embedding the watermark, the optimal embedding position is found through iterative operations, and then the watermark is embedded and extracted. First:

[0045] The original bit sequence is converted into a two-dimensional code image through a two-dimensional code image generation algorithm, the document image is converted from RGB space to YUV space, the Y channel value in the document image is transformed through a wavelet transform algorithm, and the two-dimensional code image is embedded into the document image as a watermark to obtain a watermark embedded image;

[0046] It should be noted that the two-dimensional code image generation algorithm is a well-known technology and will not be described in detail here. Since the Y channel represents brightness and is directly related to the grayscale value, it can be used to measure the light and dark changes 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 two-dimensional code image is embedded by modifying the wavelet transform coefficient to obtain a watermark-embedded image. Among them, the process of watermark embedding by the wavelet transform algorithm is a well-known technology and will not be described in detail here. In this embodiment, the wavelet function of the wavelet transform algorithm adopts 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. The background blank area is removed through the cropping process in step 1. When the digital watermark is embedded in the document image, if it is embedded near the text or overlaps with the text, it will cause document distortion, reduce the recognition of 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 is usually printed in black, and the human eye will focus on the text rather than the white part of the paper when reading the document. Therefore, if the pixel value of the document image is closer to black, the watermark is less likely to be embedded in this area. By analyzing the difference in the Y channel value of the document image before and after the watermark is embedded, the text loss is calculated to reflect the distortion of the text in the document image after the watermark of the two-dimensional code image is embedded in the document image compared to before embedding. The step flow chart of the method for obtaining the text loss of each block in the document image provided in the embodiment of the present application is as follows: Figure 2 As shown, specifically including:

[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 methods, the implementer can set it according to the actual situation.

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

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

[0053] Get the maximum Y channel value through the value range of the Y channel value in the YUV space;

[0054] It should be noted that in the YUV space, the value range of the Y channel value is 0 to 255, so 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 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;

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

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

[0058]

[0059] Among them, L m is the text loss of the mth block in the document image, Y m,i is the Y channel value of the i-th pixel in 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 in the watermark embedded image, Y max is the maximum Y channel value, N m is the number of all pixels in the mth block in 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 larger the pixel difference is, the larger the difference in the Y channel value of the pixel between the document image and the watermark embedded image is, the greater the impact of watermark embedding on the image is, and the greater the text loss of the pixel is; the smaller the color loss weight is, the closer the Y channel value of the pixel is to black. If a pixel is black, the Y channel value of the pixel is the maximum Y channel value, the color loss weight is 0, and the color component has no effect on the text loss. The larger the color loss weight is, the farther the Y channel value of the pixel is from black, and the greater the resulting text loss is, the greater the text loss caused by embedding the watermark at the pixel in the corresponding block in the text image. 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 subsequently embedded in brighter areas, which have less visual impact and can better maintain the concealment of the watermark.

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

[0062] Step 3, determining the loss consistency coefficient of each block in the document image by comparing the proximity of the text loss of each block in the document image with the remaining adjacent blocks; based on the loss consistency coefficient, screening all blocks in the document image to obtain the target embedded block; extracting the watermark from the watermark embedded image to obtain a bit extraction sequence; analyzing 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 after the watermark is embedded, the watermark of the QR code image should be embedded in the block with the smallest text loss. However, it is unreasonable to only select the block with the smallest text loss, because it is possible that the text loss of this block is the smallest, while the text loss of the surrounding blocks is large. For example, in some blank cells in a table in a document, embedding a watermark in such blank space may interfere with the text.

[0064] Based on the above analysis, the watermark should be embedded in the area corresponding to the block with smaller text loss and the block with smaller text loss around it. Therefore, for each block and the text loss of the rest of the blocks around it, the loss consistency coefficient is calculated, which is:

[0065] Calculate the mean of the text loss of each block and multiple adjacent blocks, calculate the standard deviation of the text loss of each block and multiple adjacent blocks, and use 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, the mean and standard deviation of the text loss of each block and its four adjacent blocks are calculated.

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

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

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

[0070] Furthermore, the document watermark is a binary bit stream in the encoding. If the watermark is embedded near or overlaps with the text when it is embedded in the document image, that is, the greater the text loss, the greater the difference between the bit extraction sequence and the original bit sequence obtained by extracting the watermark from the document image. Therefore, the bit information loss is calculated as follows:

[0071] The watermark is extracted from the watermark-embedded image by using the inverse wavelet transform algorithm, and the watermark of the extracted two-dimensional code image is decoded to obtain a bit extraction sequence;

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

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

[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, and A ′ is the bit extraction sequence, and d() is the calculated Hamming distance.

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

[0077] Step 4, determining the loss function of the document image based on the bit information loss and the text loss of all blocks; embedding the two-dimensional code image as a watermark in the target embedding block, iteratively calculating the loss function of the document image, and obtaining the document image after the watermark is embedded, printing the document image after the watermark is embedded, and identifying the content of the two-dimensional code image in the printed document, comparing the consistency of the identification result with the original bit sequence, and performing anti-counterfeiting verification on the document content.

[0078] Further, based on the bit information loss and the text loss, a loss function of the document image is determined, 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 mth block in the document image, M is the number of all blocks in the document image, and exp() is an exponential function with a natural constant as the base.

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

[0082] Embed the two-dimensional code image as a watermark in 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 a preset number of iterations, stop iteration, and embed the two-dimensional code image as a watermark in the target embedding block selected in the last iteration, thereby obtaining a final document image after watermark embedding;

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

[0084] The text receiving end obtains the final document image after watermark embedding through the above method, prints out the document image after watermark embedding, and sends the original bit sequence to the user receiving end. The receiving end uses a QR code reading tool to scan the content of the QR code in the document for identification. If the QR code data cannot be identified or the identified content is inconsistent with the original bit sequence, it means 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 are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0086] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0087] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the present application. It should be pointed out that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to 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 document content integrity anti-counterfeiting verification method based on multi-page QR code technology, characterized in that: The method comprises the following steps: 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 of printing the document; Converting the original bit sequence into a two-dimensional code image, taking the two-dimensional code image as a watermark, and embedding it into a document image to obtain a watermark-embedded image; Divide the document image into multiple blocks; analyze the brightness difference between each pixel in each block and the pixel at the corresponding position in the watermark embedded image, as well as the brightness difference between each pixel in each block, and calculate the text loss of each block in the document image; Determining a 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 remaining adjacent blocks; Based on the loss consistency coefficient, all blocks in the document image are screened to obtain the target embedded block; a bit extraction sequence is obtained by performing watermark extraction on the watermark embedded image; and the difference between the bit extraction sequence and the original bit sequence is analyzed to determine the bit information loss of the document image; Determining a loss function of the document image based on the bit information loss and the text loss of all blocks; The two-dimensional code image is embedded as a watermark in the target embedding block, the loss function of the document image is iteratively calculated, the document image after the watermark is embedded is obtained, the document image after the watermark is embedded is printed, and the content of the two-dimensional code image in the printed document is recognized, and the consistency of the recognition result and the original bit sequence is compared to perform anti-counterfeiting verification on the document content.

2. The document content integrity anti-counterfeiting verification method based on multi-page two-dimensional code technology as claimed in claim 1, characterized in that: The process of obtaining the original bit sequence is as follows: The electronic document content of the current page and the printing information are taken as input, and the hash value is calculated using a hash function and converted into a binary bit stream to form an original bit sequence, wherein the printing information includes the printing time, the printer, and the number of copies.

3. The document content integrity anti-counterfeiting verification method based on multi-page two-dimensional code technology as claimed in claim 1, characterized in that: The acquisition process of the watermark embedded image is as follows: The document image is converted from RGB space to YUV space, the Y channel value in the document image is transformed by wavelet transform algorithm, and the QR code image is embedded into the document image as a watermark to obtain a watermark embedded image.

4. The document content integrity anti-counterfeiting verification method based on multi-page two-dimensional code technology as claimed in claim 3, characterized in that: The calculating of the text loss of each block in the document image includes: The difference between the Y channel value of each pixel in each block in the document image and the Y channel value of the corresponding pixel in the watermark embedded image is recorded 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 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, the pixel differences of all pixels in each block in the document image are weighted summed, and the square root of the weighted summation result is used as the text loss of each block in the document image.

5. The document content integrity anti-counterfeiting verification method based on multi-page two-dimensional code technology as claimed in claim 1, characterized in that: The loss consistency coefficient is the inverse of the product of the mean and standard deviation of the text loss of each block and its adjacent blocks.

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

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

8. The document content integrity anti-counterfeiting verification method based on multi-page two-dimensional code technology as claimed in claim 1, characterized in that: The calculation formula for the bit information loss of the document image is: 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, and A ′ is the bit extraction sequence, and d() is the calculated Hamming distance.

9. The document content integrity anti-counterfeiting verification method based on multi-page two-dimensional code technology as claimed in claim 1, characterized in that: The loss function for determining the document image is specifically: 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 mth block in the document image, M is the number of all blocks in the document image, and exp() is an exponential function with a natural constant as the base.

10. The document content integrity anti-counterfeiting verification method based on multi-page two-dimensional code technology as claimed in claim 1, characterized in that: 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

  • Judicial document anti-counterfeiting and tamper-proofing method and system based on fragile watermarks

    CN111177666A

  • Document anti-counterfeiting printing method and device and printed document authentication method and device

    CN116933221A

Cited By

  • Intelligent anti-counterfeiting detection method and system for packaging design drawing based on artificial intelligence

    CN120563297A

  • Non-inductive watermark electronic file anti-counterfeiting method based on evolutionary computation

    CN121327800A