Anti-replication two-dimensional code generation and identification method, system, medium and terminal for a can body
Patent Information
- Application Number
- CN202611417857.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-10-16
AI Technical Summary
这种防伪技术必须使用特定的硬件设备,并且应用场景较为局限,不适合完成低成本的物品及其包装物的鉴别
[0041] (1) Based on the traditional QR code, the generation of anti-copying QR code is realized by combining feature texture. It not only achieves full compatibility with the existing QR code standard, but also enhances the fault tolerance and security of QR code in printing and scanning.
Smart Images

Figure CN122927346A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of QR codes, and in particular relates to a method, system, medium, and terminal for generating and identifying anti-copying QR codes for cans. Background Technology
[0002] In existing technologies, common anti-counterfeiting technologies for goods mainly include: material anti-counterfeiting, electronic identification anti-counterfeiting, and electronic code anti-counterfeiting.
[0003] Taking material anti-counterfeiting as an example, it involves identification through special inks, temperature changes, and chemical substances. The method of authenticating original items mainly relies on manual inspection for the presence of special markings. This solution is primarily used to prevent counterfeiting, and its security depends heavily on the complexity of the special markings. For example, printing invisible markings on the surface of items or packaging, including special paper treatments that allow them to be immediately stained by solvents or ultrasonic detection systems. However, these technologies require special materials or unique construction methods, making them not only expensive but also relatively insecure.
[0004] Electronic authentication and anti-counterfeiting uses magnetic records, identification cards, and a data management system for verification. This anti-counterfeiting technology requires specific hardware and has limited application scenarios, making it unsuitable for authenticating low-cost goods and their packaging.
[0005] In summary, existing anti-counterfeiting technologies all have shortcomings to varying degrees, necessitating the exploration of new solutions. QR codes (such as QR codes and Datamatrix codes) are widely used as identifiers for goods and their packaging, with applications including authenticity verification, anti-counterfeiting, and information traceability. In particular, how to generate and verify the authenticity of QR codes applied to cans has become a pressing issue. Summary of the Invention
[0006] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a method, system, medium, and terminal for generating and identifying anti-copying QR codes for cans, which can generate anti-copying QR codes for cans and accurately identify the anti-copying QR codes, effectively improving the anti-counterfeiting properties and recognition accuracy of QR codes.
[0007] In a first aspect, the present invention provides a method for generating an anti-copying QR code for a can body, the method comprising the following steps: generating a QR code; replacing the black modules in a preset area of the QR code with one or more feature textures to obtain an anti-copying QR code; coating a target area of the can body with a layer of white ink to obtain a uniform can surface; wherein the viscosity of the white ink is 10-20 mPa•s, the white pigment particles used have a D50 particle size of less than or equal to 1.5 μm, and a solid content of 45%-60%; the whiteness of the white ink is greater than or equal to 92% according to the GB / T 7974 test method, the thickness of the white ink is between 0.8 and 2.0 μm, and the surface roughness is less than or equal to 1.5 μm; spraying the anti-copying QR code into the uniform can surface; wherein the nozzle is perpendicular to the surface of the can body, the deviation angle is less than or equal to 3°, and the distance from the surface is 3-5 mm; the nozzle pressure is 0.2-0.3 MPa, and the nozzle lateral movement speed is 100-150 km / h. The speed is mm / s, the ejection frequency is between 10-30kHz, and the volume of a single ink droplet is between 10-15pL.
[0008] In one implementation of the first aspect, the anti-copying QR code is applied using a preset precision printhead and UV ink.
[0009] Secondly, the present invention provides a method for identifying counterfeit QR codes on cans, the method comprising the following steps:
[0010] Obtain a detection image of the anti-copying QR code on the tank body, wherein the anti-copying QR code is generated using the above-described anti-copying QR code generation method for tank bodies;
[0011] Based on the detected image, obtain the corrected image of the anti-copying QR code;
[0012] The corrected image is provided to the cloud server, so that the cloud server inputs the corrected image into the anti-copying QR code identification model to obtain the identification result of the anti-copying QR code;
[0013] The anti-copying QR code identification model includes a reflection removal module, a feature extraction module, and a classification output module. The reflection removal module is configured to receive the corrected image, remove specular highlight areas in the corrected image, and output a reflection-removed image. The feature extraction module is built based on the VIT architecture and is configured to receive the reflection-removed image and extract global texture features and local fine structure features from the reflection-removed image. The classification output module is configured to receive the feature vector output by the feature extraction module and output the identification result of the anti-copying QR code based on the feature vector.
[0014] In one implementation of the second aspect, obtaining the detection image of the anti-copying QR code on the tank includes the following steps:
[0015] Light detection is performed on the area containing the anti-copying QR code on the can, and a prompt is given.
[0016] The anti-copying QR code is image captured to obtain the captured image;
[0017] Blur detection is performed on the acquired images, and the acquired images that meet the clarity requirements are selected as the detection images.
[0018] In one implementation of the second aspect, light detection is performed on the area containing the anti-copying QR code on the can, and a prompt is given, including the following steps:
[0019] Obtain the pixel brightness of each pixel in the area where the anti-copying QR code is located on the can;
[0020] Obtain the average pixel brightness of the area where the anti-copying QR code is located on the can;
[0021] When the average pixel brightness is lower than the lower limit and higher than the upper limit, the user is prompted to make an identification under an environment that meets the lighting requirements.
[0022] In one implementation of the second aspect, performing blur detection on the acquired image includes the following steps:
[0023] The second derivative of the acquired image is calculated based on the Laplacian operator;
[0024] Calculate the variance of the second derivative;
[0025] When the variance value is less than a preset threshold, the acquired image is determined to be a blurry image;
[0026] When the variance value is not less than the preset threshold, the acquired image is determined to meet the clarity requirements.
[0027] In one implementation of the second aspect, obtaining the corrected image of the anti-copying QR code based on the detected image includes the following steps:
[0028] The detected image is subjected to surface correction to obtain a surface-corrected detected image;
[0029] A perspective transformation is performed on the surface-corrected detection image to obtain a standard rectangular detection image;
[0030] The standard rectangular detection image is normalized to obtain the target size detection image;
[0031] The target size detection image is normalized to obtain the corrected image.
[0032] Thirdly, the present invention provides an anti-copying QR code identification system for tanks, the system comprising an acquisition module, a correction module and an identification module;
[0033] The acquisition module is used to acquire the detection image of the anti-copying QR code on the tank body. The anti-copying QR code is generated using the above-described anti-copying QR code generation method for tank bodies.
[0034] The correction module is used to obtain a corrected image of the anti-copying QR code based on the detected image;
[0035] The identification module is used to provide the corrected image to the cloud server, so that the cloud server inputs the corrected image into the anti-copying QR code identification model to obtain the identification result of the anti-copying QR code.
[0036] Fourthly, the present invention provides a terminal, the terminal comprising: a processor and a memory;
[0037] The memory is used to store computer programs;
[0038] The processor is used to execute the computer program stored in the memory, so that the terminal executes the above-described method for generating anti-copying QR codes for cans and / or the above-described method for identifying anti-copying QR codes for cans.
[0039] Fifthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a terminal, implements the above-described method for generating anti-copying QR codes for cans and / or the above-described method for identifying anti-copying QR codes for cans.
[0040] As described above, the method, system, medium, and terminal for generating and identifying anti-copying QR codes for tanks described in this invention have the following beneficial effects:
[0041] (1) Based on the traditional QR code, the generation of anti-copying QR code is realized by combining feature texture. It not only achieves full compatibility with the existing QR code standard, but also enhances the fault tolerance and security of QR code in printing and scanning.
[0042] (2) It can accurately identify anti-copying QR codes, effectively improving the anti-counterfeiting properties and recognition accuracy of QR codes;
[0043] (3) The QR code on the can can be identified as a copy, thus providing an efficient, reliable and low-cost solution for product traceability and anti-counterfeiting. It is applicable to application scenarios such as anti-counterfeiting of goods, smart packaging, logistics tracking, supply chain management traceability, printed documents and digital copyright protection. Attached Figure Description
[0044] Figure 1 The flowchart shown is an embodiment of the method for generating anti-copying QR codes for tanks according to the present invention;
[0045] Figure 2 The diagram shows an application scenario of the anti-copying QR code generation method for tanks according to an embodiment of the present invention.
[0046] Figure 3 The flowchart shown is an embodiment of the anti-copying QR code identification method for can bodies according to the present invention;
[0047] Figure 4 The diagram shows an application scenario of the anti-copying QR code identification method for tanks according to an embodiment of the present invention.
[0048] Figure 5 The diagram shown is a structural schematic of an embodiment of the anti-copying QR code identification system for cans according to the present invention.
[0049] Figure 6 The diagram shown is a structural schematic of the terminal of the present invention in one embodiment. Detailed Implementation
[0050] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0051] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0052] The technical solutions of the present invention will now be described in detail with reference to the accompanying drawings.
[0053] like Figure 1 and Figure 2 As shown, in one embodiment, the method for generating anti-copying QR codes for cans according to the present invention includes steps S11-S14.
[0054] Step S11: Generate a QR code.
[0055] Specifically, the QR code is generated based on existing QR code generation methods. The QR code uses QR code, DataMatrix code, or PDF417 code, and has functional patterns such as location labels, positioning patterns, and alignment patterns.
[0056] Step S12: Replace the black modules in the preset area of the QR code with one or more feature textures to obtain an anti-copying QR code.
[0057] Specifically, this invention incorporates multiple feature textures. One or more anti-counterfeiting feature textures are selected to replace the black modules in a preset area of the QR code. The uniqueness and complexity of these feature textures distinguish the anti-copying QR code of this invention from existing QR codes. After printing or scanning, certain differences may appear (such as mismatched pattern features), thus achieving the anti-copying function. The size of the preset area must not affect the normal recognition and reading function of the QR code. Preferably, the preset area is the area of the QR code excluding the positioning points.
[0058] Step S13: Apply a layer of white ink to the target area of the can to obtain a uniform can surface.
[0059] Specifically, when spraying the anti-copying QR code onto the can body, a layer of white ink is first applied to the target area of the can body, such as the entire area or the printing area. The leveling properties of the ink are used to create a white area on the can surface, resulting in a relatively smooth and uniform can surface. This provides a stable base for subsequent high-precision printing of the anti-copying QR code and prevents deformation of the QR code caused by ink diffusion or breakage. In one embodiment, a layer of white ink is applied to the target area of the can body to obtain a uniform can surface. The white ink has a viscosity of 10-20 mPa•s, the white pigment particles have a D50 particle size of less than or equal to 1.5 μm, and a solid content of 45%-60%. The whiteness of the white ink, measured according to GB / T 7974, is greater than or equal to 92%, the thickness of the white ink is between 0.8 and 2.0 μm, and the surface roughness is less than or equal to 1.5 μm. Preferably, the ink viscosity is 15 mPa·s, the white pigment particle D50 particle size is 0.8 μm, the solid content is 50%, the whiteness of the white ink is about 95%, the thickness of the white ink is about 1.5 μm, and the surface roughness is less than 1.0 μm.
[0060] Step S14: Spray the anti-copying QR code onto the uniform can surface.
[0061] Specifically, flexographic inline coding technology, combined with a high-precision printhead (such as 812*812dpi) and UV fast-curing ink, is used to spray the anti-copying QR code, thereby ensuring accurate printing of the anti-copying QR code and providing a foundation for subsequent anti-copying QR code identification. In one implementation case, a curved surface synchronous tracking process is used to spray the anti-copying QR code on the can body, synchronizing the printing action with the curvature change of the can body's surface, ensuring that the QR code is not deformed and its position is accurate on the curved surface. The curved surface synchronous tracking process refers to the coating mechanism tracking and moving synchronously along the curved surface contour of the can body in real time, maintaining a constant working spacing and normal angle, and forming a uniform coating on the curved surface of the can body. The printhead is perpendicular to the surface of the can body, with a deviation angle of less than or equal to 3°, and a preset height of 3~5mm from the surface; the printhead pressure is 0.2-0.3MPa, the printhead lateral movement speed is 100-150 mm / s, the spraying frequency is between 10-30kHz, and the volume of a single ink droplet is 10-15pL. Preferably, the printhead is always perpendicular to the surface of the can, with a deviation angle of less than or equal to 3°, and a preset height of 3~5mm from the surface; the printhead pressure is preferably 0.2MPa, the printhead lateral movement speed is 100 mm / s, the ejection frequency is 20kHz, and the volume of a single ink droplet is 13pL.
[0062] like Figure 3 and Figure 4 As shown, in one embodiment, the anti-copying QR code identification method for cans of the present invention includes steps S31-S33.
[0063] Step S31: Obtain the detection image of the anti-copying QR code on the tank body. The anti-copying QR code is generated using the above-described anti-copying QR code generation method for tank bodies.
[0064] Specifically, the anti-copying QR code on the tank is captured by an image acquisition device to obtain the detection image. To ensure the clarity and accuracy of the detection image, light detection and blur detection are performed during acquisition.
[0065] Light directly determines the quality of the detected image. Insufficient light leads to loss of detail, uneven lighting causes localized distortion, and excessive light results in decreased color saturation and highlight clipping. All of these lighting issues interfere with subsequent region localization of the anti-copying QR code and the extraction of key features such as edges and textures. Therefore, this invention uses light detection to prompt image acquisition under appropriate lighting conditions, avoiding invalid feature input and reducing recognition errors. Specifically, during light detection, the area containing the anti-copying QR code on the can is first subjected to light detection, and a prompt is provided. Wherein, according to Obtain the pixel brightness of each pixel in the area where the anti-copying QR code is located on the tank. These represent the brightness values of the red, green, and blue components of a pixel, respectively. Then, the average pixel brightness of all pixels is calculated. A lower brightness limit (e.g., 30% of the baseline brightness) and an upper brightness limit (e.g., 90% of the baseline brightness) are preset, and the average pixel brightness is compared with the lower and upper brightness limits. When the average pixel brightness is lower than the lower brightness limit and higher than the upper brightness limit, the user is prompted to perform identification in an environment that meets the lighting requirements. After the lighting detection is completed, the anti-copying QR code is image-captured to obtain the captured image.
[0066] For blurred images, the loss of details due to blurred edges leads to a significant decrease in the accuracy of subsequent image detection. Pre-performing blur detection can filter low-quality images, reducing unnecessary computational resource consumption; simultaneously, it ensures the quality of input data, improving the overall system's reliability, robustness, and the credibility of the final detection results. Therefore, this invention performs blur detection on the acquired images, selecting those that meet the sharpness requirements as the detection images. Specifically, the second derivative of the acquired image is calculated based on the Laplacian operator, and the variance of this second derivative is calculated. The variance reflects the edge sharpness of the acquired image. A gentle gradient change in the acquired image results in a smaller variance; a drastic gradient change results in a larger variance. This blur detection algorithm is affected by the QR code size. To adapt to different anti-copying QR code sizes, the calculated variance is adjusted by multiplying the variance by the ratio of the detected anti-copying QR code size to the QR code size corresponding to a preset threshold, resulting in an adaptive scaling variance value. In this embodiment, the preset threshold is 0.2 times the size of the baseline anti-copying QR code, i.e., 430 * 0.2 = 86. Therefore, when the adaptive scaling variance value is less than the preset threshold, the acquired image is determined to be a blurry image; when the adaptive scaling variance value is not less than the preset threshold, the acquired image is determined to meet the clarity requirements.
[0067] Step S32: Based on the detected image, obtain the corrected image of the anti-copying QR code.
[0068] Specifically, in order to identify the anti-copying QR code, the anti-copying QR code needs to be standardized and adjusted to obtain a corresponding corrected image.
[0069] In one embodiment, in one implementation of the second aspect, obtaining the corrected image of the anti-copying QR code based on the detected image includes the following steps:
[0070] a) Perform surface correction on the detected image to obtain a surface-corrected detected image.
[0071] The detected image is surface-corrected to obtain a corresponding surface-corrected detected image. In one embodiment, a detected image of a can surface coated with a QR code is obtained. Let the pixel coordinates in the acquired detected image be (u, v), where u is the horizontal coordinate and v is the vertical coordinate. Without relying on camera intrinsic parameters, the correspondence between the original image pixel coordinates and cylindrical coordinates is established by detecting the contours of the two side edges of the can surface. Specifically, for each pixel (u, v) in the detected image, its corresponding cylindrical coordinates (θ, h) are determined through the following mapping relationship:
[0072]
[0073]
[0074] Among them, u min and u max These are the minimum and maximum pixel coordinates of the QR code region in the detection image, respectively. min and v max These are the minimum and maximum pixel coordinates of the QR code region in the detection image, respectively. These represent the starting and ending angles of the QR code area on the cylindrical surface, respectively. Let represent the starting and ending heights of the QR code area on the cylindrical surface, respectively. Assume the tank is an ideal cylinder with radius R. Unfold the QR code area on the cylindrical surface into a planar image. The mapping relationship between pixel coordinates (x, y) and cylindrical coordinates (θ, h) in the surface-corrected detection image is as follows:
[0075]
[0076]
[0077] Where x represents the horizontal coordinate of the surface-corrected detection image (corresponding to the arc length direction on the cylinder), and y represents the vertical coordinate of the surface-corrected detection image (corresponding to the height direction on the cylinder). Based on the above mapping relationship, an inverse mapping is established between the pixel coordinates (x, y) of the surface-corrected detection image and the pixel coordinates (u, v) of the original detection image:
[0078]
[0079]
[0080] By calculating the floating-point coordinates of the cylindrical surface model in the detection image according to the inverse mapping relationship, a surface-corrected detection image is generated.
[0081] b) Perform perspective transformation on the surface-corrected detection image to obtain a standard rectangular detection image.
[0082] Since the outer surface of the can is curved, in order to correct the geometric distortion caused by the shape of the can and restore the standard viewing angle, the present invention corrects the detection image into a standard rectangular view through perspective transformation to ensure the geometric consistency of the QR code pattern.
[0083] During perspective transformation, the four positioning points of the anti-copying QR code in the detected image are first obtained. Based on the four target positioning points Calculate the corresponding perspective transformation matrix H= Specifically, for each pair of positioning points According to the perspective transformation formula:
[0084]
[0085] We obtain two systems of linear equations:
[0086]
[0087] Stacking the equations of 4 pairs of points yields an 8*9 coefficient matrix A, satisfying Ah = 0, where h is the vector form of the perspective transformation matrix H to be solved. The specific solution process is as follows: calculate the singular value decomposition (SVD) form of the coefficient matrix A. Then, take the last column of V as an estimate of h, and rearrange h into a 3x3 perspective transformation matrix H.
[0088] Finally, the detection image is geometrically corrected based on the perspective transformation matrix to become a standard rectangular detection image. This perspective transformation corrects geometric distortions caused by the shooting angle, restores the target's standard viewing angle, and ensures the geometric consistency of the detected image for the anti-copying QR code.
[0089] c) Standardize the size of the standard rectangular detection image to obtain the target size detection image.
[0090] In the size standardization process, bilinear interpolation is used to obtain the target QR code size, such as 430*430, thereby unifying the spatial resolution and acquiring the target size detection image. This size standardization eliminates spatial resolution differences, adapts to the fixed input requirements of subsequent model processing, facilitates batch processing, and ensures the comparability of feature spaces.
[0091] d) Normalize the grayscale of the target size detection image to obtain the corrected image.
[0092] In the grayscale normalization process, the grayscale statistics (mean μ and standard deviation σ) of the target size detection image are first calculated, and then Z-score is used for grayscale normalization. The specific formula is as follows: By performing grayscale normalization, grayscale fluctuations caused by illumination / sensor effects can be eliminated, grayscale distribution can be standardized, and robustness to changes in illumination can be enhanced.
[0093] Step S33: Provide the corrected image to the cloud server so that the cloud server inputs the corrected image into the anti-copying QR code identification model to obtain the identification result of the anti-copying QR code.
[0094] Specifically, this invention pre-trains an anti-copying QR code identification model to distinguish whether the anti-copying QR code on the can is the original QR code or a copied QR code. The anti-copying QR code identification model includes a reflection removal module, a feature extraction module, and a classification output module. The reflection removal module is configured to receive the corrected image and remove specular highlight areas from the corrected image, outputting a reflection-removed image. The feature extraction module, built on a VIT (Vision Transformer) architecture, is configured to receive the reflection-removed image and extract global texture features and local fine structure features from the reflection-removed image. The classification output module is configured to receive the feature vector output by the feature extraction module and output the identification result of the anti-copying QR code based on the feature vector. The identification result includes two categories: genuine QR codes and copied QR codes. During model training, the optimizer used is Adam, with a learning rate of 1e-4, β1=0.9, and β2=0.999. The loss function used is binary cross-entropy. When training the anti-copying QR code identification model, a training dataset is constructed using anti-copying QR codes and corresponding copied QR codes. The training batch size is 32, and the training is conducted for 50 epochs. A strategy of stopping training if the accuracy on the validation set does not improve after 3 epochs is adopted. L2 regularization and data augmentation strategies are also used during training.
[0095] After acquiring the corrected image, the terminal sends it to a cloud server. The cloud server then uses its configured anti-copying QR code identification model to identify the corrected image by recognizing the feature textures in the QR code, thus determining whether the QR code is the original or a copy. Therefore, this method effectively identifies anti-copying QR codes on cans, making it suitable for applications such as product anti-counterfeiting, smart packaging, logistics tracking, supply chain management traceability, printed documents, and digital rights protection.
[0096] The scope of protection of the anti-copying QR code identification method for cans described in this embodiment is not limited to the execution order of the steps listed in this embodiment. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principle of this invention is included within the scope of protection of this invention.
[0097] This invention also provides an anti-copying QR code identification system for cans. The anti-copying QR code identification system for cans can implement the anti-copying QR code identification method for cans described in this invention. However, the implementation device of the anti-copying QR code identification system for cans described in this invention includes, but is not limited to, the structure of the anti-copying QR code identification system for cans listed in this embodiment. All structural modifications and substitutions of the prior art made according to the principles of this invention are included within the protection scope of this invention.
[0098] like Figure 5 As shown, in one embodiment, the anti-copying QR code identification system for cans of the present invention includes an acquisition module 51, a correction module 52, and an identification module 53.
[0099] The acquisition module 51 is used to acquire the detection image of the anti-copying QR code on the tank body. The anti-copying QR code is generated using the above-described anti-copying QR code generation method for tank bodies.
[0100] The correction module 52 is connected to the acquisition module 51 and is used to acquire the corrected image of the anti-copying QR code based on the detection image.
[0101] The identification module 53 is connected to the correction module 52 and is used to provide the corrected image to the cloud server so that the cloud server inputs the corrected image into the anti-copying QR code identification model to obtain the identification result of the anti-copying QR code.
[0102] The structure and principle of the acquisition module 51, the correction module 52 and the identification module 53 correspond one-to-one with the steps in the above-mentioned anti-copying QR code identification method for tanks, so they will not be described again here.
[0103] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, or methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules / units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of apparatuses or modules or units may be electrical, mechanical, or other forms.
[0104] The modules / units described as separate components may or may not be physically separate. The components shown as modules / units may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules / units can be selected to achieve the objectives of the embodiments of the present invention, depending on actual needs. For example, the functional modules / units in the various embodiments of the present invention may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0105] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0106] This invention also provides a computer-readable storage medium. Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing a processor. The program can be stored in a computer-readable storage medium, which is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof. The storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state drive (SSD)).
[0107] This invention also provides a terminal. The terminal includes a processor and a memory.
[0108] The memory is used to store computer programs.
[0109] The memory includes various media capable of storing program code, such as ROM, RAM, magnetic disk, USB flash drive, memory card, or optical disk.
[0110] The processor is connected to the memory and is used to execute the computer program stored in the memory, so that the terminal executes the above-described method for generating anti-copying QR codes for cans and / or the above-described method for identifying anti-copying QR codes for cans.
[0111] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0112] like Figure 6 As shown, the terminal of the present invention is presented in the form of a general-purpose computing device. The components of the terminal may include, but are not limited to: one or more processors or processing units 61, a memory 62, and a bus 63 connecting different system components (including the memory 62 and the processing unit 61).
[0113] Bus 63 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0114] Terminals typically include various computer system-readable media. These media can be any available media that can be accessed by the terminal, including volatile and non-volatile media, and removable and non-removable media.
[0115] Memory 62 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 621 and / or cache 622. The terminal may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 623 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 6 Not shown; usually referred to as a "hard drive"). Although Figure 6 As not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 63 via one or more data media interfaces. Memory 62 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0116] A program / utility 624 having a set (at least one) of program modules 6241 may be stored, for example, in memory 62. Such program modules 6241 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 6241 typically perform the functions and / or methods described in the embodiments of the present invention.
[0117] The terminal can also communicate with one or more external devices (e.g., keyboard, pointing device, display, etc.), one or more devices that enable user interaction with the terminal, and / or any device that enables the terminal to communicate with one or more other computing devices (e.g., network interface card, modem, etc.). This communication can be performed through input / output (I / O) interface 64. Furthermore, the terminal can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) through network adapter 65. Figure 6 As shown, network adapter 65 communicates with other modules of the terminal via bus 63. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the terminal, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0118] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A method for generating anti-copying QR codes for cans, characterized in that, The method includes the following steps: Generate a QR code; Replace the black modules in a preset area of the QR code with one or more feature textures to obtain an anti-copying QR code; A layer of white ink is applied to the target area of the can to obtain a uniform can surface; wherein, the viscosity of the white ink is 10-20 mPa·s, the D50 particle size of the white pigment used is less than or equal to 1.5 μm, and the solid content is 45%-60%; the whiteness of the white ink is greater than or equal to 92% according to the GB / T 7974 test method, the thickness of the white ink is between 0.8 and 2.0 μm, and the surface roughness is less than or equal to 1.5 μm; The anti-copying QR code is sprayed onto the uniform surface of the can; wherein the printhead is perpendicular to the surface of the can, with a deviation angle of less than or equal to 3°, and a preset height of 3~5mm from the surface; the printhead pressure is 0.2-0.3MPa, the printhead lateral movement speed is 100-150 mm / s, the spraying frequency is between 10-30kHz, and the volume of a single ink droplet is 10-15pL.
2. The method for generating anti-copying QR codes for tanks according to claim 1, characterized in that: The anti-copying QR code is applied using a pre-set precision printhead and UV ink.
3. A method for identifying counterfeit QR codes on cans, characterized in that: The method includes the following steps: Obtain a detection image of the anti-copying QR code on the tank body, wherein the anti-copying QR code is generated using the anti-copying QR code generation method for tank bodies as described in claim 1 or 2; Based on the detected image, obtain the corrected image of the anti-copying QR code; The corrected image is provided to the cloud server, so that the cloud server inputs the corrected image into the anti-copying QR code identification model to obtain the identification result of the anti-copying QR code; The anti-copying QR code identification model includes a reflection removal module, a feature extraction module, and a classification output module. The reflection removal module is configured to receive the corrected image, remove specular highlight areas in the corrected image, and output a reflection-removed image. The feature extraction module is built based on the VIT architecture and is configured to receive the reflection-removed image and extract global texture features and local fine structure features from the reflection-removed image. The classification output module is configured to receive the feature vector output by the feature extraction module and output the identification result of the anti-copying QR code based on the feature vector.
4. The method for identifying anti-copying QR codes on cans according to claim 3, characterized in that: Obtaining the detection image of the anti-copying QR code on the tank includes the following steps: Light detection is performed on the area containing the anti-copying QR code on the can, and a prompt is given. The anti-copying QR code is image captured to obtain the captured image; Blur detection is performed on the acquired images, and the acquired images that meet the clarity requirements are selected as the detection images.
5. The method for identifying anti-copying QR codes on cans according to claim 4, characterized in that: Perform light detection on the area containing the anti-copying QR code on the can body and provide the following prompts: Obtain the pixel brightness of each pixel in the area where the anti-copying QR code is located on the can; Obtain the average pixel brightness of the area where the anti-copying QR code is located on the can; When the average pixel brightness is lower than the lower limit and higher than the upper limit, the user is prompted to make an identification under an environment that meets the lighting requirements.
6. The method for identifying anti-copying QR codes for tanks according to claim 4, characterized in that: The blur detection of the acquired image includes the following steps: The second derivative of the acquired image is calculated based on the Laplacian operator; Calculate the variance of the second derivative, and adaptively scale the variance according to the QR code size to obtain an adaptively scaled variance; wherein the adaptively scaled variance is equal to the product of the variance and the size ratio of the anti-copying QR code to the base QR code; When the adaptive scaling variance value is less than a preset threshold, the acquired image is determined to be a blurred image; wherein, the preset threshold corresponds to the size of the reference QR code; When the adaptive scaling variance value is not less than the preset threshold, the acquired image is determined to meet the sharpness requirements.
7. The method for identifying counterfeit-proof QR codes for tanks according to claim 3, characterized in that: Obtaining the corrected image of the anti-copying QR code based on the detected image includes the following steps: The detected image is subjected to surface correction to obtain a surface-corrected detected image; A perspective transformation is performed on the surface-corrected detection image to obtain a standard rectangular detection image; The standard rectangular detection image is normalized to obtain the target size detection image; The target size detection image is normalized to obtain the corrected image.
8. A QR code identification system for preventing copying of cans, characterized in that: The system includes an acquisition module, a correction module, and an identification module; The acquisition module is used to acquire the detection image of the anti-copying QR code on the tank body, and the anti-copying QR code is generated by the anti-copying QR code generation method for tank bodies as described in claim 1 or 2. The correction module is used to obtain a corrected image of the anti-copying QR code based on the detected image; The identification module is used to provide the corrected image to the cloud server, so that the cloud server inputs the corrected image into the anti-copying QR code identification model to obtain the identification result of the anti-copying QR code.
9. A terminal, characterized in that, The terminal includes: a processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory, so that the terminal performs the anti-copying QR code generation method for cans according to any one of claims 1 to 2 and / or the anti-copying QR code identification method for cans according to any one of claims 3 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the terminal, it implements the anti-copying QR code generation method for tanks as described in any one of claims 1 to 2 and / or the anti-copying QR code identification method for tanks as described in any one of claims 3 to 7.