Method and system for quickly acquiring component characteristic parameters, storage medium and equipment
By extracting and fitting the feature profile of the component ROI region in the patch machine, combining circular and rectangular index screening, the problem of complex acquisition of component feature parameters in the prior art is solved, and fast and accurate parameter acquisition and wide applicability are achieved.
Patent Information
- Application Number
- CN202510861313.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-25
AI Technical Summary
The prior art is difficult to quickly and accurately obtain the characteristic parameters of the patch machine components, especially for special-shaped components, which are complex in operation and high requirements.
By extracting the feature groups of the element ROI region, feature profile fitting and integration are performed, and feature profiles are screened using traditional image processing methods, combining circular and rectangular fitting indicators, and component types are automatically classified and feature parameters are calculated.
It realizes rapid and accurate acquisition of feature parameters of the patch machine component, simple operation and wide application range, reducing the requirements of operators and calculation complexity.
Smart Images

Figure CN120374735A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of component identification and positioning of a mounter, and particularly to a method and system for quickly obtaining characteristic parameters of components of a mounter, and a storage medium. Background Art
[0002] A mounter is an important tool for realizing the automated production of an integrated circuit board, and it mainly relies on machine vision to complete the accurate mounting of different types of components. Generally, in the mounting process, the real-time identification and positioning of different components sucked require the characteristic parameters of the components as a prerequisite. The accuracy of the component characteristic parameters determines to a certain extent the difficulty and accuracy of identification. Therefore, how to quickly and accurately obtain the component characteristic parameters is very important.
[0003] The parameter acquisition of a new component generally includes methods such as direct measurement, off-line programming estimation, calculation using the package information in the product documentation, and image recognition.
[0004] The direct measurement method is to directly test using measuring tools such as vernier calipers. This method can quickly obtain the desired characteristic parameters such as length, width, and thickness for simple components such as Chip components. However, it has the following defects: First, the accuracy is difficult to guarantee. Both manual measurement and the measuring tools used may introduce errors, and the accuracy is difficult to guarantee. Second, for components with many and complex features, such as special-shaped components with multiple sets of features, direct measurement is instead complicated in operation and it is difficult to quickly obtain accurate characteristic parameters.
[0005] The off-line programming estimation method is to construct the characteristic edges of the component by combining an image of the component, a camera scale, and a previously set specific component characteristic parameter model and display them above the image, and then repeatedly adjust the parameters by visually comparing the coincidence degree between the constructed characteristic edges and the component boundary in the actual image to complete the parameter estimation. Although this method can handle most situations, it has too high requirements for operators, and the repeated debugging process is too complicated.
[0006] The method of calculating using the package information in the product documentation is mainly to manually calculate the required characteristic parameters according to the size data on the package information and record them. This method can handle all components, but it has high requirements for the operator. The operator needs to be able to understand the package data, understand the meaning of the component characteristic parameters, and be able to perform parameter conversion. In addition, this method is also relatively complicated in operation and involves the conversion of multiple parameters.
[0007] There are currently two common methods for image recognition. One is the method based on deep learning for target segmentation and classification. This method can achieve full adaptability, but it is generally difficult to process components with unknown packages, and the model is generally large, requiring more computer resources. The other is the method based on traditional image processing combined with some preset feature frameworks. This method also has difficulty obtaining accurate results for unknown forms. There are already more than a hundred types of packaging forms for existing SMT components, and it is difficult to consider all types in algorithm design. Therefore, the use of both of the above methods has certain limitations.
[0008] In summary, it is difficult for existing methods to quickly and accurately obtain the characteristic parameters applicable to various SMT components. Summary of the Invention
[0009] The object of the present invention is to overcome the problems existing in the prior art and provide a method and system, storage medium, and device for quickly obtaining component characteristic parameters, which can quickly and accurately obtain the characteristic parameters of various SMT components.
[0010] To achieve the above object, the first aspect of the present invention provides a method for quickly obtaining component characteristic parameters, including the following steps: Extract the feature contours of each feature group in the ROI area of the component, where the feature group is a group of features with the same shape and uniform distribution in the ROI area of the component; Fit the feature contours of each feature group to determine the shape parameters of the feature contours; Statistically analyze the shape parameters of all the feature contours and determine the component type according to the statistical results; Based on the determined component type, integrate the shape parameters of the feature contours in each feature group to obtain the complete component characteristic parameters.
[0011] Preferably, the process of fitting the feature contours of each feature group to determine the shape parameters of the feature contours includes the following steps: Perform circular fitting and rectangular fitting on the feature contours respectively to obtain the circular index Rc and rectangular index Rr of the feature contours, Rc = α × E + β × Tc , Rr = α × R + β × Tr , where E represents the circularity of the feature contour, Tc represents the proportion of the number of inlier points after circular fitting of the feature contour to the total number of contour points before fitting, R represents the rectangularity of the feature contour, Tr represents the proportion of the number of inlier points after rectangular fitting of the feature contour to the total number of contour points before fitting, the inlier points are the points among the total contour points before fitting that are less than the specified pixel distance from the fitting boundary, and α and β are weight coefficients; Retain the feature profiles that meet the preset requirements according to the magnitudes of Rc and Rr, and determine the shape parameters of the feature profiles.
[0012] Preferably, the shape parameters of the feature profiles that are retained according to the magnitudes of Rc and Rr and meet the preset requirements are specifically as follows: If Rc < 0.5 and Rr < 0.5, then filter out the corresponding feature profiles; otherwise, retain them. If Rc > Rr, then determine that the feature profile is circular, and use the diameter and center obtained by fitting the circular feature profile as the diameter and center of the profile respectively; if Rc < Rr, then determine that the feature profile is rectangular, and use the length, width, and center obtained by fitting the rectangular feature profile as the length, width, and center of the profile respectively.
[0013] A second aspect of the present invention provides a system for quickly obtaining component feature parameters, including: A feature profile extraction module, configured to extract feature profiles for each feature group in the ROI area of the component, where the feature group is a group of features with the same shape and uniform distribution in the ROI area of the component; A fitting module, configured to fit the feature profiles of each feature group to determine the shape parameters of the feature profiles; A component type determination module, configured to count the shape parameters of all the feature profiles and determine the component type according to the statistical results; A component parameter calculation module, configured to integrate the shape parameters of the feature profiles in each feature group based on the determined component type to obtain complete component feature parameters.
[0014] Preferably, it further includes a user interaction module, configured to implement the box selection interaction for the ROI area and feature groups of the component.
[0015] Preferably, it further includes: An image automatic rotation correction module, configured to extract the contour of the ROI area of the component and perform multi-angle rotation; count the sum of the projection extreme values of all the contours in the horizontal and vertical directions after each rotation, and use the rotation angle when the sum of the projection extreme values is the largest as the angle estimate in the ROI area of the component; rotate and correct the ROI area of the component with the estimated angle; A preliminary screening module, configured to perform preliminary screening on the connected contours of the feature group to remove interfering contours and obtain the feature profiles.
[0016] Preferably, the process of fitting the feature profiles of each feature group to determine the shape parameters of the feature profiles includes the following steps: Perform circular fitting and rectangular fitting on the feature contours respectively to obtain the circular index Rc and rectangular index Rr of the feature contours. Rc = α×E + β× Tc and Rr = α×R + β× Tr , where E represents the circularity of the feature contour, Tc represents the proportion of the number of inliers after circular fitting of the feature contour to the total number of contour points before fitting, R represents the rectangularity of the feature contour, Tr represents the proportion of the number of inliers after rectangular fitting of the feature contour to the total number of contour points before fitting, the inliers are the points among the total contour points before fitting that are less than the specified pixels away from the fitting boundary, and α and β are weight coefficients; If Rc < 0.5 and Rr < 0.5, then filter out the corresponding feature contours, otherwise retain them; If Rc > Rr, then determine that the feature contour is circular, and use the diameter and center obtained by circular fitting of the feature contour as the diameter and center of the contour respectively. If Rc < Rr, then determine that the feature contour is rectangular, and use the length, width and center obtained by rectangular fitting of the feature contour as the length, width and center of the contour respectively.
[0017] The third aspect of the present invention provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to cause a machine to execute the above-mentioned method for quickly obtaining component feature parameters.
[0018] The fourth aspect of the present invention provides an electronic device, the electronic device includes: one or more processors; and a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the above-mentioned method.
[0019] Through the above technical solutions, it can be satisfied that the operator only needs to frame out the approximate component ROI and feature group ROI to complete the automatic acquisition of component feature parameters. The operation method is simple, the learning cost is low, and the requirements for the operator are low; only the traditional image processing method is used to calculate the features of each feature group separately and integrate them according to certain rules, the processing speed is fast, and the parameter results are accurate. Separate designs are made for conventional components and special-shaped components, and there is no specific template form constraint for special-shaped components, and components of various packaging forms can be applied, and the method has a wide application range. Therefore, the technical solution proposed by the present invention has the advantages of simple operation, low requirements for personnel, fast parameter acquisition speed, wide application range, etc. Description of the Drawings
[0020] Figure 1 is a schematic flow chart of the method for quickly obtaining component feature parameters of a pick-and-place machine disclosed by the present invention; Figure 2 is a diagram of the feature group ROI framing in the embodiment disclosed by the present invention; Figure 3 It is a diagram showing the characteristic parameter results of multi-pin components obtained in the embodiments disclosed by the present invention. Specific Embodiments
[0021] The following will detail the specific embodiments of the embodiments of the present invention in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only for the purpose of illustrating and explaining the embodiments of the present invention, and are not used to limit the embodiments of the present invention.
[0022] Taking the rapid acquisition of the characteristic parameters of QFP multi-pin components as an example, the technical solution and specific implementation of the method for rapidly acquiring the characteristic parameters of the components of the mounter described in the present invention will be detailed below.
[0023] In the first aspect of the embodiments of the present invention, a method for rapidly acquiring the characteristic parameters of the components of a mounter is proposed. Referring to Figure 1 as shown, it includes the following steps: S1. Select the ROI area of the target component and automatically correct the image. First, select the ROI area containing the target component on the grayscale image of the component whose parameters are to be acquired. Then, extract all the contours in the ROI area by the Canny or binarization method. Then, rotate the extracted contours at multiple angles and count the sum of the extreme values of the projections of the rotated contour points in the horizontal and vertical directions. The rotation angle when the sum of the projection extreme values is the largest is used as the estimated angle of the component in the image. Finally, rotate the ROI area by the estimated angle to rotate the component in the image into a horizontal state; Further, step S1 includes the following processes: S11. Component ROI selection. Exemplarily, manually select the ROI range containing the target component on the component image by mouse, or it can also be automatically selected by the machine. Generally, the component whose parameters are to be acquired only occupies a partial area of the entire image. If the entire image is processed, it will not only take more time but also easily introduce interference, resulting in inaccurate results. Therefore, the ROI area of the component whose parameters are to be acquired is roughly selected through a human-machine interaction form, so as to make the selected ROI as small as possible for subsequent rapid processing and accurate angle estimation; S12. Contour extraction. Use the Canny algorithm to extract the edges of the image of interest, and then use the connected domain method to obtain all the contours.
[0024] S13. Estimation of the component rotation angle. Rotate all the extracted contours multiple times within the set angle range with the set angle step. Among them, the rotation center is the center of the selected ROI. In the embodiments of the present invention, it is preferably [-45°, 45°] as the rotation range and 0.2° as the angle step, and a three-layer search pyramid is designed for acceleration. Count the sum of the extreme values of the projections of the contour points in the horizontal and vertical directions after each rotation. The rotation angle in the case where the sum of the projection extreme values is the largest is used as the estimated component rotation angle.
[0025] S14. Image rotation to upright. Rotate the image with the estimated component angle as the rotation angle and the center of the selected ROI as the rotation center, so that the component ROI area is rotated to a horizontal state of the component.
[0026] S2. Feature group selection. As Figure 2 shown, regard a group of features with the same shape and uniform distribution in the component ROI area image as a feature group, roughly select the ROI areas of each feature group in the image by mouse and save them to obtain each feature group.
[0027] S3. Extract the feature contours of each feature group and perform feature calculations, including feature types and feature parameters. Use the OTSU and connected component contour extraction methods to extract the feature contours in each feature group; perform a preliminary screening on the extracted contours through area, number of contour points, roundness, rectangularity, convexity, etc.; perform circle fitting and rectangle fitting on the preliminarily screened contours respectively; calculate the circular index and rectangular index of the preliminarily screened contours, and further screen using the sizes of the circular index and rectangular index; classify the features for the remaining contours according to the sizes of the circular index and rectangular index; determine the feature size parameters for the classified contours in combination with the results of circle fitting and rectangle fitting.
[0028] Further, step S3 includes the following processes: S31. Connected contour extraction. First, binarize the current feature group using OTSU, and then use the connected component contour extraction method to obtain all the connected contours in the current feature group.
[0029] S32. Perform a preliminary screening on the extracted connected contours to remove interfering contours and obtain the feature contours.
[0030] Screen the extracted all connected contours through area, number of contour points, roundness, rectangularity, convexity, etc. The preliminary screening method is as follows: Remove the contours with a closed area less than the specified number of pixels or the difference between the closed area and the ROI image area of the feature group is less than the specified number of pixels; Remove the contours with the number of contour points less than the specified number; Remove the contours with rectangularity less than the threshold; Remove the contours with roundness less than the threshold; Remove the contours with convexity less than the threshold.
[0031] In the embodiment of the present invention, the exemplary selection rules are as follows: (1) Remove the contours with a closed area less than 5 pixels or the contours with a difference between the closed area and the ROI image area of the feature group less than 5 pixels; (2) Remove the contours with less than 8 contour points; (3) Remove the contours with a rectangularity less than 0.5; (4) Remove the contours with a circularity less than 0.5; (5) Remove the contours with a convexity less than 0.75.
[0032] S33. Fit the feature contours of each of the feature groups to determine the shape parameters of the feature contours.
[0033] Perform circular fitting and rectangular fitting on the feature contours after preliminary screening respectively. For the current feature contour, use the iterative weighted least squares circle fitting method to calculate the circle fitting and obtain the circular parameters that best fit the current contour. At the same time, use methods such as Hough transform and inverse transform, the relationship between the four sides of the rectangle, and iterative weighted least squares line fitting for the same feature contour to perform rectangular fitting and obtain the rectangular parameters that best fit the current contour. Specifically, first use Hough transform and inverse transform to obtain multiple straight line point sets and the approximate angles corresponding to each straight line point set, where the angle step of the Hough transform is set to 1 degree, the shortest straight line length is set to 4 pixels, and the minimum spacing is set to 1 pixel; then use the angle constraint that the adjacent sides of the rectangle are perpendicular to each other and the opposite sides are parallel to each other for rectangle combination, where the angle threshold for perpendicular and parallel determination is set to 5°; then use the iterative weighted least squares method to perform line fitting on a group of straight lines that meet the conditions respectively, and calculate the intersection points of the four sides after fitting and the straight line angles; finally, calculate the center, length, and width of the rectangle using the four corner points, and calculate the angle of the rectangle using the angles of the four straight lines.
[0034] S34. Fit the feature contours of each of the feature groups to determine the shape parameters of the feature contours, so as to achieve re-screening and classification of the contours.
[0035] Calculate the circular index and rectangular index of the contours after preliminary screening respectively, and perform re-screening and feature classification of the contours according to the magnitudes of the circular index and rectangular index. Specifically, for the current contour, calculate the circular index Rc using formula (1) and calculate the rectangular index Rr using formula (2).
[0036] Rc = α×E + β× Tc (1) Among them, E represents the circularity of the feature contour, Tc represents the proportion of the number of inliers after circular fitting of the feature contour to the total number of contour points before fitting. The inliers are the points among the total contour points before fitting that are less than a specified number of pixels away from the boundary of the circle fitting. α and β are weighting coefficients, and α + β = 1. In this embodiment, α is taken as 0.6 and β is taken as 0.4.
[0037] Rr = α × R + β × Tr (2) Among them, R represents the rectangularity of the feature contour, Tr represents the proportion of the number of inliers after rectangular fitting of the feature contour to the total number of contour points before fitting. The inliers are the points among the total contour points before fitting that are less than a specified number of pixels away from the boundary of the rectangle fitting. α and β are weighting coefficients, and α + β = 1. In this embodiment, α is taken as 0.6 and β is taken as 0.4.
[0038] Further, according to the magnitudes of Rc and Rr, retain the feature contours that meet the preset requirements and determine the shape parameters of the feature contours, specifically: If Rc < 0.5 and Rr < 0.5, then screen out the corresponding feature contours, otherwise retain them; If Rc > Rr, then determine that the feature contour is circular; if Rc < Rr, then determine that the feature contour is rectangular.
[0039] S35. Calculation of contour feature parameters. For each retained contour, according to its feature classification situation, use the corresponding circular parameters or rectangular parameters as the size parameters of the current feature.
[0040] S4. Statistically analyze the shape parameters of the feature contours retained in all the feature groups, and determine the component type according to the statistical results.
[0041] Automatically classify the components by using the number, feature type, feature distribution, etc. of the feature contours retained in all the feature groups. The specific classification rules are as follows: (1)When the number of the feature contours is unique: If the shape is rectangular, then determine that the component is a Chip component; if the shape is circular, then determine that the component is a BGA component; (2)When the number of the feature contours is not unique: If both circular and rectangular shapes of the feature contours exist, determine that the component is a special-shaped component; If the shapes of the feature contours are all circular, the fluctuation of the fitting circle diameter is within the threshold range, and the distribution is in a grid pattern, determine that the component is a BGA component; If the shapes of the feature contours are all rectangular, they are distributed in the NSEW directions, and the fluctuations of the lengths and widths of the fitting rectangles in the same direction are within the threshold range, determine that the component is a multi-pin component; (3)For those that do not meet the conditions in (1) and (2) above, the component is determined to be a special-shaped component.
[0042] S5. Based on the determined component type, integrate the shape parameters of the feature profiles in each of the feature groups to obtain the complete component feature parameters.
[0043] According to the classification result, combine the feature parameters, feature positions and other parameters of the remaining profiles in each feature group to calculate the overall length and width of the component and the feature description parameters. The integration is carried out according to the statistical results of the shape parameters of the remaining feature profiles in the feature group, and the process is as follows: (1)When the component type is a Chip component, the length and width of the fitting rectangle of the only feature profile are used as the length and width of the complete component.
[0044] (2)When the component type is a BGA component, the method for feature integration of the BGA component and obtaining the complete component parameters is as follows: Take the average value of the circle fitting diameters of all the remaining feature profiles in each feature group as the terminal diameter of the BGA component; Take the average value of the distances between the circle fitting centers of two adjacent profiles in the horizontal direction among all the remaining feature profiles in each feature group as the distribution pitch of the BGA component terminals in the horizontal direction; Take the average value of the distances between the circle fitting centers of two adjacent profiles in the vertical direction among all the remaining feature profiles in each feature group as the distribution pitch of the BGA component terminals in the vertical direction; Obtain the maximum number of terminals of the BGA component in the horizontal direction by the ratio of the horizontal distance between the circle fitting centers of the two farthest profiles in the horizontal direction among all the remaining feature profiles in each feature group to the distribution pitch of the BGA component terminals in the horizontal direction; Obtain the maximum number of terminals of the BGA component in the vertical direction by the ratio of the vertical distance between the circle fitting centers of the two farthest profiles in the vertical direction among all the remaining feature profiles in each feature group to the distribution pitch of the BGA component terminals in the vertical direction; Obtain the overall size of the BGA component in the horizontal direction by the maximum number of terminals of the BGA component in the horizontal direction, the distribution pitch of the BGA component terminals in the horizontal direction and the terminal diameter of the BGA component; Obtain the overall size of the BGA component in the vertical direction by the maximum number of terminals of the BGA component in the vertical direction, the distribution pitch of the BGA component terminals in the vertical direction and the terminal diameter of the BGA component.
[0045] (3)When the component type is a multi-pin component, the method for feature integration of the multi-pin component and obtaining the complete component parameters is as follows: Calculate the mean length, mean width, mean spacing between adjacent contours, and mean center coordinates of the fitting rectangles of all the retained feature contours in each of the said feature groups respectively, and use them as the feature parameters such as the pin length, pin width, pin spacing, and center coordinates of the pin group in the corresponding said feature group. Take the number of fitting rectangles as the number of pins in the pin group. According to the relative position relationship of the center coordinates of the pin groups in each of the said feature groups and the pin distribution direction, divide the pins in each group into four directions: N, S, E, and W. Calculate the maximum and minimum horizontal and vertical coordinates of the minimum bounding rectangles of the pins in each group based on the pin length, pin width, pin spacing, center coordinates, number of pins, and pin distribution direction of the pin groups in the said feature group. Determine the length and width of the complete component and the center coordinates of the complete component based on the maximum and minimum horizontal and vertical coordinates of the minimum bounding rectangle areas of the pin groups in all the said feature groups. Obtain the position offset of the pin group in each of the said feature groups based on the offset of the center coordinates of the pin group in each of the said feature groups from the center coordinates of the complete component.
[0046] The results of the feature parameters of the multi-pin component are shown as Figure 3 shown. Through the four roughly feature group images that enclose the pin feet in different directions as shown in Figure 2 shown, the complete component feature parameters can be automatically calculated, including the overall length and width dimensions, the pin length, pin width, pin spacing, pin distribution, and number of pins in each direction, and the calculated features can be completely consistent with the actual component features.
[0047] (4) When the component type is a special-shaped component, the method for feature integration of the special-shaped component and obtaining the complete component parameters is as follows: Loop through each feature group, and judge the feature types of all the retained contours in the current feature group. If there are both rectangular features and circular features, skip the current feature group. Select the feature groups whose shape parameters are all rectangles, calculate the mean length, mean width, mean spacing between adjacent contours, and mean center coordinates of the fitting rectangles of all the retained said feature contours, and use them as the feature length, feature width, feature spacing, and center coordinates of the said feature group respectively; take the number of all the retained said feature contours in the said feature group as the feature number of the said feature group; divide the distribution features of the said feature group according to the connection angle of the center coordinates of all the retained said feature contours in the said feature group; calculate the maximum and minimum horizontal and vertical coordinates of the minimum bounding rectangle of the said feature group based on the feature length, feature width, feature spacing, center coordinates, feature number, and distribution features of the said feature group. Select the feature groups where the shape parameters are all circular, calculate the mean diameter of the fitted circles of all the remaining feature contours, the mean distance between adjacent contours, and the mean center coordinates, which are respectively used as the feature diameter, feature distance, and center coordinates of the feature contours; use the number of all the remaining feature contours in the feature group as the feature number of the feature group; divide the distribution characteristics of the feature group according to the connection angles of the center coordinates of all the remaining feature contours in the feature group; calculate the maximum and minimum horizontal and vertical coordinates of the minimum bounding rectangle area of the feature group according to the feature diameter, feature distance, center coordinates, feature number, and distribution characteristics of the feature group. Determine the overall length and width of the complete component and the upper left corner coordinates of the complete component according to the maximum and minimum horizontal and vertical coordinates of the minimum bounding rectangle of each feature group; obtain the position offset of the feature group according to the offset of the center coordinates of each feature group relative to the upper left corner coordinates.
[0048] Based on the same inventive concept, in the second aspect of the embodiments of the present invention, a system for quickly obtaining component feature parameters is provided, including: A feature contour extraction module configured to extract feature contours for each feature group in the ROI area of the component, where the feature group is a group of features with the same shape and uniform distribution in the ROI area of the component; A fitting module configured to fit the feature contours of each feature group to determine the shape parameters of the feature contours; A component type determination module configured to count the shape parameters of all the feature contours and determine the component type according to the statistical results; A component parameter calculation module configured to integrate the shape parameters of the feature contours in each feature group based on the determined component type to obtain the complete component feature parameters.
[0049] Furthermore, it further includes a user interaction module, an image automatic rotation module, and a preliminary screening module. The user interaction module is configured to implement the box selection interaction of the ROI area of the component and the feature group. The image automatic rotation module is configured to extract the contour of the ROI area of the component for multi-angle rotation; count the sum of the projection extreme values of all the contours in the horizontal and vertical directions after each rotation, and use the rotation angle when the sum of the projection extreme values is the largest as the angle estimate in the ROI area of the component; rotate and correct the ROI area of the component with the estimated angle. The preliminary screening module is configured to perform preliminary screening on the connected contours of the feature group to remove interfering contours and obtain the feature contours.
[0050] Further, the process of fitting the feature profiles of each of the feature groups to determine the shape parameters of the feature profiles includes the following steps: Perform circular fitting and rectangular fitting on the feature profiles respectively to obtain the circularity index Rc and rectangularity index Rr of the feature profiles. Rc = α × E + β × Tc , Rr = α × R + β × Tr , where E represents the circularity of the feature profile, Tc represents the proportion of the number of inlier points after circular fitting of the feature profile to the total number of profile points before fitting, R represents the rectangularity of the feature profile, Tr represents the proportion of the number of inlier points after rectangular fitting of the feature profile to the total number of profile points before fitting. The inlier points are the points among the total profile points before fitting that are less than the specified number of pixels away from the fitting boundary. α and β are weight coefficients; If Rc < 0.5 and Rr < 0.5, then filter out the corresponding feature profile; otherwise, retain it; If Rc > Rr, then determine that the feature profile is circular, and use the diameter and center obtained by circular fitting of the feature profile as the diameter and center of the profile respectively. If Rc < Rr, then determine that the feature profile is rectangular, and use the length, width, and center obtained by rectangular fitting of the feature profile as the length, width, and center of the profile respectively.
[0051] A third aspect of the embodiments of the present invention provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to cause a machine to execute the above-mentioned method for quickly obtaining component feature parameters.
[0052] A fourth aspect of the embodiments of the present invention provides an electronic device, the electronic device includes: one or more processors; and a memory for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the method for quickly obtaining component feature parameters.
[0053] In summary, in the technical solution of the present invention, an operator only needs to frame out the approximate component ROI and feature group ROI to complete the automatic acquisition of component feature parameters. The operation is simple, the learning cost is low, and the requirements for the operator are low; the traditional image processing method is used to calculate the features of each feature group separately and integrate them according to certain rules, with fast processing speed and accurate parameter results; separate designs are carried out for the integration of conventional components and special-shaped components. Among them, there is no specific template form constraint for special-shaped components, and it can be applied to components of various packaging forms. This method has a wide range of applications. Therefore, the technical solution proposed by the present invention has the advantages of simple operation, low requirements for personnel, fast parameter acquisition speed, and wide application range.
[0054] The preferred embodiments of the present invention have been described in detail above in conjunction with the accompanying drawings. However, the present invention is not limited thereto. Within the technical concept of the present invention, various simple modifications can be made to the technical solutions of the present invention, including combining various specific technical features in any suitable manner. To avoid unnecessary repetition, the present invention will not separately describe various possible combination methods. However, these simple modifications and combinations should equally be regarded as the content disclosed by the present invention and all fall within the protection scope of the present invention.
Claims
1. A method for quickly obtaining component characteristic parameters, characterized in that, Including the following steps: Extract the feature contours of each feature group in the component ROI area, where the feature group is a group of features with the same shape and uniform distribution in the component ROI area; Fit the feature contours of each of the said feature groups to determine the shape parameters of the feature contours; Statistically analyze the shape parameters of all the said feature contours, and determine the component type according to the statistical results; Based on the determined component type, integrate the shape parameters of the feature contours in each of the said feature groups to obtain the complete component feature parameters.
2. The method according to claim 1, wherein The step of fitting the feature contours of each of the said feature groups to determine the shape parameters of the feature contours includes the following process: Perform circular fitting and rectangular fitting on the feature contour respectively to obtain the circular index Rc and rectangular index Rr of the feature contour, Rc = α×E + β× Tc , Rr = α×R + β× Tr , where E represents the circularity of the feature contour, Tc represents the proportion of the number of inliers after circular fitting of the feature contour to the total contour points before fitting, R represents the rectangularity of the feature contour, Tr represents the proportion of the number of inliers after rectangular fitting of the feature contour to the total contour points before fitting, the inliers are the points among the total contour points before fitting whose distance from the fitting boundary is less than the specified pixel, and α and β are weight coefficients; According to the magnitudes of Rc and Rr, retain the feature contours that meet the preset requirements and determine the shape parameters of the feature contours.
3. The method according to claim 2, wherein The step of, according to the magnitudes of Rc and Rr, retaining the feature contours that meet the preset requirements and determining the shape parameters of the feature contours is specifically as follows: If Rc < 0.5 and Rr < 0.5, then screen out the corresponding feature contours, otherwise retain them; If Rc > Rr, then determine that the feature contour is circular, and use the diameter and center obtained by fitting the circular feature contour as the diameter and center of the contour respectively. If Rc < Rr, then determine that the feature contour is rectangular, and use the length, width and center obtained by fitting the rectangular feature contour as the length, width and center of the contour respectively.
4. According to the method described in claim 2, wherein The circular fitting is performed by using the iterative weighted least squares circle fitting method; For the rectangular fitting, first use the Hough transform to obtain multiple straight line point sets and the angles of the corresponding straight lines, then use angle constraints for rectangular combination, then use straight line fitting to fit the four sides of the rectangle and calculate the intersection points and angles, and finally integrate the four corner points and angles.
5. The method according to claim 2, characterized in that Statistically analyze the shape parameters of the retained feature contours in all the said feature groups, and determine the component type according to the statistical results, specifically as follows: When the number of the feature contours is unique: If the shape is rectangular, then determine that the component is a Chip component. If the shape is circular, then determine that the component is a BGA component; When the number of the feature contours is not unique: If the feature contour shapes include both circular and rectangular at the same time, determine that the component is a special-shaped component; If the feature contour shapes are all circular, the fluctuation of the fitted circle diameter is within the threshold range and the distribution is in a grid pattern, determine that the component is a BGA component; If the feature contour shapes are all rectangular, distributed in the NSEW directions, and the fluctuation of the length and width of the fitted rectangles in the same direction is within the threshold range, determine that the component is a multi-pin component; Otherwise, determine that the component is a special-shaped component.
6. The method according to claim 5, wherein When the component type is a special-shaped component, perform the said integration according to the statistical results of the shape parameters of the retained feature contours in the feature group, and the process is as follows: Select the feature group with all shape parameters being rectangles, calculate the mean length, mean width, mean spacing between adjacent contours, and mean center coordinates of the fitted rectangles of all the remaining feature contours, and use them as the feature length, feature width, feature spacing, and center coordinates of the feature group respectively; use the number of all the remaining feature contours in the feature group as the feature number of the feature group; divide the distribution characteristics of the feature group according to the connection angle of the center coordinates of all the remaining feature contours in the feature group; calculate the maximum and minimum values of the horizontal and vertical coordinates of the minimum bounding rectangle of the feature group according to the feature length, feature width, feature spacing, center coordinates, feature number, and distribution characteristics of the feature group. Select the feature group with all shape parameters being circles, calculate the mean diameter, mean spacing between adjacent contours, and mean center coordinates of the fitted circles of all the remaining feature contours, and use them as the feature diameter, feature spacing, and center coordinates of the feature contours respectively; use the number of all the remaining feature contours in the feature group as the feature number of the feature group; divide the distribution characteristics of the feature group according to the connection angle of the center coordinates of all the remaining feature contours in the feature group; calculate the maximum and minimum values of the horizontal and vertical coordinates of the minimum bounding rectangle of the feature group according to the feature diameter, feature spacing, center coordinates, feature number, and distribution characteristics of the feature group. Determine the overall length and width of the complete component and the upper left corner coordinates of the complete component according to the maximum and minimum values of the horizontal and vertical coordinates of the minimum bounding rectangle of each feature group; obtain the position offset of the feature group according to the offset of the center coordinates of each feature group relative to the upper left corner coordinates.
7. The method according to claim 5, wherein When the component type is a Chip component, perform the integration according to the statistical results of the shape parameters of the remaining feature contours in the feature group, and the process is as follows: use the length and width of the fitted rectangle of the only feature contour as the length and width of the complete component.
8. The method according to claim 5, characterized in that When the component type is a BGA component, perform the integration according to the statistical results of the shape parameters of the remaining feature contours in the feature group, and the process is as follows: Use the mean value of the circle fitting diameters of all the remaining feature contours in each feature group as the terminal diameter of the BGA component; Use the mean value of the distances between the centers of the circle fittings of two adjacent contours in the horizontal direction among all the remaining feature contours in each feature group as the distribution spacing of the BGA component terminals in the horizontal direction; Use the mean value of the distances between the centers of the circle fittings of two adjacent contours in the vertical direction among all the remaining feature contours in each feature group as the distribution spacing of the BGA component terminals in the vertical direction; Obtain the maximum number of terminals of the BGA component in the horizontal direction by taking the ratio of the horizontal spacing between the centers of the circle fittings of the two farthest contours in the horizontal direction among all the remaining feature contours in each feature group to the distribution spacing of the BGA component terminals in the horizontal direction; Obtain the maximum number of terminals of the BGA component in the vertical direction by taking the ratio of the vertical spacing between the centers of the circle fittings of the two farthest contours in the vertical direction among all the remaining feature contours in each feature group to the distribution spacing of the BGA component terminals in the vertical direction. Obtain the overall size of the BGA component in the horizontal direction based on the maximum number of terminals of the BGA component in the horizontal direction, the distribution pitch of the BGA component terminals in the horizontal direction, and the diameter of the BGA component terminals; Obtain the overall size of the BGA component in the vertical direction based on the maximum number of terminals of the BGA component in the vertical direction, the distribution pitch of the BGA component terminals in the vertical direction, and the diameter of the BGA component terminals.
9. The method according to claim 8, wherein Calculate the distribution grid of the BGA component based on the distribution pitch, maximum number of terminals, overall size, and diameter of the BGA component terminals in the horizontal and vertical directions respectively; determine the missing situation of the BGA terminals according to whether the circle fitting center is included in the distribution grid.
10. The method according to claim 5, characterized in that, When the component type is a multi-pin component, perform the integration according to the statistical results of the shape parameters of the feature profiles retained in the feature group, and the process is as follows: Calculate the average length, average width, average spacing between adjacent profiles, and average center coordinates of the fitting rectangles of all the feature profiles retained in each feature group respectively, and use them as the feature parameters such as the pin length, pin width, pin spacing, and center coordinates of the pin group in the corresponding feature group. Use the number of fitting rectangles as the number of pins in the pin group. Divide the pins of each group into four directions: N, S, E, and W according to the relative position relationship of the center coordinates of the pin groups in each feature group and the pin distribution direction. Calculate the maximum and minimum horizontal and vertical coordinates of the minimum bounding rectangle of each group of pins based on the pin length, pin width, pin spacing, center coordinates, number of pins, and pin distribution direction of the pin group in the feature group. Determine the length and width of the complete component and the center coordinates of the complete component based on the maximum and minimum horizontal and vertical coordinates of the minimum bounding rectangle areas of each pin group in all feature groups. Obtain the position offset of the pin group in each feature group based on the offset of the center coordinates of the pin group in each feature group from the center coordinates of the complete component.
11. According to the method described in any one of claims 1-10, characterized in that, The extraction of feature profiles for each feature group in the ROI area of the component includes the following steps: Perform binary processing on the feature group using the OTSU method, and extract all connected contours using the connected domain contour extraction method. Perform preliminary screening on the extracted connected contours to remove interfering contours and obtain the feature contours.
12. The method according to claim 11, wherein The preliminary screening method is as follows: Remove the contours with a closed area less than the specified number of pixels or the contours with a difference between the closed area and the ROI image area of the feature group less than the specified number of pixels. Remove the contours with the number of contour points less than the specified number. Remove the contours with a rectangularity less than the threshold. Remove the contours with a circularity less than the threshold. Remove the contours with a convexity less than the threshold.
13. The method according to claim 11, characterized in that The ROI area of the component and each feature group are framed manually or by machine selection.
14. The method according to claim 13, characterized in that After framing the ROI area of the component, rotate and correct the ROI area of the component. Specifically: Extract the contour of the ROI area of the component and then perform multi-angle rotation. Statistically calculate the sum of the projection extreme values of all contours in the horizontal and vertical directions after each rotation, and take the rotation angle when the sum of the projection extreme values is the largest as the angle estimate in the ROI area of the component; Perform rotation correction on the ROI area of the component with the estimated angle.
15. A system for quickly obtaining component characteristic parameters, characterized in that, Including: A feature contour extraction module configured to extract feature contours for each feature group in the ROI area of the component, where the feature group is a group of features with the same shape and uniform distribution in the ROI area of the component; A fitting module configured to fit the feature contours of each feature group to determine the shape parameters of the feature contours; A component type determination module configured to statistically calculate the shape parameters of all the feature contours and determine the component type according to the statistical results; A component parameter calculation module configured to, based on the determined component type, integrate the shape parameters of the feature contours in each feature group to obtain the complete component feature parameters.
16. The system according to claim 15, wherein It further includes a user interaction module configured to implement the box selection interaction of the ROI area of the component and the feature group.
17. The system according to claim 15 or 16, characterized in that, It further includes: An image automatic rotation correction module configured to extract the contour of the ROI area of the component and perform multi-angle rotation; Statistically calculate the sum of the projection extreme values of all contours in the horizontal and vertical directions after each rotation, and take the rotation angle when the sum of the projection extreme values is the largest as the angle estimate in the ROI area of the component; perform rotation correction on the ROI area of the component with the estimated angle; A preliminary screening module configured to preliminarily screen the connected contours of the feature group to remove interfering contours and obtain the feature contours.
18. The system according to claim 17, wherein The process of fitting the feature contours of each feature group to determine the shape parameters of the feature contours includes the following steps: Perform circular fitting and rectangular fitting on the feature contour respectively to obtain the circular index Rc and rectangular index Rr of the feature contour. Rc = α×E + β× Tc , Rr = α×R + β× Tr , where E represents the circularity of the feature contour, Tc represents the proportion of the number of inliers after circular fitting of the feature contour to the total number of contour points before fitting, R represents the rectangularity of the feature contour, Tr represents the proportion of the number of inliers after rectangular fitting of the feature contour to the total number of contour points before fitting, the inliers are the points among the total contour points before fitting that are less than a specified pixel away from the fitting boundary, and α and β are weight coefficients; If Rc < 0.5 and Rr < 0.5, then screen out the corresponding feature contour, otherwise keep it; If Rc > Rr, then determine that the feature contour is circular, and take the diameter and center obtained by fitting the feature contour as a circle as the diameter and center of the contour respectively. If Rc < Rr, then determine that the feature contour is rectangular, and take the length, width and center obtained by fitting the feature contour as a rectangle as the length, width and center of the contour respectively.
19. A machine-readable storage medium storing instructions for causing a machine to execute the method for quickly obtaining component feature parameters according to any one of claims 1-14.
20. An electronic device, the electronic device comprising: One or more processors; And a memory for storing one or more programs, which when executed by the one or more processors, cause the electronic device to implement the method according to any one of claims 1-14.
Citation Information
Patent Citations
Detection and positioning method for PLCC component
CN104915963A
Patch element positioning identification method based on minimum enclosing rectangle
CN105809705A
Quad flat no-lead (QFN) element rapid and accurate identification and positioning method and device and storage medium
CN115578571A
Component classification method for automatic demonstration of chip mounter
CN116977721A
Workpiece circle fitting method and device, visual inspection system and electronic equipment
CN117218100A
Cited By
Battery positioning system and method based on visual identification
CN121170015A