Two-dimensional code seal embedding method and defect-repair type two-dimensional code set seal verification system

By embedding a pre-processed seal image into a QR code and matching it with a physical seal in a damaged state, the security and interactivity issues of the seal collection verification system are solved, achieving high anti-counterfeiting and information security while improving user interactivity.

CN121168484APending Publication Date: 2025-12-19ORIENTAL CULTURAL EXPO (CHONGQING) CULTURE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511334361.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Existing stamp verification systems are not very secure, have complex communication processes, lack user interactivity, and have insufficient QR code anti-counterfeiting capabilities.

Method used

By preprocessing the initial stamp image to make its area greater than or the sum of its areas greater than the maximum error correction and recovery area of ​​the original QR code, each stamp is embedded into the QR code. Anti-counterfeiting is achieved through physical stamp matching in the damaged state, and verification is carried out in combination with complementary repair stamp groups.

Benefits of technology

It achieves high anti-counterfeiting and interactivity, reduces the number of communications, improves information security, and enhances user engagement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121168484A_ABST
    Figure CN121168484A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of man-machine interaction verification and the technical field of identification coding, and provides a two-dimensional code seal embedding method and a defect-repair type two-dimensional code set seal verification system, and the method comprises the steps: converting to-be-converted data into an original two-dimensional code image; preprocessing the more than one initial seal image to obtain a seal list; embedding more than one seal image in the seal list into the original two-dimensional code image in sequence to obtain a seal embedded two-dimensional code image; cutting out all seal patterns from the seal embedded two-dimensional code image; embedding the seal into the two-dimensional code image, and replacing all seal patterns in the two-dimensional code image with blank areas to obtain a defective two-dimensional code pattern; the invention further discloses a defect two-dimensional code and a complementary repair seal group. The defect two-dimensional code and the complementary repair seal group are matched with each other, so that the anti-counterfeiting property of seal collection verification is enhanced, and the user interactivity is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of human-computer interaction verification and identification coding, and particularly relates to a two-dimensional code seal embedding method and a missing-repairing two-dimensional code seal collection verification system. BACKGROUND

[0002] A seal collection verification system is usually used in the field of creative authentication, marketing interaction and education tools. The seal collection verification system is a digital management system that records user behavior, proves that a user has completed a task or arrived at a certain location, and provides rewards or authentication accordingly by collecting digital or physical seals (stamps).

[0003] The working process of the seal collection verification system in the related art includes the following steps. First, the user proves that he or she has completed a task by completing an offline task. The proof method is not limited to scanning a special two-dimensional code on site for the user, notifying the server that the user has arrived at the point through the two-dimensional code, or clicking on the seal collection through the user's mobile phone GPS positioning in the preset geographic fence, or giving the user a token or verification code after the staff confirms that the user has completed the task.

[0004] Second, the front end sends the user's identity, verification data (such as the two-dimensional code, GPS position, etc. in the first step), time stamp, etc. to the server after encryption, and the server performs authenticity verification. Third, after the server verifies, the server sends the verification result to the user terminal, and the user obtains a seal. Fourth, the user repeats the first to third steps to accumulate seals, and the user terminal clearly shows the seal collection progress. When the preset condition (such as collecting all seals or a specific combination) is met, the user can enter the exchange page.

[0005] In the above seal collection verification system, the user needs to send encrypted data (GPS position, user information, etc.) to the server to verify for each seal obtained. The encrypted information is easy to be copied or tampered with, the security is not high enough, the communication process is complex, and the interactivity with the user is insufficient.

[0006] In the field of identification coding, it is necessary to convert the data to be encoded (such as a preset website, a preset text) into a two-dimensional code, and the user calls the data to be encoded by scanning the two-dimensional code, such as entering the website page. In order to promote the brand, enhance the visual attraction rate and the scanning rate, in the related technology, the error correction capability of the two-dimensional code is used to directly embed an image such as a trademark, a software logo or a social avatar in the two-dimensional code. Specifically, the specified embedded image file is taken as a logo, which is appropriately scaled and positioned at the center of the two-dimensional code generated in advance to obtain a logo-embedded two-dimensional code. Since the logo occupies a proportion lower than the maximum value of the correctable area of the two-dimensional code, the scanner cannot recognize the logo inside, and the remaining part of the code needs to be recognized by the scanner, therefore, the logo-embedded two-dimensional code cannot achieve user stamping anti-counterfeiting. SUMMARY

[0007] The present application aims to at least solve the technical problems existing in the prior art, and provides a two-dimensional code stamp embedding method and a defect-repairing two-dimensional code stamp verification system.

[0008] In a first aspect, the present application provides a two-dimensional code stamp embedding method, which comprises: Converting the data to be converted into an original two-dimensional code image; preprocessing one or more initial stamp images to obtain a stamp list, the stamp list comprising one or more stamp images, and the area of each stamp image being greater than the maximum error correction recovery area of the original two-dimensional code image, or the sum of the areas of any two stamp images being greater than the maximum error correction recovery area of the original two-dimensional code image; Embedding one or more stamp images in the stamp list in the original two-dimensional code image in sequence to obtain a stamp-embedded two-dimensional code image; wherein the embedding process of the pth stamp image is: determining a matching area of the pth stamp image in the original two-dimensional code image or the original two-dimensional code image after embedding p-1 stamp images; integrating the pth stamp image into the matching area of the pth stamp image, and ensuring that the original two-dimensional code image after integrating the pth stamp image can be recognized; taking the image of the matching area after integrating the pth stamp image as the stamp pattern corresponding to the pth stamp image; p is a positive integer; cutting all stamp patterns from the stamp-embedded two-dimensional code image; replacing all stamp patterns in the stamp-embedded two-dimensional code image with blank areas respectively to obtain a defective two-dimensional code pattern.

[0009] In a second aspect, the present application further provides a defective two-dimensional code, comprising a carrier, and a defective two-dimensional code pattern printed on the carrier, wherein the defective two-dimensional code pattern is obtained by the two-dimensional code stamp embedding method provided in the first aspect of the present application.

[0010] In a third aspect, the application further provides a complementary repair stamp set, comprising one or more physical stamps engraved with different stamp patterns, wherein the stamp patterns are obtained by the two-dimensional code stamp embedding method provided in the first aspect of the application.

[0011] The above technical solutions have the following advantages: In the two-dimensional code stamp embedding method, the initial stamp image is preprocessed, so that the area of a single stamp image or the sum of the areas of any two stamp images is greater than the maximum error correction recovery area of the original two-dimensional code image, so that only the damaged two-dimensional code pattern cannot be identified. The method embeds all or part of the stamp images in the stamp list one by one in the original two-dimensional code image, and takes the original two-dimensional code image after embedding the last stamp image as the stamp-embedded two-dimensional code image. The stamp images are embedded one by one, and each time the stamp image is embedded, it is necessary to ensure that the original two-dimensional code image after embedding the current stamp image can be identified. In this way, the user must restore the stamp pattern in the damaged two-dimensional code pattern according to the matching area in the stamp verification, and the lack of stamp or the mismatch between the stamp pattern stamped by the user and the blank area will result in that the damaged two-dimensional code pattern after stamping (stamping pattern) in the blank area cannot be identified. In this way, the two-dimensional code stamping achieves anti-counterfeiting. Compared with the LOGO-embedded two-dimensional code in the related art, the damaged two-dimensional code pattern has the anti-counterfeiting function.

[0012] The damaged two-dimensional code disclosed in the application cannot be identified, and needs to be identified by using the physical stamp of the complementary repair stamp set provided in the application to stamp the corresponding stamp pattern in all blank areas. The damaged two-dimensional code and the complementary repair stamp set are complementary, which realizes stamping anti-counterfeiting and has good usability and replicability.

[0013] In a fourth aspect, the application further provides a damaged-repair two-dimensional code stamp verification system, comprising: the damaged two-dimensional code provided in the second aspect of the application; the complementary repair stamp set provided in the third aspect of the application, used for stamping the stamp pattern in the blank area of the damaged two-dimensional code pattern of the damaged two-dimensional code; and a verification terminal, used for performing two-dimensional code identification on the damaged two-dimensional code after stamping the stamp pattern.

[0014] The above technical solution: the user uses the entity seal in the complementary repair seal group to stamp the corresponding seal pattern on all blank places of the damaged two-dimensional code to fill the blank places. Only the damaged two-dimensional code after all blank places are stamped with the corresponding seal pattern (or only one blank place is not stamped) can be successfully identified by the verification terminal. If part of the blank places (more than one blank place or more than two blank places) are not stamped with the seal pattern, or the blank places are stamped with the non-corresponding seal pattern, then the damaged two-dimensional code at this time cannot be successfully identified by the verification terminal. In this way, the seal verification process is realized, and the anti-counterfeiting performance is high. The seal verification system of the application only communicates with the server when the verification terminal is identified, reduces the communication frequency, and no longer encrypts the data information for transmission, thereby improving the information security. At the same time, the user personally participates in the production of the two-dimensional code through the stamping behavior, thereby greatly improving the user interaction. BRIEF DESCRIPTION OF DRAWINGS DETAILED DESCRIPTION OF THE INVENTION BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 is a flowchart of a two-dimensional code seal embedding method in a preferred embodiment of the application; Figure 2 is a damaged two-dimensional code pattern in an example of the application; Figure 3 is a two-dimensional code image embedded with a seal in an example of the application; Figure 4 is a detailed flowchart of a two-dimensional code seal embedding method in an example of the application; Figure 5 is a damaged two-dimensional code in another example of the application; Figure 6 is a schematic diagram of a complementary repair seal group in an example of the application; Figure 7 is a damaged two-dimensional code repaired by stamping in another example of the application. DETAILED DESCRIPTION

[0016] Embodiments of the application are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference signs represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the accompanying drawings are exemplary and are only used to explain the application and cannot be understood as a limitation of the application.

[0017] The application discloses a two-dimensional code seal embedding method. In a preferred embodiment, please see Figure 1 , the method comprises: Step S1, converting the to-be-converted data into an original two-dimensional code image.

[0018] In the embodiment, the data to be converted is not limited to a website address or plain text information. Specifically, the data to be converted can be converted into an original QR code image by using a two-dimensional code generation library pypqrcode or Spire.Barcode.

[0019] In step S2, the initial seal images are preprocessed to obtain a seal list, and the seal list includes one or more seal images, each seal image has an area greater than the maximum error correction recovery area of the original QR code image, or the sum of the areas of any two seal images is greater than the maximum error correction recovery area of the original QR code image.

[0020] In the embodiment, the execution subject of the method is not limited to reading one or more initial seal images from a local or Internet or host computer. The initial seal images are not limited to various identification images in the fields of cultural and creative authentication, marketing interaction, and educational tools, such as scenic spot images, cultural artifact images, or school images, etc. To facilitate better recognition of the original QR code image after the seal images are integrated, the initial seal images can be line images.

[0021] In the embodiment, the preprocessing is not limited to including a size scaling process, and the purpose is to match the size of the original QR code image. A ratio can be preset, and the initial seal image is scaled according to the preset ratio. Through the size scaling process, the area of each obtained seal image is greater than the maximum error correction recovery area of the original QR code image, or the sum of the areas of any two seal images is greater than the maximum error correction recovery area of the original QR code image. The maximum error correction recovery area of the original QR code image is 7% to 30% of the area of the original QR code image, and preferably, the maximum error correction recovery area of the original QR code image is 7% of the area of the original QR code image. The preprocessed seal images are grouped into a seal list for subsequent loop calling of embedding operations.

[0022] In step S3, one or more seal images in the seal list are sequentially embedded into the original QR code image to obtain a seal-embedded QR code image. Figure 3 An example of a seal-embedded QR code image is shown.

[0023] In the pth seal image embedding process, a matching area of the pth seal image is determined in the original QR code image or the original QR code image after embedding p-1 seal images; the pth seal image is integrated into the matching area of the pth seal image, and it is ensured that the original QR code image after integrating p seal images can be recognized; the image of the matching area after integrating the pth seal image is taken as the seal pattern corresponding to the pth seal image; p is a positive integer. Specifically, the pyzbar library of python can be used to detect the recognizability of the original QR code image after integrating p seal images, and it is ensured that each seal image can be recognized by a standard decoding tool.

[0024] In the embodiment, the area of each seal image is greater than the maximum error correction recovery area of the original two-dimensional code image, so that all the blank places in the subsequent damaged two-dimensional code need to be stamped with the corresponding seal pattern to be recognized by the two-dimensional code, realizing high anti-counterfeiting capability. The sum of the areas of any two seal images is greater than the maximum error correction recovery area of the original two-dimensional code image, so that the seal combination anti-counterfeiting capability can be achieved, and at least n-1 seals are collected to identify the two-dimensional code, so that the area of the seal is smaller and the number of seals is more under the condition of ensuring that the anti-counterfeiting capability decreases less. In the embodiment, all seal images in the seal list can be sequentially embedded in the original two-dimensional code image, or only part of the seal images can be embedded. In the sequential embedding process, if a certain seal image cannot be successfully embedded in all its matching areas (i.e., overlapping with the remaining embedded seal images), and even if it is successfully embedded, the original two-dimensional code image after embedding the seal image cannot be identified, then the seal image can be skipped and the next seal image can be selected for embedding processing. The finally obtained seal embedded two-dimensional code image is embedded with more than one seal image.

[0025] Step S4, all seal patterns are cropped from the seal embedded two-dimensional code image. One seal pattern corresponds to one physical seal.

[0026] Step S5, all seal patterns in the seal embedded two-dimensional code image are replaced with blank areas to obtain a damaged two-dimensional code pattern. Figure 2 A damaged two-dimensional code pattern example is shown. Scanning the damaged two-dimensional code pattern cannot be recognized by the two-dimensional code, which plays an anti-counterfeiting effect.

[0027] It should be noted that steps S1 and S2 can be executed in parallel or in series, and steps S4 and S5 can be executed in parallel or in series.

[0028] In the embodiment, the damaged two-dimensional code pattern is in a pre-set damaged state, and the damaged area is greater than the maximum error correction recovery area of the original two-dimensional code image, so that the damaged two-dimensional code pattern cannot be recognized and needs to be matched accurately by a physical seal (stamping the corresponding seal pattern on the blank place) to be restored and successfully recognized, realizing seal verification anti-counterfeiting.

[0029] In the embodiment, in step S3, in the process of embedding the seal image into the two-dimensional code image, the original two-dimensional code image with the embedded seal image is scanned and recognized once for each embedded seal image. The two-dimensional code is checked for recognizability after each seal image is placed in order to reduce the complexity of the enumeration of the embedding position. If all the seal images are embedded at one time and then the two-dimensional code is checked for recognizability, the time complexity is the product of the number of possible positions of all the seal images, which is the time complexity of the combination level. If the two-dimensional code is checked for recognizability after each seal image is placed, the total number of possible positions of each seal image is reduced, the time complexity is reduced, and the processing efficiency is improved.

[0030] In a preferred embodiment, in step S1, the pre-processing of the one or more initial seal images to obtain the seal list includes: Step S11, binarizing the initial seal image; Step S12, performing size scaling processing on the binarized initial seal image to obtain a seal image; Step S13, grouping the one or more seal images into a seal list.

[0031] In the embodiment, the edge features of the seal image are enhanced through binarization processing, so that the initial seal image after binarization processing is more similar to the pixel features in the original two-dimensional code image, which helps the seal image to be more easily recognized by the two-dimensional code after being integrated into the corresponding matching area of the original two-dimensional code image. To adapt to different sizes of original two-dimensional code images, the read initial seal image is scaled according to a preset ratio to ensure that the size of the scaled seal image exceeds the maximum error correction recovery area of the original two-dimensional code image, and a target size seal image is obtained.

[0032] In a preferred embodiment, in the process of embedding the pth seal image in step S3, the matching area of the pth seal image is determined in the original two-dimensional code image or the original two-dimensional code image after embedding p-1 seal images, including: Step S31, obtaining one or more rectangular areas with shapes and sizes matching the pth seal image on the original two-dimensional code image or the original two-dimensional code image after embedding p-1 seal images.

[0033] In the embodiment, the one or more rectangular areas with shapes and sizes matching the pth seal image are not limited to being obtained by template matching or randomly selecting the position of the rectangular area. The position of the rectangular area is generally the top-left corner coordinate of the rectangular area. The rectangular area matching the pth seal image is not limited to the circumscribed rectangular frame of the pth seal image and the internal area thereof.

[0034] For example, the size of the pth stamp image is n x m pixels, the size of the original two-dimensional code image is N x M pixels, and the rectangular region position coordinates (x, y), i.e., the coordinates of the upper left corner of the rectangular region in the two-dimensional image coordinate system, start from (0, 0) and satisfy the condition that x < N-n and y < M-m, so that more than one rectangular region is found in the original two-dimensional code image. In the two-dimensional image coordinate system, the positive direction of the y-axis is downward, and the positive direction of the x-axis is to the right. A rectangular region corresponds to a top-left corner position, which can be considered as a possible embedding position.

[0035] In step S32, the matching degree of the two-dimensional code image of each rectangular region (i.e., the two-dimensional code image corresponding to the rectangular region in the original two-dimensional code image) and the pth stamp image is calculated. The matching degree is not limited to calculating the graphical similarity of the two-dimensional code image of the rectangular region and the pth stamp image.

[0036] In the above example, the matching degree of the two-dimensional code image of the rectangular region with the top-left corner position (x, y) and the pth stamp image is : wherein represents the pixel value of the pixel point with coordinates (i, j) in the pth stamp image, represents the pixel value of the pixel point with coordinates (i, j) in the two-dimensional code image of the rectangular region with the top-left corner position (x, y). and are positive integers.

[0037] In step S33, the more than one rectangular region is sorted in descending order of the matching degree, and the top-k rectangular regions with the highest matching degree are selected as the k matching regions, and k is a positive integer.

[0038] In this embodiment, all the rectangular regions are sorted according to their matching degrees, and the top-k positions (rectangular regions) with higher matching degrees are selected as all possible matching regions. By selecting the matching regions according to the matching degrees, it is helpful to successfully identify the original two-dimensional code image after the stamp image is integrated into the matching region, and the higher the matching degree, the greater the probability of successful identification, thereby improving the speed of generating the stamp embedded two-dimensional code.

[0039] In a preferred embodiment, in the pth stamp image embedding process of step S3, the integration of the pth stamp image into the matching region of the pth stamp image includes traversing the k matching regions to perform: Step A, determine whether the current traversed matching region overlaps with the embedded seal image (specifically, determine whether the current traversed matching region overlaps with the image region in which the seal image has been embedded), if the current traversed matching region does not overlap with the embedded seal image, then embed the pth seal image in the current traversed matching region, enter step B, if the current matching region overlaps with the embedded seal image, it means that the current matching region is not suitable, then traverse the next matching region; Step B, if the current traversed matching region embeds the pth seal image so that the original two-dimensional code image embedded with the pth seal image can be recognized, then end the traversal and enter the next seal image embedding process, if the current traversed matching region embeds the pth seal image so that the original two-dimensional code image embedded with the pth seal image cannot be recognized, then return to step A to traverse the next matching region.

[0040] In the present embodiment, the original two-dimensional code image embedded with the pth seal image is not limited to being recognized by the standard decoding tool pyzbar library of python. In step B, if the current traversed matching region embeds the pth seal image so that the original two-dimensional code image can be recognized, then end the traversal and consider that the pth seal image embedding is completed, and enter the embedding process of the next seal image in the seal list. In this way, the embedding process of the next seal image in the seal list is repeated until the embedding of the preset number of seal images is completed or the embedding of all seal images in the seal list is completed.

[0041] In the present embodiment, in step A, the overlap condition is first detected to avoid the region in which the seal image has been placed. In step B, the original two-dimensional code image embedded with the pth seal image is immediately detected after the pth seal image is embedded in the matching region to determine whether the original two-dimensional code image can be successfully recognized. This can reduce the time complexity and improve the processing efficiency.

[0042] In the present embodiment, preferably, the pth seal image is embedded in the matching region of the pth seal image by using a random mask method.

[0043] Specifically, first, a random mask is initialized, the size of the random mask is the same as that of the pth seal image, and the mask value of all pixel points is 255. Then, a random floating point number in the interval of 0 to 1 is generated for each pixel point in the random mask, and when the random floating point number is greater than a preset threshold threshold, the mask value of the pixel corresponding to the random floating point number is set to 0. Finally, the pixel values of the pth seal image and the two-dimensional code image of the matching region of the pth seal image are weighted and superimposed pixel by pixel using the random mask processed by the random floating point number, and the weighted superimposed pixel values are used to replace the pixel values of the two-dimensional code image of the matching region. In this way, the fusion can be quickly completed.

[0044] In the embodiment, the pth stamp image is preferably fused into the matching area of the pth stamp image by using an HSV lightness fusion method. Specifically, the two-dimensional code image of the matching area is converted into an HSV color space, and the fusion of the two-dimensional code image of the matching area and the pth stamp image is realized by adjusting the lightness channel.

[0045] In one specific application scenario of the two-dimensional code stamp embedding method provided by the application, a specific flowchart is as shown in Figure 4 Step one: initial stamp image reading and preprocessing The algorithm reads the initial stamp image to be processed from the local. According to actual needs, the initial stamp image can be subjected to binarization processing to enhance the edge features and facilitate subsequent operations.

[0046] In order to adapt to different two-dimensional code sizes, the algorithm scales the read initial stamp image according to a preset ratio, ensures that the size of the initial stamp image exceeds the maximum error correction recovery area of the original two-dimensional code image, and obtains a stamp image of a target size.

[0047] All the preprocessed stamp images are added to a stamp list for subsequent embedding operation loop calling.

[0048] Step two: two-dimensional code generation Input website address: the user inputs data (such as a website address) to be converted into a two-dimensional code.

[0049] Generate two-dimensional code: a two-dimensional code generation module in the pythonqrcode library is called to generate a corresponding original two-dimensional code image from the input data text (such as a website address).

[0050] Step three: template matching positioning OpenCV template matching: an OpenCV or other computer vision library is used to perform template matching on the stamp image, all possible embedding positions (i.e. rectangular areas) of the stamp image on the two-dimensional code are traversed, and the matching degree of each position (i.e. each rectangular area) is calculated.

[0051] Position optimization and sorting: all positions are sorted according to the matching degree, and positions with higher matching degrees are preferentially selected as embedding candidate points (i.e. matching areas).

[0052] Step four: overlap detection Overlap detection: for each candidate position (i.e. matching area) after sorting, it is judged whether it overlaps with the embedded stamp area, and if it overlaps, the next position (i.e. matching area) is selected.

[0053] Step five: image fusion ​Stamps image and two-dimensional code fusion: for the determined embedding position (i.e. matching area), the existing two-dimensional code is fused with the stamp image, and finally the fused two-dimensional code image is used to replace the corresponding position of the stamp original image to obtain the stamp result image embedded with the two-dimensional code.

[0054] Step six: detectability detection Two-dimensional code recognition detection: using the pythonpyzbar library to recognize the fused original two-dimensional code image (i.e. including one or more stamp result images) to determine whether the two-dimensional code can be recognized by a standard decoding tool. If it is recognizable, save the current result and record the two-dimensional code position as the embedded position, and enter the next stamp image two-dimensional code embedding loop. If it is not recognizable, reselect the position (matching area) or adjust the fusion parameters (such as the random floating point number size of the random mask), and repeat the above process until it is recognizable.

[0055] Step seven: multi-stamp image embedding loop If there are multiple stamp images, repeat the process of steps three to six above to embed each stamp image in the original two-dimensional code image in turn. When all stamp images have been successfully embedded in the original two-dimensional code image and the embedded original two-dimensional code image is recognizable, the algorithm ends.

[0056] The application also discloses a defective two-dimensional code. In a preferred embodiment, the defective two-dimensional code comprises a carrier, and a defective two-dimensional code pattern is printed on the carrier, and the defective two-dimensional code pattern is obtained by the two-dimensional code stamp embedding method.

[0057] In the embodiment, in order to enable the user to accurately stamp in the blank area, preferably, a prompt mark is arranged in the blank area of the defective two-dimensional code pattern. The prompt mark corresponds to the stamp pattern (physical stamp) one by one, and the prompt mark can be a text or a numerical symbol, which can be a watermark prompt mark or a tearable label, so as to avoid interfering with subsequent two-dimensional code recognition. Preferably, the prompt mark in the blank area is a watermark of the stamp pattern corresponding to the blank area printed in the blank area, as shown in FIG. 5, so as to effectively prompt the user to stamp. Figure 5

[0058] The application also discloses a complementary repair stamp set. In a preferred embodiment, the complementary repair stamp set comprises one or more physical stamps engraved with different stamp patterns, and the stamp patterns are obtained by the two-dimensional code stamp embedding method. Figure 6 The stamp patterns of the plurality of physical stamps in the complementary repair stamp set are shown.

[0059] In the embodiment, the pattern printing end of each physical stamp is engraved with a corresponding stamp pattern.

[0060] ​The application also discloses a damaged-repaired two-dimensional code set seal verification system, and in a preferred embodiment, the system comprises: The application provides the above damaged two-dimensional code. The application provides the above complementary repair seal set, which is used for sealing the seal pattern on the blank area of the damaged two-dimensional code pattern of the damaged two-dimensional code. Figure 7 The application shows the case of sealing the corresponding seal pattern on the blank area of the damaged two-dimensional code by the complementary repair seal set.

[0061] The verification terminal is not limited to a smart phone.

[0062] The two-dimensional code seal embedding method, the damaged two-dimensional code, the complementary repair seal set and the damaged-repaired two-dimensional code set seal verification system provided by the application have the following advantages: 1. Strong anti-counterfeiting performance.

[0063] Current two-dimensional code anti-counterfeiting technologies mostly adopt digital encryption (such as dynamic two-dimensional code), which is easy to be copied or tampered. In the application, the damaged two-dimensional code in the preset damaged state cannot be recognized by code scanning, and the damaged pattern needs to be accurately matched by a physical seal to be restored, that is, the corresponding seal pattern needs to be sealed on all blank areas or only one blank area is not sealed to successfully recognize the two-dimensional code. In the embedding algorithm, the original two-dimensional code image of each new seal image embedded is detected for recognizability by using the pythonpyzbar library, so that each seal image can be recognized by a standard decoding tool.

[0064] 2. Traceability.

[0065] Each seal image in the damaged-repaired two-dimensional code set seal verification system has a unique code and can be bound with operation records. In the embedding algorithm step, the initial seal image to be embedded is read and preprocessed, and after each initial seal image is subjected to binarization processing and size scaling determination, it is sequentially arranged in the seal list.

[0066] 3. High interactivity.

[0067] The existing common LOGO embedded two-dimensional code usually only has the characteristics of propaganda and promotion, information sharing, and professional appearance, and cannot interact with users in a real entity. On the basis of this, the application improves the interactive experience of the user. The user can personally participate in the restoration of the damaged two-dimensional code by the action of real seal stamping, and restore the damaged two-dimensional code to a recognizable state. This action greatly improves the user's psychological expectation and interest level, and changes the user's acquisition and reception of information behind the damaged two-dimensional code from passive to active. In addition, the information sharing characteristics of the damaged two-dimensional code are not only indirectly shown after scanning the code, but the user can also directly understand the information transmission that the two-dimensional code wants to perform through the characteristics of the seal stamp (such as regional and cultural characteristics) when collecting the seal stamp image (group).

[0068] 4. The seal stamp image embedding effect is natural and has less influence on the original visual characteristics of the seal stamp.

[0069] In the algorithm level, the reading and preprocessing of the initial seal stamp image in the application are more detailed, considering the edge features of the initial seal stamp image and the image size scaling (i.e. scaling the initial seal stamp image for different sizes of original two-dimensional code images, the area of each seal stamp image is greater than the maximum error correction recovery area of the original two-dimensional code image, or the sum of the areas of any two seal stamp images is greater than the maximum error correction recovery area of the original two-dimensional code image, so that the seal stamp image (group) embedding effect is natural, ensuring the readability and beauty of the two-dimensional code, and bringing better interactive experience to the user.

[0070] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "example", "specific example", "one implementation", "one preferred implementation" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the application. In the specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0071] Although the embodiments of the application have been shown and described, those skilled in the art can understand that various changes, modifications, replacements and variations can be made to the embodiments without departing from the principles and purposes of the application, and the scope of the application is defined by the claims and their equivalents.

Claims

1. A method for embedding a two-dimensional code stamp, characterized in that, The method comprises: Converting the data to be converted into an original two-dimensional code image; Preprocessing one or more initial seal images to obtain a seal list, the seal list comprising one or more seal images, each seal image having an area greater than a maximum error correction recovery area of the original two-dimensional code image, or the sum of the areas of any two seal images being greater than the maximum error correction recovery area of the original two-dimensional code image; Embedding the one or more seal images in the seal list in the original two-dimensional code image in sequence to obtain a seal-embedded two-dimensional code image; In the process of embedding the pth seal image, a matching area of the pth seal image is determined in the original two-dimensional code image or the original two-dimensional code image after embedding p-1 seal images; the pth seal image is fused into the matching area of the pth seal image, and it is ensured that the original two-dimensional code image after fusing the p seal images can be recognized; the image of the matching area after fusing the pth seal image is taken as a seal pattern corresponding to the pth seal image; p is a positive integer; Cutting out all the seal patterns from the seal-embedded two-dimensional code image; Replacing all the seal patterns in the seal-embedded two-dimensional code image with blank areas to obtain a damaged two-dimensional code pattern.

2. The method of claim 1, wherein, The preprocessing of the one or more initial seal images to obtain the seal list comprises: Performing binaryzation processing on the initial seal image; Performing size scaling processing on the initial seal image after the binaryzation processing to obtain a seal image; Grouping the one or more seal images into a seal list.

3. The method of claim 1, wherein, The determination of the matching area of the pth seal image in the original two-dimensional code image or the original two-dimensional code image after embedding p-1 seal images comprises: Obtaining one or more rectangular areas with shapes and sizes matching the pth seal image on the original two-dimensional code image or the original two-dimensional code image after embedding p-1 seal images; Calculating the matching degrees of the two-dimensional code image of each rectangular area with the pth seal image; Sorting the one or more rectangular areas in descending order of the matching degrees, and selecting the first k rectangular areas with the highest matching degrees as k matching areas; k is a positive integer.

4. The method of claim 3, wherein, The fusing of the pth seal image into the matching area of the pth seal image comprises traversing the k matching areas to perform the following steps: Step A: determining whether the currently traversed matching area overlaps with the embedded seal image; if the currently traversed matching area does not overlap with the embedded seal image, the pth seal image is fused into the currently traversed matching area, and step B is entered; if the currently traversed matching area overlaps with the embedded seal image, the next matching area is traversed; Step B: if the currently traversed matching area after fusing the pth seal image makes the original two-dimensional code image after embedding the p seal images recognizable, the traversal is ended and the next seal image embedding processing is entered; if the currently traversed matching area after fusing the pth seal image makes the original two-dimensional code image after embedding the p seal images unrecognizable, step A is returned to traverse the next matching area.

5. The method of any one of claims 1-4, wherein, The pth seal image is fused into the matching area of the pth seal image by using a random mask method.

6. The method of any one of claims 1-4, wherein, The pth seal image is fused into the matching area of the pth seal image by using an HSV lightness fusion method.

7. A defective two-dimensional code, characterized by comprises a carrier on which a defective two-dimensional code pattern is printed, the defective two-dimensional code pattern being obtained by the method according to any one of claims 1-6.

8. The defective two-dimensional code according to claim 7, wherein a prompt mark is provided in the blank area of the defective two-dimensional code pattern.

9. A complementary repair stamp set, characterized in that comprises one or more physical stamps engraved with different stamp patterns, the stamp patterns being obtained by the method according to any one of claims 1-6.

10. A defective-repairing two-dimensional code stamp verification system, characterized by, comprises: the defective two-dimensional code according to claim 7 or 8; the complementary repair stamp set according to claim 9, for stamping the stamp pattern in the blank area of the defective two-dimensional code pattern of the defective two-dimensional code; and a verification terminal for performing two-dimensional code recognition on the defective two-dimensional code after the stamp pattern is stamped.