Method, device and storage medium for quickly and accurately identifying and locating QFN components
Through the Hough transformation and weighted least squares fitting method, the center and rotation angle of the QFN element are quickly and accurately identified, solving the problem of time-consuming and poor accuracy in traditional methods, and achieving high-precision and efficient component positioning.
Patent Information
- Application Number
- CN202211229168.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-08
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-10-08
AI Technical Summary
It is difficult for the prior art to quickly and accurately realize the detection of the center position and rotation angle of the QFN element, especially when there are bumps, burrs and other interferences in the boundaries of the conductive pads, the traditional method takes a long time and has poor accuracy.
The Hough transformation and weighted least squares line fitting method are used to extract the conductive pad profile, filter out the target profile, calculate the center point, and calculate the element center and rotation angle by using the intersection and inclination of the four center fitting lines to resist interference from the conductive pad boundary.
It realizes fast and accurate QFN component positioning, strong anti-interference ability, and meets the high accuracy and speed requirements of the patch machine. The center coordinate deviation is less than 0.4 pixels, the angle deviation is less than 0.4°, and the time is not more than 15ms.
Smart Images

Figure CN115578571B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a method, device and storage medium for quickly and accurately identifying and locating a QFN component. Background Art
[0002] QFN (Quad Flat No-leads Package) components are one of the most commonly used types of IC (microelectronic device) components. Their leadless design makes them smaller and lighter than traditional wing-shaped lead components. They also offer excellent electrical and thermal performance. Therefore, QFN components play a vital role in the field of highly integrated, lightweight placement machines. With the advancement of surface mount technology, placement machines have increasingly demanded higher speed and precision, placing increasingly stringent demands on the time and accuracy of the component identification process.
[0003] QFN components are primarily located by identifying the conductive pads on their bottoms. Currently, there are two main machine vision-based inspection methods: template matching using an ideal image, and point cloud matching or fitting using component feature points within the image.
[0004] Traditional template matching methods only scan position and do not support changes in rotation angle, making them inadequate for practical applications in placement machines. An improved approach involves repeated scanning with a multi-angle template, with the best match determined by the highest similarity score. However, when using multiple rotated templates or rotating the template image before scanning to detect component angles, the method's time complexity increases from O(m*n) to O(m*n*p), exponentially increasing time consumption and demanding computer resources. Furthermore, in actual detection, the size of components in images fluctuates within a standard error range. Therefore, when using a fixed-size template for matching, poor recognition accuracy results arise due to inconsistencies between the template size and the actual component size. Adding template scaling parameters in the horizontal and vertical directions as search parameters in the matching process increases the search dimension from three to five. While adding scaling improves recognition accuracy, it also increases recognition time.
[0005] Using feature points of components in an image for point cloud registration or fitting theoretically addresses the trade-off between time consumption and accuracy in traditional template matching methods. However, practical applications still present the following challenges. First, feature point stability is poor. Feature points extracted using this method are generally the corners of the rectangular image of the QFN conductive pad. Whether corner points are extracted using image grayscale variations or edge features, abnormal corner points may be extracted when the conductive pad edge is not smooth or has interference such as bumps or burrs. Abnormal corner points often cause offsets in the registration results. The QFN manufacturing process inevitably introduces cutting burrs on its conductive pads. Second, point cloud registration often relies on iterative algorithms. While loose termination conditions can improve detection speed, they can also reduce the accuracy and stability of the results. Stringent termination conditions increase the number of iterations, resulting in increased recognition time. Therefore, it's difficult to achieve a balanced detection speed and accuracy.
[0006] In summary, it is difficult for existing methods to quickly and accurately detect the center position and rotation angle of QFN mounted components. Summary of the Invention
[0007] The purpose of the present invention is to overcome the problems existing in the prior art and to provide a method, device and storage medium for quickly and accurately identifying and locating QFN components.
[0008] In order to achieve the above objectives, the first aspect of the present invention provides a method for quickly and accurately identifying and locating a QFN component, comprising the following steps:
[0009] Extract the component image contour and select the conductive pad contour as the target contour;
[0010] The boundary line point set is extracted from the single target contour through Hough transform and inverse transform. The boundary line point set is fitted using the weighted least squares straight line fitting method to obtain the boundary fitting line. The center point of each target contour is calculated based on the boundary fitting line.
[0011] Classify the center points of each target contour;
[0012] The center point after fitting classification is obtained by four center fitting lines. The center position of the component is obtained according to the intersection of the four center fitting lines. The rotation angle of the component is calculated according to the inclination angle of the four center fitting lines.
[0013] A second aspect of the present invention provides a device for quickly and accurately identifying and positioning a QFN component, comprising:
[0014] An extraction module is used to extract the contour of the component image and select the conductive pad contour as the target contour;
[0015] The center point calculation module is used to extract the boundary line point set of a single target contour through Hough transform and inverse transform, fit the boundary line point set using the weighted least squares straight line fitting method to obtain the boundary fitting line, and calculate the center point of each target contour based on the boundary fitting line;
[0016] A classification module is used to classify the center points of each target contour;
[0017] The identification and positioning module is used to fit the classified center point to obtain four center fitting lines, obtain the component center positioning according to the intersection of the four center fitting lines, and calculate the component rotation angle according to the inclination angle of the four center fitting lines.
[0018] A third aspect of the present invention provides a device for quickly and accurately identifying and positioning a QFN component, comprising:
[0019] Memory for storing computer programs;
[0020] A processor is used to implement the steps of the above-mentioned QFN component rapid and accurate identification and positioning method when executing the computer program.
[0021] A fourth aspect of the present invention provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned method for quickly and accurately identifying and locating QFN components.
[0022] The above technical solution uses Hough transform and inverse transform to filter out a set of boundary line points for rectangular fitting from the conductive pad contour. This can mitigate interference caused by irregularities such as rough conductive pad boundaries, protrusions, or arc-shaped corners. A weighted least squares linear fitting method is then used to accurately estimate the conductive pad center point, further mitigating the impact of outliers on the central coordinate estimation. The weighted least squares fitting method obtains central fitting lines for the conductive pad center point in four directions, which can mitigate errors in the calculation or deviation of the conductive pad center, resulting in more accurate positioning. The component's rotation angle is calculated by comprehensively considering the inclination angles of the lines in the four directions using the angular relationship between the central fitting lines. This provides a certain degree of tolerance for errors in the inclination angles, resulting in a more accurate and stable output rotation angle. Furthermore, the entire process does not involve complex calculations or scanning, resulting in rapid detection. Therefore, the technical solution proposed by the present invention offers advantages such as rapid detection speed, high positioning accuracy, and strong anti-interference capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0024] Figure 1(a) is a grayscale original image obtained for the QFN component disclosed in the present invention;
[0025] Figure 1 (b) is a grayscale image of the region of interest of the QFN component disclosed in the present invention;
[0026] Figure 1 (c) is a binary image of the region of interest of the QFN element disclosed in the present invention;
[0027] Figure 2 A schematic diagram of the identification and positioning process of some embodiments disclosed in the present invention;
[0028] Figure 3 (a) is an unfiltered profile distribution image of some embodiments disclosed in the present invention;
[0029] Figure 3 (b) is a contour distribution image after screening of some embodiments disclosed in the present invention;
[0030] Figure 4 (a) is a contour image of a conductive pad with interference according to some embodiments disclosed in the present invention;
[0031] Figure 4 (b) is a Hough detection contour image of an interfering conductive pad in some embodiments disclosed in the present invention;
[0032] Figure 5 A schematic flow chart of a conductive pad center classification method according to some embodiments disclosed in the present invention;
[0033] Figure 6 This is a schematic diagram of positioning results of some embodiments disclosed in the present invention;
[0034] Figure 7 (a) is an ideal image with a defined size, clear boundaries, a defined component center position, and a defined component rotation angle, constructed by using component parameters and camera pixel size in the test example of the present invention;
[0035] Figure 7 (b) for Figure 7 (a) Test image after adding noise and interference such as edge burrs and rounded corners;
[0036] Figure 7 (c) Figure 7 Partial image in (b);
[0037] Figure 7 (d) is the effect image of the test example of the present invention after identification and positioning using the method in the embodiment. DETAILED DESCRIPTION
[0038] To further illustrate the features of the present invention, the technical solutions of the present invention are described in more detail below through specific embodiments. However, the present invention can be implemented in many other ways that differ from the description herein, and those skilled in the art can make similar improvements without violating the scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0039] like Figure 1 (a) shows the original grayscale image of a QFN component, whose conductive pads are as follows: Figure 4 (a) The problem is that the boundary is convex, the boundary is not smooth, and the corners are in the shape of arcs. When using corner points as feature points, it is difficult to obtain corner points at the ideal rectangle vertex position. At this time, whether the corner points are used for point pattern matching or rectangle fitting, there is a problem of inaccurate positioning. In addition, the convex boundary and the arc-shaped corners make it difficult to accurately obtain the center position of the conductive pad using the centroid method or the direct rectangle fitting method, resulting in inaccurate positioning. If the template matching method is adopted, although the accuracy problem can be solved, the matching of the three dimensions of center coordinates and rotation angle consumes much more resources and time than the fitting method. Sometimes it is even necessary to consider the scaling coefficient problem in the horizontal and vertical directions. At this time, the matching process involves the search of five-dimensional parameters, and the recognition process is very time-consuming. Therefore, the template matching method is difficult to meet the rapid positioning requirements of the placement machine. The embodiment of the present invention uses Figure 1 The component shown in (a) is an example object. This embodiment is described to solve the problem of rapid and accurate positioning of QFN components in the presence of interference at the pad boundaries, so as to achieve rapid identification and positioning of QFN components.
[0040] In order to quickly and accurately locate QFN components, the first aspect of an embodiment of the present invention proposes a method for quickly and accurately identifying and locating QFN components, namely, a method for quickly and accurately identifying and locating QFN mounted components based on Hough transform and rectangular fitting. The basic idea is: first, the region of interest is extracted, filtered, and binarized on the original image; then, the edge contour is obtained by checking the 8-neighborhood connected domain, and the required contour is screened by area and rectangularity; secondly, the center point coordinates are obtained for each conductive pad contour by using Hough transform, inverse transform, and weighted least squares fitting; again, the pad centers are divided into four categories by using the characteristic that the centers of the conductive pads in the same direction are on the same straight line; finally, weighted least squares fitting is performed on the classified pad centers to obtain four center fitting lines, and the sub-pixel level positioning of the component center is obtained by the intersection of the center fitting lines, and the rotation angle of the component is obtained by the inclination of the center fitting lines. Figure 2 As shown, the method of the present invention includes steps S1 to S5.
[0041] S1. Preprocessing: Preprocessing the acquired grayscale image containing the QFN component, including extracting the region of interest (ROI), filtering, and binarization.
[0042] Typically, components in acquired grayscale images occupy only a portion of the image area, leading to unnecessary resource waste (memory and time) in direct processing. Therefore, it is necessary to extract a region of interest (ROI) from the original image to speed up processing and reduce resource consumption. Furthermore, due to fluctuations in camera sensor response and electrical signals, abnormal pixels in the image can interfere with boundary contour extraction, necessitating filtering of the extracted ROI image. After comprehensively considering various factors, including processing effectiveness, processing speed, and boundary protection, a median filter with a kernel size of 5 is used for filtering. This preprocessing step specifically includes steps S11 through S13.
[0043] S11. First, the region of interest is extracted from the obtained grayscale image containing QFN components by using the projection integral method. Binarize the original grayscale image, perform XY direction projection integral on the binarized image, and count the positions Xpre and Ypre where the first time the integral threshold Dt (set to 15 for example) appears from the front to the back of the XY direction projection integral curve, and the positions Xpost and Ypost where the first time the integral threshold Dt appears from the back to the front of the second half appears from the back to the front. Take the position of Dt pixels twice before Xpre (Ypre) (the starting position of the curve is taken if it exceeds the starting point of the curve) as the starting point of the width (height) of the region of interest, and take the position of Dt pixels twice after Xpost (Ypost) (the end position of the curve is taken if it exceeds the end point of the curve) as the end point of the width (height) of the region of interest. Extract the region of interest on the original image according to the above positions, further reduce the size of the image to be processed, and speed up the processing. The results are as follows: Figure 1 (b) shown.
[0044] S12 , then performing denoising processing on the extracted image of the region of interest using a median filter with a kernel size of 5, to reduce the interference of abnormal points on the subsequent extraction of the contour and calculation of the center position of the conductive pad.
[0045] S13, perform binarization processing on the filtered image of the region of interest, and the result after preprocessing is as follows Figure 1 (c) shown.
[0046] The above preprocessing operation reduces the size of the image to be processed later, speeds up the subsequent processing, and reduces the noise interference in the image, which is beneficial for the subsequent extraction of the conductive pad contour and accurate calculation of the center.
[0047] S2. Contour extraction and screening: Extract the contour of the component image and screen out the conductive pad contour as the target contour.
[0048] To obtain the coordinates of the conductive pad's center and calculate the component center, the present invention uses pad contours to calculate the pad center. Therefore, contour detection and extraction are required on the binarized image of the region of interest obtained in step S1. Because QFN components have heatsink pads in addition to conductive pads, and the binarization process is affected by image quality and may also contain other interfering contours, the extracted contours must be filtered to retain the conductive pad contours and remove interfering contours. This specific implementation process includes steps S21 and S22.
[0049] S21, using the 8-neighborhood connected domain check method to obtain all connected regions from the binary image, and extract the component image outlines of the connected regions from the background, such as Figure 3 (a)
[0050] S22. For all extracted component image contours, the interference contours are filtered out by contour area and rectangularity, and the desired conductive pad contours are retained to obtain the target contour set, such as Figure 3 (b) The conditions for filtering the extracted component image contours using contour area and rectangularity are:
[0051] Component image contours with an area between 0.7 and 1.3 times the theoretical pixel area of the contour are retained, and component image contours with a rectangularity less than 0.65 are eliminated. The theoretical pixel area of the contour is calculated as follows:
[0052] , (1)
[0053] The contour area screening condition, namely formula (1), is obtained by the component standard parameters (conductive pad length and width: LeadLength 、 LeadWidth ) and the pixel size of the captured image (the actual length represented by a pixel in the horizontal and vertical directions: ScaleX 、 ScaleY ) is calculated; the contour area screening range is determined based on the allowable error range between the actual size of the component and the standard size. The component used has a 20% error, and considering the error of contour extraction, the error range is expanded by 10%. Therefore, the screening range is 0.7-1.3 times the theoretical pixel area of the contour. If it is smaller than this range, the correct conductive pad contour will be incorrectly screened out; if it is larger than this range, the wrong contour will be retained and interfere with the recognition result.
[0054] Rectangularity is defined as follows:
[0055] (2);
[0056] S Refers to the pixel area of the detected contour, S MERRefers to the pixel area of the minimum bounding rectangle of the detected contour. If the rectangularity is set too small, incorrect contours cannot be filtered out. If the rectangularity is set too large, correct contours are easily filtered out.
[0057] S3. Conductive pad center calculation: A single target contour is subjected to Hough transform and inverse transform to extract a boundary line point set. The boundary line point set is fitted using the weighted least squares straight line fitting method to obtain a boundary fitting line. The center point of each target contour is calculated based on the boundary fitting line.
[0058] In the embodiment of the present invention, the center of the conductive pad is obtained by calculating the pad contour. First, the target contour is subjected to Hough transform, that is, each point on the conductive pad contour is converted from the image coordinate system to the parameter space according to formula (3). Then, the local maximum values in the parameter space are counted, and the corresponding contour points are found by inverse transforming the contour point parameters corresponding to the local maximum values (that is, the inverse transform of the Hough transform). At this time, multiple boundary straight line point sets can be obtained, and they are divided into boundary straight line point sets belonging to each straight line. Because the Hough transform is to make points with the same characteristics in the image coordinate space (points on the same straight line) intersect at one point in the parameter space, there are no outliers in the straight line obtained by the inverse transform whose outliers are greater than the Hough transform distance resolution, so some interfering contour points caused by protrusions, arc-shaped corners or burrs are removed. Figure 4 (a) shows the outline of a conductive pad of a component in the embodiment. Figure 4 (b) is the corresponding contour after Hough transform and inverse transform to complete the classification of the contour.
[0059] (3)
[0060] in, ρ represents the polar diameter, θ represents the polar angle, ( x , y ) are the coordinates of the contour points in image coordinates.
[0061] The weighted least squares straight line fitting method is used to obtain the boundary fitting line for the multiple boundary line point sets obtained by Hough transform and inverse transform. The weighted least squares straight line fitting method can further remove some outlier contour points, making the fitting result more consistent with the actual situation. The basic idea of the weighted least squares straight line fitting method is to introduce a distance weight function based on the least squares fitting for the data point set with outliers. ω(i) To weaken the contribution of outliers to the fitting, and then gradually approach the optimal result through several iterations (in the embodiment of the present invention, 3 iterations are used as an example, and no more than 5 iterations). The weight function used is generally Tukey weight:
[0062]
[0063] in, γ is the clipping factor. Here, the median of the distances from the points involved in the fitting to the fitting line in the last cycle is divided by 0.6745 and then multiplied by 2. δi |It's a point i The distance to the current fitted line.
[0064] The deviation and weighted least squares fit for:
[0065]
[0066] By solving the first-order derivative equations of the parameters to minimize the sum of the deviations, the optimal boundary fitting line for the current cycle is determined. During this iterative process, the influence of outliers on the fitting results is gradually weakened through weight updates, making the boundary fitting line more consistent with the actual situation.
[0067] Finally, based on the parallel and perpendicular relationships of the four sides of the rectangle, four straight lines whose inclination angles best match the rectangle are selected, the intersection of the four straight lines is calculated, and the mean of the intersection coordinates is used as the estimate of the center coordinates of the conductive pad.
[0068] In this step, the Hough transform and inverse transform are used to filter out interfering contour points such as bumps, burrs, and arc corners in the contour points, making the subsequent fitting results more accurate, that is, the calculated pad center is more accurate. At the same time, the Hough transform and inverse transform also complete the classification of the contour points. The weighted least squares linear fitting method can further remove abnormal points and outliers in the point set, further making the calculated pad center accurate and reliable.
[0069] S4. Conductive pad center classification: classify the center point of each target contour.
[0070] The center points of each target contour are quickly classified by taking advantage of the fact that the centers of the conductive pads in the same direction are near the same straight line, which is used for the next step of component positioning and angle calculation. The classification method process is as follows: Figure 5 The specific process is as follows:
[0071] (1) Put the center points of all target contours into the point set S;
[0072] (2) Randomly select two points P1 and P2 with a certain distance from each other from S and put them into the empty set VectorA. Find the straight line L passing through these two points. Preferably, the set distance limit threshold is d t0 , d t0 It needs to be greater than or equal to 2 times the theoretical center spacing of adjacent conductive pads. The distance d0 between the selected P1 and P2 needs to be greater than or equal to dt0 ;
[0073] (3) Calculate the distance d from the i-th point Pi in the remaining points in S to the line L in sequence i , if d i Less than the set distance threshold d t , preferably d t If it is set to 5 pixels, put Pi into the set VectorA;
[0074] (4) Compare whether the number of points in the set VectorA is equal to the number of conductive pads in one direction of the QFN component. If so, all points in the current VectorA are considered to be the pad center set in one direction. All points in VectorA are exported, and the elements belonging to VectorA in S are cleared. Return to (2) and continue searching for the next direction. If not, directly clear VectorA and return to (2) to continue searching.
[0075] (5) Repeat steps (2) to (4) until the point set classification in the four directions is completed.
[0076] Compared to clustering, the pad center classification method described above is simpler in principle and operation, and faster. Furthermore, when classifying the conductive pad centers of QFN components, initial points P1 and P2 can be selected, rather than randomly. Instead, point P1 is selected according to the distribution order of the center points in the set, and point P2 is selected at intervals of a certain odd number of points (three in this embodiment). This is because the contours of QFN conductive pads exhibit certain regularities when extracted using the 8-neighborhood connected domain inspection method. Therefore, the entire classification process requires a maximum of half the number of points in the point set S, and can be completed in a minimum of three searches.
[0077] S5. Component center positioning and rotation angle calculation: Fit the classified center point to obtain four center fitting lines. The component center positioning is obtained based on the intersection of the four center fitting lines. The component rotation angle is calculated based on the inclination of the four center fitting lines. The results are as follows: Figure 6 This step process specifically includes steps S51 to S54.
[0078] S51, using a weighted least squares straight line fitting method to sequentially obtain four central fitting straight lines for the center points of the target contour obtained by classification in step S4;
[0079] S52. Classify the four center-fitting lines into two categories, NS and EW, based on their inclination angles. Considering that the rotation angle of components after pickup during placement on a chip mounter generally does not exceed ±45°, the classification standard for center-fitting lines is as follows: center-fitting lines with an inclination angle between -45° and 45° are classified as NS, and the rest are classified as EW.
[0080] S53. Calculate the coordinates of the four intersection points of the NS and EW lines C i ( xc i , yc i ), calculate the component center coordinates using the intersection coordinates O ( ox , oy ). The calculation formula is as follows:
[0081] (6)
[0082] (7)
[0083] in, i =1, 2, 3, 4, x ci 、 y ci Respectively represent i The horizontal and vertical coordinates of the intersection points;.
[0084] S54, using the inclination of two straight lines of NS class θ NS1 、 θ NS2 and the inclination of the two straight lines of EW type θ EW1 、 θ EW2 Calculate component rotation angle θ , the calculation method is as follows:
[0085] .
[0086] The above rotation angle calculation method comprehensively considers the rotation angles of the four edges, which has a certain degree of resistance to the deviation of the fitting results and weakens the impact of the deviation on the final output results.
[0087] Using a weighted least squares linear fitting method to obtain the center fitting line of the conductive pad in each direction can reduce the influence of abnormal center points on the fitting results to a certain extent, making the calculation results closer to the actual results. At the same time, the fitting method is simple to operate and has a fast calculation speed, which meets the requirements of the placement machine for rapid identification and positioning.
[0088] Test Example 1:
[0089] Verification and experimental analysis of the reliability and effectiveness of the fast and accurate positioning and identification method for QFN mounted components.
[0090] In order to verify the reliability and effectiveness of the method proposed in this invention, the following verification experiment was designed:
[0091] The experiment used an ideal image constructed using the standard parameters of QFN components and the pixel size of the camera image as the test image. The component center and rotation angle set in the ideal image were used as reference standard values. The difference between the test result and the standard value was used as the evaluation value of the experimental result.
[0092] The test image is constructed as follows:
[0093] First, the ideal image of the QFN component with a fixed size, clear boundary, fixed center position and fixed rotation angle is constructed by using the standard parameters of the QFN mounting component and the pixel size in the image when the camera is imaging at the preset position of the image and the preset angle, such as Figure 7 As shown in (a). Considering that the QFN component will be affected by electromagnetic noise, dark current noise and other interferences when imaging, Gaussian noise and salt and pepper noise are added to the ideal image. At the same time, considering the interference of rounded corners and burrs on the boundaries of the conductive pads in the QFN component, the image is further processed for boundary contamination to obtain the final ideal test image, as shown in Figure 7 As shown in (b), Figure 7 The local details in (b) are as follows Figure 7 As shown in (c), there are some interference points in the figure.
[0094] The above method is used to construct 50 test images, where the image size is 512Pixel*512Pixel (pixels), the size of the QFN component in the image is 5mm*5mm, and the number of unidirectional conductive pads is 8. The method in the embodiment of the present invention is then used to perform positioning recognition on the 50 test images, and the recognition effect is as follows: Figure 7 (d) is shown. The recognition output results are compared with the reference standard values, and the statistical results are shown in Table 1. As can be seen from Table 1, compared with the standard values, the center coordinate deviation of the recognition results does not exceed 0.4 pixels, and the angle deviation does not exceed 0.4°, indicating that the recognition results of the algorithm proposed in the present invention are highly accurate; the standard deviations of the center coordinate deviation and the angle deviation do not exceed 0.1, indicating that the recognition results of the algorithm proposed in the present invention are highly stable; the average recognition time for each image does not exceed 15ms, indicating that the algorithm proposed in the present invention is fast and has good real-time performance. It meets the accuracy and speed requirements of the placement machine for QFN component placement.
[0095] Table 1 Statistics of QFN component positioning recognition algorithm recognition results
[0096]
[0097] In Table 1, ΔX, ΔY, and ΔR represent the differences between the center coordinate x, center coordinate y, and rotation angle R of the algorithm recognition results and the reference standard values, respectively.
[0098] In summary, to address the difficulty of existing methods in quickly and accurately detecting the center and rotation angle of QFN mounted components, a Hough transform, inverse transform, and weighted least squares fitting method are employed. The present invention utilizes Hough transforms and inverse transforms to remove most abnormal contour points on the conductive pad contour caused by bumps, burrs, and arc-shaped corners, and completes the classification of the contour point set. A weighted least squares straight-line fitting method is then used to obtain the fitted straight lines for the four sides of the conductive pad's rectangular contour, while further reducing the interference of outliers. The coordinates of the conductive pad's center are then obtained, making the obtained center coordinates more realistic. The characteristic that conductive pad centers in the same direction lie near the same straight line is exploited to quickly classify the pad centers. Finally, a weighted least squares straight-line fitting method is used to fit the conductive pad centers in each direction, obtaining the fitted straight lines for the centers in each direction. The sub-pixel center of the component is calculated using the intersection of the straight lines, making the calculated center closer to the true center. The component's rotation angle is calculated by comprehensively considering the inclination angles of the lines in four directions based on the angular relationship between the lines. This ensures that the output angle is resistant to errors in the inclination angles, making the output rotation angle more accurate and stable. Moreover, the entire identification and positioning process does not involve complex calculations or lengthy search and scanning processes, so the detection speed is fast. The technical solution of the present invention has the advantages of fast detection speed, high positioning accuracy, and strong anti-interference ability.
[0099] It is worth noting that the method of the present invention is not only applicable to the recognition and positioning of QFN components, but also applicable to image recognition and positioning in any field that has the same characteristics as QFN components (i.e., arrangement characteristics with a rectangular outline), such as QFP (small flat package) components.
[0100] Based on the same inventive concept, a second aspect of an embodiment of the present invention provides a QFN component rapid and accurate identification and positioning device corresponding to the QFN component rapid and accurate identification and positioning method, comprising:
[0101] An extraction module is used to extract the contour of the component image and select the conductive pad contour as the target contour;
[0102] The center point calculation module is used to extract the boundary line point set of the target contour through Hough transform and inverse transform, and use the weighted least squares straight line to fit the boundary line point set to obtain the boundary fitting line, and calculate the center point of each target contour according to the boundary fitting line;
[0103] A classification module is used to classify the center points of each target contour;
[0104] The identification and positioning module is used to fit the classified center point to obtain four center fitting lines, obtain the component center positioning according to the intersection of the four center fitting lines, and calculate the component rotation angle according to the inclination angle of the four center fitting lines.
[0105] A third aspect of an embodiment of the present invention provides a device for quickly and accurately identifying and locating QFN components, comprising:
[0106] Memory for storing computer programs;
[0107] The processor is configured to implement the steps of the above-mentioned method for quickly and accurately identifying and locating QFN components when executing the computer program.
[0108] A fourth aspect of an embodiment of the present invention provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the above-mentioned method for quickly and accurately identifying and locating QFN components are implemented.
[0109] Although the embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations may be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents, and all should be included within the scope of protection of the present invention.
Claims
1. A method for quickly and accurately identifying and locating QFN components, characterized in that: The following steps are involved: Extract the component image contour and select the conductive pad contour as the target contour; The boundary line point set is extracted from the single target contour through Hough transform and inverse transform. The boundary line point set is fitted using the weighted least squares straight line fitting method to obtain the boundary fitting line. The center point of each target contour is calculated based on the boundary fitting line. Classify the center points of each target contour; The classified center points are fitted to obtain four center fitting lines. The component center position is obtained based on the intersection of the four center fitting lines. The component rotation angle is calculated based on the inclination of the four center fitting lines. The following process is involved: The four central fitting lines are divided into two categories, NS and EW, according to the inclination angle. The central fitting lines with an inclination angle of [-45°, 45°] are NS, and the rest are EW. Calculate the coordinates C of the four intersection points of the NS and EW lines i (xc i ,yc i ), use the intersection coordinates to calculate the component center coordinates O(ox,oy), the formula is as follows: Where i = 1, 2, 3, 4, xc i 、yc i Respectively represent the horizontal and vertical coordinates of the i-th intersection; Using the inclination angle θ of two straight lines of NS class NS1 ,θ NS2 and the inclination angle θ of the two straight lines of EW type EW1 ,θ EW2 Calculate the component rotation angle θ as follows:
2. The method according to claim 1, characterized in that The single target contour is subjected to Hough transform and inverse transform to extract the boundary line point set. The following processes are included: The points on the target contour are converted from the image coordinate system to the parameter space coordinate system through Hough transform. The formula is as follows: ρ = x*cos(θ) + y + sin(θ), where ρ represents the polar radius, θ represents the polar angle, and (x, y) is the coordinate of the contour point in the image coordinate system. The local maximum values in the parameter space are counted, and the boundary line point set is obtained by inverse transformation of the line parameters corresponding to the local maximum values.
3. The method according to claim 1, characterized in that The method of extracting the component image contour and selecting the conductive pad contour as the target contour is specifically as follows: The 8-neighborhood connected domain checking method is used to extract component image contours. The extracted component image contours are screened using contour area and rectangularity to obtain the target contour set.
4. The method according to claim 3, characterized in that The conditions for screening the extracted component image contours using contour area and rectangularity are: Component image contours with an area between 0.7 and 1.3 times the theoretical pixel area of the contour are retained, and component image contours with a rectangularity less than 0.65 are eliminated. The theoretical pixel area of the contour is calculated as follows: LeadLength and LeadWidth represent the length and width of the nominal size of the conductive pad of the component, respectively. ScaleX and ScaleY represent the actual length represented by a pixel in the component image in the horizontal and vertical directions, respectively.
5. The method according to any one of claims 1 to 4, characterized in that: The process of classifying the center points of each target contour includes the following steps: (1) Randomly select two points from the center point set S of all target contours whose distance is greater than the preset threshold d t0 Put the points P1 and P2 into the empty set VectorA and find the line L passing through the two points; (2) Calculate the distance d from the remaining points Pi in the set S to the line L in sequence i , if d i Less than the set distance threshold d t Then put Pi into the set VectorA; (3) Compare whether the number of points in the set VectorA is equal to the number of conductive pads in one direction of the component; If they are equal, all points of the current VectorA are considered to be the pad center set in one direction, all points in VectorA are exported, and the elements belonging to VectorA in S are cleared, and the search for the next direction is returned to step (1); if they are not equal, VectorA is cleared directly, and the search is returned to step (1) to continue; (4) Repeat (1)-(3) until the point set classification in four directions is completed.
6. The method according to claim 5, characterized in that The method further comprises component image preprocessing, which sequentially comprises extracting a region of interest (ROI), filtering processing and binarization processing.
7. A device for quickly and accurately identifying and positioning QFN components, characterized in that: include: An extraction module is used to extract the contour of the component image and select the conductive pad contour as the target contour; The center point calculation module is used to extract the boundary line point set of a single target contour through Hough transform and inverse transform, fit the boundary line point set using the weighted least squares straight line fitting method to obtain the boundary fitting line, and calculate the center point of each target contour based on the boundary fitting line; A classification module is used to classify the center points of each target contour; The identification and positioning module is used to fit the classified center point to obtain four center fitting lines, obtain the component center location based on the intersection of the four center fitting lines, and calculate the component rotation angle based on the inclination of the four center fitting lines. It includes the following processes: The four central fitting lines are divided into two categories, NS and EW, according to the inclination angle. The central fitting lines with an inclination angle of [-45°, 45°] are NS, and the rest are EW. Calculate the coordinates C of the four intersection points of the NS and EW lines i (xc i ,yc i ), use the intersection coordinates to calculate the component center coordinates O(ox,oy), the formula is as follows: Where i = 1, 2, 3, 4, xc i 、yc i Respectively represent the horizontal and vertical coordinates of the i-th intersection; Using the inclination angle θ of two straight lines of NS class NS1 ,θ NS2 and the inclination angle θ of the two straight lines of EW type EW1 ,θ EW2 Calculate the component rotation angle θ as follows:
8. A device for quickly and accurately identifying and positioning QFN components, characterized in that: include: Memory for storing computer programs; A processor is configured to implement the steps of the method for quickly and accurately identifying and locating a QFN component as claimed in any one of claims 1 to 6 when executing the computer program.
9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for quickly and accurately identifying and locating a QFN component according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
QFP element position error visual inspection method based on region segmentation
CN101840572A
PCB cross-shaped reference point positioning method based on machine vision
CN113344856A