A method for detecting Aztec code position detection patterns

Through a multi-step Aztec code position detection graphic detection method, including linear segment detection, splicing and combination, the problem of difficulty in detecting Aztec code position detection in the prior art is solved, and robust detection of patterns with varying degrees of flawing and missing are achieved, ensuring the correct decoding of Aztec code.

CN116245124BActive Publication Date: 2025-06-03FUJIAN NEWLAND AUTO ID TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211671074.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-26
Publication Date
2025-06-03
Estimated Expiration
2042-12-26

AI Technical Summary

Technical Problem

The prior art is difficult to correctly detect Aztec code position detection graphics, especially in the case of staining, missing, rotation, tilting, curved surfaces, uneven light and noise interference in the image.

Method used

A method of Aztec code position detection is adopted to locate and detect the Aztec code position detection graph through the steps of full-graphic linear segment detection, linear splicing, "L" type combination, "└┘" type combination and quadrilateral box screening. This method combines the line segments to the quadrilateral box to ensure the detection anti-fouling performance to the greatest extent.

Benefits of technology

This method can detect different degrees of flaw and missing Aztec code position detection graphics, and has certain robustness in the case of rotation, tilt, curved surface, uneven light, noise interference, etc., ensuring the correct decoding of Aztec code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116245124B_ABST
    Figure CN116245124B_ABST
Patent Text Reader

Abstract

The present invention relates to a detection method for the position detection pattern of an Aztec code. This method locates the inner border of the outermost square of the position detection pattern of the Aztec code, and obtains the position detection pattern of the Aztec code through screening. The detection method goes through the combination process from line segments to "L"-shapes to "└┘"-shapes until finally obtaining a quadrilateral frame, which maximally ensures the anti-fouling performance of the quadrilateral frame detection. This method can detect the position detection patterns of Aztec codes with different degrees of fouling and missing. At the same time, it has a certain robustness for detecting the position detection patterns of Aztec codes with situations such as code area rotation, tilt, curved surface, uneven illumination, and noise interference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition, and more particularly to a method for detecting the position detection pattern of an Aztec code. Background Art

[0002] An Aztec code is a two-dimensional matrix bar code, which consists of black and white modules distributed in a matrix on a square grid according to a predetermined rule. There is a square bull's-eye pattern in the center of the Aztec code, which is its position detection pattern. We generally locate the Aztec code by finding the position detection pattern of the bull's-eye pattern in the picture. Therefore, the detection of the position detection pattern is the first step in the Aztec code decoding process. Whether the position detection pattern can be correctly found directly affects whether the Aztec code can be decoded. The detection of the position detection pattern is crucial in the Aztec code decoding process.

[0003] In practical applications, the position detection pattern of the Aztec code is often not an ideal square bull's-eye structure. In various application scenarios, the position detection pattern of the Aztec image collected by the image sensor may be damaged and missing to varying degrees, and may have situations such as rotation, tilt, curved surface, uneven illumination, and noise interference. These will all cause difficulties in the detection of the position detection pattern. Summary of the Invention

[0004] Therefore, the technical problem to be solved by the present invention is to propose a method for positioning the position detection pattern in view of the above-mentioned deficiencies of the prior art. This method can detect the position detection pattern of the Aztec code with different degrees of damage and missing, and at the same time has a certain robustness for detecting the position detection pattern of the Aztec code with situations such as code area rotation, tilt, curved surface, uneven illumination, and noise interference.

[0005] To solve the above technical problems, the technical solution adopted by the present invention is as follows:

[0006] A method for detecting the position detection pattern of an Aztec code, comprising the following steps:

[0007] S1: Obtain a target image;

[0008] S2: Perform a full-image straight-line segment detection on the target image, record and define the starting point, ending point, and angle of each straight-line segment;

[0009] S3: Perform straight-line splicing on the straight-line segments obtained in step S2. Splice two straight-line segments whose distance between the starting point of one segment and the ending point of another segment is within 2 pixels and the angle difference is within the range of ±15° to obtain a new segment, and recalculate the angle of the new segment; repeat the above steps until there are no longer straight-line segments in the image whose starting and ending point distances are within 2 pixels and the angle difference is within the range of ±15°.

[0010] S4: Combine the obtained straight line segments in pairs in an "L" shape, record the coordinates of the "L" shape formed by the two line segments, that is, the starting coordinates, intersection coordinates of one line segment and the ending coordinates of the other line segment, and store them in counterclockwise order, retaining the angular information of the original two line segments and the included angle information between the two line segments;

[0011] S5: Combine the "L" shape combinations obtained in step S4 in pairs to obtain a "└┘" shaped line;

[0012] S6: Continue to combine the "└┘" shaped combinations obtained in step S5 in pairs to obtain several quadrilateral frames;

[0013] S7: Screen the several quadrilateral frames obtained in step S6 to obtain the position detection pattern of the target code.

[0014] In the said step S2, the straight line segment detection method is the LSD straight line segment detection method, the edge point tracking straight line segment detection method, or the Hough transform straight line segment detection method.

[0015] In the said step S2, it is specifically defined as:

[0016] For a line segment placed horizontally, a straight line segment with white below and black above, the angle is 0°, the starting point of this line segment is the left endpoint, and the ending point is the right endpoint; for a line segment placed vertically, a straight line segment with white on the left and black on the right, the angle is 90°, the starting point of this line segment is the upper endpoint, and the ending point is the lower endpoint; for a line segment placed horizontally, a straight line segment with black below and white above, the angle is 180°, the starting point of this line segment is the right endpoint, and the ending point is the left endpoint; for a line segment placed vertically, with black on the left and white on the right, the angle is 270°, the starting point of this line segment is the lower endpoint, and the ending point is the upper endpoint; the angles, starting points and ending point positions of the remaining line segments are deduced by analogy.

[0017] In the said step S4, the combination conditions are:

[0018] a) The included angle between the two line segments is between 60° and 120° (90°±30°) or between 240° and 300° (270°±30°);

[0019] b) The length of one line segment is between 1 / 3 and 3 times that of the other;

[0020] c) The distance between the starting point of one line segment and the ending point of the other line segment is less than the length of the shorter line segment.

[0021] In the said step S5, the combination conditions are:

[0022] a) One side of each of the two "L" - shaped parts is the same line segment or collinear, and the distance between the adjacent endpoints of the two collinear sides does not exceed the length of the shorter of the two sides;

[0023] b) The angular difference between the other sides of the two "L" - shaped parts is between 150° and 210° (180±30°).

[0024] The specific steps of S7 are as follows:

[0025] S71: Using the four vertices of the quadrilateral frame as the reference points for perspective transformation, perform perspective transformation to sample the position detection pattern, the storage module for the pointing pattern and version format information outside the outer circle of the position detection pattern;

[0026] S72: Obtain the position detection pattern including an 11*11 or 15*15 grayscale dot matrix around the outer circle of the position detection pattern, and perform binarization;

[0027] S73: Judge whether the quadrilateral frame is the position detection pattern of the Aztec code according to the characteristics of the pointing pattern around the outer circle of the position detection pattern. If not, exclude the quadrilateral frame. If so, read out the version format information stored in the circle;

[0028] S74: Complete the subsequent decoding steps according to the version and format information and the placement direction of the Aztec code indicated by the pointing pattern.

[0029] The present invention locates the inner border of the outermost square of the position detection pattern of the Aztec code, and obtains the position detection pattern of the Aztec code through screening. The detection method from the combination process of line segment - "L" - shaped - "└┘" - shaped to the quadrilateral frame maximally guarantees the anti - fouling performance of the quadrilateral frame detection. Therefore, this method can detect the position detection patterns of the Aztec code with different degrees of fouling and missing. At the same time, it has a certain robustness for detecting the position detection patterns of the Aztec code with situations such as code area rotation, tilt, curved surface, uneven illumination, and noise interference. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a flow chart of the method for detecting the position detection pattern of the Aztec code according to an embodiment of the present invention;

[0031] Figure 2 It is a schematic diagram of the Aztec code structure;

[0032] Figure 3 It is a schematic diagram of the compact Aztec code structure;

[0033] Figure 4 It is a schematic diagram of the complete Aztec code structure;

[0034] Figure 5 Flowchart of Aztec code decoding according to an embodiment of the present invention. Detailed implementation manners

[0035] The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0036] Embodiment 1

[0037] As Figure 1 shown, a method for detecting the position detection pattern of an Aztec code includes the following steps:

[0038] S1: Obtain a target image; capture the image through an image sensor in cooperation with an illumination lamp group.

[0039] As Figure 2 shown, a schematic diagram of the Aztec code structure. An Aztec code is composed of a position detection pattern, a pointing pattern, version format information, a calibration pattern, a data area, etc. Among them, the position detection pattern is the square bull's-eye pattern shown in the central part, which is formed by alternately superimposing black and white square frames outward. Each square frame is one module width, and this structure is the focus of discussion in the present invention. The pointing pattern is four three-module structures located at the four corners of the outer layer of the position detection pattern, which is used to indicate the placement direction of the Aztec code. When the Aztec code is placed upright, the upper left pointing pattern is composed of three black modules, the upper right pointing pattern is composed of two black modules and one white module, the lower left pointing pattern is composed of three white modules, and the lower right is composed of two white modules and one black module. The version format information surrounds the four sides of the position detection pattern and is used to store the module layer number, module bit number, and error correction level information of the Aztec code.

[0040] Aztec codes are divided into two types: compact type and full type. As Figure 3 shown, a compact Aztec code has a 9*9 square bull's-eye pattern as the position detection pattern shown in the central part; while a full Aztec code is as Figure 4 shown, its position detection pattern is a 13*13 square bull's-eye pattern shown in the central part. At the same time, the full Aztec code also includes a calibration pattern in the form of a single-module-width track with black and white intervals, which can correct the pixel coordinates of the modules in the barcode image.

[0041] S2: Perform full-image straight-line segment detection on the target image, record and define the starting point, ending point, and angle of each straight-line segment (i.e., the direction from the starting point to the ending point of the straight-line segment, and the angle range is 0°-359°); in the S2 step, the straight-line segment detection method is the LSD straight-line segment detection method, the edge point tracking straight-line segment detection method, or the Hough transform straight-line segment detection method. In this embodiment, the LSD straight-line segment detection method is used.

[0042] In the step S2, it is specifically defined as:

[0043] The line segments are placed horizontally, with white on the bottom and black on the top, the angle is 0°, the starting point of the line segment is the left endpoint, and the end point is the right endpoint; the line segments are placed vertically, with white on the left and black on the right, the angle is 90°, the starting point of the line segment is the upper endpoint, and the end point is the lower endpoint; the line segments are placed horizontally, with black on the bottom and white on the top, the angle is 180°, the starting point of the line segment is the right endpoint, and the end point is the left endpoint; the line segments are placed vertically, with black on the left and white on the right, the angle is 270°, the starting point of the line segment is the lower endpoint, and the end point is the upper endpoint; the angles, starting points and end points of the remaining line segments are positioned similarly.

[0044] S3: Linear splicing is performed on the straight line segments obtained in step S2, and straight line segments whose starting point of a line segment and the end point of another line segment are within 2 pixels and whose angle difference is within ±15° are spliced ​​in pairs to obtain new line segments, and the new line segment angles are recalculated; the above steps are repeated until there are no straight line segments whose starting point and end point are within 2 pixels and whose angle difference is within ±15° in the image. This step is adopted to adapt to the situation where the straight line segments on the curved code area or position detection graphics are slightly contaminated.

[0045] S4: Perform an "L"-shaped combination on the obtained straight line segments in pairs, record the L-shaped coordinates of the two line segments, that is, the starting point coordinates, intersection coordinates of one line segment and the end point coordinates of the other line segment (the three vertex coordinates of the "L" shape), and store them in a counterclockwise order, retaining the angle information of the original two line segments and the angle information of the two line segments. It should be noted that a line segment may be combined with multiple line segments to form an "L" shape.

[0046] In the step S4, the combined conditions are:

[0047] a) The angle between the two line segments is between 60° and 120° (90°±30°) or between 240° and 300° (270°±30°). The angle range of ±30° is to accommodate the situation where the image has a larger inclination angle;

[0048] b) The length of one of the line segments is between 1 / 3 and 3 times the length of the other line segment, which is in order to accommodate the defacement of the square frame;

[0049] c) The distance between the start point of one line segment and the end point of the other line segment is less than the length of the shorter line segment.

[0050] S5: Pairing the “L”-shaped combinations obtained in step S4 to obtain “└┘”-shaped lines; in step S5, the combination conditions are:

[0051] a) One side of each of the two "L" shapes is the same line segment or collinear, and the distance between the adjacent endpoints of the two collinear sides does not exceed the length of the shorter of the two sides.

[0052] b) The angular difference between the other sides of the two "L" shapes is between 150° and 210° (180 ± 30°).

[0053] S6: Continue to pair up the "└┘" - shaped combinations obtained in step S5 to obtain several quadrilateral frames.

[0054] S7: Screen the several quadrilateral frames obtained in step S6 to obtain the position detection pattern of the target code.

[0055] The specific content of step S7 is as follows:

[0056] S71: Use the four vertices of the quadrilateral frame as the reference points for perspective transformation, perform perspective transformation, and sample the position detection pattern and the module for storing the pointing pattern and version format information outside the outer circle of the position detection pattern.

[0057] S72: Obtain the position detection pattern including an 11 * 11 or 15 * 15 grayscale dot matrix around the outer circle of the position detection pattern, and perform binarization. Since when the inside of the position detection pattern is severely damaged, it is impossible to determine whether the position detection pattern is for a compact or complete Aztec code position detection pattern, so during sampling, these two situations are sampled separately. 11 * 11 is adapted to the compact type, and 15 * 15 is adapted to the complete type.

[0058] S73: Judge whether the quadrilateral frame is the position detection pattern of the Aztec code according to the characteristics of the pointing pattern around the outer circle of the position detection pattern. If not, exclude the quadrilateral frame. If so, read out the version format information stored in the circle. Judging according to the characteristics of the outer - circle pointing pattern is the prior art in the field and will not be elaborated here.

[0059] S74: Complete the subsequent decoding steps according to the version and format information and the placement direction of the Aztec code indicated by the pointing pattern. The subsequent decoding steps are as Figure 5 shown.

[0060] The present invention locates the inner border of the outermost square of the position detection pattern of the Aztec code, and obtains the position detection pattern of the Aztec code through screening. The detection method from the combination process of line segment - "L" shape - "└┘" shape to the quadrilateral frame maximally ensures the anti - damage performance of the quadrilateral frame detection. Therefore, this method can detect the position detection patterns of Aztec codes with different degrees of damage and missing. At the same time, it has a certain robustness for detecting the position detection patterns of Aztec codes with situations such as code area rotation, tilt, curved surface, uneven illumination, and noise interference.

[0061] The above embodiments are only for illustration and not for limiting the present invention. Therefore, all equivalent changes or modifications made according to the methods described in the scope of this patent application for the present invention are included in the scope of this patent application for the present invention.

Claims

1. A method for detecting the position detection pattern of Aztec code, characterized in that, it includes the following steps: S1: Obtain the target image; S2: Perform full-image straight-line segment detection on the target image, record and define the starting point, ending point, and angle of each straight-line segment; S3: Perform straight-line splicing on the straight-line segments obtained in step S2. Splice two straight-line segments whose distance between the starting point of one segment and the ending point of another segment is within 2 pixels and the angle difference is within the range of ±15° to obtain a new segment, and recalculate the angle of the new segment; repeat the above steps until there are no longer straight-line segments in the image with a starting and ending point distance within 2 pixels and an angle difference within the range of ±15°; S4: Combine the obtained straight-line segments in pairs in an "L" shape, record the coordinates of the "L" shape formed by the two segments, that is, the starting point coordinates, intersection point coordinates, and ending point coordinates of one of the segments, and store them in counterclockwise order, retaining the angle information of the original two segments and the included angle information of the two segments; in step S4, the combination conditions are: a) The included angle between the two segments is between 60° and 120° (90°±30°) or between 240° and 300° (270°±30°); b) The length of one of the segments is between 1 / 3 and 3 times that of the other; c) The distance between the starting point of one segment and the ending point of the other segment is less than the length of the shorter segment; S5: Pair the "L" shape combinations obtained in step S4 in pairs to obtain a "└┘" shape line; in step S5, the combination conditions are: a) One of the sides of the two "L" shapes is the same segment or collinear, and the distance between the adjacent endpoints of the collinear two sides does not exceed the length of the shorter of the two sides; b) The angle difference between the other sides of the two "L" shapes is between 150° and 210° (180±30°); S6: Continue to pair the "└┘" shape combinations obtained in step S5 in pairs to obtain several quadrilateral frames; S7: Screen the several quadrilateral frames obtained in step S6 to obtain the position detection pattern of the target code.

2. A method for detecting the position detection pattern of Aztec code according to claim 1, characterized in that: In step S2, the straight-line segment detection method is the LSD straight-line segment detection method, the edge point tracking straight-line segment detection method, or the Hough transform straight-line segment detection method.

3. A method for detecting the position detection pattern of Aztec code according to claim 1, characterized in that: In step S2, the specific definition is: For a line segment placed horizontally, a straight-line segment with white below and black above has an angle of 0°, the starting point of this segment is the left endpoint, and the ending point is the right endpoint; The line segments are placed vertically, with white on the left and black on the right, the angle is 90°, the starting point of the line segment is the upper endpoint, and the end point is the lower endpoint; the line segments are placed horizontally, with black on the bottom and white on the top, the angle is 180°, the starting point of the line segment is the right endpoint, and the end point is the left endpoint; the line segments are placed vertically, with black on the left and white on the right, the angle is 270°, the starting point of the line segment is the lower endpoint, and the end point is the upper endpoint; the angles, starting points and end points of the remaining line segments are arranged in the same way.

4. The Aztec code position detection pattern detection method according to claim 1, Features: The S7 step is specifically as follows: S71: using the four vertices of the quadrilateral box as reference points for perspective transformation, performing perspective transformation, sampling a position detection graph and a module for storing a pointing graph and version format information in an outer circle of the position detection graph; S72: Obtaining a position detection pattern including a grayscale dot matrix of 11*11 or 15*15 surrounding the position detection pattern, and performing binarization; S73: judging whether the quadrilateral frame is the position detection pattern of the Aztec code according to the directional pattern features of the circle surrounding the position detection pattern, if not, excluding the quadrilateral frame, if yes, reading the version format information stored in the circle; S74: completing subsequent decoding steps according to the version and format information and the Aztec code placement direction indicated by the pointing graphic.

Citation Information

Patent Citations

  • Decoding method for stained Aztec bar code

    CN116205251A