Label two-dimensional code printing detection system and detection method thereof

By analyzing the edge closure, grayscale continuity, and structural stability of QR codes, the problem of insufficient accuracy in QR code printing detection in existing technologies has been solved, achieving efficient identification of detailed defects and accurate detection.

CN121937409APending Publication Date: 2026-04-28WEIFANG XINXING LABELPRODUCTS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WEIFANG XINXING LABELPRODUCTS CO LTD
Filing Date
2026-01-14
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies are unable to effectively handle minor defects or details in QR code printing, and cannot accurately identify problems such as edge distortion, misalignment, broken strokes, or uneven brightness, resulting in inaccurate QR code quality assessment.

Method used

By using the image clarity extraction module, the regional grayscale analysis module, the structural offset judgment module, and the data content verification module, combined with edge closure, grayscale continuity, and structural stability analysis, the integrity of the edges, positioning blocks, and character groups of the QR code is identified, and the QR code printing detection results are generated.

Benefits of technology

It improves the accuracy and reliability of QR code detection, ensures the correctness of QR code content, avoids information misalignment, insertion or duplication, and enhances the accuracy of image quality judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121937409A_ABST
    Figure CN121937409A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of label verification, and discloses a label two-dimensional code printing detection system and a detection method thereof, and the system comprises an image clear extraction module, a region gray scale analysis module, a structure offset judgment module, a data content proofreading module and a label label verification module. According to the method, the problems of image dislocation and offset can be efficiently recognized by accurately analyzing the edge closing degree, the positioning angle spacing and the boundary integrity of the two-dimensional code image, detail defects such as edge breakage and gray scale non-uniformity are accurately found by analyzing the image continuity and gray scale distribution, the defects in detail processing in the prior art are overcome, and the accuracy of the image processing is improved. The accurate structural path judgment and data area comparison avoid information dislocation, insertion or repetition, ensure the correctness of the two-dimensional code content, integrally improve the accuracy and reliability of two-dimensional code detection, and effectively avoid the influence of image defects on data integrity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of label verification technology, specifically, it relates to a label QR code printing detection system and its detection method. Background Technology

[0002] The field of label verification technology mainly involves the identification and verification of labels on recording media, including the reading, comparison, and error detection of visual information such as barcodes, QR codes, and characters. Its core aspects include data acquisition based on image acquisition equipment, image preprocessing, label content recognition, comparison with standard data, and error judgment. It is widely used in product traceability, packaging printing, and logistics identification to ensure the correctness and integrity of label information, avoiding data acquisition failures or information transmission errors caused by printing deviations, image defects, or content errors. This technology typically relies on optical image recognition, pattern matching algorithms, and standard template libraries to achieve the verification of printed labels. Effective detection of QR codes is crucial. Traditional label QR code printing detection systems are used to collect and identify QR code patterns printed on labels, determining whether their printing quality meets readability standards. They typically use line scan or area scan industrial cameras to scan each label individually, extracting the QR code area through image grayscale analysis. Then, a QR code decoder decodes the QR code information and compares the decoding result with preset encoding information to determine if there are quality issues such as printing defects, misalignment, broken strokes, or ghosting. Simultaneously, image resolution and illumination uniformity are used to control detection accuracy, ensuring the readability and data integrity of the label QR code.

[0003] Existing technologies suffer from limited image processing accuracy, making it difficult to effectively handle minor defects or details in QR code printing. Current technologies mainly rely on grayscale analysis and comparison with standard template libraries, but they struggle to accurately identify issues such as edge distortion, misalignment, broken strokes, or uneven brightness in QR codes. Image acquisition devices typically use line scans or area scan cameras, which cannot efficiently correct or judge subtle errors in QR code images. Traditional methods lack precise positioning and image analysis tools when dealing with missing boundaries, inaccurate positioning of blocks, and information arrangement problems, leading to a high probability of misidentification. This affects the judgment of QR code quality and standardization requirements, and fails to completely solve the technical challenges related to image quality and data integrity. Summary of the Invention

[0004] This invention addresses the technical problems existing in the prior art by providing a label QR code printing inspection system and its inspection method.

[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: A label QR code printing inspection system, the system includes: The image clarity extraction module acquires continuous images of the QR code, evaluates edge closure, positioning angular spacing, and boundary integrity, and combines edge offset, pixel focus, and brightness contrast to filter images with structural closure and complete imaging, generating usable image imaging content. The regional grayscale analysis module extracts three positioning blocks, the central data area, and the edge area from the image based on the available judgment content of image imaging. It counts the grayscale levels and the maximum jump value, judges the grayscale continuity and edge breakage, and generates the local continuity judgment content of the image. The structural offset determination module obtains the coordinate paths of the three positioning blocks based on the local continuity determination content of the image, analyzes the changes in the angle between the block and the outer frame edge of the image, determines the connectivity of the block arrangement, identifies rotation offset and skipping columns, and outputs the structural stability determination content. The data content verification module combines structural stability judgment content to identify the character group order and numbering start position, judge the arrangement pattern, detect misalignment, insertion, and repetition, and generate complete character judgment content. The label marking and verification module determines the content based on the integrity of the characters, extracts the sequence number and encoding, judges the sequential continuity, checks for interruptions, intersections, and overlaps, and generates the QR code printing inspection results.

[0006] The following are further optimizations of the above technical solution by the present invention: The image imaging criteria include: QR code edge closure degree, positioning angle side length spacing, boundary integrity ratio, boundary spacing offset, pixel focus position, background brightness distribution, and image block region contrast; image local continuity criteria include: gray level occurrence frequency, maximum gray level jump value, gray level equalization interval, gray level distribution continuity, edge breakage, and brightness difference of positioning block boundaries; structural stability criteria include: coordinate path of three positioning blocks, angle change between structural lines and image outer frame edge lines, data block arrangement order, pixel block boundary connectivity, rotation offset, skipping column phenomenon, structural line offset and compression misalignment; character integrity criteria include: character group order, block starting position number, arrangement consistency, misalignment, insertion, and repeated structure; QR code printing detection results include: correspondence between image number order and encoding order, interruption of image-code order, mark intersection, repeated superposition, and image batch encoding repetition.

[0007] Further optimization: The connectivity of the block arrangement refers to the continuous and regular spatial arrangement of the positioning blocks and data modules in the QR code, verifying that the overall structure is free from breaks and misalignments.

[0008] Further optimization: The identification of rotation offset and skip column refers to extracting the center coordinates of the three positioning blocks of the QR code, constructing a structural path, calculating the angle change between the structural line and the image edge, determining whether there is rotation tilt, and judging the connectivity of the row and column pixel block boundaries based on the connectivity of the block arrangement to identify skip column phenomenon.

[0009] Further optimization: The image sharpness extraction module includes: The QR code detection submodule detects and extracts the QR code region in the image based on the acquired continuous QR code images, identifies the image features of the QR code, determines whether it conforms to the preset QR code standard, and obtains the QR code detection result. The edge detection and matching submodule extracts QR code edge information based on the QR code detection results, calculates the closure degree of the QR code edge through edge detection, matches it with the standard QR code model, calculates the error value of the QR code edge, and obtains the QR code edge closure degree. The image quality screening submodule evaluates the structural integrity of the image based on the closure of the QR code edge, detects the background brightness distribution and contrast changes, and filters images that meet the preset quality requirements to obtain the usable image imaging content.

[0010] Further optimization: The regional grayscale analysis module includes: The regional grayscale statistics submodule extracts three localization block regions, the central data region, and the image edge region based on the image imaging usability determination content, and counts the occurrence frequency of grayscale levels in each region to obtain the regional grayscale distribution statistics results. The grayscale jump judgment submodule calculates the maximum jump value of grayscale in each region based on the statistical results of grayscale distribution in the region, and compares it with the grayscale equalization interval to determine whether there is a discontinuity in grayscale distribution and generate grayscale jump judgment results. The brightness difference judgment submodule obtains the location block boundary and data area information based on the grayscale transition judgment result, calculates and compares the brightness difference, performs partition judgment, and obtains the image local continuity judgment content.

[0011] Further optimization: The structural offset determination module includes: The structure path extraction submodule determines the content based on the local continuity of the image, extracts the coordinate paths of three positioning blocks in the QR code, obtains the geometric information of the positioning blocks, and obtains the structure path data. The angle change judgment submodule calculates the angle change between the structure line formed by three points and the edge of the image outline based on the structure path data. By comparing the changes, it determines whether there is an angle shift and obtains the angle change judgment result. The offset and misalignment screening submodule determines the connectivity of pixel block boundary line segments based on the angle change judgment results and structural path data, identifies rotation offset and column skipping phenomena in the image, and outputs the structural stability judgment content.

[0012] Further optimization: The data content verification module includes: The character group recognition submodule determines the content based on structural stability, identifies the character group order in the QR code content area, extracts the starting position of each character group, and assigns a position number to obtain the character group position number result. The arrangement pattern comparison submodule compares the arrangement patterns between the content characters and the numbers based on the character group position numbering results, detects whether there are misalignments, insertions and repetitions in the character group, and obtains the character arrangement pattern comparison results; The consistency judgment submodule compares the results based on the character arrangement rules, compares them with the standard character arrangement order, determines whether the character groups are consistent, and generates complete character judgment content.

[0013] Further optimization: The label marking verification module includes: The number and code matching submodule extracts the sequence number and code content of the QR code in the image based on the complete character judgment content, judges the correspondence between the number order and the code order, and obtains the number and code matching result; The sequence continuity judgment submodule judges the continuity between the image number order and the code order based on the matching results of numbering and encoding, checks for the existence of sequence interruption, mark intersection and duplicate superposition, and generates the sequence continuity judgment result. The code duplication screening submodule screens the encoded content in the image batch based on the sequential continuity judgment result to determine whether there is a case of repeated encoded content, and obtains the QR code printing detection result.

[0014] The present invention also provides a label QR code printing detection method, which is based on the above-mentioned label QR code printing detection system and includes the following steps: S1: Acquire continuous images of the QR code, evaluate edge closure, positioning angular spacing, and boundary integrity, and combine edge offset, pixel focus, and brightness contrast to filter images with structural closure and complete imaging, and generate usable image imaging content. S2: Based on the available judgment content of image imaging, extract three positioning blocks, central data area and edge area from the image, count the gray level and maximum jump value, judge the gray level continuity and edge breakage, and generate the local continuity judgment content of the image. S3: Based on the local continuity of the image, obtain the coordinate paths of the three positioning blocks, analyze the changes in the angle between the blocks and the outer edge of the image, determine the connectivity of the block arrangement, identify rotation offset and skip columns, and output the structural stability determination content. S4: Combining structural stability judgment content, identify the character group order and numbering start position, determine the arrangement pattern, detect misalignment, insertion, and repetition, and generate complete character judgment content; S5: Based on the complete character determination content, extract the sequence number and encoding, determine the sequential continuity, check for interruptions, intersections, and overlaps, and generate the QR code printing detection result.

[0015] The present invention, by adopting the above technical solution, has at least the following beneficial effects: 1. This invention, through precise analysis of the edge closure degree, positioning angle spacing, and boundary integrity of QR code images, can efficiently identify image misalignment and offset problems. By analyzing the continuity of the image and grayscale distribution, it accurately discovers detailed defects such as edge breaks and uneven grayscale, solving the shortcomings of existing technologies in detail processing. Precise structural path determination and data area comparison avoid information misalignment, insertion, or duplication, ensuring the correctness of QR code content. Overall, it improves the accuracy and reliability of QR code detection and effectively avoids the impact of image defects on data integrity. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of the system in an embodiment of the present invention; Figure 2 This is a schematic diagram of the system framework in an embodiment of the present invention; Figure 3 This is a flowchart of the image sharpness extraction module in an embodiment of the present invention; Figure 4 This is a flowchart of the regional grayscale analysis module in an embodiment of the present invention; Figure 5 This is a flowchart of the structural offset determination module in an embodiment of the present invention; Figure 6 This is a flowchart of the data content verification module in an embodiment of the present invention; Figure 7 This is a flowchart of the label marking verification module in an embodiment of the present invention; Figure 8 This is a flowchart of the method in an embodiment of the present invention. Detailed Implementation

[0017] In embodiments of the present invention, words such as “example” and “for example” are used to indicate that something is an example, illustration, or description; any embodiment or design described as “example” in the present invention should not be construed as being more preferred or more advantageous than other embodiments or designs; more precisely, the use of the word “example” is intended to present the concept in a specific manner; furthermore, in embodiments of the present invention, the meaning expressed by “and / or” can be both, or either one.

[0018] In the embodiments of the present invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, their intended meanings are consistent. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, their intended meanings are consistent.

[0019] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0020] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0021] This invention provides a label QR code printing detection system, such as... Figure 1-2 The diagram shown illustrates a label QR code printing inspection system, which includes: The image clarity extraction module acquires continuous images of the label QR code, compares the degree of closure of the QR code edges in the image, calculates the ratio of the distance between the positioning corners and the integrity of the boundary, judges whether there is image misalignment based on the boundary distance offset and pixel focus position in the image, judges the background brightness distribution and the contrast distribution of the image area, and filters images with closed outlines and complete structure to obtain the usable image imaging content. The regional grayscale analysis module extracts three positioning block regions, the central data region, and the image edge region from the QR code image based on the image imaging usability judgment content. It counts the occurrence frequency of grayscale levels in the three regions, compares the maximum grayscale jump value and grayscale equalization interval between each region, and judges whether there is discontinuous grayscale distribution and edge breakage. It also performs partition judgment on the brightness difference between the positioning block boundary and the data region, and generates local continuity judgment content of the image. The structural offset determination module obtains the coordinate paths of the three positioning blocks in the QR code based on the local continuity determination content of the image, compares the angle changes between the structural line formed by the three points and the edge line of the image frame, judges the connectivity of the pixel block boundary line segments in the row and column arrangement order of the data blocks, screens for rotation offset and column skipping phenomena in the structural path, identifies whether the structural line deviates from the reference direction and is compressed and misaligned, and outputs the structural stability determination content. The data content verification module combines structural stability judgment content to identify the character group order in the QR code content area, assigns position numbers to the starting position of each block within the character group structure, compares the arrangement pattern between the content characters and the numbers, detects whether there are misaligned, inserted, or repeated structures, compares the results with the standard character arrangement order to determine consistency, and obtains the complete character judgment content. The label marking verification module extracts the sequence number and encoding content of the label to which the image belongs based on the character integrity judgment content, judges the continuity of the correspondence between the image number order and the encoding order, checks for interruptions in the image-code order, cross-marking and overlapping, screens whether the encoding content appears repeatedly in the image batch, and generates QR code printing detection results.

[0022] Image imaging can be judged based on the following: the degree of closure of the QR code edge, the distance between the side lengths of the positioning corners, the proportion of boundary integrity, the offset of the boundary spacing, the position of pixel focus, the distribution of background brightness, and the contrast of the image block area; the local continuity of the image can be judged based on the following: the number of occurrences of gray levels, the maximum jump value of gray levels, the gray level equalization interval, the continuity of gray level distribution, edge breakage, and the brightness difference of the positioning block boundary; the structural stability can be judged based on the following: the coordinate path of the three positioning blocks, the change of the angle between the structural line and the edge of the image frame, the arrangement order of data blocks, the connectivity of pixel block boundaries, rotation offset, skipping column phenomenon, structural line offset and compression misalignment; the character integrity can be judged based on the character group order, the number of the starting position of the block, the consistency of the arrangement pattern, misalignment, insertion, and repeated structure; the QR code printing detection results can be judged based on the correspondence between the image number order and the encoding order, the interruption of the image code order, the intersection of marks, the repeated superposition, and the duplicate encoding of the image batch.

[0023] Specifically, such as Figure 2 , 3 As shown, the image sharpness extraction module includes: The QR code detection submodule detects and extracts the QR code region in the image based on the acquired continuous QR code images, identifies the image features of the QR code, determines whether it conforms to the preset QR code standard, and obtains the QR code detection result. Based on the acquired continuous images of the QR code, each frame of the image acquired from the camera is numbered, and the pixel matrix of the image is read sequentially. The grayscale level changes of pixels in the image area are scanned line by line. During the scanning process, regions exhibiting regular alternating black and white characteristics are extracted, their edge coordinates are recorded, and they are cropped to form candidate image regions. These candidate regions are converted into standard grayscale images, and then binary segmentation is performed based on a grayscale threshold to obtain a preliminary pattern structure composed of black and white modules. Subsequently, the number of black and white blocks switching in each row and column of the pattern structure is analyzed to determine whether the module arrangement conforms to the QR code format. In further recognition, three preset corner regions in the candidate regions are read, and their features are compared with the three Fi elements in the standard QR code. The spatial layout features of the pattern include a large square outer border and a concentric structure composed of black and white lines in the middle. The relative positional relationship between the three points, the length of the boundary line and the included angle are measured. If the identified pattern structure meets the requirements that the included angle between the three points is close to a right angle, the side distance is equal and the proportion is reasonable, the candidate area can be determined as a standard QR code image area. In this process, the average pixel block size of each module in the image also needs to be estimated and compared with the module size in the standard template. If the spacing error between modules is within the set range, it is considered to meet the QR code standard. Finally, the position information, module structure parameters and geometric feature information of the image area are extracted to confirm that it is a valid QR code area and obtain the QR code detection result.

[0024] The edge detection and matching submodule extracts QR code edge information based on the QR code detection results, calculates the closure degree of the QR code edge through edge detection, matches it with the standard QR code model, calculates the error value of the QR code edge, and obtains the QR code edge closure degree. The image boundary pixel values ​​are read from the identified QR code area. A pixel-by-pixel difference analysis is performed on the brightness changes of all edge pixels in the horizontal and vertical directions. The grayscale changes between adjacent pixels are compared, and the edge point positions are recorded at abrupt brightness changes. All edge points are then connected according to pixel connections to trace the continuity of the edge path. The number of successfully connected edge segments and the total number of edge points are counted to determine whether the edges of the QR code area are continuous and closed. After the contour is constructed, the geometric features of the QR code area boundary are further calculated. The lengths and angles of the four sides of the boundary are extracted, and these boundary information are compared with the side lengths and angles of the standard QR code square edge. For example, when the difference in length of the four sides of the edge does not exceed the set maximum deviation value, and each interior angle is close to a right angle, it can be initially judged that the edge is well closed. At the same time, it is also necessary to compare the overlap between the extracted contour boundary and the standard QR code contour model, align the edge lines of the two contours on the boundary in each direction, and measure the degree of deformation of the corresponding edge. By accumulating the deformation length of all boundaries, it is determined whether the QR code edge has deformed or shifted. Combined with the pixel size of the actual recognition area, it is inferred whether the QR code edge in the image meets the matching standard. If the geometric contour change of the edge of the recognition area is within the allowable range, it is determined that the closure degree of the QR code edge meets the matching requirements, and finally the QR code edge closure degree is obtained.

[0025] The image quality screening submodule evaluates the structural integrity of the image based on the edge closure of the QR code, detects the background brightness distribution and contrast changes, and screens images that meet the preset quality requirements to obtain the usable image imaging content. First, the background area outside the QR code is delineated in the image. The average gray value and gray value variation range of all pixels in this area are calculated to determine whether the background brightness is within the medium brightness range of the image captured by the image sensor. At the same time, the average gray value inside the QR code area is statistically analyzed, and the gray value difference between the QR code area and the background area is compared to see if it is significant. If the average gray value of the QR code is significantly higher or lower than the background gray value, and the difference between the two is within the set contrast range, the image is judged to have effective contrast performance. To further evaluate the structural integrity of the image, all pattern areas with positioning functions are extracted from the QR code, including three FinderPattern and one alignment mark. The positioning success of each feature pattern is judged. When more than two positioning patterns are identified, it indicates that the image has a relatively complete QR code structure. Based on this, combined with the QR code edge closure degree obtained above, if the edge structure is clear and continuous, and the contrast between the background brightness and the QR code is significant, and the positioning structure is basically complete, the image is judged to have no serious blurring, underexposure, or structural loss problems during the imaging process, and can be regarded as an image with acceptable image quality. Finally, it is output as the judgment result of image imaging usability.

[0026] Specifically, such as Figure 2 , 4 As shown, the regional grayscale analysis module includes: The regional grayscale statistics submodule extracts three localization block regions, the central data region, and the image edge region based on the image imaging usability determination content, and counts the occurrence frequency of grayscale levels in each region to obtain the regional grayscale distribution statistics results. Three positioning block regions, the central data region, and the image edge region are selected sequentially in the image. After reading the pixel coordinate range of the corresponding regions in the image, the pixel grayscale values ​​in these regions are extracted respectively. The integer values ​​of each grayscale value from 0 to 255 are counted, and the frequency of each grayscale value in the region is recorded to form a grayscale frequency list. During the statistical process, a one-dimensional array is used to record the count value of each grayscale level. In practical applications, for example, if the size of a positioning block region is 21×21 pixels, totaling 441 pixels, and a pixel with a grayscale value of 120 appears 45 times, and a pixel with a grayscale value of 121 appears 39 times, and other grayscale values ​​are recorded sequentially in the same way, then the corresponding values ​​are extracted in the central data region according to the QR code version standard. The coordinate range should be set accordingly. For example, the central data area of ​​the QR code in version 6 can be set to a 41×41 pixel range in the middle. After extracting the data, the above counting operation is repeated for the grayscale values. The image edge area can be the outermost 10-pixel wide area of ​​the image. The corresponding pixels are extracted along the boundary for grayscale frequency statistics. After the statistics are completed, the grayscale distribution of each type of area is organized into a data structure to facilitate the judgment and comparison of subsequent modules. For example, the grayscale values ​​of the three positioning blocks are concentrated in the range of 110 to 135, the central data area is concentrated in the range of 90 to 115, and the grayscale values ​​of the image edge area are more dispersed, ranging from 80 to 160. This is further used to analyze the regional contrast relationship and jump trend, and finally obtain the regional grayscale distribution statistics results.

[0027] The grayscale jump judgment submodule calculates the maximum jump value of grayscale in each region based on the statistical results of grayscale distribution in the region, and compares it with the grayscale equalization interval to determine whether there is a discontinuity in grayscale distribution and generate grayscale jump judgment results. For each region, grayscale values ​​are arranged in ascending order. The frequency of occurrence of adjacent grayscale values ​​is compared to identify the segment with the most significant frequency change. Within each region, grayscale pairs with adjacent levels but the largest difference in frequency are selected, and the jump value between these pairs is calculated; this is the maximum jump value. Based on the total number of 256 grayscale intervals with an 8-bit image depth, the grayscale intervals are evenly divided into several segments. For example, if the grayscale equalization interval is set to 32, the grayscale interval is divided into 8 segments, each with a grayscale span of 32. If a maximum jump value falls within any segment, a break occurs—that is, several consecutive grayscale levels within a certain grayscale level do not appear or appear far less frequently than surrounding levels. If the gray level changes from 115 to 160, and the frequency of gray levels in between is 0 or extremely low, the jump value is judged to be 45. In the gray level equalization segment, this segment is from 128 to 160, and there should be multiple gray levels continuously distributed within it. Therefore, this jump is considered a discontinuous behavior. If the central data area changes continuously between gray levels 100 and 120 without any gray level gaps, it is considered continuous. If the gray level frequency in the image edge area is 0 in multiple adjacent gray levels, it is considered to have a jump. The maximum jump of gray level value in each area and whether it crosses the gap in gray level are used to determine whether the gray level in the area is continuous, and finally, the gray level jump judgment result is generated.

[0028] The brightness difference judgment submodule obtains the location block boundary and data area information based on the grayscale transition judgment result, calculates and compares the brightness difference, performs partition judgment, and obtains the image local continuity judgment content. First, the boundaries of the three FinderPattern regions in the image are located. The grayscale values ​​of all pixels in the boundary regions are read, and the average grayscale value within the boundary of each location block is calculated. Simultaneously, the grayscale values ​​of pixels in the central data region are also averaged to obtain the average brightness value of each region. Then, the average brightness value of each location block region is compared with the average brightness value of the central data region one by one. During the comparison, a brightness difference threshold is set, for example, 20. If the difference between the average brightness values ​​of two regions is greater than this threshold, it is determined that there is a brightness inconsistency. Further partitioning is then performed, that is, the image is divided into several functional sub-regions, and the above brightness difference is repeated for each sub-region. By comparing the differences, if the brightness difference within a certain area remains within a set threshold, it is determined to be a region with continuous brightness. If the brightness difference frequently exceeds the threshold, it is determined to be a region with sudden changes in local brightness. In practical applications, if the average brightness of the boundary area of ​​the positioning block is 130 and the central data area is 105, the brightness difference is 25, which exceeds the threshold of 20. This is determined to be a region with sudden changes in brightness in the image. At the same time, if the average brightness of the upper and lower areas of the image is 110 and 112 respectively, with a difference of only 2, it is determined to be a region with consistent local brightness. Combining the brightness difference judgment results of each sub-region in the entire image, continuous and discontinuous blocks are divided, and the final output is the content of the image local continuity judgment.

[0029] Specifically, such as Figure 2 , 5 As shown, the structural offset determination module includes: The structure path extraction submodule determines the content based on the local continuity of the image, extracts the coordinate paths of three positioning blocks in the QR code, obtains the geometric information of the positioning blocks, and obtains the structure path data. The code reads a QR code image region that has been determined to have continuous brightness and stable structure. It then sequentially locates the geometric center coordinates of three positioning blocks within the image. By analyzing the grayscale distribution, module shape, and black-and-white edge boundaries of the positioning block regions, it determines the rectangular border of each block and marks its four corner points. Further, it extracts the center point coordinates using diagonal intersections, recording the coordinates of the three center points as P1(x1, y1), P2(x2, y2), and P3(x3, y3). Subsequently, based on the relative positions of the three points, it constructs a structural path by connecting the three points in a clockwise order to form structural path segments. Simultaneously, it obtains the length information of each segment and correlates it with... The image size is normalized to obtain the side length ratio data between the three points. In the actual image, for example, P1 is (120, 140), P2 is (320, 135), and P3 is (125, 340). The connecting line segments are P1-P2, P2-P3, and P3-P1, with corresponding pixel distances of 200, 210, and 200. The resulting structural path data includes point coordinates, line segment lengths, line segment order, and structural direction markings. After recording the structural path information, it is necessary to further mark the path starting point and direction vector value for subsequent angle changes and rotation offset judgments. Finally, the above information is sorted and output as structural path data.

[0030] The angle change judgment submodule calculates the angle change between the structure line formed by three points and the edge of the image outline based on the structure path data. By comparing the changes, it determines whether there is an angle shift and obtains the angle change judgment result. First, calculate the slope of each structural line segment. Based on the extracted coordinates of the three points, calculate the angle of the connecting lines between each pair of segments. Take the direction vectors of the two most important line segments and calculate the angle between them and the horizontal boundary line of the image. Then, take the direction of the image reference boundary line as the horizontal 0-degree line and calculate the absolute difference between the direction angle of the structural line segment and this reference direction. For example, if the direction of P1-P2 is horizontal, calculate its angle with the horizontal line as 5 degrees, and record the angle deviation of this line segment as 5 degrees. Repeat this calculation for the directions of P2-P3 and P3-P1 to obtain the angle change values ​​of all structural line segments. Record the maximum angle change... The angle difference is compared with a preset baseline threshold, which can be set to 10 degrees. If the angle between any structural line segment and the outer edge of the image exceeds this threshold, it is judged that an angle shift has occurred. If the angle is less than 5 degrees, it is considered that the structure is normal. In the actual example, if the angle between P1 and P2 is 6 degrees, P2 and P3 is 3 degrees, and P3 and P1 is 7 degrees, the maximum angle change is 7 degrees, which is less than the set threshold of 10 degrees. Therefore, it is judged that the image has not experienced an angle shift. If the angle between P1 and P2 in an image reaches 13 degrees, it exceeds the judgment threshold and is determined to be an angle abnormality. Finally, the angle change judgment result is output.

[0031] The offset and misalignment screening submodule judges the connectivity of pixel block boundary line segments based on the angle change judgment result and structural path data, identifies rotation offset and column skipping phenomena in the image, and outputs the structural stability judgment content. Extract all data patch regions from the image. Within each patch region, define pixel block boundaries sequentially along the row and column directions. Establish a coordinate grid based on the main direction of the QR code determined by the positioning blocks. Map all data modules onto the grid points. Then, continuously select adjacent pixel blocks from left to right in each row and compare whether their boundary pixels are consistent in the vertical direction. If the boundary line segments are continuous and without breaks, it is considered connected normally; otherwise, it is determined that there is a skipped column. Simultaneously, continuously scan adjacent pixel blocks from top to bottom in each column. If a break in the boundary or inter-block displacement is detected in the horizontal direction, it is determined that the image is misaligned. During the judgment process, rotational offset correction is further performed based on the structural path angle information. If there is still a disconnect or offset after correction, it is determined that the structure is not stable. In practice, for example, in the row direction data block arrangement of an image, if the boundary misalignment of 3 consecutive blocks in the middle of a row exceeds 2 pixels, causing the line segment to break and exceed the set error threshold of 1 pixel, it is determined that there is a column skipping phenomenon in that row. If the difference between the upper and lower boundaries of 2 out of 5 blocks detected in the column direction exceeds the set deviation value of 3 pixels, it is identified as column misalignment. Combining the above judgment content, the overall structure of the image is output as stable, and the final output is the structural stability judgment content.

[0032] Specifically, such as Figure 2 , 6 As shown, the data content verification module includes: The character group recognition submodule determines the content based on structural stability, identifies the character group order in the QR code content area, extracts the starting position of each character group, and assigns a position number to obtain the character group position number result. First, the effective content area composed of modules is extracted from the QR code image. Under the premise of structural stability, based on the row and column arrangement order of the data modules in the image, the recognizable character modules in the QR code are scanned row by row from left to right and top to bottom. The binary encoded data contained in each module is extracted. During the data conversion process, every 8 bits of binary code is mapped to a standard character code, and consecutive character codes are divided into independent character groups. The starting module coordinates of each character group are recorded according to its first occurrence position in the image. Simultaneously, each character group is sequentially numbered according to the relative position order of the character groups. The characters are numbered sequentially from left to right. For example, in a version 4 QR code, 24 character groups are extracted. The first group starts at coordinates (30, 35) and is numbered 1. The second group starts at coordinates (38, 35) and is numbered 2, and so on. The coordinates and numbers of all character groups form a correspondence table. This table is used for subsequent comparative analysis. In practical applications, if the total number of extracted character groups is 24, and the numbers from 1 to 24 are evenly distributed in the logical grid of the QR code data area, and each number corresponds one-to-one with its corresponding position coordinates without overlap, it means that the recognition process is complete and accurate, and the final result of the character group position number is obtained.

[0033] The arrangement pattern comparison submodule compares the arrangement patterns between the content characters and the numbers based on the character group position numbering results, detects whether there are misalignments, insertions and repetitions in the character group, and obtains the character arrangement pattern comparison results; Extract the content information and corresponding position index of the numbered character groups. Rearrange the character content under each number in numerical order to form a character sequence. Then, calculate the number difference between adjacent character groups in the sequence item by item to determine if there are any consecutive breaks, skips, or repetitions in the numbering. If the number interval between two character groups is not 1 and does not conform to the skipping rule, it is recorded as a misalignment. If a number appears in multiple positions, it is judged as a repetition. If a number is missing and subsequent numbers suddenly increase, it is judged as insertion or missing. For example, if the extracted character group number sequence is 1, 2, 3, 5, 6, 6, 8, 9, then the missing number 4 is an interruption anomaly, and the missing number 6 is an insertion or missing number. Repeated occurrences are considered repetition anomalies. If the numbers change to 1, 3, 4, 5, then number 2 is missing and number 3 is advanced, which is a misalignment. At the character content level, it is also necessary to compare whether the character value corresponding to each number matches the standard value. If the characters themselves are disordered, but the positional order is abnormal, it is classified as an abnormal arrangement pattern. In actual analysis, when the number sequence 1, 2, 3, 5, 6, ... appears in the character group numbered 1 to 24, it is determined that number 4 is skipped, which is a misalignment. If the character "X" appears repeatedly in the 6th and 7th groups at the same time, it is marked as a repetition phenomenon. After the comparison is completed, the abnormal correspondence between all numbers and characters is recorded, and the final character arrangement pattern comparison result is obtained.

[0034] The consistency judgment submodule compares the results based on the character arrangement rules, compares them with the standard character arrangement order, determines whether the character groups are consistent, and generates complete character judgment content. Using a known standard QR code character sequence as a reference, the character group numbers extracted from the current image are compared one-to-one with the standard sequence. The character values ​​corresponding to each position are compared to determine if they match, and if a character value appears correctly at the corresponding position. If a character value appears at an unexpected position, it is considered inconsistent. Similarly, if a character is not extracted or its value is missing at a certain position, it is also considered inconsistent. In practice, the standard character arrangement is "ABCD...X", and the extraction result is "ABDC...X", where "C" and "D" are in the correct order. If the characters are swapped, it is recorded as an inconsistency in order. If the extracted value is "ABBD...X", then "B" is repeated and "C" is missing, which is recorded as an inconsistent state where repetition and missing characters coexist. During the judgment process, it is necessary to count the total number of consistent and inconsistent items. If the proportion of consistent items is lower than a certain set threshold, such as 90%, then the overall character group arrangement is judged to be inconsistent. In the actual example, if there are 20 character groups in total, and only 17 groups of the standard sequence and the current extraction result are completely consistent in position and content, then the consistency ratio is 85%, which is less than the threshold. Finally, the judgment result is marked as inconsistent, and the complete judgment content of the characters is output.

[0035] Specifically, such as Figure 2 , 7 As shown, the label marking verification module includes: The number and code matching submodule extracts the sequence number and code content of the QR code in the image based on the complete character judgment content, judges the correspondence between the number order and the code order, and obtains the number and code matching result; The process involves extracting the QR code sequence number and its corresponding encoded content from an image by recognizing complete character groups. First, the module position corresponding to each character group is re-identified, and the number information and corresponding character encoding information at that position are read to construct a one-to-one correspondence table between the number and the encoding. Then, the encoded content is sorted according to the number order, and the sorted result is compared side-by-side with the original character sequence to check whether a matching encoded value is stored at each number position. If the encoded value contained in character group number n appears in number m, and m ≠ n, then the encoding and number do not match. For example, if two QR codes are recognized in a single QR code... For group 0 data, the numbering order should be from 1 to 20. If the code value "E3F2" contained in number 5 in the extraction result should actually appear in standard number 6, then there is a mismatch at that position. During the comparison process, it is also necessary to count the differences between all numbers and codes. If multiple numbers have disordered, overlapping, or offset code positions, they are further classified as overall matching anomalies. In practical applications, if the numbers and codes of groups 1 to 5 are consistent, the code content of number 7 appears from group 6 onwards, and group 7 is still the code of number 6, then it is considered that 6 and 7 are overlapping. If such overlaps accumulate to more than 3 times, the whole is marked as a matching anomaly, and the final output is the matching result of the number and code.

[0036] The sequence continuity judgment submodule judges the continuity between the image number order and the code order based on the matching results of numbering and encoding, checks for the existence of sequence interruption, mark intersection and duplicate superposition, and generates the sequence continuity judgment result. The output table of number-to-code correspondence is used as the basis for judgment. The complete number sequence, after ascending order, is extracted from the table. Simultaneously, the corresponding code sequences are extracted in the same order. By comparing the numerical difference between adjacent numbers to see if it is 1, it is determined whether there is a break in the numbering order. Then, string similarity comparison is performed on the structural differences between adjacent code values ​​to identify whether there are abrupt changes, repetitions, or crossovers in the code values ​​corresponding to consecutive numbers. In the judgment process, the standard for breaking the order is set as a number difference exceeding 1. For example, if the number sequence is 1, 2, 3, 5, then number 4 is recorded as a break. The standard for marking crossover is set as a certain code value appearing... If the code value is not in the original number and is interchanged with other numbers, such as number 6 being coded as "G8A2" and number 7 as "F1B9", which should actually be interchanged, it is marked as an intersection phenomenon. In addition, all code values ​​are deduplicated. If a certain code value appears in multiple numbers, it is recorded as a repetition phenomenon. In the example, if number 8 and number 11 both correspond to the code "J6D3", it is judged as a repetition. If the code "J6D3" should correspond to number 8 but appears in number 11, it is an intersection. If the numbers are consecutive 1, 2, 3, 6, 7, then number 4 and 5 are interrupted. Finally, the integrated judgment content generates the sequential continuity judgment result.

[0037] The code duplication screening submodule screens the encoded content in the image batch based on the sequential continuity judgment result to determine whether there is a case of repeated encoded content, and obtains the QR code printing detection result; The code pool is constructed by extracting the encoded content from all QR code images in the current batch. During the extraction process, the complete encoded information consisting of all character groups in each QR code image is read to build a batch code set table. All encoded content in the table is compared one by one to determine whether there are two or more sets of identical encoded values. The comparison process uses two conditions in parallel: identical character length and identical content. If every character is identical under the premise of equal code length, it is determined to be a duplicate code. The number of duplicate codes is accumulated during the judgment. If the number of duplicates exceeds the set duplicate threshold, for example, set to 1, that is, any code can only appear once. If a code "X4G9B1" appears twice, it is determined to be a duplicate item. If there are 50 QR code images in a batch, and three encoded values ​​are repeated twice, namely "A1B2C3", "X4G9B1" and "Z9Y8X7", these three are recorded as duplicate anomalies. During the screening process, the location number and image sequence number of the QR code image to which the duplicate code belongs also need to be marked for subsequent processing and tracking. Finally, the screening data is integrated and the QR code printing detection results are output.

[0038] Please see Figure 8 The label QR code printing detection method is based on the above-mentioned label QR code printing detection system and includes the following steps: S1: Acquire continuous images of the QR code, evaluate edge closure, positioning angular spacing, and boundary integrity, and combine edge offset, pixel focus, and brightness contrast to filter images with structural closure and complete imaging, and generate usable image imaging content. S2: Based on the available judgment content of image imaging, extract three positioning blocks, central data area and edge area from the image, count the gray level and maximum jump value, judge the gray level continuity and edge breakage, and generate the local continuity judgment content of the image. S3: Based on the local continuity of the image, obtain the coordinate paths of the three positioning blocks, analyze the changes in the angle between the blocks and the outer edge of the image, determine the connectivity of the block arrangement, identify rotation offset and skip columns, and output the structural stability determination content. S4: Combining structural stability judgment content, identify the character group order and numbering start position, determine the arrangement pattern, detect misalignment, insertion, and repetition, and generate complete character judgment content; S5: Based on the complete character determination content, extract the sequence number and encoding, determine the sequential continuity, check for interruptions, intersections, and overlaps, and generate the QR code printing detection result.

[0039] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A label QR code printing inspection system, characterized in that: The system includes: The image clarity extraction module acquires continuous images of the QR code, evaluates edge closure, positioning angular spacing, and boundary integrity, and combines edge offset, pixel focus, and brightness contrast to filter images with structural closure and complete imaging, generating usable image imaging content. The regional grayscale analysis module extracts three positioning blocks, the central data area, and the edge area from the image based on the available judgment content of image imaging. It counts the grayscale levels and the maximum jump value, judges the grayscale continuity and edge breakage, and generates the local continuity judgment content of the image. The structural offset determination module obtains the coordinate paths of the three positioning blocks based on the local continuity determination content of the image, analyzes the changes in the angle between the block and the outer frame edge of the image, determines the connectivity of the block arrangement, identifies rotation offset and skipping columns, and outputs the structural stability determination content. The data content verification module combines structural stability judgment content to identify the character group order and numbering start position, judge the arrangement pattern, detect misalignment, insertion, and repetition, and generate complete character judgment content. The label marking and verification module determines the content based on the integrity of the characters, extracts the sequence number and encoding, judges the sequential continuity, checks for interruptions, intersections, and overlaps, and generates the QR code printing inspection results.

2. The label QR code printing inspection system according to claim 1, characterized in that: The image imaging criteria include: QR code edge closure degree, positioning angle side length spacing, boundary integrity ratio, boundary spacing offset, pixel focus position, background brightness distribution, and image block region contrast; image local continuity criteria include: gray level occurrence frequency, maximum gray level jump value, gray level equalization interval, gray level distribution continuity, edge breakage, and brightness difference of positioning block boundaries; structural stability criteria include: coordinate path of three positioning blocks, angle change between structural lines and image outer frame edge lines, data block arrangement order, pixel block boundary connectivity, rotation offset, skipping column phenomenon, structural line offset and compression misalignment; character integrity criteria include: character group order, block starting position number, arrangement consistency, misalignment, insertion, and repeated structure; QR code printing detection results include: correspondence between image number order and encoding order, interruption of image-code order, mark intersection, repeated superposition, and image batch encoding repetition.

3. The label QR code printing inspection system according to claim 1, characterized in that: The connectivity of the block arrangement refers to the continuous and regular spatial arrangement of the positioning blocks and data modules in the QR code, verifying that the overall structure is free from breaks and misalignments.

4. The label QR code printing inspection system according to claim 1, characterized in that: The identification of rotation offset and skip column refers to extracting the center coordinates of the three positioning blocks of the QR code, constructing a structural path, calculating the angle change between the structural line and the image edge, determining whether there is rotation tilt, and judging the connectivity of the row and column pixel block boundaries based on the connectivity of the block arrangement to identify skip column phenomenon.

5. The label QR code printing inspection system according to claim 1, characterized in that: The image sharpness extraction module includes: The QR code detection submodule detects and extracts the QR code region in the image based on the acquired continuous QR code images, identifies the image features of the QR code, determines whether it conforms to the preset QR code standard, and obtains the QR code detection result. The edge detection and matching submodule extracts QR code edge information based on the QR code detection results, calculates the closure degree of the QR code edge through edge detection, matches it with the standard QR code model, calculates the error value of the QR code edge, and obtains the QR code edge closure degree. The image quality screening submodule evaluates the structural integrity of the image based on the closure of the QR code edge, detects the background brightness distribution and contrast changes, and filters images that meet the preset quality requirements to obtain the usable image imaging content.

6. The label QR code printing inspection system according to claim 1, characterized in that: The regional grayscale analysis module includes: The regional grayscale statistics submodule extracts three localization block regions, the central data region, and the image edge region based on the image imaging usability determination content, and counts the occurrence frequency of grayscale levels in each region to obtain the regional grayscale distribution statistics results. The grayscale jump judgment submodule calculates the maximum jump value of grayscale in each region based on the statistical results of grayscale distribution in the region, and compares it with the grayscale equalization interval to determine whether there is a discontinuity in grayscale distribution and generate grayscale jump judgment results. The brightness difference judgment submodule obtains the location block boundary and data area information based on the grayscale transition judgment result, calculates and compares the brightness difference, performs partition judgment, and obtains the image local continuity judgment content.

7. The label QR code printing inspection system according to claim 1, characterized in that: The structural offset determination module includes: The structure path extraction submodule determines the content based on the local continuity of the image, extracts the coordinate paths of three positioning blocks in the QR code, obtains the geometric information of the positioning blocks, and obtains the structure path data. The angle change judgment submodule calculates the angle change between the structure line formed by three points and the edge of the image outline based on the structure path data. By comparing the changes, it determines whether there is an angle shift and obtains the angle change judgment result. The offset and misalignment screening submodule determines the connectivity of pixel block boundary line segments based on the angle change judgment results and structural path data, identifies rotation offset and column skipping phenomena in the image, and outputs the structural stability judgment content.

8. The label QR code printing inspection system according to claim 1, characterized in that: The data content verification module includes: The character group recognition submodule determines the content based on structural stability, identifies the character group order in the QR code content area, extracts the starting position of each character group, and assigns a position number to obtain the character group position number result. The arrangement pattern comparison submodule compares the arrangement patterns between the content characters and the numbers based on the character group position numbering results, detects whether there are misalignments, insertions and repetitions in the character group, and obtains the character arrangement pattern comparison results; The consistency judgment submodule compares the results based on the character arrangement rules, compares them with the standard character arrangement order, determines whether the character groups are consistent, and generates complete character judgment content.

9. The label QR code printing inspection system according to claim 1, characterized in that: The label verification module includes: The number and code matching submodule extracts the sequence number and code content of the QR code in the image based on the complete character judgment content, judges the correspondence between the number order and the code order, and obtains the number and code matching result; The sequence continuity judgment submodule judges the continuity between the image number order and the code order based on the matching results of numbering and encoding, checks for the existence of sequence interruption, mark intersection and duplicate superposition, and generates the sequence continuity judgment result. The code duplication screening submodule screens the encoded content in the image batch based on the sequential continuity judgment result to determine whether there is a case of repeated encoded content, and obtains the QR code printing detection result.

10. A method for detecting printed QR codes on labels, characterized in that: The label QR code printing detection system according to any one of claims 1-9 is executed, including the following steps: S1: Acquire continuous images of the QR code, evaluate edge closure, positioning angular spacing, and boundary integrity, and combine edge offset, pixel focus, and brightness contrast to filter images with structural closure and complete imaging, and generate usable image imaging content. S2: Based on the available judgment content of image imaging, extract three positioning blocks, central data area and edge area from the image, count the gray level and maximum jump value, judge the gray level continuity and edge breakage, and generate the local continuity judgment content of the image. S3: Based on the local continuity of the image, obtain the coordinate paths of the three positioning blocks, analyze the changes in the angle between the blocks and the outer edge of the image, determine the connectivity of the block arrangement, identify rotation offset and skip columns, and output the structural stability determination content. S4: Combining structural stability judgment content, identify the character group order and numbering start position, determine the arrangement pattern, detect misalignment, insertion, and repetition, and generate complete character judgment content; S5: Based on the complete character determination content, extract the sequence number and encoding, determine the sequential continuity, check for interruptions, intersections, and overlaps, and generate the QR code printing detection result.