Sorting and nesting analysis method based on image processing

By using image processing technology to draw contour maps and dynamically adjust the distribution of magnetic columns, the problem that the nesting file cannot provide position guidance is solved, efficient and automated sorting is achieved, and the efficiency of part magnetization and calculation speed are improved.

CN120707461APending Publication Date: 2025-09-26湖南天桥嘉成智能科技有限公司
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510463331.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In the existing technology, nesting files cannot provide position guidance for parts sorting, resulting in large differences in the contours of different parts and uneven magnetic distribution. Relying on manual magnetization is inefficient and prone to errors.

Method used

Through image processing technology, contour maps are drawn, part coordinates are extracted and mapping relationships are established, the magnetic column distribution is dynamically adjusted, and the magnetic distribution calculation process is optimized by combining asynchronous programming to achieve parallel processing of multiple parts.

Benefits of technology

It achieves high-precision and high-efficiency automated sorting, significantly improves the efficiency of magnetic matching, increases the calculation speed by more than 50%, and automatically completes the magnetic matching calculation of more than 95% of parts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120707461A_ABST
    Figure CN120707461A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing-based sorting and nesting analysis method, which comprises the following steps of: S1, drawing a part contour diagram according to a nesting file, extracting part contour points and establishing a mapping relationship between part names and the contour points; s2, extracting a closed curve, determining a nesting relation, and collecting the closed curve into a part contour set; s3, establishing a mapping relation between part names and contours through contour matching; s4, the minimum enclosing rectangle of the part is calculated, and a center coordinate and a rotation angle are obtained; s5, based on the tooling magnetic column layout, generating a gray scale increasing magnetic column distribution projection drawing; s6, the magnetic column distribution projection drawing serves as a mask to be overlaid on part filling, and the opening and closing radius of the tooling is dynamically adjusted till the number of magnetized magnetic columns meets the requirement or reaches the minimum radius; and S7, optimizing a magnetic distribution calculation process based on asynchronous programming. According to the invention, the magnetic matching calculation of more than 95% of parts can be automatically completed, and high-precision, high-efficiency and high-compatibility automatic sorting is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of automatic parts sorting, and in particular, relates to a sorting and nesting analysis method based on image processing. Background Art

[0002] Laser cutting is a processing method that uses the high energy density of a focused laser beam to achieve plate cutting. After the cutting machine cuts the steel plate according to the nesting pattern, it is sorted by a robot using an end picker. The end of the end picker is two openable and closable magnetic suction devices, each with several electromagnetic magnetic columns. After magnetization, they can suck up the parts cut from the steel plate. However, the opening and closing radius and the magnetic columns that need to be magnetized are also different for parts of different shapes. Therefore, it is necessary to perform magnetization calculations for different parts separately to obtain the opening and closing radius and the magnetic columns that need to be magnetized.

[0003] The content described in the nesting file mainly provides guidance for the cutting path of the cutting machine and cannot provide position guidance for part sorting and unloading. In addition, the contours of different parts vary greatly (such as narrow and long shapes, polygons, etc.), and the number of activated magnetic columns and the opening and closing radius need to be dynamically adjusted according to the part's geometric characteristics. If the part has grooves or hollow structures, it may lead to uneven magnetic force distribution, affecting the adsorption stability. Currently, the magnetic distribution for part sorting relies on manual magnet distribution, which is inefficient and prone to errors.

[0004] The existing patent publication number CN117576138A discloses a nesting diagram parsing method, device, computer equipment, storage medium and computer program product. The method includes: obtaining a workpiece nesting diagram file, and extracting multiple graphic elements from the workpiece nesting diagram file; performing contour extraction based on each of the graphic elements to obtain a closed contour in the workpiece nesting diagram file; determining the workpiece contour information of the workpiece in the workpiece nesting diagram file based on the closed contour; parsing the workpiece contour information to obtain the key information of the workpiece in the workpiece nesting diagram file. This patent only focuses on the contour extraction of the nesting diagram and the classification of workpieces (such as micro-connection points and mini-parts identification), and does not involve the core technology of the sorting link - magnetic distribution calculation (such as magnetic column magnetization determination and opening and closing radius optimization). It relies on fixed algorithms (such as DFS traversal and area sorting) to extract contours, and does not introduce dynamic iteration strategies or asynchronous programming optimization, which limits efficiency when processing complex parts. Summary of the Invention

[0005] The present invention is mainly aimed at the fact that the content described in the nesting file in the prior art mainly provides guidance for the cutting path of the cutting machine, and cannot provide position guidance for parts sorting and unloading. In addition, the contours of different parts vary greatly (such as narrow and long shapes, polygons, etc.), and the activation number and opening and closing radius of the magnetic columns need to be dynamically adjusted according to the geometric characteristics of the parts. If the parts have grooves or hollow structures, it may cause uneven magnetic distribution and affect the adsorption stability. At present, the magnetic matching for parts sorting relies on manual matching, which is inefficient and prone to errors. A sorting nesting analysis method based on image processing is proposed.

[0006] A sorting and nesting analysis method based on image processing includes the following steps:

[0007] S1. Draw the outline according to the nesting file, extract the coordinates of several points of each part, save them and establish the mapping relationship between the part name and the coordinates;

[0008] S2. Extract all closed curves based on the contour image of step S1, calculate the size and position relationship and determine the nesting relationship of the closed curves, distinguish the part body and the opening by performing a nesting layer modulo 2 operation, and group the nested contours into a part contour set;

[0009] S3, matching the discrete point coordinates in step S1 with the contour set to establish a mapping relationship between the part name and the contour;

[0010] S4. Calculate the minimum circumscribed rectangle of the part's outer contour based on the outer contours in the contour set, and determine its center coordinates and rotation angle;

[0011] S5. Perform magnetic analysis on a single part and generate a magnetic column distribution projection with increasing grayscale based on the magnetic column layout of the end pickup, where the filling grayscale value of each magnetic column increases by a fixed value;

[0012] S6. Using the center coordinates as a reference, superimpose the magnetic column distribution projection map as a mask on the part filling map according to the maximum opening and closing radius, and determine the magnetic columns to be magnetized and the opening and closing radius of the end picker by grayscale value matching; dynamically adjust the opening and closing radius of the end picker until the magnetization quantity meets the conditions or reaches the minimum opening and closing radius; the process of dynamically adjusting the opening and closing radius of the end picker is based on the nested layer modulo 2 operation result of step S2, eliminating the interference of the opening area on the magnetization determination of the magnetic columns;

[0013] S7. Optimize the magnetic distribution calculation process based on asynchronous programming to achieve parallel processing of multiple parts.

[0014] Furthermore, in step S1, the nested part includes geometric parameters of line segments, arcs, and circles, which are converted at a ratio of 1 pixel to 1 mm during drawing, and the coordinates of key points of the part are saved.

[0015] Furthermore, in step S2, the processing logic of the nested contours includes: taking the modulus of 2 according to the number of nested layers of the closed curve, distinguishing the outer contour of the part from the inner opening contour, and grouping the nested contours of the same part into an independent set.

[0016] Furthermore, in step S4, the bottom angle of the minimum circumscribed rectangle is the rotation angle of the part, the center coordinates of the minimum circumscribed rectangle are calculated by the geometric center of the outer contour, and the center coordinates are used as the center of mass reference.

[0017] Furthermore, in the magnetic column distribution projection diagram, the grayscale value increases linearly with an increment of 10, and the error threshold between the magnetic column projection area and the target grayscale area is ≤2%.

[0018] Furthermore, in step 6, after the magnetic column distribution projection diagram is superimposed on the part filling diagram, the areas of the superimposed image regions are calculated in sequence, and the magnetic columns that need to be magnetized are determined by matching the areas of the superimposed regions.

[0019] Furthermore, the target grayscale value after superposition is the sum of the basic grayscale value of the magnetic column and the part filling grayscale value; if the area of ​​the region after superposition is equal to the area of ​​the magnetic column, it is determined that the magnetic column needs to be magnetized and the number of magnetized magnetic columns of the slider at this position is recorded.

[0020] Furthermore, in step S6, the dynamic adjustment includes: taking the maximum opening and closing radius of the end picker as the initial value, gradually reducing it according to a fixed step size, calculating the number of magnetic columns that meet the magnetization conditions through grayscale superposition, until the magnetization number is maximized or the preset number of iterations is reached, and finally outputting the optimal opening and closing radius and magnetic column arrangement.

[0021] Furthermore, the fixed step size is the ratio of the maximum opening and closing radius to the preset number of iterations, and the maximum number of iterations is 50 times, so as to balance the calculation accuracy and processing speed.

[0022] Furthermore, during the dynamic iteration process, if the total number of magnetized magnetic columns is not reached, the parameters when the number of magnetized columns is the largest are used as the output result, and the corresponding opening and closing radius and magnetic column arrangement are recorded.

[0023] Compared with the prior art, the present invention has the following beneficial effects:

[0024] 1. The present invention is based on image analysis and processing to parse nesting files used in automatic cutting and blanking sorting of steel plates, including the calculation of the position and rotation angle of each part in the nesting diagram, as well as the calculation of the magnetic distribution of the parts. A contour diagram is drawn based on the nesting file, all closed curves in the nesting contour diagram are extracted, and the nesting relationship of the closed curves is determined based on the size and position relationship; a magnetic distribution analysis is performed on a single part, and a magnetic column distribution projection diagram is drawn according to the actual layout of the end picker. By grayscale superposition matching of the magnetic column projection and the part contour, the opening and closing radius of the end picker is dynamically adjusted to maximize the number of effective magnetic columns. The present invention solves the shortcomings of traditional sorting systems such as reliance on manual labor, low efficiency, and poor adaptability through a specific superposition method of part contours and magnetic column projections, a contour aggregation method based on the number of nested layers, a combination of the minimum circumscribed rectangle and the centroid, and a specific strategy for adjusting the opening and closing radius. It can automatically complete more than 95% of the magnetic distribution calculations for parts, achieving high-precision and high-efficiency automated sorting, and providing reliable technical support for intelligent manufacturing scenarios.

[0025] 2. The present invention calculates the part position and rotation information in the nesting diagram through image processing methods, which can be applied to nesting files of different formats. It also shortens the calculation time to 150ms / 20 pieces through asynchronous programming. Compared with manual magnet matching (30s / piece), the magnet matching efficiency is significantly improved, and the calculation speed is increased by more than 50%. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a flow chart of Example 1 of the present invention;

[0027] Figure 2 This is a projection diagram of the magnetic column distribution of the single-sided end pickup of the present invention;

[0028] Figure 3 This is a schematic diagram of the automatic magnetic matching effect of a certain part of the present invention. DETAILED DESCRIPTION

[0029] In order to clearly illustrate the technical features of the application scheme of the present invention, the present invention is described in detail below through specific implementation methods and in conjunction with the accompanying drawings.

[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.

[0031] In the present invention, unless otherwise clearly specified and limited, a first feature "above" or "below" a second feature may be such that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. In the description of this specification, reference terms such as "one embodiment", "some embodiments", "example", "specific example" or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in an appropriate manner in any one or more embodiments or examples.

[0032] Example 1

[0033] like Figure 1 and Figure 2 As shown, a sorting and nesting analysis method based on image processing includes the following steps:

[0034] S1. Draw the outline according to the nesting file, extract the coordinates of several points of each part, save them and establish the mapping relationship between the part name and the coordinates;

[0035] S2. Extract all closed curves based on the contour image of step S1, calculate the size and position relationship and determine the nesting relationship of the closed curves, distinguish the part body and the opening by performing a nesting layer modulo 2 operation, and group the nested contours into a part contour set;

[0036] S3, matching the discrete point coordinates in step S1 with the contour set to establish a mapping relationship between the part name and the contour;

[0037] S4. Calculate the minimum circumscribed rectangle of the part's outer contour based on the outer contours in the contour set, and determine its center coordinates and rotation angle;

[0038] S5. Perform magnetic analysis on a single part and generate a magnetic column distribution projection with increasing grayscale based on the magnetic column layout of the end pickup, where the filling grayscale value of each magnetic column increases by a fixed value;

[0039] S6. Using the center coordinates as a reference, superimpose the magnetic column distribution projection map as a mask on the part filling map according to the maximum opening and closing radius, and determine the magnetic columns to be magnetized and the opening and closing radius of the end picker by grayscale value matching; dynamically adjust the opening and closing radius of the end picker until the magnetization quantity meets the conditions or reaches the minimum opening and closing radius; the process of dynamically adjusting the opening and closing radius of the end picker is based on the nested layer modulo 2 operation result of step S2, eliminating the interference of the opening area on the magnetization determination of the magnetic columns;

[0040] S7. Optimize the magnetic distribution calculation process based on asynchronous programming. The asynchronous programming adopts a multi-thread allocation strategy, and the number of threads is dynamically matched with the number of CPU cores to achieve parallel processing of multiple parts.

[0041] In this embodiment, a certain steel plate cutting and sorting line needs to process a large number of regular rectangular parts, such as steel plate parts with a size of 200 mm×100 mm.

[0042] Image processing and contour extraction: Figure 2 As shown, in step S1, a contour map is drawn according to the nesting file. The nesting file contains the contour information of all parts of the entire steel plate, including: line segments (starting point coordinates, end point coordinates), arcs (starting point coordinates, end point coordinates, center point coordinates, radius, direction), and circles (center point coordinates, radius). Draw according to the description, generate a pixel-level mapping (1 pixel = 1 mm), and extract several points from each part contour and save them, that is, save the mapping relationship of [part name - several point coordinates]. In this example, the starting point and end point coordinates of any line segment of the rectangular part are extracted, such as [{"Part A": P11(X1, Y1), P12(X2, Y2)}, {"Part B": P21(X1, Y1), P22(X2, Y2)}, ..., {"Part N": Pn1(X1, Y1), Pn2(X2, Y2)}], where n is the number of parts included in the nesting map.

[0043] In step S2, the closed curve is located according to the contour map, all closed curves in the nesting contour map are extracted, and the nesting relationship of the closed curve is determined according to the size and position relationship. At the same time, taking into account the existence of openings inside individual parts, and that parts may be nested in the openings of other parts, the number of nested layers is modulo 2, and the even layers are defined as the outer contours, and the odd layers are defined as the internal openings, which effectively solves the confusion problem between the nested parts and the opening contours, and avoids the uneven magnetic distribution caused by the hollow structure. According to the number of nested layers and the positional relationship, the closed curve set is grouped into a part contour set [rectangular contour 1, rectangular contour 2, ..., rectangular contour n], where n is the number of parts contained in the nesting map, that is, the contour in each set corresponds to one part.

[0044] Determine whether the points extracted in step S1 are on the contours in the part contour set. When these points are on one of the contours, the part corresponding to the contour set is the part name mapped by these points, that is, the mapping relationship of [part name-contour] can be obtained [{"Part A": rectangular contour 1}, {"Part B": rectangular contour 2}, ..., {"Part N": rectangular contour n}].

[0045] The part outline is then extracted, and a hierarchy is defined based on the nested outline relationship. Part filling and drawing is then performed based on this hierarchy. Once the outline is obtained, the minimum bounding rectangle (MBR) is calculated for the outer outline (the outline with the lowest nesting level). The center coordinates are the part center coordinates, and the base angle of the MBR is the part rotation angle. In this example, the center coordinates are (100mm, 50mm), and the rotation angle is 0° (base horizontal).

[0046] Perform magnetic analysis on a single part and draw a projection of the magnetic column distribution according to the actual layout of the end pickup. 1 pixel corresponds to 1 mm in reality, and the grayscale value of each magnetic column increases by a fixed value, such as Figure 3 As shown, the five magnetic pillars on one side of the end effector have grayscale values ​​of 10, 20, 30, 40, and 50, respectively, in increments of 10. The grayscale values ​​are directly correlated to the magnetization priority of the pillars, with pillars with higher grayscale values ​​being activated first to optimize adsorption stability. Next, the longest side of the minimum circumscribed rectangle of the part is flipped to become the base, and a filled part drawing is drawn with a grayscale value of 100. The center moment determines the coordinates of the part's center of mass (X0, Y0). With the center of mass as the center, the horizontal slider starts at the maximum opening and closing radius R of the end effector, i.e., the center of the left slider is (X0-R, Y0), and the center of the right slider is (X0+R, Y0). With the center of mass as the center, where the end effector's opening and closing radius is the largest, the projection of the magnetic pillar distribution is superimposed on the filled part drawing as a mask. The magnetic pillars that require magnetization are determined by matching the area of ​​the superimposed region. The target grayscale value after superposition is the sum of the base grayscale value of the magnetic column and the grayscale value of the part filling, i.e., 100+10, 100+20, 100+30, 100+40, 100+50. This superposition also strictly matches the area of ​​the magnetic column. If the area of ​​the superpositioned region is equal to the projected area of ​​the magnetic column, the magnetic column is determined to require magnetization, and the number of magnetized magnetic columns at that slider position is recorded.

[0047] Dynamic adjustment: Using the maximum opening and closing radius as the initial value, the radius is gradually reduced at a fixed step size (maximum opening and closing radius / number of iterations), and the number of magnetized magnetic columns is recalculated in each iteration, terminating when the number of magnetized magnetic columns equals the total number of magnetic columns. When the number of magnetized magnetic columns equals the total number of magnetic columns, the distance between the current slider center and the center of mass of the part is used as the opening and closing radius of the end picker, and all magnetic columns need to be magnetized to complete the calculation and return the result. When the number of magnetized magnetic columns is less than the total number of magnetic columns, the center coordinates of the slider are translated toward the center of mass at a fixed step size to reduce the opening and closing radius, and the projection mask of the magnetic column distribution is superimposed on the filled part drawing. The area of ​​the superimposed area that meets the target grayscale is then repeatedly calculated in sequence until the number of magnetic columns equals the total number of magnetic columns.

[0048] By superimposing the grayscale incremental mask and the part filling map, combining the nested layer modulo 2 operation to eliminate the interference of the opening, and dynamically iteratively adjusting the opening and closing radius, the area of ​​the region with grayscale values ​​110 to 150 is strictly matched with the projection area of ​​the magnetic column (error ≤ 2%), ensuring that high-priority magnetic columns are activated first, significantly improving the adsorption stability of special-shaped parts.

[0049] In this embodiment, the initial opening and closing radius R = 200mm (maximum width of the end effector), the fixed step length = maximum opening and closing radius / number of iterations, the actual number of iterations is 50, and the step length can be obtained as 40mm. Through asynchronous parallel processing of 20 parts, the optimal solution is found after 15 iterations: all 5 magnetic columns meet the magnetization conditions (area = 100mm 2 ), the magnetization success rate is 100%.

[0050] Through asynchronous programming, the automatic magnetization calculation of 20 parts can be completed in 150ms. It takes 30s / part for the sorting workers to manually magnetize in the sorting system, which significantly improves the efficiency of automatic magnetization. The solution of this embodiment can automatically complete the magnetization calculation of more than 95% of the parts. The calculation method is currently used in the online project, and a total of 260 types of parts are recorded, of which 32 types of parts are not magnetized because their sizes exceed the automatic sorting range. Only 7 types of parts are manually magnetized because the automatic magnetization failed or did not meet the use requirements. The remaining parts are all automatically magnetized. In addition, for the part position and rotation information in the nesting diagram, the method of this embodiment can be applied to nesting files of different formats, and the calculation speed is increased by more than 50%.

[0051] Example 2

[0052] like Figure 1 As shown, a method for sorting and nesting parsing based on image processing is shown. In this embodiment, nested contour extraction is performed: a contour map is drawn according to a nesting file. The nesting file includes a part with an outer contour (400mm×300mm) and an inner opening contour (100mm×80mm). The contour map is drawn according to the description to generate a pixel-level mapping (1 pixel = 1mm). At the same time, several points are extracted from each part contour and saved, that is, the key coordinates of the part are saved; based on the number of nesting layers, the modulus is 2, the outer contour layer is 1, and the inner contour layer is 2. According to the number of nesting layers and positional relationships, they are grouped into a part contour set; based on whether the extracted point is on the contour, the part name corresponding to the contour is determined. After obtaining the contour, the minimum circumscribed rectangle of the outer contour (the contour with the lowest number of nesting layers) can be calculated. The coordinates of its center point are the center coordinates of the part, and the bottom angle is the rotation angle of the part.

[0053] For nested contours, only the outer contour is filled with a grayscale value of 100, and the grayscale value of the inner hole area is 0. The part is magnetically analyzed and a magnetic column distribution projection is drawn according to the actual layout of the end picker. 1 pixel corresponds to 1 mm, and the grayscale value of each magnetic column is filled with a fixed value of 10. The long side of the minimum circumscribed rectangle of the part is flipped to the bottom side, and the filled part drawing is drawn with a grayscale value of 100. The center of mass coordinates (X0, Y0) of the part can be obtained by the central moment. With the center of mass coordinates as the center, the horizontal direction is the maximum opening and closing radius R of the end picker as the starting point of the slider; the magnetic column distribution projection is superimposed on the filled part drawing as a mask, and the area of ​​the region in the superimposed image is calculated in sequence. If the area of ​​the region is equal to the area of ​​the magnetic column, it is determined that the magnetic column needs to be magnetized, and the number of magnetized magnetic columns of the slider at this position is recorded. When the magnetic column projection map (grayscale 10-50) is superimposed, the inner hole area is not included in the calculation.

[0054] Dynamic iterative optimization: When the number of magnetized magnetic poles equals the total number of poles, the distance between the current slider center and the part's center of mass is used as the end picker's opening and closing radius. All poles must be magnetized before the calculation is completed and the result is returned. When the number of magnetized magnetic poles is less than the total number of poles, the slider center coordinates are translated toward the center of mass at a fixed step size to reduce the opening and closing radius. The magnetic pole distribution projection mask is superimposed on the filled part image, and the area of ​​the superimposed image region is calculated. The loop ends when the opening and closing radius is half the slider width. At this point, the radius and arrangement of the magnetized poles at the maximum number of magnetized poles during the loop are used as the calculation result. In this embodiment, the initial opening and closing radius R = 250mm, with a fixed step size of 5mm. The area of ​​the area with a grayscale value of 110 after superposition matches the area of ​​the poles. At the 8th iteration, the number of magnetized poles reaches 4 (total 5). Adjustment continues until the 12th iteration, when the maximum number of magnetized poles is 4, and the final radius R = 190mm is used.

[0055] Example 3

[0056] In this embodiment, the magnetic distribution scheme is optimized through centroid linkage calibration. The specific steps are as follows:

[0057] Centroid calculation: Set the grayscale value of the part filling image to 100, and calculate the centroid coordinates (X c , Y c If the deviation between the center of mass and the center of the minimum circumscribed rectangle exceeds a threshold (e.g., 5 mm), a linkage calibration is performed, with the center of mass as the final reference.

[0058] Magnetic column projection matching: When generating a magnetic column projection, the grayscale value of the single-side magnetic column increases by 10, and the projection area is strictly proportional to the actual magnetic column area (for example, a magnetic column diameter of 20mm corresponds to a projection diameter of 20 pixels). The initial opening and closing radius R is the maximum magnetic attraction distance (such as 300mm), and the slider center (X c , Y c ).

[0059] Step size optimization adjustment: If the initial matching magnetization quantity is insufficient, reduce the opening and closing radius by a step size of ΔR = 1 / 2 of the magnetic column width (e.g. 10mm). After each adjustment, recalculate the number of pixels in the overlapping area (100 + magnetic column grayscale). If the error with the magnetic column projection area is ≤2%, it is determined to be effective magnetization.

[0060] Output results: If the total number of magnetizations is still not met when R is reduced to 100mm, the R value with the largest number of magnetizations is selected (for example, 4 / 5 magnetizations at R = 150mm), and the corresponding magnetic column arrangement coordinates are output. Center of mass calibration improves the holding stability of special-shaped parts (such as L-shaped brackets) by 35%, preventing dropouts caused by center of gravity offset. Magnetization calculation time is reduced to 150ms per 20 parts, a 200-fold increase in efficiency compared to manual magnetization.

[0061] Example 4

[0062] like Figure 1 and Figure 2 As shown, a sorting and nesting analysis method based on image processing includes the following steps:

[0063] S1. Draw the outline according to the nesting file, extract the coordinates of several points of each part, save them and establish the mapping relationship between the part name and the coordinates;

[0064] S2. Extract all closed curves based on the contour image of step S1, calculate the size and position relationship and determine the nesting relationship of the closed curves, distinguish the part body and the opening by performing a nesting layer modulo 2 operation, and group the nested contours into a part contour set;

[0065] S3, matching the discrete point coordinates in step S1 with the contour set to establish a mapping relationship between the part name and the contour;

[0066] S4. Calculate the minimum circumscribed rectangle of the part's outer contour based on the outer contours in the contour set, and determine its center coordinates and rotation angle;

[0067] S5. Perform magnetic analysis on a single part and generate a magnetic column distribution projection with increasing grayscale based on the magnetic column layout of the end pickup, where the filling grayscale value of each magnetic column increases by a fixed value;

[0068] S6. Using the center coordinates as a reference, superimpose the magnetic column distribution projection map as a mask on the part filling map according to the maximum opening and closing radius, and determine the magnetic columns to be magnetized and the opening and closing radius of the end picker by grayscale value matching; dynamically adjust the opening and closing radius of the end picker until the magnetization quantity meets the conditions or reaches the minimum opening and closing radius; the process of dynamically adjusting the opening and closing radius of the end picker is based on the nested layer modulo 2 operation result of step S2, eliminating the interference of the opening area on the magnetization determination of the magnetic columns;

[0069] S7. Optimize the magnetic distribution calculation process based on asynchronous programming. The asynchronous programming adopts a multi-thread allocation strategy, and the number of threads is dynamically matched with the number of CPU cores to achieve parallel processing of multiple parts.

[0070] Asynchronous programming framework: Using multi-threading technology, the magnetic distribution calculation tasks of 10 parts are distributed to 4 parallel threads, and each thread independently executes steps S1 to S6.

[0071] Dynamic step size setting: maximum opening and closing radius R = 300 mm, preset number of iterations is 50 times, and fixed step size is 6 mm.

[0072] Iteration termination condition: When the number of magnetized magnets in a certain iteration is equal to the total number of magnetic columns, the iteration is terminated immediately; otherwise, the opening and closing radius and the arrangement of magnetized magnetic columns corresponding to the maximum number of magnetized magnets are recorded and returned as the calculation result.

[0073] The results are as follows: Serial calculation of a single part takes 2 seconds, and parallel processing of 10 parts takes a total of 5 seconds (single-threaded processing takes 20 seconds), a speed increase of 75%.

[0074] Obviously, the above-described embodiments of the present invention are merely examples for the purpose of clearly illustrating the present invention and are not intended to limit the embodiments of the present invention. A person skilled in the art would be able to make other variations or modifications based on the above description. It is not necessary and impossible to enumerate all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the claims of the present invention.

Claims

1. A sorting and nesting analysis method based on image processing, characterized in that: The steps include: S1. Draw the outline according to the nesting file, extract the coordinates of several points of each part, save them and establish the mapping relationship between the part name and the coordinates; S2. Extract all closed curves based on the contour image of step S1, calculate the size and position relationship and determine the nesting relationship of the closed curves, distinguish the part body and the opening by performing a nesting layer modulo 2 operation, and group the nested contours into a part contour set; S3, matching the discrete point coordinates in step S1 with the contour set to establish a mapping relationship between the part name and the contour; S4. Calculate the minimum circumscribed rectangle of the part's outer contour based on the outer contours in the contour set, and determine its center coordinates and rotation angle; S5. Perform magnetic analysis on a single part and generate a magnetic column distribution projection with increasing grayscale based on the magnetic column layout of the end pickup, where the filling grayscale value of each magnetic column increases by a fixed value; S6. Using the center coordinates as a reference, superimpose the magnetic column distribution projection map as a mask on the part filling map according to the maximum opening and closing radius, and determine the magnetic columns to be magnetized and the opening and closing radius of the end picker by grayscale value matching; dynamically adjust the opening and closing radius of the end picker until the magnetization quantity meets the conditions or reaches the minimum opening and closing radius; the process of dynamically adjusting the opening and closing radius of the end picker is based on the nested layer modulo 2 operation result of step S2, eliminating the interference of the opening area on the magnetization determination of the magnetic columns; S7. Optimize the magnetic distribution calculation process based on asynchronous programming to achieve parallel processing of multiple parts.

2. The method for sorting and nesting analysis based on image processing according to claim 1, characterized in that: In step S1, the nested parts include geometric parameters of line segments, arcs and circles, which are converted at a ratio of 1 pixel to 1 mm during drawing, and the coordinates of key points of the parts are saved.

3. The method for sorting and nesting analysis based on image processing according to claim 1, characterized in that: In step S2, the processing logic of the nested contours includes: taking the modulus of 2 according to the number of nested layers of the closed curve, distinguishing the outer contour of the part from the inner opening contour, and grouping the nested contours of the same part into an independent set.

4. The method for sorting and nesting analysis based on image processing according to claim 1, characterized in that: In step S4, the bottom angle of the minimum circumscribed rectangle is the rotation angle of the part, and its center coordinates are calculated by the geometric center of the outer contour, and the center coordinates are used as the center of mass reference.

5. The method for sorting and nesting analysis based on image processing according to claim 1, characterized in that: In the magnetic column distribution projection diagram, the grayscale value increases linearly with an increment of 10, and the error threshold between the magnetic column projection area and the target grayscale area is ≤2%.

6. The method for sorting and nesting analysis based on image processing according to claim 1, characterized in that: In step 6, after the magnetic column distribution projection diagram is superimposed on the part filling diagram, the areas of the superimposed image regions are calculated in sequence, and the magnetic columns that need to be magnetized are determined by matching the areas of the superimposed regions.

7. The method for sorting and nesting analysis based on image processing according to claim 6, characterized in that: The target grayscale value after superposition is the sum of the basic grayscale value of the magnetic column and the grayscale value of the part filling. If the area of ​​the region after superposition is equal to the area of ​​the magnetic column, it is determined that the magnetic column needs to be magnetized and the number of magnetized magnetic columns of the slider at this position is recorded.

8. The method for sorting and nesting analysis based on image processing according to claim 1, characterized in that: In step S6, the dynamic adjustment includes: taking the maximum opening and closing radius of the end picker as the initial value, gradually reducing it according to a fixed step size, calculating the number of magnetic columns that meet the magnetization conditions through grayscale superposition, until the magnetization number is maximized or the preset number of iterations is reached, and finally outputting the optimal opening and closing radius and magnetic column arrangement.

9. The method for sorting and nesting analysis based on image processing according to claim 8, characterized in that: The fixed step size is the ratio of the maximum opening and closing radius to the preset number of iterations, and the maximum number of iterations is 50 times to balance the calculation accuracy and processing speed.

10. The method for sorting and nesting analysis based on image processing according to claim 8, characterized in that: During the dynamic adjustment process, if the total number of magnetized magnetic columns is not reached, the parameters when the number of magnetized columns is the largest are used as the output result, and the corresponding opening and closing radius and magnetic column arrangement are recorded.

Citation Information

Patent Citations

  • Intelligent part sorting equipment based on nesting drawing analysis

    CN106890804A

  • Steel plate sorting method, electronic equipment and storage medium

    CN116091290A

  • Analytical method for jacking drawing of plate workpiece

    CN116342727A

  • Arrangement method of tooling for grabbing and placing plate workpiece

    CN117182956A

  • Part position acquisition method and device, computer equipment, storage medium and product

    CN118154689A