System and method for identifying piece based on Gerber data

By processing Gerber data in the vector domain, directly extracting polygons and performing geometric feature matching, the accuracy and efficiency issues of traditional methods are solved and high-precision piece recognition is achieved.

CN120747221APending Publication Date: 2025-10-03SHENSHI OPTOMETRY (SHANGHAI) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510901482.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-01
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

Traditional Gerber data recognition methods based on image processing have significant bottlenecks in accuracy, efficiency and robustness, especially when dealing with small structures and complex geometric shapes, which are prone to information loss and precision loss.

Method used

By directly analyzing in the vector domain, parsing the Gerber file to extract polygon data, converting it into a filled polygon, and then screening the target polygon through the geometric feature matching algorithm, calculating the pose transformation matrix, and outputting the spatial position and pose information of the repeated piece.

Benefits of technology

It avoids the accuracy loss and efficiency bottleneck caused by image conversion, can accurately identify fine lines and complex structures, achieve sub-pixel positioning accuracy, and improve recognition efficiency and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120747221A_ABST
    Figure CN120747221A_ABST
Patent Text Reader

Abstract

The invention discloses a system and a method for performing piece identification based on original data of a gerber file, and the method comprises the following steps: S1, analyzing the gerber file to extract polygon data, and converting the polygon data into a filling type polygon; s2, selecting a reference polygon corresponding to the reference piece from the filling type polygon set, and selecting a reference polygon corresponding to the reference piece from the filling type polygon set; s3, on the basis of a geometric feature matching algorithm, screening out a target polygon from all the polygons; s4, calculating a pose transformation matrix between the reference polygon and the target polygon; and S5, outputting spatial positions and pose information of all repeated pieces according to the transformation matrix. Compared with the prior art, through direct vector domain geometric analysis and accurate transformation parameter calculation (including translation calculation based on the centroid and rotation calculation based on unique feature points), information loss and calculation bottleneck brought by the image conversion process are thoroughly avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of avi visual inspection technology, and in particular to a system and method for identifying pieces based on Gerber data. Background Art

[0002] Traditional piece recognition methods usually follow the following process:

[0003] 1. Extract the Rout layer: Find the Rout layer that defines the Piece outline from the Gerber data package.

[0004] 2. Image conversion: Convert the vector data of the Rout layer into a bitmap image according to a certain pixel accuracy (DPI).

[0005] 3. Contour recognition: In the generated image, the contours of each closed area are identified using image processing algorithms (such as edge detection, region growing, etc.).

[0006] 4. Feature matching and search: Based on the extracted image contour features (such as shape and size), the image matching algorithm is used to search for repeated pieces and calculate the relative displacement and rotation between them.

[0007] Although this traditional image processing-based method is feasible in some simple scenarios, it has significant technical bottlenecks in terms of accuracy, efficiency, and robustness:

[0008] 1. Images are composed of discrete pixels. If fine structures in Gerber (such as small arcs and narrow spacing) are smaller than the physical size represented by a pixel, the information will be lost or severely distorted. For example, due to the loss of precision during the conversion process, if one pixel represents a physical scale of 1 micron, the relative position offset between pieces can only be expressed with an accuracy of 1 micron at most; offsets below 1 micron cannot be effectively expressed. This means that sub-pixel features and positioning accuracy cannot be guaranteed.

[0009] 2. Thin lines defined in the Rout layer are prone to breakage, burrs, or discontinuities when rendered at low DPI. This can cause areas within the image to be non-closed, leading to failure of subsequent contour extraction algorithms or the extraction of erroneous or incomplete contours. For example, if the conversion accuracy is too low or the lines specified in the client's Rout layer are too thin, rendering issues can result in discontinuous lines and non-closed areas in the exported image, making it impossible to effectively support the search for duplicate areas at the data level.

[0010] 3. The conversion from vector to raster is an approximate process. Especially for curves and oblique lines, it will produce a jagged effect, which changes the accuracy of the original geometric shape and affects subsequent shape-based matching.

[0011] Therefore, the industry urgently needs a better way to solve the above problems. Summary of the Invention

[0012] In view of this, the present invention proposes a system and method for piece identification based on Gerber data. By directly analyzing and calculating in the vector domain, the accuracy loss and efficiency bottleneck caused by image conversion are fundamentally avoided. The technical solution of the present invention is as follows:

[0013] In one aspect, the present invention discloses a method for identifying pieces based on Gerber data, comprising the following steps:

[0014] S1. Parse the gerber file to extract polygon data and convert it into a filled polygon;

[0015] S2. Select the reference polygon corresponding to the reference piece from the filled polygon set;

[0016] S3, based on the geometric feature matching algorithm, filter out the target polygon from all polygons;

[0017] S4, calculating the pose transformation matrix between the reference polygon and the target polygon,

[0018] S5. Output the spatial position and posture information of all repeated pieces according to the transformation matrix.

[0019] Specifically, the step S1 is as follows: extracting all geometric data from the rout layer of the gerber file and converting them into a filled polygon expression.

[0020] Specifically, in step S3, the target polygon and the reference polygon have the same area, perimeter, and number of inner holes.

[0021] Specifically, in the step S4: the transformation matrix includes a translation matrix and a rotation matrix.

[0022] Specifically, the steps of calculating the rotation transformation matrix include: simplifying the outlines of the reference piece polygon and the candidate piece polygon, determining a unique feature point on the simplified polygon that does not coincide with the centroid, constructing a feature vector from the centroid to the feature point, and calculating the rotation angle.

[0023] Specifically, the rotation angle is the angle between the feature vector of the reference piece and the feature vector of the candidate piece.

[0024] Specifically, the determination of the unique feature point includes: sorting the sides of the polygon by length, and selecting the midpoint of a side with a unique length.

[0025] Another aspect of the present invention discloses a system for identifying pieces based on Gerber data, characterized in that it is configured to execute executable instructions to implement the steps of the above method.

[0026] The advantages of the present invention are as follows:

[0027] 1. By directly manipulating the vector data (Polygons) in the Gerber file, the inherent loss of precision and information distortion in the vector-to-raster image conversion process is completely avoided. Whether it is fine lines, complex holes, or sub-pixel features, as long as they are precisely defined in the original Gerber data, this method can accurately capture and process them.

[0028] 2. Calculations of geometric features (such as area, perimeter, and centroid) and transformation parameters (translation and rotation) are performed in the vector domain with floating-point precision. Their accuracy is limited only by the accuracy of the Gerber data itself and the numerical stability of the calculation process, which is much higher than image analysis methods based on pixel grids.

[0029] 3. Because it does not rely on image rendering quality, this method maintains excellent recognition performance even for pieces containing extremely fine lines, complex internal structures (such as dense holes and narrowly spaced features), and small size differences. This method effectively avoids issues such as line breakage, incomplete contours, and feature flooding that are common in traditional image-based methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only one embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0031] Figure 1 Schematic diagram of the process of the piece identification method in an embodiment of the present invention;

[0032] Figure 2 Schematic diagram of selecting the Rout layer from Gerber data in an embodiment of the present invention;

[0033] Figure 3 Schematic diagram of converting an outlined Polygon into a filled Polygon through a Union operation in an embodiment of the present invention;

[0034] Figure 4 Schematic diagram of selecting a reference piece for search in an embodiment of the present invention;

[0035] Figure 5 Schematic diagram of all repeated pieces identified and their positions in an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The following will clearly and completely describe the technical solutions of the present invention in conjunction with the embodiments of the present invention and the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.

[0037] Unless otherwise defined, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by technicians in the technical field to which the present invention belongs; the terms used in the specific embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present invention; the terms "including" and "having" in the description and claims of the present invention and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0038] In the description of the specific embodiments of the present invention, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the technical features indicated. In the description of the embodiments of the present invention, the meaning of "plurality" is more than two, unless otherwise specifically defined.

[0039] References to "embodiments" in this disclosure mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the disclosure. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0040] In the description of the embodiments of the present invention, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three possible relationships exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exists simultaneously, and B exists alone. In addition, the character " / " in this invention generally indicates that the associated objects are in an "or" relationship.

[0041] It should be noted that, for the convenience of description, in the following embodiments, all identical technical features are marked with the same symbols.

[0042] Traditional piece recognition methods usually follow the following process:

[0043] 1. Extract the Rout layer: Find the Rout layer that defines the Piece outline from the Gerber data package.

[0044] 2. Image conversion: Convert the vector data of the Rout layer into a bitmap image according to a certain pixel accuracy (DPI).

[0045] 3. Contour recognition: In the generated image, the contours of each closed area are identified using image processing algorithms (such as edge detection, region growing, etc.).

[0046] 4. Feature matching and search: Based on the extracted image contour features (such as shape and size), the image matching algorithm is used to search for repeated pieces and calculate the relative displacement and rotation between them.

[0047] Although this traditional image processing-based method is feasible in some simple scenarios, it has significant technical bottlenecks in terms of accuracy, efficiency, and robustness:

[0048] 1. Images are composed of discrete pixels. If fine structures in Gerber (such as small arcs and narrow spacing) are smaller than the physical size represented by a pixel, the information will be lost or severely distorted. For example, due to the loss of precision during the conversion process, if one pixel represents a physical scale of 1 micron, the relative position offset between pieces can only be expressed with an accuracy of 1 micron at most; offsets below 1 micron cannot be effectively expressed. This means that sub-pixel features and positioning accuracy cannot be guaranteed.

[0049] 2. Thin lines defined in the Rout layer are prone to breakage, burrs, or discontinuities when rendered at low DPI. This can cause areas within the image to be non-closed, leading to failure of subsequent contour extraction algorithms or the extraction of erroneous or incomplete contours. For example, if the conversion accuracy is too low or the lines specified in the client's Rout layer are too thin, rendering issues can result in discontinuous lines and non-closed areas in the exported image, making it impossible to effectively support the search for duplicate areas at the data level.

[0050] 3. The conversion from vector to raster is an approximate process. Especially for curves and oblique lines, it will produce a jagged effect, which changes the accuracy of the original geometric shape and affects subsequent shape-based matching.

[0051] Therefore, the industry urgently needs a better way to solve the above problems.

[0052] In view of this, the present invention proposes a system and method for identifying pieces based on Gerber data. By directly analyzing and calculating in the vector domain, the accuracy loss and efficiency bottleneck caused by image conversion are fundamentally avoided. The technical solution of the present invention is shown in the following embodiments:

[0053] Example

[0054] like Figure 1 As shown, the present invention discloses a method for identifying pieces based on Gerber data, comprising the following steps:

[0055] S1. Parse the gerber file to extract polygon data and convert it into a filled polygon;

[0056] S2. Select the reference polygon corresponding to the reference piece from the filled polygon set;

[0057] S3, based on the geometric feature matching algorithm, filter out the target polygon from all polygons;

[0058] S4. Calculate the pose transformation matrix between the reference polygon and the target polygon.

[0059] S5. Output the spatial position and posture information of all repeated pieces according to the transformation matrix.

[0060] In one feasible implementation, step S1 specifically includes extracting all geometric data from the rout layer of the gerber file and converting them uniformly into a filled polygon expression.

[0061] Specifically, if Figure 2 As shown, first, the Rout layer representing the panel and piece outlines is selected from the imported Gerbler data, either specified by the user or automatically based on pre-set rules (e.g., file name or layer properties). This Rout layer is then parsed, converting all geometric objects (e.g., line segments, arcs, and filled areas) into a series of Polygon objects. Each Polygon represents a separate closed area or hole.

[0062] Specifically, if Figure 3As shown, the extracted Polygons may be outlined (defined by line strokes) or filled. To facilitate accurate calculation and consistency comparison of geometric features such as area, perimeter, and centroid, outlined Polygons require preprocessing. This involves performing a geometric "union" operation on multiple outlined Polygons representing the outer boundary and internal slots of the same piece, converting them into one or more uniform filled Polygons. This step ensures that each piece is represented with a standard, consistent fill format.

[0063] Specifically, if Figure 4 As shown in the figure, a polygon is selected from the preprocessed filled polygon set as the "base piece" for the search. This base piece serves as a template for finding other identical pieces in the panel. The base piece can be selected manually by the user or automatically by an algorithm (for example, selecting the first polygon encountered or one with an area within a typical range). Figure 4 A composite shape consisting of two white Polygon areas (possibly representing a Piece and a complex hole or feature inside it) was selected as the reference Piece.

[0064] In one feasible implementation, in step S3: the target polygon and the reference polygon have the same area, perimeter, and number of inner holes.

[0065] In one feasible implementation, in step S4: the transformation matrix includes a translation matrix and a rotation matrix.

[0066] Specifically, the transformation matrix from the reference piece to the target piece is calculated by calculating the centroid center1 of the reference polygon and the centroid center2 of the target polygon; dir = center2 - center1 to obtain the translation vector dir from the reference polygon to the target polygon, which can also be expressed in matrix form as:

[0067]

[0068] Next, calculate the rotation between the piece and the reference piece. You need to first determine the reference polygon and search for unique feature points on the polygon, and these feature points cannot coincide with the centroid. Specific methods include, but are not limited to, the following methods used in this invention:

[0069] A. Simplify the polygon, remove the line segments with length 0 and then merge the collinear segments;

[0070] B. Sort the edges of the polygon in order of their length;

[0071] C. From the above results, select the midpoint of the edge with the only edge length as the feature point;

[0072] D. Establish the vector between the feature point and the polygon centroid, base dir_r;

[0073] Following the above steps, we can obtain the eigenvectors dir_r1 and dir_r2 of the reference polygon and the target polygon, and calculate the rotation angle θ of the two vectors dir_r1 and dir_r2, that is, the rotation transformation angle from the reference piece to the target piece, expressed in a matrix as:

[0074]

[0075] In one feasible implementation, the step of calculating the rotation transformation matrix includes: simplifying the outlines of the reference piece polygon and the candidate piece polygon, determining a unique feature point on the simplified polygon that does not coincide with the centroid, constructing a feature vector from the centroid to the feature point, and calculating the rotation angle.

[0076] In one feasible implementation, the rotation angle is the angle between the feature vector of the reference piece and the feature vector of the candidate piece.

[0077] In one feasible implementation, determining the unique feature point includes: sorting the sides of the polygon by length, and selecting the midpoint of a side with a unique length.

[0078] Specifically, if Figure 5 As shown in Figure 2, through the above steps, the complete transformation (translation and rotation) of each candidate piece relative to the reference piece can be calculated. Apply this transformation to the reference piece. If the transformed reference piece and the candidate piece can highly overlap (which can be verified by calculating the overlapping area or Hausdorff distance), the candidate piece is confirmed to be a duplicate piece instance. Traverse all candidate polygons that pass the initial screening and repeat step 5 to find all duplicate pieces in the panel that have the same shape as the reference piece but different postures, and obtain their precise position and orientation information.

[0079] Another aspect of the present invention discloses a system for identifying pieces based on Gerber data, characterized in that it is configured to execute executable instructions to implement the steps of the above method.

[0080] The advantages of the present invention are as follows:

[0081] 1. By directly manipulating the vector data (Polygons) in the Gerber file, the inherent loss of precision and information distortion in the vector-to-raster image conversion process is completely avoided. Whether it is fine lines, complex holes, or sub-pixel features, as long as they are precisely defined in the original Gerber data, this method can accurately capture and process them.

[0082] 2. Calculations of geometric features (such as area, perimeter, and centroid) and transformation parameters (translation and rotation) are performed in the vector domain with floating-point precision. Their accuracy is limited only by the accuracy of the Gerber data itself and the numerical stability of the calculation process, which is much higher than image analysis methods based on pixel grids.

[0083] 3. Because it does not rely on image rendering quality, this method maintains excellent recognition performance even for pieces containing extremely fine lines, complex internal structures (such as dense holes and narrowly spaced features), and small size differences. This method effectively avoids issues such as line breakage, incomplete contours, and feature flooding that are common in traditional image-based methods.

Claims

1. A method for piece identification based on gerber file raw data, characterized in that: The following steps are involved: S1. Parse the gerber file to extract polygon data and convert it into a filled polygon; S2. Select the reference polygon corresponding to the reference piece from the filled polygon set; S3, based on the geometric feature matching algorithm, filter out the target polygon from all polygons; S4, calculating the pose transformation matrix between the reference polygon and the target polygon; S5. Output the spatial position and posture information of all repeated pieces according to the transformation matrix.

2. The method for piece identification based on Gerber file raw data according to claim 1, characterized in that: The step S1 specifically includes extracting all geometric data from the rout layer of the gerber file and converting them into a filled polygon expression.

3. The method for piece identification based on Gerber file raw data according to claim 1, characterized in that: In step S3, the target polygon and the reference polygon have the same area, perimeter, and number of inner holes.

4. The method for piece identification based on Gerber file raw data according to claim 1, characterized in that: In the step S4: the transformation matrix includes a translation matrix and a rotation matrix.

5. The method for piece identification based on Gerber file raw data according to claim 1, characterized in that: The steps of calculating the rotation transformation matrix include: simplifying the outlines of the reference piece polygon and the candidate piece polygon, determining a unique feature point on the simplified polygon that does not coincide with the centroid, constructing a feature vector from the centroid to the feature point, and calculating the rotation angle.

6. The method for piece identification based on Gerber file raw data according to claim 5, characterized in that: The rotation angle is the angle between the feature vector of the reference piece and the feature vector of the candidate piece.

7. The method for piece identification based on Gerber file raw data according to claim 6, characterized in that: The determination of the unique feature point includes: sorting the sides of the polygon by length, and selecting the midpoint of a side with a unique length.

8. A system for identifying pieces based on Gerber data, characterized in that: The method is configured to execute executable instructions to implement the steps of the method according to any one of claims 1 to 7.