A method for identifying misaligned AOI components based on reverse grabbing logic
The AOI component misalignment identification method, which uses reverse background feature extraction and edge analysis, solves the problems of missed detection and false detection caused by component body feature drift in the existing technology, and achieves efficient and accurate component misalignment detection, adapting to the needs of different production lines and equipment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING YULONG OPTOELECTRONICS TECH CO LTD
- Filing Date
- 2026-03-24
- Publication Date
- 2026-05-26
AI Technical Summary
Existing AOI inspection technologies rely on the characteristics of the component body, which are easily affected by the blackening of the electrodes after reflow soldering, resulting in a high rate of missed and false detections. Furthermore, the technology does not consider detecting by capturing background features in reverse, leading to insufficient detection stability and accuracy.
An AOI component misalignment identification method based on reverse grabbing logic is adopted. By acquiring the target circuit board image, background feature parameters are obtained based on the reverse grabbing detection boxes on both sides of the component under test. Misalignment sensitive information is calculated, and multi-level recognition and self-calibration are performed in combination with edge feature parameters. The position of the detection box is dynamically adjusted, a two-dimensional misalignment sensitive information measurement system is constructed, and clear thresholds and similarity judgment logic are set to achieve efficient identification of components.
It significantly improves the detection rate and false alarm rate, enhances the reliability and adaptability of detection results, and can accurately identify component misalignment under complex process interference environments, reducing systematic errors and waste of computing resources.
Smart Images

Figure CN121904052B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to an AOI component misalignment recognition method based on reverse grabbing logic. Background Technology
[0002] With the rapid development of the electronics manufacturing industry towards miniaturization and automation, automated optical inspection (AOI) equipment has become an indispensable quality inspection process on printed circuit board assembly (PCBA) production lines. By rapidly acquiring and intelligently analyzing images of components after placement and before soldering, it aims to promptly intercept misalignment defects, prevent defective products from entering the market, thereby ensuring the reliability of the final product and reducing production costs. The core idea of traditional AOI technology is forward matching and measurement, which involves accurately identifying the characteristic positions of the component body and comparing them with preset theoretical coordinates to calculate the offset to determine whether misalignment has occurred.
[0003] However, this identification method, which relies on the inherent characteristics of the component itself, faces severe challenges in terms of stability and accuracy when dealing with complex process interferences in actual production. Especially after reflow soldering, the component electrodes are subjected to the combined effects of solder paste, high-temperature flux residue, and thermal stress, often resulting in discoloration, oxidation, or the accumulation of other colors. This causes significant drift or even distortion in their visual characteristics compared to the preset template. Existing technologies often address this by continuously adjusting matching parameters or tolerance thresholds, but this easily leads to a dilemma: relaxing the threshold increases false alarms and raises the cost of manual review; tightening the threshold may result in missed detections, allowing misalignment defects to go undetected. Therefore, a new approach to component misalignment identification that can fundamentally avoid process interference and possess stronger robustness is urgently needed.
[0004] Chinese Patent Publication No. CN120014004A discloses an image alignment method, apparatus, device, and storage medium, relating to the field of image processing. This solution acquires a scanned image of a circuit board to be inspected, identifies and extracts any unit region within the circuit board; based on preset segmentation rules, the unit region is divided into several partitions, generating a set of window images; the window images in the set are extracted, mapped one-to-one to the corresponding master image of the PCS particle image according to the image contours, and image alignment is performed according to the image contours to enable defect detection based on the master image.
[0005] Therefore, it is evident that the existing technology has the following problems:
[0006] Existing AOI inspection technologies suffer from high rates of missed and false detections due to their reliance on the characteristics of components susceptible to electrode blackening after reflow soldering and their failure to consider reverse-grabbing of background features in conjunction with the self-calibration within the circuit board. Summary of the Invention
[0007] To address this, the present invention provides an AOI component misalignment identification method based on reverse grabbing logic, which overcomes the problems of high component miss rate and false detection rate in existing AOI detection technologies, where forward color recognition is easily affected by the component body characteristics of electrode blackening after reflow soldering, and the lack of consideration for reverse grabbing of background features and combination with the internal self-calibration of the detection circuit board.
[0008] To achieve the above objectives, this invention provides a method for identifying misaligned AOI components based on reverse-grabbing logic, comprising:
[0009] Acquire the target circuit board image, and determine the anti-grabbing detection box on both sides of the background of each component under test based on the theoretical position of each component under test in the target circuit board and the preset small offset threshold.
[0010] Background feature parameters are obtained based on the anti-grabbing detection boxes on both sides of the background of each component under test, wherein the background feature parameters include color category and area ratio of each color category;
[0011] The misalignment sensitivity information is calculated based on the background feature parameters of the anti-grabbing detection box on both sides and the preset background reference feature parameters. The misalignment sensitivity information includes the deviation degree of the background on both sides and the deviation difference ratio.
[0012] The component test type is determined by comparing the misalignment sensitive information on both sides of the background with a preset misalignment sensitive information threshold. The component test type includes suspected misaligned components and good components.
[0013] Based on each suspected misaligned element, the edge feature parameters of the blackened area within the anti-grabbing detection box on both sides of the background are obtained to determine the suspected edge features. The edge feature parameters include edge gradient direction consistency, edge curvature, and edge intensity distribution.
[0014] Extract good components from the target circuit board that are identical to each suspected misaligned component, and obtain the edge feature parameters of each good component to determine the good edge features;
[0015] The similarity between the suspected edge features and the corresponding good edge features is used to determine whether there is an inconsistency in the edge features, wherein,
[0016] If there are inconsistencies in the edge features, calculate the proportion of components with blackened areas in the anti-grabbing detection box of the target circuit board;
[0017] The proportion of components with blackened areas is compared with a preset component proportion threshold to determine whether to analyze the yield rate of components with blackened areas.
[0018] Based on the proportion of components with blackened areas, determine whether to trigger a secondary judgment on suspected misaligned components according to the component good rate, and generate an identification result of the component misalignment state.
[0019] Furthermore, the process of determining the anti-grabbing detection frame on both sides of the background of each component under test includes:
[0020] The theoretical anti-grabbing detection frame of the background on both sides of each component under test is determined based on the theoretical position of each component under test in the target circuit board.
[0021] The theoretical anti-grabbing detection box is corrected based on a preset small offset threshold to determine the anti-grabbing detection box of the background on both sides of each component under test.
[0022] Furthermore, the process of calculating misalignment-sensitive information includes:
[0023] The similarity between the background feature parameters of the anti-grabbing detection boxes on both sides and the preset background baseline feature parameters is calculated respectively to determine the deviation of the background on both sides. The deviation includes a first background deviation and a second background deviation.
[0024] The deviation difference ratio of the two backgrounds is determined based on the ratio of the first background deviation to the second background deviation.
[0025] Furthermore, the process of determining the type of component test includes:
[0026] The first condition and the second condition are determined based on the misalignment sensitive information of the background on both sides and the preset misalignment sensitive information threshold.
[0027] Under the first condition, the component test type is determined to be a suspected misaligned component;
[0028] Under the second condition, the component test type is determined to be a good component;
[0029] The first condition is that the component under test has any misalignment sensitive information greater than a preset misalignment sensitive information threshold.
[0030] The second condition is that the misalignment sensitivity information of the component under test is all less than the preset misalignment sensitivity information threshold.
[0031] Furthermore, the process of determining whether there are inconsistencies in edge features includes:
[0032] Based on the comparison results of the suspected edge features and the corresponding good edge features having a similarity of less than a preset similarity threshold, it is determined that there is an inconsistency in the edge features.
[0033] Furthermore, it also includes determining that the edge features are consistent based on the comparison result of the similarity between the suspected edge features and the corresponding good edge features being greater than or equal to a preset similarity threshold, so as to determine that the corresponding suspected misaligned element is a misaligned element.
[0034] Furthermore, the process of analyzing the yield of components with blackened areas based on the first preset condition of component ratio includes:
[0035] Based on the comparison between the component ratio and the preset component ratio threshold, it is determined whether the first preset condition for the component ratio is met.
[0036] Under the first preset condition of determining the component ratio, the component yield rate of the blackened area is calculated;
[0037] The first preset condition is that the proportion of the components is greater than a preset component proportion threshold.
[0038] Furthermore, it also includes determining, based on the comparison results of the component proportions not meeting the first preset condition, the corresponding suspected misaligned component as a misaligned component.
[0039] Furthermore, the process of determining whether to trigger a secondary judgment on suspected misaligned components based on the component yield rate, based on the proportion of components with blackened areas, includes:
[0040] The comparison result based on the proportion of components with blackened areas meeting the first preset condition of component proportion triggers a comparison between the component good rate and the preset component good rate threshold to perform a secondary judgment on suspected misaligned components.
[0041] Furthermore, the process of making a secondary determination of suspected misaligned components by comparing the component yield rate with a preset component yield rate threshold includes:
[0042] Based on the comparison results of the component good rate being greater than the preset component good rate threshold, the corresponding suspected misaligned component is determined to be a good component;
[0043] Based on the comparison results of the component goodness rate being less than or equal to the preset component goodness rate threshold, the corresponding suspected misaligned component is determined to be a misaligned component.
[0044] Compared with existing technologies, the advantages of this invention lie in its multi-level and progressive identification framework that combines background reverse screening with edge feature analysis to further perform self-calibration within the circuit board. This transforms the traditional AOI's positive dependence on the component itself into reverse monitoring of a stable background. By detecting anomalies in background color, it efficiently identifies potential problem points, overcoming the feature failure problem caused by interference from the component electrode blackening process. By introducing edge morphology analysis, it effectively distinguishes between misaligned entities and contamination artifacts. By utilizing statistical information from all components on the board, it dynamically adjusts the judgment criteria based on the actual process status of the current production line. Through this series of logically rigorous and progressive steps, this invention overcomes interference from the component electrode blackening process, while achieving a high detection rate for genuine misalignment defects and a low false alarm rate for contaminated good products, significantly improving the intelligence level of detection and the reliability of detection results.
[0045] Furthermore, this invention achieves adaptive and optimized detection frame position by employing theoretical frame pre-setting and small offset threshold correction to determine the anti-grabbing detection frame. By closely integrating the small offset threshold pre-setting with the actual process capabilities of a specific production line, the detection frame is adjusted in reverse compensation. This ensures that the defined detection frame, even when the component is within any possible range of normal mounting position fluctuations, maintains the purity of its internal background area to the maximum extent, avoiding misjudging normal fluctuations of the component body as background intrusion. This step improves the stability and accuracy of subsequent feature extraction and comparison, enabling robust implementation of the anti-grabbing logic, eliminating systematic errors introduced by improper detection frame position setting, and enhancing the adaptability and portability of the method across different production lines and equipment.
[0046] Furthermore, this invention constructs a two-dimensional misalignment-sensitive information measurement system by separately calculating the deviation degree of the background on both sides and further deriving the deviation difference ratio. Calculating the deviation degree on one side can directly quantify the degree of background anomaly and effectively capture any form of intrusion; while calculating the deviation difference ratio utilizes the characteristic that misalignment is usually directional, i.e., unilateral intrusion. By comparing the difference in the degree of anomaly on both sides, the signal of unidirectional misalignment can be amplified. This dual measurement mechanism can not only detect obvious background anomalies, but also effectively distinguish between true unidirectional misalignment and global interference that may cause the deviation degree on both sides to increase simultaneously through the difference ratio, thereby enhancing the targeting and anti-interference ability of detection and reducing false triggering caused by environmental factors.
[0047] Furthermore, this invention standardizes the initial screening process into a clear decision rule by setting explicit dual thresholds, including a deviation degree threshold and a deviation difference ratio threshold, along with corresponding first and second conditions for judgment logic. The first condition, employing "OR" logic, ensures high detection sensitivity; any indicator exceeding the standard is considered suspicious, effectively preventing missed detections. The second condition, employing "AND" logic, is used to confirm unquestionable good products. This structured judgment method makes the initial screening process efficient and fast, and its logic transparent, transforming the complex image judgment problem into a clear mathematical comparison. It provides a reliable set of suspected misaligned samples for subsequent steps, making it a crucial link in the quality of the initial screening in the entire multi-level judgment process.
[0048] Furthermore, this invention determines the consistency of edge features by setting a quantified similarity threshold, providing an objective standard for distinguishing between component edges and contamination edges. When the similarity is below the threshold, it can clearly identify that the edges of suspected areas lack the regularity and clarity characteristics of standard component edges, thus reasonably generating an inconsistency judgment. This mechanism can initially eliminate false misalignment signals caused by irregular contamination such as blackening and solder splatter, providing accurate triggering conditions for subsequent more complex board-level statistical analysis, avoiding the increased computational burden caused by introducing all suspected cases into statistical decision-making, and optimizing the allocation of processing flow.
[0049] Furthermore, this invention establishes a highly efficient and rapid decision-making channel by stipulating that components with high edge feature similarity can be directly identified as misaligned. For typical misalignment cases with obvious features and clear edges, a final judgment can be made without undergoing a complete board-level statistical process. This significantly shortens the judgment time for such clearly defined defects, improves the overall detection throughput, and frees up computing resources to focus on handling complex cases with blurred edges and difficult judgments. This approach optimizes resource utilization and response efficiency.
[0050] Furthermore, this invention achieves intelligent control over the depth of analysis by introducing a component ratio threshold as a condition for triggering component yield analysis. When the blackening ratio is low, the decision logic focuses on individual characteristic analysis; only when the blackening ratio exceeds the threshold, indicating potential systemic process fluctuations, is an in-depth statistical analysis of the group yield triggered. This conditional triggering mechanism avoids unnecessary full-board statistics under all circumstances, saving computational resources. More importantly, it ensures that the analysis of the key indicator of component yield is only activated when interference is prevalent, improving the applicability and efficiency of advanced decision-making logic.
[0051] Furthermore, this invention provides a probability-based effective decision-making rule by directly identifying suspected components as misaligned when the blackening ratio is low. When the proportion of components with blackened areas is less than or equal to a preset threshold, it indicates that the overall process status of the board is basically normal, and the blackening contamination is only an occasional event of a very small number of components. In this case, combined with the previous steps that have determined that the edge characteristics of the component are inconsistent with those of good components, it indicates that the probability of the suspected misaligned component being a good component with blackening contamination is low, thus confirming that the suspected misaligned component is indeed a misaligned component. This rule enables decisive defect interception capabilities when dealing with occasional interference, adheres to the bottom line of quality control, and ensures rapid response to defects under normal production conditions.
[0052] Furthermore, this invention establishes a high blackening ratio as a necessary condition for triggering secondary judgment, constructing a logical bridge from individual anomaly identification to group state assessment. This triggering mechanism is the core of intelligent decision-making, capable of sensing overall changes in the production environment. When a widespread anomaly is detected, it no longer views individual suspected points in isolation, but observes the overall board status and prepares to use group statistical information to calibrate individual judgments. Based on the global quality background of the production unit in which it is located, it significantly improves the rationality and robustness of decision-making in complex and fluctuating environments, and is a key design for reducing group false alarms.
[0053] Furthermore, this invention achieves defect classification calibration based on statistical inference by making a final secondary judgment based on the comparison results of component yield and threshold. When the yield is high, it indicates that widespread blackening has not affected the position of most components, thus tending to classify individual components as good, effectively protecting contaminated qualified products and reducing false alarms. When the yield is low, it indicates that blackening is strongly correlated with position issues, thus tending to classify individual components as defects, preventing missed detections. This rule essentially uses the statistical regularity of group behavior to compensate for the inaccuracy of decision-making caused by the uncertainty of contamination interference when judging individual components. It can adapt to different process fluctuation modes, and can make a final judgment that is more in line with the actual situation, whether in different scenarios where there is only external contamination or where there has been substantial misalignment, greatly enhancing the reliability of detection and reducing the component missed detection rate and false detection rate. Attached Figure Description
[0054] Figure 1 This is a flowchart of an AOI component misalignment identification method based on reverse grabbing logic according to an embodiment of the present invention;
[0055] Figure 2 This is a flowchart illustrating the process of determining the reverse-grabbing detection frame of the background on both sides of each component under test in an embodiment of the present invention;
[0056] Figure 3 This is a flowchart illustrating the calculation of misalignment-sensitive information in an embodiment of the present invention;
[0057] Figure 4 This is a flowchart for determining the component test type in an embodiment of the present invention. Detailed Implementation
[0058] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0059] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0060] It should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0061] Please see Figure 1 The diagram shows a flowchart of an AOI component misalignment identification method based on reverse-grabbing logic according to an embodiment of the present invention. The AOI component misalignment identification method based on reverse-grabbing logic according to an embodiment of the present invention includes:
[0062] Step S1: Obtain the target circuit board image, and determine the anti-grabbing detection box of the background on both sides of each component under test based on the theoretical position of each component under test in the target circuit board and the preset small offset threshold.
[0063] Step S2: Obtain background feature parameters based on the anti-grabbing detection boxes on both sides of the background of each component under test, wherein the background feature parameters include color category and area ratio of each color category;
[0064] Step S3: Calculate the misalignment sensitive information based on the background feature parameters of the anti-grabbing detection boxes on both sides and the preset background reference feature parameters. The misalignment sensitive information includes the deviation degree of the background on both sides and the deviation difference ratio.
[0065] Step S4: Compare the misalignment sensitive information of the background on both sides with the preset misalignment sensitive information threshold to determine the component test type, wherein the component test type includes suspected misaligned components and good components;
[0066] Step S5: Based on each suspected misaligned element, obtain the edge feature parameters of the blackened area within the anti-grabbing detection box on both sides of the background to determine the suspected edge features. The edge feature parameters include edge gradient direction consistency, edge curvature, and edge intensity distribution.
[0067] Step S6: Extract good components from the target circuit board that are the same as each suspected misaligned component, and obtain the edge feature parameters of each good component to determine the good edge features;
[0068] Step S7: Determine whether there is an inconsistency in the edge features based on the similarity between the suspected edge features and the corresponding good edge features;
[0069] Step S8: If there is inconsistency in the edge features, calculate the proportion of components with blackened areas in the anti-grabbing detection box of the target circuit board.
[0070] Step S9: Based on the comparison between the proportion of components with blackened areas and the preset component proportion threshold, determine whether to analyze the goodness rate of components with blackened areas.
[0071] Step S10: Based on the proportion of components with blackened areas, determine whether to trigger a secondary judgment on suspected misaligned components according to the component good rate, and generate an identification result of the component misalignment state.
[0072] Please see Figure 2 As shown, it is a flowchart of the reverse grabbing detection frame for determining the background on both sides of each component under test in an embodiment of the present invention.
[0073] Specifically, in step S1, the process of determining the anti-grabbing detection frame of the background on both sides of each component under test includes:
[0074] Step S11: Determine the theoretical anti-grabbing detection frame of the background on both sides of each component under test based on the theoretical position of each component under test in the target circuit board.
[0075] Step S12: Correct the theoretical anti-grabbing detection box based on a preset small offset threshold to determine the anti-grabbing detection box of the background on both sides of each component under test.
[0076] In this embodiment, based on the ideal position of the standard template set during the forward gripping process of a component in traditional AOI inspection, a theoretical detection frame is preset on the left and right sides, or the top and bottom sides of its theoretical contour. The position and size of each theoretical reverse gripping detection frame are fixed. The size of each theoretical reverse gripping detection frame is determined proportionally to the component size: the width of the detection frame perpendicular to the component edge is preferably set to 15%-25% of the component width, typically 0.15mm to 0.3mm; the height of the detection frame parallel to the component edge is preferably set to 60%-80% of the component length to ensure sufficient coverage of the background area for stable features, while avoiding interference with adjacent components or pads. The reverse gripping detection frames are preferably set symmetrically on the left and right sides, or the top and bottom sides, determined based on the probability of misalignment during historical component soldering. The preset threshold for minute offset refers to the IPC610 (Acceptability of Electronic Components) standard, where the side offset of components such as resistors is less than or equal to 25% of the component electrode width, or 25% of the pad width, whichever is smaller, is taken as the preset threshold for minute offset. The preset threshold for minute offsets defines all reasonable positions that components might occupy under normal process fluctuations. During the correction process, the theoretical anti-grabbing detection box is fine-tuned according to the possible offset directions to determine the anti-grabbing detection box for each component. For example, if the preset threshold for minute offsets determines that a component might offset to the right by a maximum of 0.05mm, then the left boundary of the right detection box should be contracted to the right by at least 0.05mm to ensure that even if the component is at the normal offset limit position, its body will not intrude into the right detection box. The final determined position of the anti-grabbing detection box can fully adapt to the normal fluctuations of the production line, improving the stability of subsequent feature extraction.
[0077] In this embodiment, in step S2, an unsupervised clustering algorithm, preferably the K-means algorithm, is applied to the image region within each anti-grabbing detection box to cluster the color values of all pixels within the box. The color values can be in RGB or Lab color space. The number of clusters K needs to be preset, usually set to any integer value between 2 and 4 based on the background complexity of the circuit board (PCB). For example, clusters may be formed for categories such as green for solder mask, silver / gold for pads, and black for components or solder paste. After clustering, the number of pixels belonging to each cluster center is counted, and the percentage of each pixel in the total number of pixels is calculated to obtain the area proportion of each color category. These proportions constitute the main feature vector describing the color composition of the region. For example, in a normal solder mask area, the feature vector may show that green accounts for more than 95%, while other colors account for very low proportions. However, if a component is misaligned and intrudes, the feature vector of the region will change significantly, for example, the green proportion will decrease, and a new category proportion representing the component's body color may appear. This feature, based on color category and proportion, has a strong ability to capture color differences in different materials, such as component plastic bodies or solder paste blackening, metal leads, and PCB substrates, and has high computational efficiency, making it suitable for rapid initial screening.
[0078] Please see Figure 3 As shown, it is a flowchart for calculating misalignment sensitive information in an embodiment of the present invention.
[0079] Specifically, in step S3, the process of calculating the misalignment-sensitive information includes:
[0080] Step S31: Calculate the similarity between the background feature parameters of the anti-grabbing detection boxes on both sides and the preset background reference feature parameters, so as to determine the deviation of the background on both sides respectively. The deviation includes a first background deviation and a second background deviation.
[0081] Step S32: Determine the deviation difference ratio of the two backgrounds based on the ratio of the first background deviation to the second background deviation.
[0082] In this embodiment, for the detection boxes on the left and right sides (or the top and bottom sides), multi-dimensional feature vectors are constructed based on the extracted color categories and area proportions. The Euclidean distance between this vector and the preset background baseline feature parameter vector is calculated as the similarity between the background feature parameters of the anti-grabbing detection box and the preset background baseline feature parameters. The preset background baseline feature parameter vector is determined by averaging the background feature parameter vectors of good component samples. The similarity calculated for both sides of the background is used as the deviation of the two sides of the background, with the larger similarity recorded as the first background deviation and the smaller similarity recorded as the second background deviation. It can be understood that the larger the deviation value, the greater the difference between the color composition of the area and the normal PCB background, and the higher the possibility of misaligned components or solder paste blackening contamination. The ratio of the first background deviation to the second background deviation is calculated to obtain the deviation difference ratio. For a well-positioned component, both sides of the background should be normal, with low and similar deviation values, so the ratio tends to be close to 1. When a component is offset in one direction, the deviation on the intruding side will increase significantly while the other side remains normal, resulting in a ratio much greater than 1. The difference ratio effectively amplifies the signal of the unidirectional misalignment.
[0083] Please see Figure 4 As shown, it is a flowchart for determining the component test type in an embodiment of the present invention.
[0084] Specifically, in step S4, the process of determining the component test type includes:
[0085] Step S41: Determine the first condition and the second condition based on the misalignment sensitive information of the backgrounds on both sides and the preset misalignment sensitive information threshold.
[0086] Step S42: Under the first condition, determine that the component test type is a suspected misaligned component;
[0087] Step S43: Under the second condition, determine that the component test type is a good component;
[0088] The first condition is that the component under test has any misalignment sensitive information greater than a preset misalignment sensitive information threshold.
[0089] The second condition is that the misalignment sensitivity information of the component under test is all less than the preset misalignment sensitivity information threshold.
[0090] In this embodiment, the preset misalignment sensitive information thresholds include a deviation threshold and a deviation difference ratio threshold. The deviation threshold is preferably set to the 99.5th percentile of the deviation distribution of good product samples to ensure that the false alarm rate for good products is controlled at an extremely low level. The deviation difference ratio threshold is preferably set to a value that can effectively distinguish between unidirectional misalignment and symmetrical interference, such as 2.0. During the judgment process, the misalignment sensitive information of the current component is checked: the first background deviation, the second background deviation, and the deviation difference ratio. Two conditions are defined based on the comparison results: the first condition is that there exists any background deviation > the deviation threshold or a deviation difference ratio > the difference ratio threshold; the second condition is complementary to the first condition, that is, both the first and second background deviations are ≤ the deviation threshold and the deviation difference ratio is ≤ the difference ratio threshold. If the first condition is met, it indicates that the component has a significant abnormality in the background on at least one side, or that the two sides are severely asymmetrical, therefore the component is judged as a suspected misaligned component requiring further verification. If the second condition is met, it indicates that the background on both sides of the component is within the normal fluctuation range and has good symmetry, and it can be directly judged as a good component. This dual-threshold determination mechanism is more effective than relying solely on deviation determination in distinguishing between genuine misalignment and uniform background changes.
[0091] In this embodiment, step S5 aims to distinguish between anomalies caused by the edges of component entities and false anomalies caused by process contamination such as solder paste blackening. It is necessary to locate the blackened area within the anti-grabbing detection frame, identifying connected regions within this frame that are significantly different from the normal PCB background through background feature analysis, such as color abrupt segmentation. For this specific area, fine edge feature parameters are extracted, including edge gradient direction consistency, edge curvature, and edge intensity distribution. Edge gradient direction consistency involves calculating the gradient direction angles of all edge pixels and statistically analyzing the variance of these angles. It can be understood that the gradient direction of a regular component edge tends to be concentrated within a narrow range perpendicular to the edge, resulting in a small variance; while blackened contamination edges are usually disordered, with a scattered gradient direction distribution and a large variance. Edge curvature involves analyzing the curvature at points of change in the edge contour. It can be understood that component edges are usually straight or have regular arcs, while blackened edges may exhibit irregular and rugged shapes. Edge intensity distribution: By statistically analyzing the gradient magnitude of edge pixels and calculating their mean and standard deviation, it can be understood that sharp and clear component edges have high and relatively uniform gradient magnitudes, i.e., small standard deviations; while blurred and gently transitioning dark edges have lower gradient magnitudes and potentially larger variations, i.e., low mean values. These three parameters together constitute a comprehensive feature vector describing edge regularity and sharpness, i.e., suspected edge features.
[0092] In this embodiment, in step S6, other components with the same model as the suspected misaligned component and already identified as good components in step S4 are searched from the same target circuit board image currently being inspected. These components are considered standard samples with correct and no misalignment. A reverse-grabbing detection box is captured on the left or right side of the same good component, and the same edge detection and feature extraction process as in step S5 is performed. However, since these are good components, theoretically no component body should intrude into their detection box. Therefore, an expected edge position is needed when extracting edge features, i.e., the boundary near the detection box based on the theoretical contour of the component. Edges are extracted near this expected edge position, and their edge gradient direction consistency, edge curvature, and edge intensity distribution are calculated to obtain standard good edge features and construct a feature vector. This step achieves self-calibration within the target circuit board, eliminating systematic drift of edge features caused by different circuit board batches, different imaging devices, or differences in global illumination, making subsequent similarity comparisons more fair and accurate.
[0093] Specifically, in step 7, the process of determining whether there are inconsistencies in the edge features includes:
[0094] Step S71: Based on the comparison result that the similarity between the suspected edge feature and the corresponding good edge feature is less than a preset similarity threshold, it is determined that there is an inconsistency in the edge features.
[0095] In this embodiment, the similarity between suspected edge features and good edge features is determined by calculating the Euclidean distance between the two feature vectors. The average similarity between known true and false misalignments of blackened good sample products is used as the similarity threshold. When the calculated similarity is less than the preset similarity threshold, it is determined that there is an inconsistency in the edge features. This means that the edge morphology of the current suspected area differs significantly from the regular edge morphology of standard good components on the same board, and cannot be determined as the edge of a component entity. It is more likely to be contamination, solder splatter, or other irregular foreign matter, thus guiding the analysis towards a board-level statistical decision path.
[0096] Specifically, in step S72, based on the comparison result that the similarity between the suspected edge feature and the corresponding good edge feature is greater than or equal to a preset similarity threshold, the edge features are determined to be consistent, so as to determine that the corresponding suspected misaligned element is a misaligned element.
[0097] In this embodiment, when the calculated similarity is greater than or equal to a preset similarity threshold, it indicates that the irregular area within the suspected misaligned component detection frame has edges whose regularity, clarity, and directionality highly match the standard edges of good components on the same board. This high degree of consistency proves that the blackened area has minimal interference in determining whether a component is good or not, thus confirming the suspected misaligned component as a misaligned component.
[0098] In this embodiment, in step S8, the proportion of components with blackened areas in the anti-grabbing detection frames of the target circuit board is calculated. This requires counting the number of components with blackened areas in the anti-grabbing detection frames of all inspected components on the current entire circuit board. This number is divided by the total number of inspected components on the circuit board to obtain the proportion of components with blackened areas. For example, if there are 100 capacitors of the same model on a board, and analysis reveals that 35 of them have abnormal dark areas in their left or right detection frames, the proportion of these components is 35%.
[0099] Specifically, in step S9, the process of analyzing the yield of components with blackened areas based on the first preset condition of component ratio includes:
[0100] Step S91: Based on the comparison between the component ratio and the preset component ratio threshold, determine whether it meets the first preset condition for the component ratio.
[0101] Step S92: Under the first preset condition of determining the component ratio, calculate the component yield rate of the blackened area;
[0102] The first preset condition is that the proportion of the components is greater than a preset component proportion threshold.
[0103] In this embodiment, the proportion of components with blackened areas is compared with a preset component proportion threshold. The preset component proportion threshold is an empirical value used to define "individual phenomena" and "common phenomena," and preferably, it can be set to any value between 20% and 25%. It is determined whether the component proportion meets a first preset condition, i.e., the component proportion is greater than the preset component proportion threshold. If the proportion is less than or equal to the proportion threshold, it indicates that the blackening is only sporadic and belongs to an individual phenomenon; further analysis of the yield rate is unnecessary. If the proportion is greater than the proportion threshold, it indicates that the blackening is a widespread systemic phenomenon on the current circuit board, which may originate from solder paste issues in the current printing, furnace temperature profile fluctuations, or PCB batch differences. In this case, the possibility of suspected misalignment of individual components being affected by widespread interference is extremely high, therefore, a more in-depth analysis must be initiated, i.e., calculating the component yield rate with blackened areas. In the set of components with blackened areas, the number of components judged as good in step S4 is counted. This number is divided by the total number of components with blackened areas to obtain the component yield rate. This ratio reveals whether the positions of most components are actually still correct in the current widespread blackening situation, and is a key indicator for judging whether blackening causes substantial interference to positioning.
[0104] Specifically, in step S93, based on the comparison results of the component ratio not meeting the first preset condition, the corresponding suspected misaligned component is determined to be a misaligned component.
[0105] In this embodiment, when the proportion of components with blackened areas is less than or equal to a preset threshold, it indicates that the overall process status of the board is basically normal, and the blackening contamination is only an occasional event of a very small number of components. In this case, combined with the previous steps that have determined that the edge characteristics of the component are inconsistent with those of good components, it indicates that the probability of the suspected misaligned component being a good component (without misalignment) with blackening contamination is low. Therefore, the suspected misaligned component is determined to be a misaligned component.
[0106] Specifically, in step S10, determining whether to trigger a secondary judgment on suspected misaligned components based on the component goodness rate, based on the proportion of components with blackened areas, includes:
[0107] Step S101: Based on the comparison results of the proportion of components with blackened areas meeting the first preset condition of component proportion, it is determined to trigger a comparison between the component good rate and the preset component good rate threshold to make a secondary judgment on suspected misaligned components.
[0108] In this embodiment, when the proportion of components with blackened areas meets the first preset condition (i.e., a high proportion), it triggers the necessity of analyzing the component yield rate. The core of the secondary judgment is to compare this calculated component yield rate with a preset component yield rate threshold. The preset yield rate threshold is preferably set to any value between 85% and 90%. Triggering the secondary judgment means that the decision-making logic has risen from the analysis of individual component characteristics to an overall assessment of the entire board's production status. Using group statistical results to back-infer and calibrate the judgment of individual components is a core step in reducing the false alarm rate.
[0109] Specifically, in step S101, the process of making a secondary determination of suspected misaligned components by comparing the component goodness rate with a preset component goodness rate threshold includes:
[0110] Step S1011: Based on the comparison results of the component good rate being greater than the preset component good rate threshold, the corresponding suspected misaligned component is determined to be a good component;
[0111] Step S1012: Based on the comparison results of the component good rate being less than or equal to the preset component good rate threshold, the corresponding suspected misaligned component is determined to be a misaligned component.
[0112] In this embodiment, after step S101 is triggered, the calculated component goodness rate is compared with a preset component goodness rate threshold. The preset goodness rate threshold is preferably set to any value between 85% and 90%. If the component goodness rate is greater than the preset component goodness rate threshold, it indicates that although blackening is widespread, the vast majority of blackened components are still in good position after initial screening. This strongly suggests that this type of blackening in the current batch or board is mainly an apparent contamination or color change and does not substantially affect the component placement accuracy. Therefore, the suspected misaligned components that were suspected of being misaligned due to irregular edges are likely also components that are correctly positioned but contaminated by blackening, and are re-evaluated as good components. If the component goodness rate is less than or equal to the preset component goodness rate threshold, it indicates that widespread blackening has seriously interfered with component placement or caused numerous placement problems. In this context of poor overall quality, the suspected misaligned components are more likely to be truly misaligned. Therefore, the suspected misaligned component is determined to be a misaligned component.
[0113] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
Claims
1. A method for identifying misaligned AOI components based on reverse-grabbing logic, characterized in that, include: Acquire the target circuit board image, and determine the anti-grabbing detection box on both sides of the background of each component under test based on the theoretical position of each component under test in the target circuit board and the preset small offset threshold. Background feature parameters are obtained based on the anti-grabbing detection boxes on both sides of the background of each component under test. The background feature parameters include color category and area ratio of each color category. The misalignment sensitivity information is calculated based on the background feature parameters of the anti-grabbing detection box on both sides and the preset background reference feature parameters. The misalignment sensitivity information includes the deviation degree of the background on both sides and the deviation difference ratio. The component test type is determined by comparing the misalignment sensitive information on both sides of the background with a preset misalignment sensitive information threshold. The component test type includes suspected misaligned components and good components. Based on each suspected misaligned element, the edge feature parameters of the blackened area within the anti-grabbing detection box on both sides of the background are obtained to determine the suspected edge features. The edge feature parameters include edge gradient direction consistency, edge curvature, and edge intensity distribution. Extract good components from the target circuit board that are identical to each suspected misaligned component, and obtain the edge feature parameters of each good component to determine the good edge features; The similarity between the suspected edge features and the corresponding good edge features is used to determine whether there is an inconsistency in the edge features, wherein, If there are inconsistencies in the edge features, the proportion of components with blackened areas in the anti-grabbing detection box of the target circuit board is calculated. The proportion of components with blackened areas is compared with a preset component proportion threshold to determine whether to analyze the yield rate of components with blackened areas. Based on the proportion of components with blackened areas, determine whether to trigger a secondary judgment on suspected misaligned components according to the component goodness rate, and generate an identification result of the component misalignment state.
2. The AOI component misalignment identification method based on reverse grabbing logic according to claim 1, characterized in that, The process of determining the anti-grabbing detection frame on both sides of the background of each component under test includes: The theoretical anti-grabbing detection frame of the background on both sides of each component under test is determined based on the theoretical position of each component under test in the target circuit board. The theoretical anti-grabbing detection box is corrected based on a preset small offset threshold to determine the anti-grabbing detection box of the background on both sides of each component under test.
3. The AOI component misalignment identification method based on reverse grabbing logic according to claim 2, characterized in that, The process of calculating misalignment-sensitive information includes: The similarity between the background feature parameters of the anti-grabbing detection boxes on both sides and the preset background baseline feature parameters is calculated respectively to determine the deviation of the background on both sides. The deviation includes a first background deviation and a second background deviation. The deviation difference ratio of the two backgrounds is determined based on the ratio of the first background deviation to the second background deviation.
4. The AOI component misalignment identification method based on reverse grabbing logic according to claim 3, characterized in that, The process of determining the type of component test includes: The first condition and the second condition are determined based on the misalignment sensitive information of the background on both sides and the preset misalignment sensitive information threshold. Under the first condition, the component test type is determined to be a suspected misaligned component; Under the second condition, the component test type is determined to be a good component; The first condition is that the component under test has any misalignment sensitive information greater than a preset misalignment sensitive information threshold. The second condition is that the misalignment sensitivity information of the component under test is all less than the preset misalignment sensitivity information threshold.
5. The AOI component misalignment identification method based on reverse grabbing logic according to claim 4, characterized in that, The process of determining whether there are inconsistencies in edge features includes: Based on the comparison results of the suspected edge features and the corresponding good edge features having a similarity of less than a preset similarity threshold, it is determined that there is an inconsistency in the edge features.
6. The AOI component misalignment identification method based on reverse grabbing logic according to claim 5, characterized in that, It also includes, Based on the comparison results of the suspected edge features and the corresponding good edge features having a similarity greater than or equal to a preset similarity threshold, the edge features are determined to be consistent, thereby determining the corresponding suspected misaligned element as a misaligned element.
7. The AOI component misalignment identification method based on reverse grabbing logic according to claim 6, characterized in that, The process of analyzing the yield of components with blackened areas based on the first preset condition of component ratio includes: Based on the comparison between the component ratio and the preset component ratio threshold, it is determined whether the first preset condition for the component ratio is met. Under the first preset condition of determining the component ratio, the component yield rate of the blackened area is calculated; The first preset condition is that the proportion of the components is greater than a preset component proportion threshold.
8. The AOI component misalignment identification method based on reverse grabbing logic according to claim 7, characterized in that, It also includes determining, based on the comparison results that the component ratio does not meet the first preset condition, the corresponding suspected misaligned component is a misaligned component.
9. The AOI component misalignment identification method based on reverse grabbing logic according to claim 8, characterized in that, The process of determining whether to trigger a secondary judgment on suspected misaligned components based on the proportion of components with blackened areas includes: The comparison result based on the proportion of components with blackened areas meeting the first preset condition of component proportion triggers a comparison between the component good rate and the preset component good rate threshold to make a secondary judgment on suspected misaligned components.
10. The AOI component misalignment identification method based on reverse grabbing logic according to claim 9, characterized in that, The process of secondary determination of suspected misaligned components by comparing the component goodness rate with a preset component goodness rate threshold includes: Based on the comparison results where the component's good rate is greater than a preset component good rate threshold, the corresponding suspected misaligned component is determined to be a good component; Based on the comparison results where the component goodness rate is less than or equal to a preset component goodness rate threshold, the corresponding suspected misaligned component is determined to be a misaligned component.