Mark point center positioning method and system, electronic equipment and storage medium
By converting the original contour of the Mark point into a subcontour and fitting it, the problem of irregular Mark point center positioning is solved, and the accurate positioning of the Mark point center and patch efficiency are improved.
Patent Information
- Application Number
- CN202411729851.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-07
AI Technical Summary
During the installation process, the shape of the Mark point becomes irregular due to bending and deformation, which makes the SMT device unable to accurately locate the center coordinates of the Mark point, thereby reducing the patch efficiency.
By converting the original contour of the Mark point into each subcontour, and determining the target subcontour according to the position points in the subcontour, the circle radius obtained is cleared to clear the subcontour to be cleared, and the intermediate contour is obtained, and finally the center of the Mark point is determined based on the circle fitted by the intermediate contour.
The accurate positioning of irregular Mark point centers is achieved, the patch efficiency is improved, and the precise positioning capability of SMT equipment is ensured.
Smart Images

Figure CN119584532A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of component patch technology, and in particular to a method, system, electronic device and storage medium for locating the center of a Mark point. Background Art
[0002] Mark points are mainly used for optical positioning during solder paste printing and component placement, which can ensure that SMT (Surface Mount Technology) equipment can accurately locate PCB (Printed Circuit Board) components. However, during the placement process, the shape of the mark point is easily irregular due to bending, deformation, etc., which causes the SMT equipment to be unable to accurately locate the center coordinates of the mark point, thereby reducing the placement efficiency.
[0003] Therefore, how to locate the center of the irregular Mark point is a technical problem that needs to be solved by those skilled in the art. Summary of the invention
[0004] The main purpose of the present application is to provide a method, system, electronic device and storage medium for locating the center of a mark point, aiming to solve the technical problem of how to locate the center of an irregular mark point.
[0005] To achieve the above purpose, the present application proposes a Mark point center positioning method, which is applied to the field of component placement, and the method includes:
[0006] Convert the original contour of the Mark point into each sub-contour, and determine the target sub-contour in each sub-contour according to the position point in each sub-contour;
[0007] According to the radius of the circle obtained by fitting the target sub-contour, determining the sub-contour to be cleared in each of the sub-contours, and deleting the position points corresponding to the sub-contour to be cleared in the original contour to obtain an intermediate contour;
[0008] The center of the Mark point is determined according to the circle obtained by fitting the intermediate contour, so that the component is mounted according to the coordinates of the center.
[0009] In one embodiment, the step of determining the center of the Mark point according to the circle obtained by fitting the intermediate contour includes:
[0010] According to the radius of the circle obtained by fitting the intermediate contour and the distance between each position point on the intermediate contour and the center of the circle, each target position point is determined from each position point on the intermediate contour;
[0011] The center of the circle obtained by fitting each of the target position points is used as the center of the Mark point.
[0012] In one embodiment, the step of determining each target position point from each position point on the intermediate contour according to the radius of the circle obtained by fitting the intermediate contour and the distance between each position point on the intermediate contour and the center of the circle includes:
[0013] Subtract the distance between each position point on the intermediate contour and the center of the circle from the radius of the circle obtained by fitting the intermediate contour to obtain the difference value corresponding to each position point;
[0014] Each of the difference values is compared with a preset difference threshold value, and a position point where the difference value is less than or equal to the difference threshold value is taken as a target position point.
[0015] In one embodiment, the step of converting the original contour of the Mark point into each sub-contour includes:
[0016] Obtaining a preset contour point overlap length and a preset total number of sub-contour position points, wherein the contour point overlap length is the overlap length between two adjacent sub-contours converted from the original contour, and the total number of sub-contour position points is the number of position points in each sub-contour;
[0017] Based on the preset contour starting point, the total number of sub-contour position points and the overlapping length of the contour points, the original contour of the Mark point is converted into each sub-contour.
[0018] In one embodiment, the step of determining the sub-contour to be removed in each of the sub-contours according to the radius of the circle obtained by fitting the target sub-contours comprises:
[0019] Fitting each of the sub-contours respectively to obtain the radius of the circle to be screened corresponding to each of the sub-contours;
[0020] The radius of each circle to be screened is compared with the radius of the circle obtained by fitting the target sub-contour, and the sub-contour whose radius of the circle to be screened is larger than the radius of the circle is taken as the sub-contour to be removed.
[0021] In one embodiment, the step of determining a target sub-contour in each of the sub-contours according to the position points in each of the sub-contours comprises:
[0022] The coordinates of the position points in each of the sub-contours are respectively input into a preset arc recognition model to obtain the arc recognition results corresponding to each of the sub-contours, wherein the arc recognition model is trained using the coordinates of the position points on each preset arc as model input data and the arc recognition binary classification labels corresponding to each of the preset arcs as model training labels;
[0023] According to the arc recognition results, a sub-contour representing the arc is determined in each sub-contour, and the sub-contour corresponding to the arc is used as a target sub-contour.
[0024] In one embodiment, before the step of converting the original contour of the Mark point into each sub-contour, the method further includes:
[0025] Acquire an image of a preset position area, wherein the preset position area is an area including a Mark point image;
[0026] Threshold processing is performed on the image to obtain the original outline of the Mark point.
[0027] In addition, to solve the above problems, the present application also proposes a Mark point center positioning system, which is applied to the field of component patch, and the Mark point center positioning system includes:
[0028] A contour conversion module, used to convert the original contour of the Mark point into each sub-contour, and determine the target sub-contour in each sub-contour according to the position point in each sub-contour;
[0029] A position point clearing module, used for determining a sub-contour to be cleared in each sub-contour according to the radius of the circle obtained by fitting the target sub-contour, and deleting position points corresponding to the sub-contour to be cleared in the original contour to obtain an intermediate contour;
[0030] The center calculation module is used to determine the center of the Mark point according to the circle obtained by fitting the intermediate contour, so as to mount the component according to the coordinates of the center.
[0031] In addition, to solve the above problems, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the Mark point center positioning method as described above.
[0032] In addition, to solve the above problems, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the Mark point center positioning method as described above are implemented.
[0033] In an embodiment of the present application, by converting the original contour of the Mark point into various sub-contours, and determining the target sub-contour in each sub-contour based on the position points in each sub-contour, the original contour can be broken down into small pieces, and the center of the Mark point can be estimated in units of sub-contours, wherein the sub-contour that is most similar to the arc can be used as the target sub-contour, so that the position points in the original contour that do not belong to the true contour of the Mark point can be cleared based on the target sub-contour; then, based on the radius of the circle fitted by the target sub-contour, the sub-contour to be cleared is determined in each sub-contour, and the position points corresponding to the sub-contour to be cleared are deleted from the original contour to obtain an intermediate contour, and the position points that do not belong to the true contour of the Mark point can be cleared from the original contour based on the radius of the circle corresponding to the target sub-contour; finally, based on the circle fitted by the intermediate contour, the center of the Mark point is determined, and the components are mounted based on the coordinates of the center, and the shape of the Mark point can be restored by the circle fitted by the position points retained on the original contour, so that the center of the Mark point can be calculated based on the fitted circle. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0036] Figure 1 A flow chart of the Mark point center positioning method embodiment 1 provided in this application;
[0037] Figure 2 This is a before and after comparison diagram of the Mark point contour of a specific embodiment of the Mark point center positioning method of this application;
[0038] Figure 3 This is a schematic diagram of the horizontal coordinate values of the center of the circle corresponding to 70 tests of the Mark point center positioning method of this application;
[0039] Figure 4 This is a schematic diagram of the vertical coordinate values of the center of the circle corresponding to 70 tests of the Mark point center positioning method of this application;
[0040] Figure 5 This is a schematic diagram of the radius values corresponding to 70 tests of the Mark point center positioning method in this application;
[0041] Figure 6This is a schematic diagram of the module structure of the Mark point center positioning system of the embodiment of the present application;
[0042] Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the Mark point center positioning method in the embodiment of the present application.
[0043] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0046] Mark points are mainly used for optical positioning during solder paste printing and component placement, which can ensure that SMT equipment can accurately locate PCB board components. However, during the placement process, the shape of the mark point is easily irregular due to bending, deformation, etc., which causes the SMT equipment to be unable to accurately locate the center coordinates of the mark point, thereby reducing the placement efficiency.
[0047] Therefore, how to locate the center of the irregular Mark point is a technical problem that needs to be solved by those skilled in the art.
[0048] To solve the above problem, in an embodiment of the present application, by converting the original contour of the Mark point into various sub-contours, and determining the target sub-contour in each sub-contour according to the position points in each sub-contour, the original contour can be broken down into small pieces, and the center of the Mark point can be estimated in units of sub-contours, wherein the sub-contour that is most similar to the arc can be used as the target sub-contour, so that the position points in the original contour that do not belong to the true contour of the Mark point can be cleared based on the target sub-contour; then, based on the radius of the circle fitted by the target sub-contour, the sub-contour to be cleared is determined in each sub-contour, and the position points corresponding to the sub-contour to be cleared are deleted from the original contour to obtain an intermediate contour, and the position points that do not belong to the true contour of the Mark point can be cleared from the original contour based on the radius of the circle corresponding to the target sub-contour; finally, based on the circle fitted by the intermediate contour, the center of the Mark point is determined, and the components are mounted according to the coordinates of the center, and the shape of the Mark point can be restored by the circle fitted by the position points retained on the original contour, so that the center of the Mark point can be calculated based on the fitted circle.
[0049] It should be noted that the execution subject of the Mark point center positioning method of the present application can be an electronic device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, etc. The following takes a computer as an example to illustrate various embodiments of the Mark point center positioning method of the present application.
[0050] Based on this, the present application embodiment provides a method for locating the center of a Mark point. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the Mark point center positioning method of the present application.
[0051] In this embodiment, the Mark point center positioning method is applied to the field of component placement, and the Mark point center positioning method includes steps S10 to S30:
[0052] Step S10, converting the original contour of the Mark point into various sub-contours, and determining the target sub-contour in each sub-contour according to the position points in each sub-contour;
[0053] It is understandable that a sub-contour refers to a contour between two positions in the original contour. In this embodiment, usually most of the contours in the original contour are the real contours of the Mark point, and a small part of the contours are caused by abnormal conditions such as the bending of the Mark point. In order to avoid the abnormal situation affecting the center calculation process of the Mark point, the original contour of the Mark point can be converted into various sub-contours to reduce the influence of the contour corresponding to the abnormal situation on the center calculation process.
[0054] Furthermore, when the shape of the Mark point is a circle, in order to facilitate the determination of the contour (target sub-contour) that is most similar to the true contour (standard circle) of the Mark point in each sub-contour, the shape of the sub-contour can be identified based on the position points in each sub-contour, and then the sub-contour that is most similar to the arc in the standard circle can be used as the target sub-contour.
[0055] Exemplarily, the original contour may be divided into three sub-contours, and then the contour most similar to the arc among the three sub-contours is used as the target sub-contour.
[0056] Step S20, determining a sub-contour to be removed in each of the sub-contours according to the radius of the circle obtained by fitting the target sub-contour, and deleting position points corresponding to the sub-contour to be removed in the original contour to obtain an intermediate contour;
[0057] It can be understood that the intermediate contour refers to the original contour after deleting the position points in the sub-contour to be cleared.
[0058] In this embodiment, after determining the target sub-contour, the target sub-contour can be fitted into a circle by using the least square method, the minimum circumscribed circle method, and the like, so that the radius of the circle can be obtained. Since the target sub-contour is closest to the true contour of the Mark point, the radius of the circle can be temporarily used as the radius of the Mark point. Then, based on the radius, the sub-contours that do not match the radius can be determined in other sub-contours except the target sub-contour, so that the sub-contours that need to be cleared can be obtained. Furthermore, in order to avoid the negative impact of the sub-contour to be cleared on the calculation of the center, the position points corresponding to the sub-contour to be cleared can also be deleted from the original contour, so that the intermediate contour can be obtained.
[0059] For example, when there are 810 contour points on the original contour, if the number of sub-contours is set to 3, there are 270 points in each sub-contour, and the original contour can be split into 3 sub-contours. Then, based on the similarity between each sub-contour and the arc, the sub-contour with the highest similarity can be used as the target sub-contour, and then based on the radius of the circle obtained by fitting the target sub-contour, the contour to be cleared can be determined in the remaining 2 sub-contours. For example, when the contour to be cleared is the third sub-contour, all position points corresponding to the third sub-contour are cleared in the original contour to obtain the intermediate contour.
[0060] In a feasible implementation manner, the above step S20 includes:
[0061] Step S201, fitting each of the sub-contours respectively to obtain the radius of the circle to be screened corresponding to each of the sub-contours;
[0062] It is understandable that, for each sub-contour, fitting can also be performed by the least square method or other methods to obtain the circle corresponding to each sub-contour. Then, the radius of the circle corresponding to each sub-contour can be used as the radius of the circle to be screened corresponding to each sub-contour.
[0063] Step S202 , respectively comparing the radius of each circle to be screened with the radius of the circle obtained by fitting the target sub-contour, and taking the sub-contour whose radius of the circle to be screened is larger than the radius of the circle as the sub-contour to be removed.
[0064] It is understandable that, since the target sub-contour is closest to the real contour of the Mark point, the sub-contour with a radius value greater than the radius of the circle corresponding to the target sub-contour can be used as the sub-contour corresponding to the abnormal situation. Thus, the sub-contour corresponding to the abnormal situation can be used as the sub-contour to be cleared.
[0065] In this embodiment, by comparing the radius of the circle obtained by fitting the target sub-contour with the radius of the circle obtained by fitting each sub-contour, the contour corresponding to the abnormal situation in the original contour can be easily determined, thereby facilitating the subsequent removal of the abnormal contour to improve accuracy.
[0066] Step S30, determining the center of the Mark point according to the circle obtained by fitting the intermediate contour, so as to mount the component according to the coordinates of the center.
[0067] It is understandable that after obtaining the intermediate contour, the position points on the intermediate contour can be identified as points on the real contour of the Mark point. Therefore, the circle corresponding to the intermediate contour can be fitted again based on the intermediate contour, so that the center of the circle corresponding to the intermediate contour can be used as the center of the Mark point, so as to perform steps such as component placement based on the coordinates of the center.
[0068] In an embodiment of the present application, by converting the original contour of the Mark point into various sub-contours, and determining the target sub-contour in each sub-contour based on the position points in each sub-contour, the original contour can be broken down into small pieces, and the center of the Mark point can be estimated in units of sub-contours, wherein the sub-contour that is most similar to the arc can be used as the target sub-contour, so that the position points in the original contour that do not belong to the true contour of the Mark point can be cleared based on the target sub-contour; then, based on the radius of the circle fitted by the target sub-contour, the sub-contour to be cleared is determined in each sub-contour, and the position points corresponding to the sub-contour to be cleared are deleted from the original contour to obtain an intermediate contour, and the position points that do not belong to the true contour of the Mark point can be cleared from the original contour based on the radius of the circle corresponding to the target sub-contour; finally, based on the circle fitted by the intermediate contour, the center of the Mark point is determined, and the components are mounted based on the coordinates of the center, and the shape of the Mark point can be restored by the circle fitted by the position points retained on the original contour, so that the center of the Mark point can be calculated based on the fitted circle.
[0069] Furthermore, based on the first embodiment of the Mark point center positioning method of the present application, a second embodiment of the Mark point center positioning method of the present application is proposed.
[0070] In this embodiment, the above step S30 includes:
[0071] Step S301, determining each target position point from each position point on the intermediate contour according to the radius of the circle obtained by fitting the intermediate contour and the distance between each position point on the intermediate contour and the center of the circle;
[0072] It should be noted that the target position point refers to the position point belonging to the real contour of the Mark point that is further evaluated based on the intermediate contour.
[0073] Step S302: The center of the circle fitted by each of the target position points is used as the center of the Mark point.
[0074] It can be understood that after obtaining the circle determined based on the intermediate contour, the distance between each position point on the intermediate contour and the center of the circle can be compared with the radius of the circle respectively, so that the position point that actually belongs to the true contour of the Mark point can be further determined among the various position points in the intermediate contour, so as to improve the accuracy of the calculated center.
[0075] In a feasible implementation manner, the above step S301 includes:
[0076] Step S3011, subtracting the distance between each position point on the intermediate contour and the center of the circle from the radius of the circle obtained by fitting the intermediate contour, to obtain the difference value corresponding to each position point;
[0077] Step S3012: compare each of the difference values with a preset difference threshold value, and take a position point whose difference value is less than or equal to the difference threshold value as a target position point.
[0078] It can be understood that the difference threshold is the standard for determining the target position point. The smaller the difference threshold, the smaller the difference between the calculated center of the circle and the true center of the Mark point. The larger the difference threshold, the greater the difference between the calculated center of the circle and the true center of the Mark point.
[0079] After obtaining the distance between each position point on the intermediate contour and the center of the circle, the distance can be subtracted from the radius of the circle to obtain each difference value. Then, the target position point can be determined from each position point on the intermediate contour according to the size of the difference value.
[0080] Exemplarily, when the difference value corresponding to a certain position point on the intermediate contour is 1 and the difference threshold is 3, the position point can be used as the target position point.
[0081] In this embodiment, the present application removes edge burrs on the middle contour by further processing the position points on the middle contour and screening out the target position points, thereby further improving the probability of accurately locating the center.
[0082] Furthermore, based on the first embodiment and / or the second embodiment of the Mark point center positioning method of the present application, a third embodiment of the center calculation method of the present application is proposed.
[0083] In this embodiment, the above step S10 includes:
[0084] Step S101, obtaining a preset contour point overlap length and a preset total number of sub-contour position points, wherein the contour point overlap length is the overlap length between two adjacent sub-contours converted from the original contour, and the total number of sub-contour position points is the number of position points in each sub-contour;
[0085] Step S102: based on the preset contour starting point, the total number of sub-contour position points and the contour point overlap length, the original contour of the Mark point is converted into each sub-contour.
[0086] It should be noted that the contour starting point refers to a pre-set position point used to represent the starting position of the sub-contour division.
[0087] It is understandable that, for the original contour, if the original contour is directly split as in the first embodiment, the number of sub-contours obtained is small under the premise that the total number of sub-contour position points is large. For example, when the number of position points of the original contour is 810, if the number of sub-contours is 270, there are only 3 sub-contours. Therefore, in the subsequent step of determining the center, a large deviation will be generated due to the small number of sub-contours.
[0088] Therefore, in this embodiment, the original contour can be reused according to the overlapping length of the contour points, that is, after all the position points on the original contour are used once, a new round of reuse can be performed starting from the contour starting point. Therefore, a large number of sub-contours can be obtained under the premise that the total number of sub-contour position points is large, thereby improving the accuracy of center calculation.
[0089] Exemplarily, when the total number of position points of the original contour is 810, the total number of sub-contours is 20, the contour point overlap length is 40, and the total number of sub-contour position points is 270, the first sub-contour is [1,270], the second sub-contour is [40,309], ..., until the 20th sub-contour is obtained.
[0090] Furthermore, based on the above-mentioned embodiments of the Mark point center positioning method of the present application, a fourth embodiment of the Mark point center positioning method of the present application is proposed.
[0091] In this embodiment, the above step S10 further includes:
[0092] Step S103, respectively inputting the coordinates of the position points in each of the sub-contours into a preset arc recognition model to obtain arc recognition results corresponding to each of the sub-contours, wherein the arc recognition model is trained using the coordinates of the position points on each preset arc as model input data and the arc recognition binary classification labels corresponding to each of the preset arcs as model training labels;
[0093] It can be understood that the arc recognition model is a pre-trained model used to determine whether a set of input coordinates belongs to an arc. The arc recognition result is the conclusion output by the arc recognition model to characterize whether each input coordinate can form an arc. The arc recognition binary classification label is the manually determined conclusion of whether an arc can be formed.
[0094] Step S104 , determining a sub-contour representing the arc in each of the sub-contours according to the arc recognition results, and taking the sub-contour corresponding to the arc as a target sub-contour.
[0095] It can be understood that after obtaining the arc recognition results corresponding to each sub-contour, the sub-contour belonging to the arc can be used as the target sub-contour to serve as a basis for subsequently determining the intermediate contour.
[0096] It should be noted that when only one sub-contour in each sub-contour is an arc, the sub-contour corresponding to the arc is the target sub-contour. When there are multiple arcs in each sub-contour, any one of the multiple arcs can be selected as the target sub-contour.
[0097] In this embodiment, the present application can determine the target sub-contour in each sub-contour based on the arc recognition model, thereby improving the intelligence of the Mark point center determination.
[0098] Furthermore, based on the above-mentioned embodiments of the Mark point center positioning method of the present application, a fifth embodiment of the Mark point center positioning method of the present application is proposed.
[0099] In this embodiment, before the above step S10, the method further includes:
[0100] Step S100, acquiring an image of a preset position area, wherein the preset position area is an area including a Mark point image;
[0101] Step S200, performing threshold processing on the image to obtain the original outline of the Mark point.
[0102] It is understandable that the area where the Mark point is located on the PCB board component is pre-set, but in the patch process, the center of the Mark point needs to be accurately located. Therefore, an image of the area where the Mark point is located can be obtained, and then the original outline of the Mark point can be extracted through threshold processing.
[0103] It should be noted that threshold processing means: according to the threshold value set by the pixel brightness or color value of the Mark point area, all pixels above (or below, depending on the threshold type) the threshold are set to white (or black), and the remaining pixels are set to black (or white). Thus, the boundary of the pixel can be identified by the edge detection algorithm, and then the original outline of the Mark point can be obtained.
[0104] In this embodiment, the present application can automatically extract the original outline of the Mark point by image processing, thereby improving the portability of determining the center of the Mark point.
[0105] Furthermore, based on the above-mentioned embodiments of the Mark point center positioning method of the present application, a specific embodiment of the Mark point center positioning method of the present application is proposed.
[0106] Please refer to Figure 2 , Figure 2 This is a before and after comparison diagram of the Mark point contour of a specific embodiment of the Mark point center positioning method of this application. Among them, Figure 2 The original outline is on the left. Figure 2 The right side shows the Mark point outline restored based on the original outline.
[0107] Specifically, based on Figure 2 The left side gets Figure 2 The steps on the right could be:
[0108] Take a certain number of the total number of position points of the original contour (assuming 810) as the size a of the new contour (the total number of sub-contour position points), and take a fixed value b as the overlapping part (contour point overlapping length), divide the Mark point contour into i (the total number of sub-contours) contours of size a, and repeat the value of the insufficient area, and then fit circles to these contours respectively;
[0109] For example, assuming that there are 810 points in total for the Mark contour, 810 / 20, i.e., b=40, are taken as the overlapping part, and the size of the new contour a is 810 / 3, i.e., 270 points. The Mark contour is divided into 20 new contours for calculation, and the position points of the new contour are taken in a circular manner using i*b+a. When the value of i*b+a is greater than the number of total contours c, the starting position of the total contour c is reassigned until 20 new contours are taken out.
[0110] Since the starting point S of the original contour is on the arc segment, the radius R of the first fitted circle can be used as the standard to obtain the radii of the remaining fitted circles and record the position points of the circles larger than the radius R. The recorded data is removed from the contour points of the total contour (the position points of the fitted circles with a radius larger than R include the horizontal edge points), and the remaining position points are re-fitted into a new circle to obtain the radius r;
[0111] Then, the distance between each point in the new circle and the center of the circle can be calculated cyclically, and the position points whose distance difference with r is greater than 3 pixels (difference threshold) are removed to prevent edge burrs. Then the remaining position points are refitted into a circle, and the result is the final circle obtained by the Mark point, and the position and radius of the center of the circle are obtained at the same time, thus obtaining Figure 2 Contour image on the right.
[0112] Further, to verify the stability of the present application, after 70 consecutive tests, the value of the horizontal coordinate x of the center of the circle is as follows: Figure 3 As shown, the value of the ordinate y is Figure 4 As shown, the value of the Mark point radius is as follows Figure 5 As shown. Among them, Figures 3 to 5 The horizontal axis of the coordinate axis is the number of tests.
[0113] exist Figure 3 Among the values of the horizontal coordinates of the center of the circle corresponding to the 70 tests shown, the maximum value did not reach 2421.5, and the minimum value did not reach 2420.6. It can be seen that in the values of x, the difference between the maximum and minimum values is within one pixel. Similarly, in Figure 4 In , the difference between the maximum and minimum values of y is also within one pixel. Figure 5 In the example, for the radius, the difference between the maximum and minimum values is also within one pixel. It can be seen that the position of the center of the circle calculated by the present application is stable, and thus, the position of the center of the Mark point calculated by the present application is also stable.
[0114] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the Mark point center positioning method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0115] This application also provides a Mark point center positioning system, please refer to Figure 6 The Mark point center positioning system is applied to the field of component placement. The Mark point center positioning system includes:
[0116] The contour conversion module 10 is used to convert the original contour of the Mark point into each sub-contour, and determine the target sub-contour in each sub-contour according to the position point in each sub-contour;
[0117] A position point clearing module 20 is used to determine a sub-contour to be cleared in each sub-contour according to the radius of the circle obtained by fitting the target sub-contour, and to delete the position points corresponding to the sub-contour to be cleared in the original contour to obtain an intermediate contour;
[0118] The center calculation module 30 is used to determine the center of the Mark point according to the circle obtained by fitting the intermediate contour, so as to mount the component according to the coordinates of the center.
[0119] In one embodiment, the central computing module 30 is further used for:
[0120] According to the radius of the circle obtained by fitting the intermediate contour and the distance between each position point on the intermediate contour and the center of the circle, each target position point is determined from each position point on the intermediate contour;
[0121] The center of the circle obtained by fitting each of the target position points is used as the center of the Mark point.
[0122] In one embodiment, the central computing module 30 is further used for:
[0123] Subtract the distance between each position point on the intermediate contour and the center of the circle from the radius of the circle obtained by fitting the intermediate contour to obtain the difference value corresponding to each position point;
[0124] Each of the difference values is compared with a preset difference threshold value, and a position point where the difference value is less than or equal to the difference threshold value is taken as a target position point.
[0125] In one embodiment, the profile conversion module 10 is further configured to:
[0126] Obtaining a preset contour point overlap length and a preset total number of sub-contour position points, wherein the contour point overlap length is the overlap length between two adjacent sub-contours converted from the original contour, and the total number of sub-contour position points is the number of position points in each sub-contour;
[0127] Based on the preset contour starting point, the total number of sub-contour position points and the overlapping length of the contour points, the original contour of the Mark point is converted into each sub-contour.
[0128] In one embodiment, the location point clearing module 20 is further used for:
[0129] Fitting each of the sub-contours respectively to obtain the radius of the circle to be screened corresponding to each of the sub-contours;
[0130] The radius of each circle to be screened is compared with the radius of the circle obtained by fitting the target sub-contour, and the sub-contour whose radius of the circle to be screened is larger than the radius of the circle is taken as the sub-contour to be removed.
[0131] In one embodiment, the profile conversion module 10 is further configured to:
[0132] The coordinates of the position points in each of the sub-contours are respectively input into a preset arc recognition model to obtain the arc recognition results corresponding to each of the sub-contours, wherein the arc recognition model is trained using the coordinates of the position points on each preset arc as model input data and the arc recognition binary classification labels corresponding to each of the preset arcs as model training labels;
[0133] According to the arc recognition results, a sub-contour representing the arc is determined in each sub-contour, and the sub-contour corresponding to the arc is used as a target sub-contour.
[0134] In one embodiment, the Mark point center positioning system includes:
[0135] An image acquisition module, used to acquire an image of a preset position area, wherein the preset position area is an area including a Mark point image;
[0136] The image processing module is used to perform threshold processing on the image to obtain the original outline of the Mark point.
[0137] The Mark point center positioning system provided by the present application adopts the Mark point center positioning method in the above-mentioned embodiment, which can solve the technical problem of how to locate the center of an irregular Mark point. Compared with the prior art, the beneficial effects of the Mark point center positioning system provided by the present application are the same as the beneficial effects of the Mark point center positioning method provided by the above-mentioned embodiment, and other technical features of the Mark point center positioning system are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0138] The present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the Mark point center positioning method in the above-mentioned embodiment one.
[0139] Reference below Figure 7 , which shows a schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present application. Figure 7 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0140] like Figure 7 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0141] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0142] The electronic device provided by the present application adopts the Mark point center positioning method in the above embodiment, which can solve the technical problem of how to locate the center of an irregular Mark point. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the Mark point center positioning method provided in the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0143] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0144] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0145] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the Mark point center positioning method in the above-mentioned embodiment.
[0146] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0147] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0148] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device: converts the original contour of the Mark point into various sub-contours, and determines the target sub-contour in each sub-contour according to the position points in each sub-contour; determines the sub-contour to be cleared in each sub-contour according to the radius of the circle fitted by the target sub-contour, and deletes the position points corresponding to the sub-contour to be cleared in the original contour to obtain an intermediate contour; determines the center of the Mark point according to the circle fitted by the intermediate contour, so as to mount the component according to the coordinates of the center.
[0149] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0150] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0151] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0152] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned Mark point center positioning method, and can solve the technical problem of how to locate the center of irregular Mark points. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the Mark point center positioning method provided in the above-mentioned embodiment, and will not be repeated here.
[0153] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned Mark point center positioning method when executed by a processor.
[0154] The computer program product provided by this application can solve the technical problem of how to locate the center of irregular Mark points. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the Mark point center positioning method provided by the above embodiment, which will not be repeated here.
[0155] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for locating the center of a Mark point, characterized in that: The Mark point center positioning method is applied to the field of component patch, and the Mark point center positioning method includes: Convert the original contour of the Mark point into each sub-contour, and determine the target sub-contour in each sub-contour according to the position point in each sub-contour; According to the radius of the circle obtained by fitting the target sub-contour, determining the sub-contour to be cleared in each of the sub-contours, and deleting the position points corresponding to the sub-contour to be cleared in the original contour to obtain an intermediate contour; The center of the Mark point is determined according to the circle obtained by fitting the intermediate contour, so that the component is mounted according to the coordinates of the center.
2. The Mark point center positioning method according to claim 1, characterized in that: The step of determining the center of the Mark point according to the circle obtained by fitting the intermediate contour comprises: According to the radius of the circle obtained by fitting the intermediate contour and the distance between each position point on the intermediate contour and the center of the circle, each target position point is determined from each position point on the intermediate contour; The center of the circle obtained by fitting each of the target position points is used as the center of the Mark point.
3. The Mark point center positioning method as claimed in claim 2, characterized in that: The step of determining each target position point from each position point on the intermediate contour according to the radius of the circle obtained by fitting the intermediate contour and the distance between each position point on the intermediate contour and the center of the circle comprises: Subtract the distance between each position point on the intermediate contour and the center of the circle from the radius of the circle obtained by fitting the intermediate contour to obtain the difference value corresponding to each position point; Each of the difference values is compared with a preset difference threshold value, and a position point where the difference value is less than or equal to the difference threshold value is taken as a target position point.
4. The Mark point center positioning method according to claim 1, characterized in that: The step of converting the original contour of the Mark point into each sub-contour comprises: Obtaining a preset contour point overlap length and a preset total number of sub-contour position points, wherein the contour point overlap length is the overlap length between two adjacent sub-contours converted from the original contour, and the total number of sub-contour position points is the number of position points in each sub-contour; Based on the preset contour starting point, the total number of sub-contour position points and the overlapping length of the contour points, the original contour of the Mark point is converted into each sub-contour.
5. The Mark point center positioning method according to claim 1, characterized in that: The step of determining the sub-contour to be cleared in each of the sub-contours according to the radius of the circle obtained by fitting the target sub-contours comprises: Fitting each of the sub-contours respectively to obtain the radius of the circle to be screened corresponding to each of the sub-contours; The radius of each circle to be screened is compared with the radius of the circle obtained by fitting the target sub-contour, and the sub-contour whose radius of the circle to be screened is larger than the radius of the circle is taken as the sub-contour to be removed.
6. The Mark point center positioning method according to claim 1, characterized in that: The step of determining a target sub-contour in each of the sub-contours according to the position points in each of the sub-contours comprises: The coordinates of the position points in each of the sub-contours are respectively input into a preset arc recognition model to obtain the arc recognition results corresponding to each of the sub-contours, wherein the arc recognition model is trained using the coordinates of the position points on each preset arc as model input data and the arc recognition binary classification labels corresponding to each of the preset arcs as model training labels; According to the arc recognition results, a sub-contour representing the arc is determined in each sub-contour, and the sub-contour corresponding to the arc is used as a target sub-contour.
7. The method for locating the center of a Mark point according to any one of claims 1 to 6, characterized in that: Before the step of converting the original contour of the Mark point into each sub-contour, the method further comprises: Acquire an image of a preset position area, wherein the preset position area is an area including a Mark point image; Threshold processing is performed on the image to obtain the original outline of the Mark point.
8. A Mark point center positioning system, characterized in that: The Mark point center positioning system is applied to the field of component patch, and the Mark point center positioning system comprises: A contour conversion module, used to convert the original contour of the Mark point into each sub-contour, and determine the target sub-contour in each sub-contour according to the position point in each sub-contour; A position point clearing module, used for determining a sub-contour to be cleared in each sub-contour according to the radius of the circle obtained by fitting the target sub-contour, and deleting position points corresponding to the sub-contour to be cleared in the original contour to obtain an intermediate contour; The center calculation module is used to determine the center of the Mark point according to the circle obtained by fitting the intermediate contour, so as to mount the component according to the coordinates of the center.
9. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the Mark point center positioning method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the Mark point center positioning method according to any one of claims 1 to 7 are implemented.