Machine Vision-Based Detection Method and System for Printing Quality of Wide Coils of Pulled Wires

The outlier and abnormality of characters are calculated by machine vision method, and the number of pixels and position offsets of the wide-format coil characters of the wire pulling wire pulling wire pulling wire pulling wire pulling wire pulling wire pulling wire is analyzed using CTPN and U-Net models, which solves the accuracy of laser printing wire pulling wire and improves the detection accuracy and reliability of anti-counterfeiting wire pulling wire.

CN120107253BActive Publication Date: 2025-07-04GUANGZHOU HUADU LIANHUA PACKING MATERIAL CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510585409.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-07-04
Estimated Expiration
2045-05-08

AI Technical Summary

Technical Problem

The prior art is difficult to accurately determine whether the color and outline of the pull-line wide-format coil characters based on laser printing meet the standards, especially when the light changes and the character size are too small, resulting in poor anti-counterfeiting effect.

Method used

Through machine vision methods, the outlier and anomalies of characters are calculated, and the character recognition model of the CTPN architecture and the image segmentation model of the U-Net architecture are used to analyze the pixel number difference and position offset of characters, and the angles included in the line are fitted to determine whether the character's morphology and position meet the standards.

Benefits of technology

It improves the automatic detection accuracy and reliability of wide-format coils of wire pulling, avoids recognition errors caused by lighting changes and character sizes too small, and ensures the quality of anti-counterfeiting wire pulling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120107253B_ABST
    Figure CN120107253B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image recognition technology. The present invention relates to a method and system for detecting the printing quality of anti-counterfeiting wire-drawn wide-width coils based on machine vision. The method includes: obtaining a wide-width coil image, and marking and selecting each character through a marking frame to obtain the number of pixels belonging to the character in the marking frame; determining the horizontal / vertical coordinate of the center of the marking frame as the horizontal / vertical coordinate of the character, and dividing all characters into multiple wire-drawn clusters and multiple identical character clusters; calculating the outlier degree of each character; fitting a first straight line according to the horizontal / vertical coordinates of each character in the wire-drawn cluster, and calculating a first included angle between the first straight line and the horizontal axis; fitting a second straight line according to the horizontal / vertical coordinates of each character in the identical character cluster, and calculating a second included angle between the second straight line and the vertical axis; calculating the abnormality degree of each character and alarming when the abnormality degree of at least one character is less than a preset second threshold. The present invention improves the automatic detection accuracy and reliability of anti-counterfeiting wire-drawn wide-width coils.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition. More specifically, the present invention relates to a method and system for detecting the printing quality of a wide-width coil of drawstrings based on machine vision. Background Art

[0002] In the production process of anti-counterfeiting drawstrings, a wide-width coil (i.e., a wide-width coil of drawstrings) is usually produced first. The wide-width coil includes a plurality of identical drawstrings, and a plurality of identical drawstrings can be obtained after cutting the wide-width coil.

[0003] Since the patterns engraved by laser are usually very fine and complex. Considering that in the production process of the wide-width coil used for making drawstrings, environmental factors (such as too high temperature, etc.) may cause the tension of the coil to be unstable, resulting in the change of the coating due to the deformation of the coil during or after the printing process. At this time, the anti-counterfeiting function of the drawstrings obtained by cutting the wide-width coil may be lost due to the change of the detailed features of the characters (such as the size and shape of the characters, etc.).

[0004] The prior art usually evaluates the printing effect of the wide-width coil when the printing is completed to prevent the anti-counterfeiting effect from being poor due to the change of the detailed features of the characters. For example, an anti-counterfeiting drawstring detector can be used to determine whether the drawstring has an anti-counterfeiting function. With the development of deep learning algorithms, in order to reduce labor costs, the prior art uses a deep learning model to identify whether the printed characters conform to the standards in the template, and then determines whether each character has an error. For example, the Chinese patent application document with the publication number CN118710599A discloses a method and device for detecting character defects in printed matter. The patent application document matches the obtained image information with a pre-created template, and performs defect detection on the characters in the image information based on the OCR detection algorithm, so as to identify the character defects existing in the printed matter.

[0005] However, on the one hand, due to the dynamic color-changing effect based on the laser process, the optical characteristics of the anti-counterfeiting drawstring are that its color is different in different lighting environments, and it cannot be recognized by the pixel values of the pixels of the corresponding images of each character, that is, it is difficult to accurately determine whether the color of the character meets the standard. On the other hand, since the characters on the anti-counterfeiting drawstring are small, the error in identifying them according to the edge shape of the characters is relatively large, that is, it is difficult to accurately determine whether the contour of the character meets the standard. Therefore, the existing methods for identifying the quality of printed characters are not applicable to wide-width coils of drawstrings based on laser printing (laser engraving). Summary of the Invention

[0006] To solve the above technical problem that it is difficult to accurately determine whether the color of characters meets the standard based on the pixel values of pixels corresponding to each character image or the shape of character edges for the wide-width coil with pull lines based on laser printing technology, the present invention provides solutions in the following aspects.

[0007] In the first aspect, a method for detecting the printing quality of a wide-width coil with pull lines based on machine vision, the method includes: obtaining a wide-width coil image, and marking out each character through a marking frame to obtain the number of pixels belonging to the character in the marking frame, where the wide-width coil image includes multiple characters obtained by laser printing; determining the horizontal / vertical coordinate of the center of the marking frame as the horizontal / vertical coordinate of the character, and dividing all characters into multiple pull-line clusters and multiple same-character clusters, where the absolute value of the difference between the vertical coordinates of any two characters in the pull-line cluster or the absolute value of the difference between the horizontal coordinates of any two characters in the same-character cluster is less than a preset first threshold, and the horizontal axis of the coordinate system is parallel to the straight line for cutting the wide-width coil; calculating the outlier degree of each character, where the outlier degree is proportional to the absolute value of the difference between the number of pixels of the character and the average value of the number of pixels of all characters in the same-character cluster to which it belongs, and the outlier degree is proportional to the absolute value of the difference between the number of pixels of the character and the number of pixels of the character in the same same-character cluster and adjacent in the vertical axis direction; fitting a first straight line according to the horizontal / vertical coordinates of each character in the pull-line cluster, and calculating the first angle between the first straight line and the horizontal axis; fitting a second straight line according to the horizontal / vertical coordinates of each character in the same-character cluster, and calculating the second angle between the second straight line and the vertical axis; calculating the abnormality degree of each character and alarming when the abnormality degree of at least one character is less than a preset second threshold, where the abnormality degree of the character is proportional to its outlier degree, the first angle of the pull-line cluster to which it belongs, and the second angle of the same-character cluster.

[0008] The beneficial effects of the present invention are as follows: The present invention determines whether the size of a character has changed based on the difference in the number of pixels between each character and other same characters, and determines the degree of position deviation of the character based on the degree of position deviation of the character row (the pull-line cluster in the present invention) and character column (the same-character cluster in the present invention) to which the character belongs, and then determines whether the character is the same as the preset standard form, and alarms when the probability of the character size and form changing is relatively large, where the greater the degree of position deviation of the character, the greater the possibility of changes in the character contour and form. Based on this, the present invention avoids recognition errors caused by problems such as light changes and too small character sizes, and effectively improves the automatic detection accuracy and reliability of the wide-width pull lines for making anti-counterfeiting pull lines.

[0009] Preferably, the formula for calculating the outlier degree of the i th character in the j th same-character cluster in the preset direction is:

[0010] ​​

[0011] Among them, in the i th identical character cluster, n is the number of characters, is the average value of the pixel numbers of all characters, is the standard deviation of the pixel numbers of all characters, A i,j is the pixel number of the j th character, A i,j-1 is the pixel number of the j -1th character, A i,j+1 is the pixel number of the j +1th character, i , j are positive integers, q is a preset parameter, and exp is the exponential function with the natural logarithm e as the base.

[0012] The present invention determines the first difference between the pixel number of a single character and the average value of the pixel numbers of other identical characters (i.e., ), and the present invention also determines the second difference between the pixel number of a single character and the pixel number of its adjacent identical character (i.e., or ) to determine the second difference between the character and the identical characters in its local area, and determines the outlier degree of the character through the first difference and the second difference corresponding to the character, thereby improving the accuracy of whether the pixel number of the character is abnormal.

[0013] Preferably, the formula for calculating the abnormality degree h of the characters belonging to the g th wire-pulling cluster and the β h,g th identical character cluster is: , where the characters belonging to the h th wire-pulling cluster and the g th identical character cluster are the g th character in the h th identical character cluster in the preset direction, α h,g is the outlier degree of the characters belonging to the h th wire-pulling cluster and the g th identical character cluster, θ 1,h is the first included angle corresponding to the h th wire-pulling cluster, θ 2,g is the second included angle corresponding to the g th identical character cluster, 0 < θ1,h <90°, 0 < θ 2,g <90°, h , g is a positive integer, norm is the standard normalization function.

[0014] Preferably, the first straight line fitted according to the horizontal / vertical coordinates of each character in the wire cluster includes: calculating the first slope and the first intercept , to obtain the straight line equation of the first straight line: , where: calculating the first slope The formula for

[0015] .

[0016] is the abscissa of the v th character in the wire cluster, is the ordinate of the v th character in the wire cluster, m is the number of characters in the wire cluster, v is a positive integer; the formula for the first intercept is:

[0017] .

[0018] The present invention obtains the first straight line by least squares fitting, so that the fitting result can better represent the trend of the horizontal / vertical coordinates of each character in the wire cluster.

[0019] Preferably, the second straight line fitted according to the horizontal / vertical coordinates of each character in the same character cluster includes: calculating the second slope and the second intercept , to obtain the straight line equation of the second straight line: , where: calculating the second slope The formula for

[0020] .

[0021] is the abscissa of the a th character in the same character cluster, is the ordinate of the a th character in the wire cluster, b is the number of characters in the same character cluster, a is a positive integer; the formula for the second intercept is:

[0022] .

[0023] Preferably, each character is selected by a marking box through a character recognition model. The construction of the character model includes: constructing a first training set, where the first training set includes a plurality of first training pictures, each of the first training pictures includes a plurality of characters obtained by laser printing, and the characters are selected by the marking box; constructing a first initial model, where the first initial model is a model with a CTPN architecture; training the first initial model with the first training set to obtain the character recognition model.

[0024] The present invention uses a character recognition model with a CTPN architecture, which improves the accuracy of character detection.

[0025] Preferably, through an image segmentation model, the pixels belonging to the characters in each marking box are marked with a preset label, and the number of pixels marked with the preset label is calculated to obtain the number of pixels belonging to the characters in each marking box. The construction of the image segmentation model includes: constructing a second training set, where the second training set includes a plurality of second training pictures, each of the second training pictures includes a plurality of characters obtained by laser printing, and the pixels corresponding to the characters are marked with the preset label; constructing a second initial model, where the second initial model is a model with a U-Net architecture; training the second initial model with the second training set to obtain the image segmentation model.

[0026] The present invention uses an image segmentation model with a U-Net architecture, which can more accurately identify the pixels belonging to the characters in the marking box.

[0027] In a second aspect, a machine vision-based wire drawing wide-width coil printing quality detection system includes a processor and a memory. The memory stores a computer program, and the processor executes the computer program to implement the machine vision-based wire drawing wide-width coil printing quality detection method according to any one of the above-mentioned invention contents.

[0028] The beneficial effects of the present invention are as follows:

[0029] The present invention analyzes the pixel quantity difference between a character and other identical characters to more accurately judge the size change of the character. At the same time, according to the position offset degree of the character in the row and column, it judges whether the character has a position offset, so as to evaluate whether the character form is consistent with the preset standard. When the possibility of the character size or form changing is relatively large, an alarm is given. The present invention avoids errors in character judgment for wire drawing wide-width coils based on laser printing caused by factors such as light change and too small character size, and improves the automatic detection accuracy and reliability of anti-counterfeiting wire drawing wide-width. Description of the Drawings

[0030] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features, and advantages of the exemplary embodiments of the present invention will become readily understandable. In the drawings, several embodiments of the present invention are shown in an exemplary rather than restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0031] Figure 1 is a flowchart of the steps of a machine vision-based printing quality detection method for a wide-width coiled material with a drawn wire;

[0032] Figure 2 is a schematic diagram of some characters in the wide-width coiled material image according to an embodiment of the present invention;

[0033] Figure 3 is a structural block diagram of a machine vision-based printing quality detection system for a wide-width coiled material with a drawn wire according to this embodiment. Detailed Embodiments

[0034] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0035] Next, the detailed embodiments of the present invention will be described in detail with reference to the accompanying drawings.

[0036] Figure 1 is a flowchart of the steps of a machine vision-based printing quality detection method for a wide-width coiled material with a drawn wire according to an embodiment of the present invention.

[0037] As Figure 1 shown, the machine vision-based printing quality detection method for a wide-width coiled material with a drawn wire includes steps S1 to S6.

[0038] Step S1: Obtain a wide-width coiled material image, and use a marking frame to select each character, and obtain the number of pixels belonging to the character in the marking frame.

[0039] Among them, the wide-width coiled material image includes multiple characters obtained by laser printing. It should be noted that laser printing is a printing technology that uses laser ink (with metal optical variable anti-counterfeiting ink) and adopts laser printing technology to screen-print or roll-print laser ink on various smooth and transparent materials. The printed matter can present different colors as the viewing angle changes, with an obvious dynamic color-changing effect, and can produce a rainbow ring effect under concentrated light. Therefore, it is difficult to accurately judge the printing quality of each character through pixel values for a drawn wire with anti-counterfeiting function or a wide-width coiled material composed of multiple drawn wires.

[0040] In one embodiment, each character is selected by a bounding box through a character recognition model. The construction of the character model includes: constructing a first training set, where the first training set includes a plurality of first training pictures, each of the first training pictures includes a plurality of characters obtained by laser printing, and the characters are selected by bounding boxes; constructing a first initial model, where the first initial model is a model with a CTPN architecture; training the first initial model with the first training set to obtain the character recognition model. Among them, the bounding box is usually a rectangular box.

[0041] It should be noted that for the number of pixels of any character, it is the number of all pixels that make up the character. In one embodiment, the pixels belonging to the character in each bounding box are marked with a preset label through an image segmentation model, and the number of pixels marked with the preset label is calculated to obtain the number of pixels belonging to the character in each bounding box. The construction of the image segmentation model includes: constructing a second training set, where the second training set includes a plurality of second training pictures, each of the second training pictures includes a plurality of characters obtained by laser printing, and the pixels corresponding to the characters are marked with a preset label; constructing a second initial model, where the second initial model is a model with a U-Net architecture; training the second initial model with the second training set to obtain the image segmentation model.

[0042] Step S2: Determine the horizontal / vertical coordinate of the center of the bounding box as the horizontal / vertical coordinate of the character, and divide all characters into a plurality of string clusters and a plurality of identical character clusters.

[0043] It should be noted that determining the horizontal / vertical coordinate of the center of the bounding box as the horizontal / vertical coordinate of the character means: determining the horizontal coordinate of the center of the bounding box as the horizontal coordinate of the character, and determining the vertical coordinate of the center of the bounding box as the vertical coordinate of the character.

[0044] Among them, the absolute value of the difference between the vertical coordinates of any two characters in the string cluster or the absolute value of the difference between the horizontal coordinates of any two characters in the identical character cluster is less than a preset first threshold, and the horizontal axis of the coordinate system is parallel to the straight line for cutting the wide-width coil material.

[0045] It should be noted that the text length of the characters corresponding to the string is usually short. For example, the characters on the string used for cigarette cases are usually the product name or the production company name, etc., with a short text length and repeated occurrences. Cutting the wide-width coil material can obtain the string, and each string is the same. That is to say, on the perpendicular line of the string on the wide-width coil material, the characters on different strings passing through the perpendicular line are the same. On the wide-width coil material, if the characters belonging to a string are arranged horizontally, then the straight line for cutting the wide-width coil material (i.e., the above-mentioned "straight line for cutting the wide-width coil material") is horizontal, and at this time, the characters in each vertical column on the wide-width coil material are the same.

[0046] Furthermore, a method for obtaining the same character clusters can also be determined according to the printing method of the wide-width coil material. For example, the horizontal / vertical coordinates of the centers of the characters in the wide-width coil material are determined according to the character layout method in the printing of the wide-width coil material, which are denoted as the preset coordinates of each character. The horizontal / vertical coordinates of the center of the marking box corresponding to each character are matched with the preset coordinates of the character, and the matching with the smallest distance between the preset coordinates and the horizontal / vertical coordinates of the center of the marking box is selected, so as to determine the characters within the marking box, and the same characters are assigned to the same "same character cluster". Based on this, the purpose of this step is to assign the characters belonging to the same wire to a "wire cluster" and the same characters to a "same character cluster".

[0047] Figure 2 It is a schematic diagram of some characters in the wide-width coil material image according to an embodiment of the present invention.

[0048] As Figure 2 shown, the characters of "……ABCDEFAB……" in the same row are the characters on one wire. A straight line L used to cut the wide-width coil material is parallel to the horizontal axis of the coordinate system in the figure. The characters included in any one wire are actually "ABCDEFAB……EFABCDEF", that is, the periodically appearing characters are "ABCDE", and each wire is the same, so the characters in the same order of each wire are the same, that is, for any one wire, the (7Z + 1)-th character is "A", the (7Z + 2)-th character is "B", the (7Z + 3)-th character is "C", the (7Z + 4)-th character is "D", the (7Z + 5)-th character is "E", and the (7Z + 6)-th character is "F", where Z is an integer greater than 0. The spacing between each character is the same, so the characters in the same column are the same. Based on this, the present invention determines all the characters that satisfy the condition that "the absolute value of the difference between the abscissas of any two characters is less than a preset first threshold" as a same character cluster, so that all the characters in the same character cluster are the same.

[0049] Step S3: Calculate the outlier degree of each character.

[0050] Among them, the outlier degree is proportional to the absolute value of the difference between the number of pixels of the character and the average value of the number of pixels of all characters in the same character cluster to which it belongs, and the outlier degree is proportional to the absolute value of the difference between the number of pixels of the character and the number of pixels of the character in the same character cluster and adjacent in the vertical axis direction.

[0051] In one embodiment, calculating the outlier degree of the i -th character in the preset direction of the j -th same character cluster The formula is as follows:[[]]END]]

[0052] .

[0053] Among them, in thei Among the same character clusters, n is the number of characters, is the average value of the pixel numbers of all characters, is the standard deviation of the pixel numbers of all characters, A i,j is the j th pixel number of a character, A i,j-1 is the j th - 1 pixel number of a character, A i,j+1 is the j th + 1 pixel number of a character, i , j are positive integers, q is a preset parameter, exp is the exponential function with the natural logarithm e as the base. The i th character in the preset direction of the j th same - character cluster belongs to the i th same - character cluster and the j th wire - drawing cluster. In one embodiment, the size of the preset parameter q is 1.

[0054] It should be noted that in the embodiments of the present invention, a same - character cluster represents a column of characters, and a wire - drawing cluster represents a row of characters. Therefore, any character belongs to a same - character cluster and a wire - drawing cluster, and the intersection of the characters included in any same - character cluster and wire - drawing cluster has only one character. The present invention makes the i th character in the preset direction of the j th same - character cluster belong to the i th same - character cluster and the j th wire - drawing cluster.

[0055] Furthermore, for the same characters, generally the differences between the pixel numbers of the characters are small. If the pixel number of a certain character is quite different from the pixel numbers of other same characters, it indicates that the character may have been deformed due to environmental factors in the corresponding part of the wide - width coil material, resulting in a change in the size of the character, and the character is no longer suitable for anti - counterfeiting identification. Among them, for the i th character in the preset direction of the j th same - character cluster, the larger it is, the greater the difference between the pixel number of this character and the pixel numbers of other characters in the i th same - character cluster. The more likely this character is magnified or reduced, that is, the more likely the size of this character has changed. At this time, the outlier degree of this character is larger; or The larger it is, the greater the difference between the character and its adjacent characters belonging to the same character cluster, that is, the character is more prominent (or called "more abnormal") within the local range of the image. At this time, the size of the character is more likely to change, and the outlier degree of the character is larger.

[0056] Based on this, the larger the outlier degree of the character, the more likely the size of the character is to change.

[0057] Step S4: Fit a first straight line according to the horizontal / vertical coordinates of each character in the wire-drawing cluster, and calculate the first angle between the first straight line and the horizontal axis.

[0058] Among them, the first angle is an acute angle.

[0059] In one embodiment, the fitting of the first straight line according to the horizontal / vertical coordinates of each character in the wire-drawing cluster includes: calculating the first slope of the first straight line and the first intercept , so as to obtain the straight line equation of the first straight line: , where: calculating the first slope The formula is:

[0060] .

[0061] is the abscissa of the v th character in the wire-drawing cluster, is the ordinate of the v th character in the wire-drawing cluster, m is the number of characters in the wire-drawing cluster, v is a positive integer; the formula for the first intercept is:

[0062] .

[0063] It should be noted that the connecting line of the horizontal / vertical coordinates of the centers of the corresponding marking frames of all characters in a wire-drawing cluster is theoretically parallel to the horizontal axis. Therefore, fitting the horizontal / vertical coordinates of each character in the wire-drawing cluster to obtain the first straight line and calculating the first angle between the first straight line and the horizontal axis, this first angle reflects the deviation degree of all characters in a wire-drawing cluster compared with the set position (that is, in the ideal state, the position of the character). And the change in the shape and contour of the character will cause the change in the shape of its marking frame, and then cause the deviation of the coordinates of the center of the marking frame (that is, the horizontal / vertical coordinates of the character in the present invention) from the set position. Based on this, the larger the first angle corresponding to the wire-drawing cluster, the greater the possibility that the shape and contour of the characters in the wire-drawing cluster change.

[0064] Step S5: Fit a second straight line based on the horizontal / vertical coordinates of each character in the same character cluster, and calculate the second angle between the second straight line and the vertical axis.

[0065] Among them, the second angle is an acute angle.

[0066] In one embodiment, calculate the second slope of the second straight line and the second intercept , to obtain the straight line equation of the second straight line: , where: calculate the second slope The formula for is:

[0067] .

[0068] is the abscissa of the a th character in the same character cluster, is the ordinate of the a th character in the wire drawing cluster, b is the number of characters in the said same character cluster, a is a positive integer; the formula for the second intercept is:

[0069] .

[0070] Similarly, the connecting line of the horizontal / vertical coordinates of the centers of the marking frames corresponding to all characters in the same character cluster is theoretically parallel to the vertical axis. Therefore, fit the horizontal / vertical coordinates of each character in the same character cluster to obtain a second straight line, and calculate the second angle between the second straight line and the vertical axis. This second angle reflects the degree of deviation of all characters in the same character cluster compared to the set position, and changes in the shape and contour of the characters will cause changes in the shape of their marking frames, and further cause the coordinates of the center of the marking frame to deviate from the set position. Based on this, the larger the second angle corresponding to the same character cluster, the greater the possibility that the shape and contour of the characters in the same character cluster have changed.

[0071] In other embodiments, if the printing method of the wire drawing wide-width coil is different from the embodiment of the present invention (as Figure 2 shown), then when printing the wide-width coil, set two lines for each character, the two lines are perpendicular to each other, the two lines are respectively parallel to one side of the wide-width coil, and the intersection of the two lines is the center of each character. Calculate the first angle and the second angle based on the angles between the two lines and the vertical axis and the horizontal axis in this image.

[0072] Step S6: Calculate the abnormality degree of each character and alarm when the abnormality degree of at least one character is less than the preset second threshold.

[0073] Among them, the abnormality degree of a character is directly proportional to its outlier degree, the first included angle with the stay wire cluster it belongs to, and the second included angle with the same character cluster.

[0074] In one embodiment, calculate the abnormality degree of the character belonging to the h th stay wire cluster and the g th same character cluster β h,g The formula is: , where the character belonging to the h th stay wire cluster and the g th same character cluster is the g th character of the h th same character cluster in the preset direction, α h,g is the outlier degree of the character belonging to the h th stay wire cluster and the g th same character cluster, θ 1,h is the first included angle corresponding to the h th stay wire cluster, θ 2,g is the second included angle corresponding to the g th same character cluster, 0 < θ 1,h < 90°, 0 < θ 2,g < 90°, h , g is a positive integer, norm is the standard normalization function. Among them, the standard normalization function norm is used to map the value to the range of (0, 1).

[0075] It should be noted that for the character belonging to the h th stay wire cluster and the g th same character cluster, the larger the first included angle h 1,h or the second included angle θ 2,g g corresponding to the θ 2,g th same character cluster, the more likely the shape and contour of the character have changed, and at this time the abnormality degree β h,g of the character is larger; the larger the outlier degree α h,g of the character, the greater the possibility that the size of the character has changed, and at this time the abnormality degree β h,gThe larger it is. When the size of the character changes or its shape and contour change, the character may not be suitable for anti-counterfeiting identification. Based on this, the greater the abnormality degree of the character, the greater the possibility that the character cannot be used for anti-counterfeiting identification. Therefore, an alarm is triggered when the abnormality degree of at least one character is less than a preset second threshold.

[0076] Furthermore, characters with a length less than the preset second threshold are marked for easy manual inspection and related processing (such as cutting and discarding the wire to which the character belongs).

[0077] Figure 3 It is a structural block diagram of the wire-width coil printing quality inspection system based on machine vision in this embodiment.

[0078] The present invention also provides a wire-width coil printing quality inspection system based on machine vision. As Figure 3 shown, the system includes a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the wire-width coil printing quality inspection method based on machine vision according to the first aspect of the present invention is implemented.

[0079] The system further includes a communication interface, which is other components well-known to those skilled in the art, and its settings and functions are known in the art, so they will not be elaborated here.

[0080] In the present invention, the aforementioned memory can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or component. For example, a computer-readable storage medium can be any suitable magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc., or any other medium that can be used to store the required information and can be accessed by an application, module, or both. Any such computer storage medium can be part of the device or accessible or connectable to the device. Any application or module described in the present invention can be implemented using computer-readable / executable instructions that can be stored or otherwise held by such a computer-readable medium.

[0081] In the description of this specification, the meanings of "a plurality of" and "several" are at least two, such as two, three or more, etc., unless otherwise specifically defined.

[0082] Although this specification has shown and described multiple embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will think of many changes, alterations and alternative ways without departing from the spirit and scope of the present invention. It should be understood that various alternatives to the embodiments of the present invention described herein may be employed in the practice of the present invention.

Claims

1. A method for detecting the printing quality of wire-drawn wide-width coils based on machine vision, characterized in that, Including: Obtain a wide-width coil image, select each character through a bounding box, and obtain the number of pixels belonging to the character in the bounding box, where the wide-width coil image includes multiple characters obtained by laser printing; Determine the horizontal / vertical coordinate of the center of the bounding box as the horizontal / vertical coordinate of the character, and divide all characters into multiple wire-drawing clusters and multiple identical-character clusters, where the absolute value of the difference between the vertical coordinates of any two characters in the wire-drawing cluster or the absolute value of the difference between the horizontal coordinates of any two characters in the identical-character cluster is less than a preset first threshold, and the horizontal axis of the coordinate system is parallel to the straight line for cutting the wide-width coil; calculate the outlier degree of each character, and the outlier degree is proportional to the absolute value of the difference between the number of pixels of the character and the average value of the number of pixels of all characters in the identical-character cluster to which it belongs, and the outlier degree is proportional to the absolute value of the difference between the number of pixels of the character and the number of pixels of the character in the same identical-character cluster and adjacent in the vertical axis direction; Fit a first straight line according to the horizontal / vertical coordinates of each character in the wire-drawing cluster, and calculate the first angle between the first straight line and the horizontal axis; fit a second straight line according to the horizontal / vertical coordinates of each character in the identical-character cluster, and calculate the second angle between the second straight line and the vertical axis; calculate the abnormality degree of each character and alarm when the abnormality degree of at least one character is less than a preset second threshold, where the abnormality degree of the character is proportional to its outlier degree, the first angle of the wire-drawing cluster to which it belongs, and the second angle of the identical-character cluster.

2. The method for detecting the printing quality of a wire-drawn wide-width coil based on machine vision according to claim 1, wherein Calculate the i th character outlier degree of the j th identical character cluster in the preset direction is given by the formula: ; Among them, in the i th identical character cluster, is the mean of the pixel numbers of all characters, is the standard deviation of the pixel numbers of all characters, A i,j is the pixel number of the j th character, A i,j-1 is the pixel number of the j -1th character, A i,j+1 is the pixel number of the j +1th character, i , j are positive integers, q is a preset parameter, exp is the exponential function with the natural logarithm e as the base. The i th character in the preset direction of the j th identical character cluster belongs to the i th identical character cluster and the j th wire-drawing cluster.

3. The method for detecting the printing quality of a wire-drawn wide-width coil based on machine vision according to claim 1, characterized in that, Calculate the abnormality degree of the characters belonging to the h th guy wire cluster and the g th identical character cluster. The formula for β h,g is as follows: ; wherein α h,g is the outlier degree of the characters belonging to the h th wire cluster and the g th identical character cluster, θ 1,h is the first included angle corresponding to the h th wire cluster, θ 2,g is the second included angle corresponding to the g th identical character cluster, 0 < θ 1,h < 90°, 0 < θ 2,g < 90°, h , g is a positive integer, norm is the standard normalization function.

4. The method for detecting the printing quality of a wire-drawn wide-width coil based on machine vision according to claim 1, wherein The step of fitting a first straight line according to the horizontal / vertical coordinates of each character in the wire-drawing cluster includes: Calculate the first slope of the first straight line and the first intercept , to obtain the straight line equation of the first straight line: , where: Calculate the first slope The formula is as follows: , is the abscissa of the v th character in the guy wire cluster, is the ordinate of the v th character in the guy wire cluster, m is the number of characters in the said guy wire cluster, v is a positive integer; The first intercept The formula for .

5. The method for detecting the printing quality of a wire-drawn wide-width coil based on machine vision according to claim 1, wherein, The step of fitting a second straight line according to the horizontal / vertical coordinates of each character in the identical-character cluster includes: Calculate the second slope of the second straight line and the second intercept , to obtain the straight line equation of the second straight line: , where: Calculate the second slope The formula is as follows: , is the abscissa of the a th character in the same character cluster, is the ordinate of the a th character in the same character cluster, b is the number of characters in the said same character cluster, a is a positive integer; Second intercept The formula for is:

6. The method for detecting the printing quality of a wire-drawn wide-width coil based on machine vision according to claim 1, characterized in that, Select each character through a bounding box by a character recognition model, where constructing the character model includes: Construct a first training set, where the first training set includes multiple first training pictures, each first training picture includes multiple characters obtained by laser printing, and the characters are selected through bounding boxes; Construct a first initial model, where the first initial model is a model with a CTPN architecture; Train the first initial model with the first training set to obtain the character recognition model.

7. The method for detecting the printing quality of a wire-drawn wide-width coil based on machine vision according to claim 1, wherein Mark the pixels belonging to the character in each bounding box with a preset label through an image segmentation model, and calculate the number of pixels marked with the preset label to obtain the number of pixels belonging to the character in each bounding box, where constructing the image segmentation model includes: Construct a second training set, where the second training set includes multiple second training pictures, each second training picture includes multiple characters obtained by laser printing, and the pixels corresponding to the characters are marked with a preset label; Construct a second initial model, where the second initial model is a model with a U-Net architecture; Train the second initial model with the second training set to obtain the image segmentation model.

8. A wire drawing wide-width coil printing quality detection system based on machine vision, comprising a processor and a memory, wherein the memory stores a computer program, characterized in that, The processor executes the computer program to implement the machine vision-based wire-drawing wide-width coil printing quality detection method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Printed matter character defect detection method and device

    CN118710599A

  • Printed matter quality detection method, device and equipment and computer medium

    CN113406110A

  • Method of detecting misprints, computing device, and storage medium

    US20230092072A1