A method and device for generating anti-counterfeiting pattern

Through contour detection and meshing of the pattern, combined with tiny shape adjustments controlled by coding, an indistinguishable anti-counterfeiting pattern is generated, which solves the problems of high cost and easy duplication of anti-counterfeiting labels in the existing technology, and realizes the application in handicrafts, calligraphy and painting, etc. Significant anti-counterfeiting effect in the field.

CN114529627BActive Publication Date: 2024-10-11BEIJING YOUKUAIYOUHAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011227033.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-06
Publication Date
2024-10-11
Estimated Expiration
2040-11-06

AI Technical Summary

Technical Problem

Existing visual anti-counterfeiting label technology has high costs and limited usage scenarios. The anti-counterfeiting technology with graphic coding design is easy to copy and has unsatisfactory anti-counterfeiting properties. It is especially difficult to apply to products such as handicrafts, calligraphy and paintings, and affects the anti-counterfeiting effect.

Method used

By performing contour detection and key point extraction on the input pattern, dividing it into grids and making minor shape adjustments, a unique anti-counterfeiting pattern is generated. Coding is used to control pattern deformation, and patterns are adjusted using translation, scaling, rotation, etc. to generate a pattern that is difficult to distinguish. Anti-counterfeiting pattern.

Benefits of technology

It realizes the generation of anti-counterfeiting patterns with low cost, strong versatility and remarkable anti-counterfeiting effect, which is suitable for various products, including handicrafts, calligraphy and painting, and fills the gaps of existing technologies in these fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114529627B_ABST
    Figure CN114529627B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and device for generating an anti-counterfeiting pattern. The generating method is based on an existing pattern, and slightly deforms the pattern according to a specific deformation rule, so as to generate a large number of anti-counterfeiting patterns with slight shape changes that are indistinguishable to the human eye and are unique. The generation of the anti-counterfeiting pattern in the present invention is based on the deformation of the existing pattern, does not require special ink, material, and manufacturing process, has low cost, strong practicality, and the anti-counterfeiting pattern of each product is unique, difficult for the human eye to distinguish, and the anti-counterfeiting effect is more significant than the existing anti-counterfeiting technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visual anti-counterfeiting technology, and in particular to a method and a device for generating an anti-counterfeiting pattern. Background Art

[0002] At present, the anti-counterfeiting label technology in product vision mainly includes the following methods:

[0003] (1) Anti-counterfeiting technology using special inks / materials: temperature-dependent ink anti-counterfeiting technology, water-drop-disappearing anti-counterfeiting technology, fluorescent anti-counterfeiting technology, and peel-off label technology;

[0004] (2) Anti-counterfeiting technology using special manufacturing processes: engraving anti-counterfeiting technology, laser, 3D neon light-changing technology, security thread anti-counterfeiting label technology, etc.;

[0005] (3) Anti-counterfeiting technology using graphic coding design: QR code, logical color-changing QR code technology, micro-anti-counterfeiting technology, digital coding query technology, etc.

[0006] The main problems with the anti-counterfeiting label technologies listed above are:

[0007] Anti-counterfeiting technology using special inks / materials and special manufacturing processes: Although the anti-counterfeiting technology is good, it is costly and has limited usage scenarios.

[0008] Anti-counterfeiting technology using graphic coding design: Although it is low-cost and highly versatile, it is easy to copy and has poor anti-counterfeiting performance. At the same time, the existence of the QR code not only takes up space on the label, but also affects the overall appearance of the product.

[0009] Moreover, for some special scenarios, such as handicrafts, calligraphy and painting, the above anti-counterfeiting label technical solutions cannot appear on the products and can only be used as an accessory label description, which greatly reduces the anti-counterfeiting effect of the label. Summary of the invention

[0010] Based on the above situation of the prior art, the purpose of the present invention is to provide a method for generating an anti-counterfeiting pattern with low cost, strong versatility and good anti-counterfeiting effect. Based on the existing pattern, the pattern is slightly deformed according to a specific deformation rule to generate a large number of anti-counterfeiting patterns with slight shape changes that are indistinguishable to the human eye and unique. The generation of the anti-counterfeiting pattern does not require special inks, materials, and manufacturing processes, and has low cost and strong practicality. In addition, the anti-counterfeiting pattern of each product is unique, difficult for the human eye to distinguish, and the anti-counterfeiting effect is more significant than the existing anti-counterfeiting technology.

[0011] To achieve the above object, according to a first aspect of the present invention, a method for generating an anti-counterfeiting pattern is provided, comprising the steps of:

[0012] Perform contour detection and key point extraction on the input pattern;

[0013] According to the results of contour detection and key point extraction, the pattern is divided into several grids and valid grid numbers are obtained;

[0014] Encode the input anti-counterfeiting control word, wherein the number of bits of the encoded control word corresponds to the number of valid grids;

[0015] According to the effective bits of the encoded control word, the pattern in the effective grid numbered corresponding to the effective bits is adjusted to obtain a deformed anti-counterfeiting pattern.

[0016] Furthermore, dividing the pattern into a plurality of grids and obtaining valid grid numbers includes dividing the grids according to the length and width of the pattern, and screening and numbering the divided grids for validity.

[0017] Furthermore, dividing the pattern into a plurality of grids and obtaining valid grid numbers includes dividing the pattern into grids and numbering the grids according to the distribution density of key points in each grid.

[0018] Furthermore, the method further includes inspecting the deformed anti-counterfeiting pattern. If the similarity between the contours of the deformed anti-counterfeiting pattern and the input pattern is higher than a set threshold, the inspection is qualified.

[0019] Furthermore, the pattern in the valid grid corresponding to the number of the valid digit is adjusted, including: for each valid grid,

[0020] Number the key points in the effective grid;

[0021] Based on each key point and the key point number, split the contour in the valid grid into line segments;

[0022] Specify the line segments corresponding to the contours that need to be adjusted and the adjustment method;

[0023] The line segment corresponding to the contour that needs to be adjusted is adjusted using the adjustment method, and the position of the key point on the corresponding line segment is updated according to the adjustment result.

[0024] Furthermore, the adjustment method includes at least one of translating, scaling, and rotating the line segment, or a combination of two or more thereof.

[0025] According to another aspect of the present invention, a device for generating an anti-counterfeiting pattern is provided, comprising a pre-processing module, a grid division and screening module, an encoding module and an adjustment module; wherein:

[0026] The preprocessing module receives an input pattern and performs contour detection and key point extraction on the input pattern;

[0027] The grid division and screening module divides the pattern into a number of grids according to the results of contour detection and key point extraction, and obtains valid grid numbers;

[0028] The encoding module receives the anti-counterfeiting control word and encodes the received anti-counterfeiting control word, wherein the number of bits of the encoded control word corresponds to the number of valid grids;

[0029] The adjustment module adjusts the grid pattern with the number corresponding to the valid bit in the screened valid grid output by the grid screening module according to the valid bit of the encoded control word output by the encoding module, and outputs the deformed anti-counterfeiting pattern.

[0030] Furthermore, the device also includes a verification module to check the anti-counterfeiting pattern output by the adjustment module. If the similarity between the contours of the deformed anti-counterfeiting pattern and the input pattern is higher than a set threshold, the verification is qualified.

[0031] Furthermore, in the adjustment module, the content of the grid pattern corresponding to the number of the valid position is adjusted, including: for each valid grid,

[0032] Number the key points in the effective grid;

[0033] Based on each key point and the key point number, split the contour in the valid grid into line segments;

[0034] Specify the line segments corresponding to the contours that need to be adjusted and the adjustment method;

[0035] The line segment corresponding to the contour that needs to be adjusted is adjusted using the adjustment method, and the position of the key point on the corresponding line segment is updated according to the adjustment result.

[0036] Furthermore, in the adjustment module, the adjustment method includes at least one of translating, scaling, and rotating the line segment, or a combination of two or more thereof.

[0037] In summary, the present invention provides a method and device for generating an anti-counterfeiting pattern. The generating method is based on an existing pattern, and slightly deforms the pattern according to a specific deformation rule, so as to generate a large number of anti-counterfeiting patterns with slight shape changes that are indistinguishable to the human eye and are unique. The generation of the anti-counterfeiting pattern is based on the deformation of the existing pattern, does not require special inks, materials, and manufacturing processes, and has low cost and strong practicality. Moreover, the anti-counterfeiting pattern of each product is unique, which is difficult for the human eye to distinguish, and the anti-counterfeiting effect is more significant than the existing anti-counterfeiting technology. It can still be used for some special usage scenarios, such as handicrafts, calligraphy and painting, etc., which makes up for the gap in anti-counterfeiting technology on such products. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a schematic diagram of the effect of fine-tuning the outline of the rectangular area in the icon pattern;

[0039] Figure 2 It is a basic flow chart of the method for generating the anti-counterfeiting pattern of the present invention;

[0040] Figure 3 It is a flow chart of the contour detection and key point extraction steps in the method for generating the anti-counterfeiting pattern of the present invention and a schematic diagram of the pattern processing effect;

[0041] Figure 4 It is a flow chart of the grid division, validity screening and numbering steps in the method for generating the anti-counterfeiting pattern of the present invention and a schematic diagram of the pattern processing effect;

[0042] Figure 5 It is a schematic diagram of grid division based on key point distribution density in the method for generating the anti-counterfeiting pattern of the present invention;

[0043] Figure 6 It is a flow chart of pattern adjustment and generation of anti-counterfeiting pattern in the method for generating anti-counterfeiting pattern of the present invention and a schematic diagram of pattern processing effect;

[0044] Figure 7 It is a flow chart of the specific steps of pattern adjustment in the method for generating the anti-counterfeiting pattern of the present invention and a schematic diagram of the pattern processing effect;

[0045] Figure 8 It is a schematic diagram of the translation adjustment method in the method for generating the anti-counterfeiting pattern of the present invention;

[0046] Fig. 9 It is a schematic diagram of the translation combination adjustment method in the method for generating the anti-counterfeiting pattern of the present invention;

[0047] Fig.10 It is a schematic diagram of a scaling adjustment method in the method for generating an anti-counterfeiting pattern of the present invention;

[0048] Fig.11It is a schematic diagram of a rotation adjustment method in the method for generating an anti-counterfeiting pattern of the present invention;

[0049] Fig.12 It is a schematic diagram of a translation + stretching combination and a translation + stretching + rotation combination adjustment method in the method for generating an anti-counterfeiting pattern of the present invention;

[0050] Fig.13 A comparison diagram of the anti-counterfeiting pattern generated in the method for generating the anti-counterfeiting pattern of the present invention and the original pattern;

[0051] Fig.14 It is a schematic diagram of the composition of the device for generating the anti-counterfeiting pattern of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.

[0053] The basic principle of the technical solution of the present invention is explained below. The human eye is insensitive to small changes in the size of the pattern at the millimeter level (mm) and to changes in the relative relationship of the graphic elements in the pattern at the millimeter level (mm). For a pattern, such as a trademark logo pattern, the most basic pixel point is adjusted at the millimeter level, and a different pattern can be generated, but the human eye cannot distinguish it. Figure 1 As shown in FIG. 1 , a new icon pattern is generated after the outline of the rectangular area in the icon pattern is slightly adjusted, but the two icon patterns look basically the same to the human eye. In this way, all the outlines of the pattern can be selectively adjusted at the millimeter level, so that a large number of patterns that are indistinguishable to the human eye but have slight differences can be generated.

[0054] The technical solution of the present invention is described in detail below with reference to the accompanying drawings. Based on the above principle, according to an embodiment of the present invention, a method for generating an anti-counterfeiting pattern is provided. The basic flow chart of the generation method is as follows: Figure 2 As shown, the method is described in detail below by taking the input pattern as a Logo icon as an example.

[0055] The input Logo icon is preprocessed, including contour detection and key point extraction. The specific process of this step and the obtained pattern processing results are as follows: Figure 3As shown. Among them, contour detection may include graying, edge extraction, binarization, and contour extraction of the input pattern. According to some embodiments, the generation method can be implemented by a computer, using existing methods in opencv, such as cvcolor (BGR2GRAY), canny, findContours, etc. The key points on the contour refer to the points that describe the characteristics of the key information of the pattern shape contour. Specifically, they can refer to the upper corner points and extreme points in the contour, that is, the points where the contour shape changes particularly prominently, the isolated points with the maximum or minimum shape change intensity, the end points of the line segments, and the extreme points of the curve contour. The contour key point set is a set of feature points that describe the key information of the pattern shape contour. The following mathematical description can be used to define the key points:

[0056] (1) Points in the image where the gradient value and gradient direction change at a very high rate;

[0057] (2) The pixel point corresponding to the local maximum of the first-order derivative (i.e., the grayscale gradient);

[0058] (3) The intersection of two or more edges;

[0059] (4) The first-order derivative at the corner point is the largest, and the second-order derivative is zero, indicating the direction where the edge of the object changes discontinuously.

[0060] According to some embodiments, the key points can be extracted by using methods such as Harris corner points, Sift feature points, Surf corner points, and ORB corner points. In this embodiment, the Harris corner point method is used to extract the key points, and the following can be obtained: Figure 3 The extraction results shown in .

[0061] According to the results of contour detection and key point extraction, the logo icon pattern is divided into several grids, the validity of the several grids is screened, and the screened valid grids are numbered. The specific process of this step and the obtained pattern processing results are shown in Figure 4 There are many ways to divide the grid. According to some embodiments, the grid can be divided into M×N grids according to the length and width of the input pattern. Figure 4 In the example shown, M=5, N=4, and a total of 20 grids are generated. Then, based on the number of key points in each grid, the grids are screened for effectiveness, and grids with no key points or only a small number of key points are eliminated. In this embodiment, grids with less than or equal to three key points are eliminated. In practical applications, the screening criteria can also be set according to actual needs. According to some embodiments, the grids can also be divided according to the distribution density of key points in each grid. The schematic diagram of this division method is shown in FIG. Figure 5As shown. Figure 5 In the example in , each grid covers 4 key points, and a total of 28 valid grids are generated for encoding adjustment. By adjusting the pattern in each valid grid, 2 28 (About 270 million) kinds of changing patterns. For the screened grids, according to the arrangement of the grids, the valid grids can be numbered in sequence from left to right and from top to bottom.

[0062] Before adjusting each screened grid pattern, the grid that needs to be adjusted is selected, and the selection is determined by the input anti-counterfeiting control word. The input anti-counterfeiting control word content is encoded, and the number of bits of the encoded control word corresponds to the number of valid grids. In the prior art, there are many ways to encode information, such as QR Numericmode (digital encoding) and Alphanumeric mode (character encoding). In this embodiment, the simplest binary encoding is used as an example for explanation. For example, the input anti-counterfeiting control word content is "2020". The binary encoding method is used to convert the content "2020" into a binary code of 11111100100. Considering that the number of valid coding bits (i.e., the number of valid grids) in this embodiment is 13 bits, the first bit is set as a marker, and the final binary code is 1011111100100.

[0063] According to the effective bit of the encoded control word content, the pattern content in the effective grid numbered corresponding to the effective bit is adjusted to obtain a deformed anti-counterfeiting pattern. The flowchart of this step and the schematic diagram of the pattern processing effect are shown in FIG. Figure 6 According to the previous step, the binary code 1011111100100 obtained by encoding the anti-counterfeiting control word content corresponds to the 13 valid grids obtained after screening, and the grids corresponding to the code 1 need to be adjusted, that is, the grids numbered A0, A2-A7, and A10 need to be adjusted. After the adjustment, the deformed anti-counterfeiting pattern can be obtained.

[0064] The following is a description of the specific steps for adjusting the content in the grid, a flowchart of the specific adjustment steps and a schematic diagram of the pattern processing effect are shown in FIG. Figure 7 As shown. For each valid grid, the key points in the valid grid are numbered. The key points can be numbered in sequence from left to right and from top to bottom according to the arrangement of the key points in the grid. Figure 7In the example shown, taking the adjustment of the grid numbered A0 as an example, the key points therein are numbered according to the above principles. There are 10 key points in the grid, thus obtaining key point numbers p0-p9. According to the position of each key point on the contour line, the contour is split into several line segments, with each key point as the starting point and end point of the line segment. Specify the line segment corresponding to the contour that needs to be adjusted and the adjustment method. The user can select the line segment corresponding to the contour that needs to be adjusted according to actual needs. Figure 7 In the example shown, a random selection scheme is adopted to select two line segments p3-p6 and p6-p7 for adjustment. Regarding the selection of the adjustment method, the adjustment method can generally include at least one of translating, scaling, and rotating the line segment, or a combination of two or more. Figure 8-Figure 12 Schematic diagrams of adjustment methods of translation, translation combination, scaling, rotation, translation + stretching combination, and translation + stretching + rotation combination are shown respectively. Among them, the translation of the line segment includes upward translation, downward translation, left translation, and right translation; the direction of translation can also be combined, such as translation to the upper left, translation to the upper right, translation to the lower left, and translation to the lower right. Scaling of the line segment includes stretching and shortening, and further includes stretching to the left or right, stretching left and right, shortening to the left or right, and shortening left and right. Rotation of the line segment includes clockwise rotation of the left end or the right end, clockwise rotation of both ends, counterclockwise rotation of the left end or the right end, and counterclockwise rotation of both ends. Two or more of the methods can also be combined, such as translation + stretching combination, translation + rotation combination, stretching + rotation combination, translation + stretching + rotation combination, etc. Users can also make other easy-to-think-of but not mentioned adjustments to the line segment based on the above adjustment methods and in combination with actual needs. In Figure 7 In the example shown, the specified line segments (p3-p6, p6-p7) are adjusted to move upwards, and the adjustment distance is within 2mm. Specifically, the two specified line segments are moved upwards by 1mm. After the adjustment is completed, the positions of the corresponding key points are updated according to the adjustment results. The positions of the key points p3, p6, and p7 are updated to p3 ’ 、p6 ’ 、p7 ’ .

[0065] The deformed anti-counterfeiting pattern still needs to be inspected. The contour of the icon pattern is extracted and compared with the contour of the original icon for similarity. There are many ways to calculate contour similarity. The commonly used method is to compare contour moments. Specifically, a contour feature description is obtained by integrating (or summing) all points on the contour. In this embodiment, the contour distance of the generated anti-counterfeiting pattern and the original pattern is obtained by using the existing cvContoursMoments of opencv, and then ShapeDistanceExtractor.computeDistance is used to obtain the similarity between the anti-counterfeiting pattern and the original pattern, thereby obtaining a similarity score. The similarity score is compared with the set threshold. If it is higher than the set threshold, the generated anti-counterfeiting pattern is considered qualified. Otherwise, the anti-counterfeiting pattern is regenerated using the above steps.

[0066] The method for generating anti-counterfeiting patterns provided in this embodiment of the present invention has strong scalability, and each grid can support a certain number of variants. For example, each grid has 4 key points, and each key point can support basic translation change operations such as up, down, left, and right. 4 ×4=64 kinds of changes. In this embodiment, the generation method can support the encoding of 17 billion different commodities. In this embodiment, the pattern of the Logo icon is used as an example for explanation, but the generation method provided by the present invention can also be used for anti-counterfeiting of other types of patterns. For example, it can be used to anti-counterfeit various types of patterns including multimedia content such as numbers, text, images, and voices, and has a wide range of applications.

[0067] According to another embodiment of the present invention, a device for generating an anti-counterfeiting pattern is provided. The schematic diagram of the device is as follows: Fig.14As shown, it includes a preprocessing module, a grid division and screening module, an encoding module, an adjustment module and a verification module. Among them, the preprocessing module receives the input pattern, performs contour detection and key point extraction on the input pattern. The grid division and screening module divides the pattern into a number of grids according to the results of contour detection and key point extraction, screens the validity of the several grids output by the grid division module, and numbers the screened valid grids. Among them, for the division of the grid, the grid can be divided according to the length and width of the input pattern, or according to the distribution density of key points in each grid. The encoding module receives the anti-counterfeiting control word and encodes the received anti-counterfeiting control word, and the number of bits of the encoded control word corresponds to the number of valid grids. The adjustment module adjusts the grid pattern content of the grids with the corresponding number in the screened valid grids output by the grid screening module according to the valid bits of the encoded control word output by the encoding module, and outputs the deformed anti-counterfeiting pattern. The adjustment specifically includes: for each valid grid, numbering the key points in the valid grid; based on the key points and the key point numbers, splitting the contour in the valid grid into line segments; specifying the line segments corresponding to the contours that need to be adjusted and the adjustment method; for the line segments corresponding to the contours that need to be adjusted, using the adjustment method to adjust and update the positions of the key points on the line segments to be adjusted. Among them, the adjustment method may include at least one of translating, scaling, and rotating the line segments, or a combination of two or more. The verification module verifies the anti-counterfeiting pattern output by the adjustment module, and if the similarity between the deformed anti-counterfeiting pattern and the input pattern contour is higher than a set threshold, the verification is qualified. In the generation device of the anti-counterfeiting pattern, the specific steps and basic principles of each module implementing the module function are the same as the generation method of the first embodiment mentioned above, and will not be repeated here.

[0068] In summary, the present invention relates to a method and device for generating anti-counterfeiting patterns. Based on an existing pattern, the pattern is slightly deformed according to a specific deformation rule to generate a large number of anti-counterfeiting patterns with slight shape changes that are indistinguishable to the human eye and are unique. The implementation of the technical solution of the present invention does not require special inks, materials, and manufacturing processes, and has low cost and strong practicality. Moreover, the anti-counterfeiting pattern of each product is unique, which is difficult for the human eye to distinguish, and the anti-counterfeiting effect is more significant than the existing anti-counterfeiting technology. It can still be used for some special usage scenarios, such as handicrafts, calligraphy and painting, etc., making up for the gap in anti-counterfeiting technology on such products.

[0069] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. In addition, the appended claims of the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or the equivalent forms of such scope and boundaries.

Claims

1. A method for generating an anti-counterfeiting pattern, characterized in that: Includes steps: Perform contour detection and key point extraction on the input pattern; According to the results of contour detection and key point extraction, the pattern is divided into several grids and valid grid numbers are obtained; Encode the input anti-counterfeiting control word, wherein the number of bits of the encoded control word corresponds to the number of valid grids; According to the effective bits of the encoded control word, the pattern in the effective grid numbered corresponding to the effective bits is adjusted to obtain a deformed anti-counterfeiting pattern, including: For each valid grid, number the key points in the valid grid; Based on each key point and the key point number, split the contour in the valid grid into line segments; Specify the line segments corresponding to the contours that need to be adjusted and the adjustment method; The line segment corresponding to the contour that needs to be adjusted is adjusted using the adjustment method, and the position of the key point on the corresponding line segment is updated according to the adjustment result.

2. The generation method according to claim 1, characterized in that: The step of dividing the pattern into a plurality of grids and obtaining valid grid numbers includes dividing the grids according to the length and width of the pattern, and screening and numbering the divided grids for validity.

3. The generation method according to claim 1, characterized in that: The step of dividing the pattern into a plurality of grids and obtaining valid grid numbers includes dividing the pattern into grids and numbering the grids according to the distribution density of key points in each grid.

4. The generation method according to claim 2 or 3, characterized in that: The method also includes inspecting the deformed anti-counterfeiting pattern. If the similarity between the deformed anti-counterfeiting pattern and the input pattern is higher than a set threshold, the inspection is qualified.

5. The generation method according to claim 4, characterized in that: The adjustment method includes at least one of translating, scaling, and rotating the line segment, or a combination of two or more thereof.

6. A device for generating an anti-counterfeiting pattern, characterized in that: It includes preprocessing module, grid division and screening module, encoding module and adjustment module; among them, The preprocessing module receives an input pattern and performs contour detection and key point extraction on the input pattern; The grid division and screening module divides the pattern into a number of grids according to the results of contour detection and key point extraction, and obtains valid grid numbers; The encoding module receives the anti-counterfeiting control word and encodes the received anti-counterfeiting control word, wherein the number of bits of the encoded control word corresponds to the number of valid grids; The adjusting module adjusts the grid pattern with the number corresponding to the valid bit in the screened valid grid output by the grid screening module according to the valid bit of the encoded control word output by the encoding module, and outputs the deformed anti-counterfeiting pattern, including: For each valid grid, number the key points in the valid grid; Based on each key point and the key point number, split the contour in the valid grid into line segments; Specify the line segments corresponding to the contours that need to be adjusted and the adjustment method; The line segment corresponding to the contour that needs to be adjusted is adjusted using the adjustment method, and the position of the key point on the corresponding line segment is updated according to the adjustment result.

7. The generating device according to claim 6, characterized in that: The device further comprises a verification module for checking the anti-counterfeiting pattern output by the adjustment module. If the similarity between the contours of the deformed anti-counterfeiting pattern and the input pattern is higher than a set threshold, the verification is qualified.

8. The generating device according to claim 6, characterized in that In the adjustment module, the content of the grid pattern corresponding to the number of the valid position is adjusted, including: for each valid grid, Number the key points in the effective grid; Based on each key point and the key point number, split the contour in the valid grid into line segments; Specify the line segments corresponding to the contours that need to be adjusted and the adjustment method; The line segment corresponding to the contour that needs to be adjusted is adjusted using the adjustment method, and the position of the key point on the corresponding line segment is updated according to the adjustment result.

9. The generating device according to claim 8, characterized in that In the adjustment module, the adjustment method includes at least one of translating, scaling, and rotating the line segment, or a combination of two or more thereof.