PCB component double-rotation frame positioning method and system

CN122820828APending Publication Date: 2026-09-25CHONGQING MICRO-LINK DAOAI ROBOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610945040.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

缺点一:传统NPI编程效率极低

Benefits of technology

本发明所提供的方法,通过同时预测两个语义不同的旋转矩形框(完整框和本体框),在一次推理中同时完成元件定位和极性方向判定;通过周期匹配的角度编码消除角度回归的边界不连续问题;通过两阶段级联检测管线兼顾全图检测效率和单元件定位精度;从而将NPI编程时间从传统的3至5小时大幅缩短至5分钟以内。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122820828A_ABST
    Figure CN122820828A_ABST
Patent Text Reader

Abstract

The application provides a PCB element double-rotation frame positioning method, which comprises the following steps: acquiring an image of a PCB substrate; performing target detection on the image to obtain at least one element candidate region; cutting each element candidate region to obtain an element region of interest image; inputting the element region of interest image into a configured double-rotation frame regression model to simultaneously predict a corresponding complete frame and a body frame; the complete frame represents first rotation rectangular frame parameters surrounding the complete physical boundary of the element; and the body frame represents second rotation rectangular frame parameters surrounding the body region of the element. The application simultaneously predicts two rotation rectangular frames with different semantics, simultaneously completes element positioning and polarity direction determination in one inference, eliminates the boundary discontinuity problem of angle regression through period-matched angle coding, and takes into account the whole image detection efficiency and element positioning accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automated optical inspection (AOI) technology for printed circuit boards (PCBs), and in particular to a method and system for positioning PCB components using a dual rotating frame. Background Technology

[0002] In the field of PCB manufacturing and quality inspection, AOI systems are widely used to detect component mounting defects. When a factory introduces a new product (NPI, New Product Introduction), the AOI system needs to be programmed to create inspection templates and parameters for each component.

[0003] Currently, the industry mainly uses the following technical solutions for PCB component positioning: Option 1: Traditional method based on CAD data and pre-built component library Traditional AOI systems rely on PCB CAD design data and pre-built component libraries for programming. Operators need to import CAD data, match each component to templates in the library, and manually adjust the inspection parameters. This process typically takes 3 to 5 hours.

[0004] Option 2: Single-frame detection method based on rotated rectangle In recent years, various methods for detecting rotating targets have been developed in the field of computer vision. These methods locate targets by predicting a rotating bounding box (containing center coordinates, width, height, and rotation angle).

[0005] Option 3: Angle Coding Method To address the boundary discontinuity problem in angle regression, researchers have proposed several angle encoding schemes: methods that transform angles into classification problems, methods that employ multi-frequency encoding, and methods that use trigonometric functions to continuously encode angles.

[0006] However, the aforementioned existing technologies still have the following drawbacks: Disadvantage 1: Traditional NPI programming is extremely inefficient. Traditional AOI systems rely on CAD data and pre-built component libraries, and the programming for importing new products takes 3 to 5 hours. Operators need to manually create inspection templates for each component, while PCBs typically contain hundreds or even thousands of components. When factories frequently change production lines, this severely impacts production line utilization.

[0007] Disadvantage 2: A single rotating frame cannot express the polarity direction of a component. Existing rotating target detection methods only output a rotated rectangle to enclose the component. However, the rectangle itself has 180-degree rotational symmetry—it completely overlaps with the original rectangle after rotating 180 degrees. This means that a single rotated rectangle cannot distinguish the polarity direction of the component.

[0008] In PCB inspection, polarity determination is crucial. For example, tantalum capacitors have positive and negative terminals; reversing the polarity can lead to short circuits or even component burnout. The first pin marking on an IC chip determines its mounting orientation; incorrect orientation will render the entire circuit board unusable. Therefore, traditional single-frame methods require an additional classification step to determine polarity after positioning, increasing system complexity and reasoning time.

[0009] Disadvantage 3: Boundary discontinuity problem in angle regression In rotating target detection, the angle parameter is periodic. When the true angle is close to the boundary of the period, if the predicted value is slightly biased to the other side, although the actual angle difference is small, the numerical difference is close to a complete period, causing a huge jump in the loss function, making the model training unstable and limiting the accuracy of angle prediction.

[0010] Existing triangular coding schemes also have their shortcomings: the accuracy of classification methods is limited by the classification granularity; multi-frequency coding methods have high computational complexity; and the period of ordinary triangular coding does not match the symmetry period of the rectangular frame, resulting in redundant mapping.

[0011] Disadvantage 4: Single-stage detection struggles to balance efficiency and accuracy. Full-board images of PCBs typically have very high resolution, while component sizes vary greatly—from miniature surface-mount resistors to large array-packaged chips. Single-stage detectors require enormous computation for high-resolution inference across the entire image, while reducing resolution significantly decreases the accuracy of small components. Summary of the Invention

[0012] In view of this, the present invention provides a method and system for positioning PCB components using a dual rotating frame.

[0013] This invention proposes a method for positioning PCB components using a dual-rotation frame, comprising: Step 1: Obtain an image of the PCB substrate; Step 2: Perform target detection on the image to obtain at least one candidate region for a component; Step 3: Crop each candidate region of the element to obtain the region of interest image of the element; Step 4: Input the image of the region of interest of the element into the configured double-rotation bounding box regression model, and simultaneously predict the corresponding complete bounding box and the body bounding box: where, The complete frame: The parameters of the first rotating rectangular frame that characterize the complete physical boundary of the element include the first center coordinates, the first width, the first height, and the first rotation angle; The body frame: a second rotating rectangular frame parameter characterizing the region surrounding the element body, including a second center coordinate, a second width, a second height, and a second rotation angle; wherein the orientation of the second rotation angle is aligned with the orientation of the element body, and is used to indicate the polarity direction when the element has polarity.

[0014] In one embodiment, step 2 includes: After preprocessing the image of the PCB substrate, it is fed into the configured first neural network for inference, and outputs the approximate location, category label and confidence of all component candidate regions. Then, redundant detection boxes are removed through post-processing and used as component candidate regions for the current image. The image is input using a resolution lower than the original image resolution.

[0015] In one implementation, step 3 includes: The region of interest is cropped from the image of the PCB substrate, a boundary extension is added, and the image is scaled to the standard input size and normalized.

[0016] In one implementation, step 4 includes: The normalized image is fed into the second neural network for inference, and two sets of parameters, the complete bounding box and the body box, are output simultaneously. After angle decoding and long and short side normalization, the local coordinates are mapped back to the global coordinate system, and the complete bounding box, the body box, and the polarity result are output.

[0017] In one implementation, the dual-rotation-box regression model is based on a convolutional neural network regression architecture, including a feature extraction backbone network and a regression head; wherein... The backbone network is used to extract multi-level visual features from the input ROI image; The regression head is used to receive the visual features and output two sets of rotated rectangle parameters, which include position, size and angle encoding information.

[0018] In one implementation, the loss function of the double-rotated-box regression model is configured based on the following parameters: Location loss: used to measure the deviation between the predicted center coordinates and the true center coordinates; Size loss: Used to measure the deviation between the predicted width and height and the actual width and height; Angle loss: directly applied to the angle encoding value, where the encoding space is continuous and there is no boundary jump problem.

[0019] In one embodiment, after the step of acquiring the image of the PCB substrate, the method further includes: The corresponding extractor is automatically selected based on the component category label. After feature extraction, it is compared with the template of the standard reference sample to determine the component status. The extractor includes: IC feature extractors, resistor / capacitor feature extractors, connector feature extractors, diode / transistor feature extractors, and general-purpose feature extractors.

[0020] Another aspect of the present invention provides a PCB component dual rotating frame positioning system, comprising: The image acquisition module is used to acquire images of the PCB substrate; The full-image detection module is used to perform target detection on the image and obtain at least one candidate region for a component. The region cropping module is used to crop each candidate region of the component to obtain an image of the region of interest of the component; The dual-rotation bounding box regression module is used to input the image of the region of interest of the element into a configured dual-rotation bounding box regression model, and simultaneously predict the corresponding complete bounding box and the body bounding box: wherein, The complete frame: The parameters of the first rotating rectangular frame that characterize the complete physical boundary of the element include the first center coordinates, the first width, the first height, and the first rotation angle; The body frame: a second rotating rectangular frame parameter characterizing the region surrounding the element body, including a second center coordinate, a second width, a second height, and a second rotation angle; wherein the orientation of the second rotation angle is aligned with the orientation of the element body, and is used to indicate the polarity direction when the element has polarity.

[0021] Another aspect of the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the PCB component dual rotation frame positioning method as described in any of the preceding claims.

[0022] Another aspect of the present invention provides a computer-readable storage medium storing a computer program that is executed to implement the PCB component dual rotation frame positioning method as described in any of the preceding claims.

[0023] By adopting the above technical solution, the present invention has at least the following advantages: The method provided by this invention simultaneously predicts two semantically different rotating rectangular boxes (complete box and body box), and completes component localization and polarity direction determination in one inference; it eliminates the boundary discontinuity problem of angle regression through periodic matching angle encoding; and it balances the efficiency of full-image detection and the accuracy of component localization through a two-stage cascaded detection pipeline; thereby significantly reducing the NPI programming time from the traditional 3 to 5 hours to less than 5 minutes. Attached Figure Description

[0024] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a schematic flowchart of a PCB component dual-rotation frame positioning method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a dual rotating frame concept according to an embodiment of the present invention; Figure 3 This is a schematic diagram of a dual rotating frame with different component types according to an embodiment of the present invention; Figure 4 This is a comparative schematic diagram of the angle encoding principle according to an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the normalization of long and short sides according to an embodiment of the present invention; Figure 6 This is a schematic diagram of a two-stage cascaded detection pipeline according to an embodiment of the present invention; Figure 7 This is a schematic diagram of a multi-type feature extractor system according to an embodiment of the present invention. Detailed Implementation

[0025] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments.

[0026] While exemplary embodiments of the invention are shown in the accompanying drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the invention and to fully convey its scope to those skilled in the art. The invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0027] The first embodiment of the present invention provides a method for positioning PCB components using a dual rotating frame, as follows: Figure 1 As shown, it includes the following steps: Step 1: Obtain an image of the PCB substrate; Step 2: Perform target detection on the image to obtain at least one candidate region for a component; Step 3: Crop each candidate region of the element to obtain the region of interest image of the element; Step 4: Input the image of the region of interest of the element into the configured double-rotation bounding box regression model, and simultaneously predict the corresponding complete bounding box and the body bounding box: where, The complete frame: The parameters of the first rotating rectangular frame that characterize the complete physical boundary of the element include the first center coordinates, the first width, the first height, and the first rotation angle; The body frame: a second rotating rectangular frame parameter characterizing the region surrounding the element body, including a second center coordinate, a second width, a second height, and a second rotation angle; wherein the orientation of the second rotation angle is aligned with the orientation of the element body, and is used to indicate the polarity direction when the element has polarity.

[0028] The following will be combined with the appendix Figures 2 to 7 The method provided in this embodiment will be described in detail.

[0029] 1) Overview of the plan: For ease of understanding, the main technologies mentioned in this embodiment are summarized as follows: 1. Double Rotation Box Representation: Simultaneously predicts two rotated rectangles: the "complete box" that surrounds the complete physical boundary of the element and the "body box" that surrounds the body region of the element. 2. Periodic matching angle encoding: A special encoding scheme is adopted to make the period of the encoding function precisely match the symmetrical period of the rectangle; 3. Standardization of length and short sides: Unify the representation of the width and height of the rotated rectangle to eliminate parameter ambiguity; 4. Two-stage cascaded inspection pipeline: a cascaded processing flow of full-image coarse inspection, ROI clipping, and precise double-frame positioning; 5. Multi-type feature extractor system: Design dedicated feature extraction strategies for different component types.

[0030] 2) Double Rotation Frame Representation (see Appendix) Figure 2 Appendix Figure 3 ) 2.1 Definition of Double Rotation Frame This invention predicts two rotating rectangles simultaneously for each component on the PCB, instead of a single rotating rectangle as in traditional methods: (a) Complete frame: The first rotating rectangular frame that tightly surrounds the complete physical boundary of the component. Its parameters include center coordinates, width, height, and rotation angle. The complete frame surrounds all visible parts of the component (body, pins, markings, etc.) and has 180-degree rotational symmetry.

[0031] (ii) Body frame: A second rotating rectangular frame that surrounds the component body or functional area, with the same parameter structure as the complete frame. The body frame only surrounds the component body area (excluding pin extensions). Its key feature is that its direction is aligned with the polarity direction of the component, thereby breaking the 180-degree symmetry and achieving a unique 360-degree direction representation.

[0032] 2.2 Collaborative Relationship of the Two Frames Spatial containment relationship: The body box is contained within or substantially overlaps with the complete box, and its size is usually smaller than or equal to the complete box.

[0033] Angle Relationship and Polarity Encoding: For symmetrical components (such as resistors and capacitors), the angles of the two frames are consistent; for polarized components (such as tantalum capacitors, diodes, and IC chips), the angle of the main frame points in the polarity direction, and the angle of the complete frame only indicates the overall orientation. The polarity state can be determined by comparing the difference between the two angles.

[0034] Information complementarity: The complete frame provides spatial occupancy information, while the ontology frame provides functional orientation information. The combination of the two allows for simultaneous location and polarity determination in a single reasoning process.

[0035] 2.3 Application of double frames in different component types 2.4 Model Output Structure The double-rotated bounding box regression model outputs two sets of rotated bounding box parameters, corresponding to the complete bounding box and the body bounding box, respectively. Each set of parameters includes position, size, and specially encoded angle information. The angle parameter does not output the angle value directly, but rather outputs a continuous value after periodic matching encoding. The reason and method for this are detailed in section 3) below.

[0036] 3) Periodic matching angle encoding (see appendix) Figure 4 ) 3.1 Problem Analysis After rotating the rectangle 180 degrees, it coincides with itself, so the true period of the angle parameter is 180 degrees. When directly regressing the angle value, if the true angle is close to one side of the period boundary while the predicted value is on the other side, the numerical difference is close to a complete period, causing a huge jump in the loss function and making training unstable.

[0037] 3.2 Encoding Scheme This embodiment specifically adopts a period-matching angle encoding scheme, which makes the period of the encoding function precisely match the symmetrical period of the rectangle, mapping the angle to a continuous space, thereby eliminating the boundary discontinuity problem in angle regression.

[0038] The core features of this encoding scheme include: Periodic exact matching: The period of the encoding function is exactly equal to the symmetry period of the rectangle (180 degrees). Therefore, two angle values ​​describing the same rectangle (180 degrees apart) are mapped to the exact same point in the encoding space, naturally eliminating symmetry ambiguity.

[0039] Complete continuity: The encoding function is continuously differentiable across the entire angle range, with no jumps or discontinuities. When the angle changes slightly, the encoded value also changes slightly, and the loss function remains continuous and smooth.

[0040] Lossless reversibility: The original angle can be accurately restored from the encoded value without any information loss.

[0041] During training, the true angles in the labeled data are encoded as the supervision target in the manner described above. The model's angle output head directly predicts the encoded continuous values, rather than directly predicting the angle itself.

[0042] 3.3 Comparison with other angle encoding schemes Compared to direct angular regression, this scheme completely eliminates discontinuities and loss jumps at periodic boundaries. Compared to angular classification methods, this scheme is a continuous regression, and the angular resolution is not limited by the classification granularity. Compared to ordinary triangular coding, the period of this scheme precisely matches the symmetry of the rectangle, with no redundant mapping. Compared to multi-frequency coding, this scheme is computationally simpler and does not require multiple frequency channels.

[0043] 4) Standardization of long and short sides (see appendix) Figure 5 ) 4.1 Problem Background The parametric representation of a rotated rectangle is inherently ambiguous: swapping the width and height and adjusting the angle accordingly describes the exact same rectangle. This ambiguity results in two valid parametric representations for the same rectangle, causing ambiguity during model training and increasing the learning difficulty.

[0044] 4.2 Standardization Methods This embodiment adopts a long and short side normalization strategy to force the width to always be no less than the height, while adjusting the angle parameters accordingly to eliminate the parameter ambiguity of the rotating rectangle.

[0045] The effect of standardization: Eliminating ambiguity in width and height: Each rotated rectangle has a unique parameter representation. Compression angle range: The angle is constrained within half a cycle. Collaborative Enhanced Angle Encoding: Combined with periodically matched angle encoding, it achieves completely unambiguous revolving box parameterization. 5) Two-stage cascaded detection pipeline (see appendix) Figure 6 ) 5.1 Overall Architecture This embodiment employs a two-stage cascaded detection pipeline, dividing the PCB component positioning process into three processing stages: Phase 1: Full-map object detection Phase Two: ROI Cropping and Scaling Phase 3: Precise Dual Rotation Frame Positioning The three stages are executed sequentially, with the output of each stage serving as the input for the next stage, gradually improving positioning accuracy.

[0046] 5.2 Phase 1: Full-map target detection After preprocessing the high-resolution image of the entire PCB board, it is fed into the first neural network for inference, outputting the approximate location, category label, and confidence score of all candidate regions for components. Redundant detection boxes are then removed through post-processing. Stage 1 uses lower resolution input to ensure speed, aiming to quickly locate the approximate location and category of all components.

[0047] 5.3 Phase Two: ROI Clipping and Scaling For each candidate region of interest, the region of interest is cropped from the original high-resolution image (the unscaled low-resolution image), boundary expansion is added, it is scaled to the standard input size, and normalized. The key advantage is that cropping from the original high-resolution image preserves all pixel details.

[0048] 5.4 Stage Three: Precise Dual Rotation Frame Positioning The normalized ROI image is fed into the second neural network for inference, simultaneously outputting two sets of parameters: the complete bounding box and the body bounding box. After angle decoding and length and short side normalization, the local coordinates are mapped back to the global coordinate system. Stage 3 supports batch inference mode to improve efficiency.

[0049] 6) Regression Model Network Structure The dual-rotation bounding box regression model is based on a convolutional neural network regression architecture, consisting of a feature extraction backbone network and a regression head. The backbone network extracts multi-level visual features from the input ROI image, and the regression head receives the features and outputs two sets of rotated bounding box parameters (complete box and body box), each containing position, size, and angle encoding information. The model output is a normalized value, which needs to be restored to actual pixel coordinates during inference.

[0050] 7) Loss Function Design The model training employs a joint loss function, simultaneously optimizing the prediction accuracy of both the complete bounding box and the ontology box. The total loss function is a weighted combination of the position, size, and angle regression losses for both the complete bounding box and the ontology box.

[0051] Specifically: Location loss: measures the deviation between the predicted center coordinates and the true center coordinates. Size loss: measures the deviation between the predicted width and height and the actual width and height. Angle loss: Directly affects the angle encoded value. Since the encoding space is continuous, there is naturally no boundary jump problem. The contributions of the three types of losses are calculated separately for the complete bounding box and the ontology box, and then balanced using weight hyperparameters.

[0052] 8) Multi-type feature extractor system (see appendix) Figure 7 ) The types of components on PCBs vary greatly, making it difficult for a single general-purpose feature extraction method to achieve optimal performance across all types. This invention designs a pluggable, multi-type feature extractor system, including various dedicated extractors: an IC feature extractor (focusing on pin patterns and surface markings), a resistor / capacitor feature extractor (focusing on size and color texture), a connector feature extractor (focusing on structural and orientation features), a diode / transistor feature extractor (focusing on polarity markings), and a general-purpose feature extractor (based on deep learning-based general features).

[0053] During operation, the corresponding extractor is automatically selected based on the component category label detected in Phase 1. After extracting features, the extractor is compared with the template of the standard reference sample to determine the component status.

[0054] 9) Polarity determination method Based on the positioning results of the dual-rotation frame, the difference between the angle of the complete frame and the angle of the main frame is calculated: a difference close to zero indicates correct orientation, a difference close to half a cycle indicates polarity reversal, and the difference for components without polarity is always close to zero. The results are compared with a standard reference sample to determine whether there are any polarity mounting defects.

[0055] 10) Training methods In the training data, each PCB component is labeled with two rotated bounding boxes: a complete bounding box and a body bounding box. After preprocessing the annotation parameters by normalizing the length and short sides, encoding the angles, and normalizing the coordinates, the ROI image is input into the model, the joint loss function is calculated, and the model parameters are optimized through backpropagation until convergence.

[0056] Through the above specific implementation methods, this method can be used to achieve: 1. Complete positioning and polarity determination in one step. Traditional methods require locating the component's position first, then using an additional classification model to determine its polarity, necessitating two inference steps. This invention, through a dual-rotation box design, simultaneously outputs the component's complete bounding box and polarity information in a single inference step, unifying two independent tasks into a single regression task. This reduces the number of inference steps, lowers system complexity, and avoids error accumulation.

[0057] 2. Completely eliminate boundary discontinuities in angle regression The periodic matching angle encoding of this invention precisely matches the symmetry of the bounding box. There are no boundary transition points in the encoding space, the loss function is continuously differentiable across the entire angle range, resulting in more stable model training and higher angle prediction accuracy. Compared to classification methods, the angle resolution is not limited by granularity; compared to multi-frequency encoding, the computation is simpler.

[0058] 3. Balancing overall drawing efficiency with unit component accuracy The two-stage cascaded pipeline design enables the system to operate efficiently on a high-resolution PCB full-image. The first stage quickly scans the entire image at a lower resolution; the second stage crops the ROI from the original high-resolution image while preserving all details; and the third stage performs precise double-frame positioning on the high-resolution ROI. This "coarse-to-fine" strategy balances speed and accuracy.

[0059] 4. Eliminate parameter ambiguity in rotating rectangles The collaborative design of long and short side normalization and period matching angle encoding completely eliminates the ambiguity of the parameter representation of the rotated rectangle, reduces the learning difficulty of the model, and improves training efficiency and prediction consistency.

[0060] 5. Significantly improves NPI programming efficiency This invention reduces the NPI programming time of PCB AOI systems from the traditional 3 to 5 hours to less than 5 minutes. The factory only needs to take an image of a standard reference sample, and the system can automatically complete the positioning and polarity determination programming of all components, without the need for a pre-built component library or CAD data.

[0061] 6. Adaptable to high-precision testing of various types of components The multi-type feature extractor system employs dedicated feature extraction strategies for different component types, enabling the system to achieve optimal detection accuracy on various components.

[0062] In some feasible implementations, a single rotating rectangle can be used for component positioning, with an additional independent classification head to determine the polarity direction. The disadvantages of this approach are that the polarity classification head and the positioning frame are separate, lacking geometric joint constraints; and for components with multiple orientation variations, the classification head needs to be expanded into a multi-classification problem, increasing design complexity.

[0063] In some feasible implementations, the periodic matching code of this invention can be replaced by classification methods, multi-frequency coding, or ordinary triangular coding. Classification methods are limited by granularity, multi-frequency coding has higher computational complexity, and ordinary triangular coding does not match the symmetry of the rectangular frame. This invention achieves an optimal balance between simplicity and accuracy.

[0064] In some feasible implementations, a single-stage rotating target detector can be used to perform component detection and double-box regression directly on the entire image. This approach eliminates the ROI clipping step and may be faster, but its accuracy in locating small components on high-resolution, large images may not be as good as the two-stage approach.

[0065] In some feasible implementations, keypoint detection methods (such as detecting the corners of a bounding box) can be used to replace the rotation bounding box regression. This approach avoids the angle regression problem, but it requires handling the keypoint sorting issue and has poor robustness to occlusion.

[0066] In summary, compared with the prior art, the advantages of this application are: I. Double Rotation Frame Representation For PCB components, two semantically distinct rotating bounding boxes are predicted simultaneously: a complete bounding box (enclosing the complete physical boundary of the component) and a body bounding box (enclosing the body region of the component and indicating the polarity). Component location and polarity direction determination are achieved simultaneously in a single regression inference.

[0067] II. Angular Coding for Periodic Matching A special encoding scheme is used to continuously encode the rotation angle, so that the encoding period is precisely matched with the symmetry period of the rectangle, thus completely eliminating the boundary discontinuity problem of angle regression.

[0068] III. Collaborative Design of Long and Short Side Normalization and Angle Encoding By combining the normalization constraint that the width must be no less than the height with the periodic matching angle encoding, a unique representation of the parameters of the rotating rectangle is achieved, eliminating parameter ambiguity.

[0069] A second embodiment of the present invention provides a PCB component dual-rotation frame positioning system, which can be understood as a physical device for implementing the method provided in the first embodiment. The system specifically includes: The image acquisition module is used to acquire images of the PCB substrate; The full-image detection module is used to perform target detection on the image and obtain at least one candidate region for a component. The region cropping module is used to crop each candidate region of the component to obtain an image of the region of interest of the component; The dual-rotation bounding box regression module is used to input the image of the region of interest of the element into a configured dual-rotation bounding box regression model, and simultaneously predict the corresponding complete bounding box and the body bounding box: wherein, The complete frame: The parameters of the first rotating rectangular frame that characterize the complete physical boundary of the element include the first center coordinates, the first width, the first height, and the first rotation angle; The body frame: a second rotating rectangular frame parameter characterizing the region surrounding the element body, including a second center coordinate, a second width, a second height, and a second rotation angle; wherein the orientation of the second rotation angle is aligned with the orientation of the element body, and is used to indicate the polarity direction when the element has polarity.

[0070] According to a third embodiment of the present invention, an electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the PCB component dual rotation frame positioning method as described in the first embodiment.

[0071] A fourth embodiment of the present invention provides a computer-readable storage medium storing a computer program that is executed to implement the PCB component dual-rotation frame positioning method as described in the first embodiment.

[0072] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims. All of these forms are within the protection scope of this application.

Claims

1. A method for positioning PCB components using a dual rotating frame, characterized in that, include: Step 1: Obtain an image of the PCB substrate; Step 2: Perform target detection on the image to obtain at least one candidate region for a component; Step 3: Crop each candidate region of the element to obtain the region of interest image of the element; Step 4: Input the image of the region of interest of the element into the configured double-rotation bounding box regression model, and simultaneously predict the corresponding complete bounding box and the body bounding box: where, The complete frame: The parameters of the first rotating rectangular frame that characterize the complete physical boundary of the element include the first center coordinates, the first width, the first height, and the first rotation angle; The body frame: The parameters of the second rotating rectangle that characterize the area surrounding the body of the element include the second center coordinates, the second width, the second height, and the second rotation angle; The orientation of the second rotation angle is aligned with the orientation of the component body, and is used to indicate the polarity direction when the component has polarity.

2. The PCB component dual-rotation frame positioning method according to claim 1, characterized in that, Step 2 includes: After preprocessing the image of the PCB substrate, it is fed into the configured first neural network for inference, and outputs the approximate location, category label and confidence of all component candidate regions. Then, redundant detection boxes are removed through post-processing and used as component candidate regions for the current image. The image is input using a resolution lower than the original image resolution.

3. The PCB component dual-rotation frame positioning method according to claim 2, characterized in that, Step 3 includes: The region of interest is cropped from the image of the PCB substrate, a boundary extension is added, and the image is scaled to the standard input size and normalized.

4. The PCB component dual-rotation frame positioning method according to claim 3, characterized in that, Step 4 includes: The normalized image is fed into the second neural network for inference, and two sets of parameters, the complete bounding box and the body box, are output simultaneously. After angle decoding and long and short side normalization, the local coordinates are mapped back to the global coordinate system, and the complete bounding box, the body box, and the polarity result are output.

5. The PCB component dual-rotation frame positioning method according to claim 4, characterized in that, The dual-rotation-box regression model is based on a convolutional neural network regression architecture. This includes a feature extraction backbone network and a regression head; among which, The backbone network is used to extract multi-level visual features from the input ROI image; The regression head is used to receive the visual features and output two sets of rotated rectangle parameters, which include position, size and angle encoding information.

6. The PCB component dual-rotation frame positioning method according to claim 5, characterized in that, The loss function of the double-rotated-box regression model is configured based on the following parameters: Location loss: used to measure the deviation between the predicted center coordinates and the true center coordinates; Size loss: Used to measure the deviation between the predicted width and height and the actual width and height; Angle loss: directly applied to the angle encoding value, where the encoding space is continuous and there is no boundary jump problem.

7. The PCB component dual-rotation frame positioning method according to claim 1, characterized in that, After the step of acquiring the image of the PCB substrate, the method further includes: The corresponding extractor is automatically selected based on the component category label. After feature extraction, it is compared with the template of the standard reference sample to determine the component status. The extractor includes: IC feature extractors, resistor / capacitor feature extractors, connector feature extractors, diode / transistor feature extractors, and general-purpose feature extractors.

8. A PCB component dual-rotation frame positioning system, characterized in that, include: The image acquisition module is used to acquire images of the PCB substrate; The full-image detection module is used to perform target detection on the image and obtain at least one candidate region for a component. The region cropping module is used to crop each candidate region of the component to obtain an image of the region of interest of the component; The dual-rotation bounding box regression module is used to input the image of the region of interest of the element into a configured dual-rotation bounding box regression model, and simultaneously predict the corresponding complete bounding box and the body bounding box: wherein, The complete frame: The parameters of the first rotating rectangular frame that characterize the complete physical boundary of the element include the first center coordinates, the first width, the first height, and the first rotation angle; The body frame: The parameters of the second rotating rectangle that characterize the area surrounding the body of the element include the second center coordinates, the second width, the second height, and the second rotation angle; The orientation of the second rotation angle is aligned with the orientation of the component body, and is used to indicate the polarity direction when the component has polarity.

9. An electronic device, characterized in that, include: A memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the PCB component dual rotation frame positioning method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The medium stores a computer program that is executed to implement the PCB component dual-rotation frame positioning method as described in any one of claims 1 to 7.