A two-dimensional irregular parts layout method based on graphic images
By optimizing the layout of two-dimensional irregular parts through image edge extraction and convolution calculation, the problems of long calculation time and low accuracy in the existing technology are solved, and efficient and accurate part layout is achieved, which is suitable for parts with complex geometries.
Patent Information
- Application Number
- CN202310274062.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-03-15
AI Technical Summary
Existing technologies suffer from long computation time and low accuracy when processing two-dimensional irregular graphic layouts of multi-curved parts, especially when the number of sides is large, which leads to a decrease in fitting accuracy and loss of application value.
A two-dimensional irregular parts layout method based on image is adopted. The external edge shape of the parts and sheet metal is obtained by image edge extraction algorithm, penalty value and reward interval are constructed, and convolution calculation and angle iteration optimization are used to finally achieve efficient parts layout.
It improves the calculation efficiency and accuracy of layout of two-dimensional irregular parts, adapts to complex geometries, especially parts with holes, interlocks and precise fitting, and makes full use of sheet space.
Smart Images

Figure CN116580042B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of two-dimensional image data technology, and in particular relates to a method for arranging two-dimensional irregular parts based on graphic images. Background Technology
[0002] The two-dimensional irregular bin packing problem seeks to arrange as many parts as possible within a specific shaped region of a two-dimensional shape to achieve optimal region utilization. It has applications in the manufacturing industries of clothing, leather goods, sporting goods, and machinery. This problem is also a fundamental problem in computer science and operations research, and theoretically belongs to the NP-complete category.
[0003] Existing advanced methods for nesting irregular two-dimensional shapes, such as the no-fit polygon method, mostly store the shapes of parts and nesting areas in a vector format. During computation, increasing the number of polygon sides significantly increases the time consumption and accuracy of the nesting method. Currently, the typical cases of irregular two-dimensional shapes considered by this type of method use concave and convex polygons with relatively small numbers of sides (less than 8). In such cases, the fitting accuracy for parts with multiple curves decreases significantly, thus diminishing its application value in the industry. Summary of the Invention
[0004] The purpose of this invention is to provide a two-dimensional irregular parts layout method based on graphic images to solve the above-mentioned technical problems.
[0005] To solve the above-mentioned technical problems, the specific technical solution of the present invention for a two-dimensional irregular parts layout method based on graphic images is as follows:
[0006] A method for arranging two-dimensional irregular parts based on graphic images includes the following steps:
[0007] Step 1: By photographing the parts and sheet metal, the objects are sampled into two-dimensional images composed of pixels, or the shapes of the parts and sheet metal are directly constructed by hand-drawing images;
[0008] Step 2: Extract the outer edge shapes of irregular objects in the sheet metal and part images obtained by the image edge extraction algorithm, separate them from the original image and convert them into grayscale images;
[0009] Step 3: Assign a penalty value to the outer region in the sheet metal image, and feather the sheet metal image through a filtering matrix. Based on the feathered image, construct a progressively increasing reward range from the edge of the sheet metal to the inside.
[0010] Step 4: Use the grayscale image of the part to be arranged as the convolution kernel to perform pooling operation on the sheet metal image. The area with a larger pooling value is the key area for arrangement, which reduces the amount of subsequent convolution calculation.
[0011] Step 5: In the key areas of the layout, further use the part drawing as the convolution kernel to perform region convolution to obtain the optimal layout position in the corner of the part;
[0012] Step 6: Further update the rotation angle of the part during the layout by using the bisection method to iteratively update the angle of the part during the layout, and finally obtain the optimal layout angle and layout position by combining the results;
[0013] Step 7: Place the parts to be arranged in the sheet metal and treat it as a new outer area of the sheet metal to achieve sequential filling of the sheet metal;
[0014] Step 8: Repeat the edge feathering of the new sheet and the pose calculation of the new parts under the new sheet, and complete the layout of irregular parts in sequence until the sheet space is fully filled.
[0015] Furthermore, step 1 includes the layout of parts and sheet metal. During the layout process, the outer contours of the sheet metal and parts encompass complex graphics including concave and convex polygons as well as annular structures with internal cavities.
[0016] Furthermore, the image edge extraction algorithm used in step 2 is the Canny operator, which obtains the complete outer contour of the part by repeating the image edge extraction algorithm multiple times.
[0017] Furthermore, step 3 includes the following specific steps:
[0018] The penalty value for the outer area of the plate is negative, while the inner space is filled with 0. The progressively increasing reward range generated by feathering is positive, with the positive reward increasing closer to the edge. Its simplified mathematical expression is as follows:
[0019]
[0020] in, Representing pixels Pixel distance from the boundary, This is an integer representing the size of the feathered reward region, which is equal to the size of the feathered filter convolution kernel.
[0021] Furthermore, the size of the convolution kernel of the filter used to feather the image is 1 / 10 of the short side of the sheet metal.
[0022] Furthermore, in step 4: the pooling operation is performed using average pooling, and the step size in the pooling process is 1 / 2 of the length and width of the pooling kernel.
[0023] Furthermore, in step 5: the stride size during the part image convolution process is... .
[0024] Furthermore, in step 5, the mathematical expression for the convolution of parts in the key region is as follows:
[0025]
[0026] Where F is the part image, m and n are the length and width of the part image, respectively; G is the region of interest of the sheet metal, i and j are the length and width of the region of interest, and the optimal nesting position at this angle is the convolutional image. The position of the maximum pixel value.
[0027] Furthermore, in step 6: the designed angle bisection iterative operation constructs the placement angle diagrams of the part by rotating the part image at a certain angle, and repeats step 5 to obtain the optimal matching value at that angle. First, the matching values of the original part at 8 standard angles with 45-degree intervals are calculated, and a new rotation value is calculated between the two largest matching values using the bisection method. Finally, the optimal layout angle of the part is obtained through iteration.
[0028] Furthermore, in step 8: the standard for the sheet space to be fully filled is that the newly introduced part inevitably comes into contact with other parts already placed or extends beyond the edge of the sheet.
[0029] The two-dimensional irregular parts layout method based on image processing of the present invention has the following advantages: it uses convolution calculation as the core, supplemented by pooling and angle bisection to accelerate the calculation process. Since this method does not introduce polygon collision detection algorithms throughout the process, but instead presents the overall image of the parts to be layout in pixels and performs convolution, the shape of the parts does not affect the computational load. Moreover, due to the nature of image convolution algorithms, this method has good adaptability to parts types that are difficult to handle using geometric methods, such as those with holes, interlocking elements, and precise fitting, and can also realize the layout of irregular curved surface parts. Attached Figure Description
[0030] Figure 1 This is a flowchart of the two-dimensional irregular parts layout algorithm of the present invention;
[0031] Figure 2 This is a schematic diagram of part image extraction;
[0032] Figure 3 This is a schematic diagram of the feathering process during the sorting process;
[0033] Figure 4 This is a schematic diagram of the pooling process during the sorting process;
[0034] Figure 5A schematic diagram showing the layout results of various irregular parts. Detailed Implementation
[0035] To better understand the purpose, structure, and function of this invention, the following detailed description of a two-dimensional irregular parts layout method based on graphic images is provided in conjunction with the accompanying drawings.
[0036] like Figure 1 As shown, the present invention provides a two-dimensional irregular parts layout method based on graphic images, comprising the following steps:
[0037] Step 1: Image Acquisition of Sheet Metal and Parts. By photographing the parts and sheet metal, the objects are sampled into two-dimensional images composed of pixels, or the shapes of the parts and sheet metal are directly constructed by hand-drawing images, and then laid out. The outer contours of the sheet metal and parts in the laying-out process include complex graphics such as concave and convex polygons and annular structures with internal cavities.
[0038] Step 2: Contour Image Generation. The irregular outer edge shapes of objects in the sheet metal and part images obtained through an image edge extraction algorithm are extracted from the original images and converted to grayscale images; the Canny operator is used as the image edge extraction algorithm. The edge extraction algorithm can be repeated multiple times to obtain the complete outer contour of the part; preferably, the number of repetitions is 2. The sheet metal and part are extracted from the original image in the form of AABB bounding boxes of the outer contours. Figure 2 The process of generating the contours of multiple parts is given.
[0039] Step 3: Construction of reward and penalty regions. A penalty value is assigned to the outer region of the sheet metal image, and the sheet metal image is feathered using a filtering matrix. Based on the feathered image, a progressively increasing reward region is constructed from the edge of the sheet metal inwards. The penalty value for the outer region of the sheet metal is a relatively large negative value (1e-4), while the inner space of the sheet metal is filled with 0 values. The progressively increasing reward region generated by feathering is a relatively small positive value (10 to 1), with the positive reward increasing closer to the edge.
[0040] Its concise mathematical expression is as follows:
[0041]
[0042] in, Representing pixels Pixel distance from the boundary, This is an integer representing the size of the feathered reward region, which is equal to the size of the feathered filter convolution kernel.
[0043] Preferably, the size of the filter convolution kernel used to feather the image is 1 / 10 of the shorter side of the sheet metal. Figure 3 A partial schematic diagram of sheet metal feathering is provided;
[0044] Step 4: Identifying Key Areas for Layout. The grayscale image of the parts to be laid out is used as the convolution kernel to perform pooling on the sheet metal image. Areas with larger pooling values are the key areas for layout, reducing the amount of subsequent convolution calculations. Average pooling is used, with a step size of half the length and width of the pooling kernel. For example... Figure 4 The diagram shown illustrates the pooling process.
[0045] Step 5: Part Layout Position Convolution. In key layout areas, further convolution is performed using the part drawing as the kernel to obtain the optimal layout position at the corner of the part; the stride during the part image convolution process is... The mathematical expression for the convolution of parts in key areas is as follows:
[0046]
[0047] Where F is the part image, m and n are the length and width of the part image, respectively; G is the region of interest (ROI) of the sheet metal, i and j are the length and width of the ROI, respectively. The optimal nesting position at this angle is the convolutional image. The position of the maximum pixel value.
[0048] Step 6: Part Layout Angle Iteration. The bisection method is used to iterate and update the rotation angles during part layout, ultimately obtaining the optimal layout angle and position. The designed angle bisection iterative operation rotates the part image at a certain angle to construct placement angle diagrams for the part, and repeats Step 5 to obtain the optimal matching value at that angle. Preferably, the matching values of the original part at 8 standard angles with 45-degree intervals are first calculated, and a new rotation value is calculated between the two largest matching values using the bisection method. Finally, the optimal layout angle of the part is obtained through iteration.
[0049] Step 7: Sheet space update. Place the parts to be arranged in the sheet metal and treat it as a new external area of the sheet metal to achieve sequential filling of the sheet metal;
[0050] Step 8: Sequential overall layout. Repeat the edge feathering of the new sheet metal and the pose calculation of the new parts under the new sheet metal to complete the layout of irregular parts in sequence until the sheet metal space is fully filled; the standard for the sheet metal space to be fully filled is that the newly introduced parts inevitably contact other placed parts or go beyond the edge of the sheet metal. Figure 5 The diagrams show the nesting process and various nesting results.
[0051] Experimental results show that this method can efficiently achieve the layout of irregular sheet metal and parts, making full use of sheet space. Specific case studies can be seen below. Figure 3-5 .
[0052] It is understood that the present invention has been described through some embodiments, and those skilled in the art will recognize that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the invention. Furthermore, under the teachings of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of the present invention.
Claims
1. A method for arranging two-dimensional irregular parts based on graphic images, characterized in that, Includes the following steps: Step 1: By photographing the parts and sheet metal, the objects are sampled into two-dimensional images composed of pixels, or the shapes of the parts and sheet metal are directly constructed by hand-drawing images; Step 2: Extract the outer edge shapes of irregular objects in the sheet metal and part images obtained by the image edge extraction algorithm, separate them from the original image and convert them into grayscale images; Step 3: Assign a penalty value to the outer region in the sheet metal image, and feather the sheet metal image through a filtering matrix. Based on the feathered image, construct a progressively increasing reward range from the edge of the sheet metal to the inside. Step 4: Use the grayscale image of the part to be arranged as the convolution kernel to perform pooling operation on the sheet metal image. The area with a larger pooling value is the key area for arrangement, which reduces the amount of subsequent convolution calculation. Step 5: In the key areas of the layout, further use the part drawing as the convolution kernel to perform region convolution to obtain the optimal layout position in the corner of the part; Step 6: Further update the rotation angle of the part during the layout by using the bisection method to iteratively update the angle of the part during the layout, and finally obtain the optimal layout angle and layout position by combining the results; Step 7: Place the parts to be arranged in the sheet metal and treat it as a new outer area of the sheet metal to achieve sequential filling of the sheet metal; Step 8: Repeat the edge feathering of the new sheet and the pose calculation of the new parts under the new sheet, and complete the layout of irregular parts in sequence until the sheet space is fully filled.
2. The two-dimensional irregular parts layout method based on graphic images according to claim 1, characterized in that, Step 1 includes the layout of parts and sheet metal. During the layout process, the outer contours of the sheet metal and parts include complex shapes with concave and convex polygons as well as annular structures with internal cavities.
3. The two-dimensional irregular parts layout method based on graphic images according to claim 1, characterized in that, The image edge extraction algorithm used in step 2 is the Canny operator. The edge extraction algorithm of the image is repeated multiple times to obtain the complete outer contour of the part.
4. The two-dimensional irregular parts layout method based on graphic images according to claim 1, characterized in that, Step 3 includes the following specific steps: The penalty value for the outer area of the plate is negative, while the inner space is filled with 0. The progressively increasing reward range generated by feathering is positive, with the positive reward increasing closer to the edge. Its simplified mathematical expression is as follows: , in, Representing pixels Pixel distance from the boundary, is an integer representing the size of the feathered reward region, which is equal to the size of the feathered filter convolution kernel.
5. The two-dimensional irregular parts layout method based on graphic images according to claim 4, characterized in that, The size of the convolution kernel of the filter used to feather the image is 1 / 10 of the shorter side of the sheet metal.
6. The two-dimensional irregular parts layout method based on graphic images according to claim 1, characterized in that, In step 4: the pooling operation is performed using the average pooling method, and the step size in the pooling process is 1 / 2 of the length and width of the pooling kernel.
7. The two-dimensional irregular parts layout method based on graphic images according to claim 1, characterized in that, In step 5: the stride size during the part image convolution process is... .
8. The two-dimensional irregular parts layout method based on graphic images according to claim 1, characterized in that, In step 5, the mathematical expression for the convolution of parts in the key region is as follows: , Where F is the part image, m and n are the length and width of the part image, respectively; G is the region of interest of the sheet metal, i and j are the length and width of the region of interest, and the optimal nesting position at this angle is the convolutional image. The position of the maximum pixel value.
9. The two-dimensional irregular parts layout method based on graphic images according to claim 1, characterized in that, In step 6: the designed angle bisection iterative operation rotates the part image at a certain angle to construct the placement angle diagram of the part, and repeats step 5 to obtain the optimal matching value at that angle. First, the matching values of the original part at 8 standard angles with 45-degree intervals are calculated, and the new rotation value is calculated between the two largest matching values using the bisection method. Finally, the optimal layout angle of the part is obtained through iteration.
10. The two-dimensional irregular parts layout method based on graphic images according to claim 1, characterized in that, In step 8: the standard for the sheet space to be fully filled is that the newly introduced part inevitably comes into contact with other parts that have been placed or extends beyond the edge of the sheet.
Citation Information
Patent Citations
Real-time intelligent high-robustness layout optimization method and system for multi-shape manufactured parts
CN113705860A
Machining device, automatic programing device, and method for controlling machining device
WO2021193292A1