Steel plate contour extraction method and device, computer equipment, medium and program product

By automatically extracting the outline of steel plates using a line laser camera and machine vision algorithms, the problems of low efficiency and poor accuracy of traditional manual nesting are solved. This achieves accurate extraction of steel plate outlines and seamless integration with CAD systems, thereby improving production efficiency and material utilization.

CN122244082APending Publication Date: 2026-06-19SPEEDBOT ROBOTICS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SPEEDBOT ROBOTICS CO LTD
Filing Date
2026-03-06
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Traditional manual nesting methods before steel plate cutting are inefficient, make it difficult to accurately measure the dimensions of irregularly shaped steel plates, resulting in nesting diagram deviations, affecting cutting accuracy and production efficiency, and lack automated contour data generation methods, making it impossible to seamlessly integrate with CAD nesting systems.

Method used

A line laser camera is used to acquire point cloud data of steel plates. Planar images are extracted using the PEAC planar algorithm. Connectivity analysis is performed using machine vision algorithms to extract target contour images. Feature points are identified and ordered. Contour fitting and line segment fusion are then performed to generate DXF format files that can be recognized by CAD.

Benefits of technology

It enables automatic and precise extraction of steel plate outlines, improves material utilization and production efficiency, reduces labor costs, ensures the accuracy of irregular steel plate outlines, and achieves seamless integration with CAD nesting systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122244082A_ABST
    Figure CN122244082A_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer equipment, medium, and program product for extracting steel plate contours, comprising: acquiring binary image data of a steel plate; performing connected component analysis on the binary image data to extract a target contour image of the steel plate part; extracting target feature points from the target contour image and ordering the target feature points to obtain an ordered feature point set; performing contour fitting on the ordered feature point set to obtain an initial fitted line segment set; performing line segment fusion processing on the initial fitted line segment set to obtain a fused target line segment set; and generating a target contour file in a preset format based on the target line segment set. This application, through an automatic contour extraction algorithm, ordered feature point set construction, contour fitting, and line segment fusion, can automatically and accurately extract steel plate contours and complete vectorized modeling, achieving efficient integration of steel plate contour data with a CAD nesting system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer vision and steel plate processing technology, and in particular to a method, apparatus, computer equipment, medium and program product for extracting steel plate contours. Background Technology

[0002] In the manufacturing and processing industry, steel plates typically undergo a nesting process before cutting. This involves planning and optimizing the layout of parts on the steel plate before cutting to maximize material utilization and reduce waste. This process usually relies on CAD vector graphics, where the dimensions of the steel plate are manually measured, the outline of the steel plate is manually drawn, and then the layout of the parts is designed based on this.

[0003] Traditional methods rely mainly on manual experience for CAD drawing and layout, which is complex and inefficient. When dealing with irregularly shaped steel plates, such as those with irregular edges or local deformation, the dimensions are difficult to measure accurately, resulting in deviations in the generated nesting diagrams, which affect the subsequent cutting accuracy and production efficiency. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, medium, and program product for extracting steel plate contours that can automatically generate waste material contours, fully improve steel plate utilization efficiency, and save steel plate and labor costs, in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a method for extracting the contour of a steel plate, including:

[0006] Obtain binary image data of the steel plate;

[0007] Connectivity analysis is performed on the binary image data to extract the target contour image of the steel plate part; wherein, the target contour image includes an outer contour image and an inner contour image;

[0008] Target feature points are extracted from the target contour image, and the target feature points are ordered to obtain an ordered feature point set.

[0009] The ordered set of feature points is fitted with a contour to obtain an initial set of fitted line segments.

[0010] The initial fitted line segment set is subjected to line segment fusion processing to obtain the fused target line segment set;

[0011] Generate a target contour file in a preset format based on the target line segment set.

[0012] In one embodiment, acquiring the binary image data of the steel plate includes:

[0013] A line laser camera was used to scan the pallet on which the steel plates were placed to obtain the raw point cloud data of all the steel plates.

[0014] Based on the PEAC plane algorithm, all planes corresponding to the steel plates are extracted from the original point cloud data to obtain a 2D recognition image of the steel plates.

[0015] The 2D recognition image is converted into a binary image, and background pixels are removed to obtain the binary image data.

[0016] In one embodiment, the step of performing connected component analysis on the binary image data to extract the target contour image of the steel plate part includes:

[0017] The outer background connected component is extracted from the binary image data using an edge filling algorithm to obtain the outer contour image of the steel plate part;

[0018] Remove the pixels corresponding to the external background connected components from the binary image data to obtain the inner contour binary image data;

[0019] The internal contour binary image data is processed by a connected component analysis algorithm, and the valid internal contours are filtered according to a preset area threshold to obtain the internal contour image of the steel plate part.

[0020] In one embodiment, extracting target feature points from the target contour image includes:

[0021] According to the preset gradient threshold range and feature sampling interval, the boundary of the target contour image is subjected to gradient scanning to extract the target feature points; wherein, the target feature points include boundary inflection points and curvature change points.

[0022] In one embodiment, the process of ordering the target feature points to obtain an ordered feature point set includes:

[0023] Calculate the area of ​​each contour in the set of outer contour images of the target contour image, and select the contour with the largest area as the target contour.

[0024] The contour data points of the target contour are converted into matrix form for storage, and a kd-tree is constructed.

[0025] Nearest neighbor search is performed using the kd-tree. Point pairs are constructed based on the index of the search results and the corresponding target feature points, and the point pairs are added to the feature container.

[0026] The target feature points in the feature container are sorted according to the index to obtain an ordered feature point set.

[0027] In one embodiment, the step of contour fitting of the ordered feature point set to obtain an initial set of fitted line segments includes:

[0028] Based on the ordered feature point set, polygon approximation processing is performed to obtain a polygon approximation point set;

[0029] The original contour points are expanded into an N×2 floating-point matrix, and a kd-tree is constructed based on the floating-point matrix and a nearest neighbor search is performed. The ordered feature points in the polygon approximation point set are traversed. The current feature point is used as the starting index, and the inner layer traverses the feature points to determine the ending index. The index difference between the starting index and the ending index is calculated.

[0030] If the index difference is less than a preset threshold, perform circular arc fitting; if the index difference is greater than or equal to the preset threshold, perform linear fitting.

[0031] By integrating the results of circular arc fitting and straight line fitting, an initial set of fitted line segments is obtained.

[0032] Secondly, this application also provides a steel plate contour extraction device, comprising:

[0033] The acquisition module is used to acquire binary image data of the steel plate;

[0034] The extraction module is used to perform connected component analysis on the binary image data to extract the target contour image of the steel plate part; wherein, the target contour image includes an outer contour image and an inner contour image;

[0035] The sorting module is used to extract target feature points from the target contour image and to sort the target feature points to obtain an ordered feature point set.

[0036] The fitting module is used to perform contour fitting on the ordered feature point set to obtain an initial set of fitted line segments.

[0037] The fusion module is used to perform line segment fusion processing on the initial fitted line segment set to obtain the fused target line segment set.

[0038] The generation module is used to generate a target contour file in a preset format based on the target line segment set.

[0039] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the steel plate contour extraction method described in the first aspect.

[0040] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the steel plate contour extraction method described in the first aspect.

[0041] Fifthly, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the steel plate contour extraction method described in the first aspect.

[0042] In summary, this application proposes a method, apparatus, computer equipment, medium, and program product for steel plate contour extraction, comprising: acquiring binary image data of a steel plate; performing connected component analysis on the binary image data to extract a target contour image of the steel plate part; extracting target feature points from the target contour image and ordering the target feature points to obtain an ordered feature point set; performing contour fitting on the ordered feature point set to obtain an initial fitted line segment set; performing line segment fusion processing on the initial fitted line segment set to obtain a fused target line segment set; and generating a target contour file in a preset format based on the target line segment set. This application, through an automatic contour extraction algorithm, ordered feature point set construction, contour fitting, and line segment fusion, can automatically and accurately extract the steel plate contour and complete vectorized modeling, achieving efficient integration of steel plate contour data with a CAD nesting system. Attached Figure Description

[0043] Figure 1 This is an application environment diagram of the steel plate contour extraction method in one embodiment;

[0044] Figure 2 This is a flowchart illustrating a steel plate contour extraction method in one embodiment;

[0045] Figure 3 This is a schematic diagram of the target contour image of a steel plate in one embodiment;

[0046] Figure 4 This is a schematic diagram of the target contour image of the steel plate in another embodiment;

[0047] Figure 5 This is a schematic diagram showing the opening effect of the target outline file of the steel plate in one embodiment.

[0048] Figure 6 This is a schematic flowchart illustrating the steps for obtaining binary image data of a steel plate in one embodiment;

[0049] Figure 7 This is a schematic diagram of the steps for obtaining a target contour image of a steel plate in one embodiment;

[0050] Figure 8 This is a flowchart illustrating the steps for obtaining an ordered set of feature points in one embodiment.

[0051] Figure 9 This is a flowchart illustrating the steps for obtaining an initial set of fitted line segments in one embodiment;

[0052] Figure 10 This is a schematic diagram of the start index and end index in one embodiment;

[0053] Figure 11 This is a structural block diagram of a steel plate contour extraction device in one embodiment;

[0054] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0056] Steel plate nesting is a highly efficient material utilization process in the metal processing field. By scientifically planning the cutting path, multiple part outlines can be rationally arranged on a single steel plate to maximize material utilization and minimize production costs. In practical applications, steel plate nesting requires optimized arrangement on the steel plate plane based on the shape, size, and quantity of the parts to minimize leftover scrap after cutting.

[0057] In related technologies, obtaining steel plate contour data mainly relies on manually measuring steel plate dimensions and manually drawing the steel plate contour, followed by CAD drawing and nesting layout based on the hand-drawn contour. This method has several drawbacks, such as: First, the steel plate shape and size data rely on manual measurement and input, which is inefficient and prone to errors due to human operation. Second, for irregularly shaped steel plates or those with local deformation, manual drawing cannot accurately reproduce the true boundaries of the steel plate, resulting in deviations in the generated nesting diagram and affecting subsequent cutting accuracy. Third, it does not fully utilize image and point cloud information, and cannot automatically extract the steel plate contour from the collected visual data and perform structured processing. Fourth, it lacks an automated and standardized method for generating contour data, making it difficult for manually drawn contour files to seamlessly integrate with the subsequent CAD nesting system, further reducing production efficiency.

[0058] The image contour recognition and vectorization modeling method for steel plate nesting provided in this invention can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. Terminal 102 can acquire point cloud data of the steel plate using a line laser camera and upload the data to server 104 for processing. Server 104 executes the method of this invention to complete the steel plate contour recognition and vector modeling, generates a DXF format file, and feeds it back to terminal 102 for use by staff in the CAD nesting system. Terminal 102 can be various personal computers, laptops, smartphones, tablets, industrial control terminals, etc.; server 104 can be a standalone server or a server cluster consisting of multiple servers.

[0059] In one embodiment, such as Figure 2 As shown, a method for extracting the contour of a steel plate is provided, which can be applied to... Figure 1 Taking the server in the example, the following steps are included:

[0060] Step 201: Obtain the binary image data of the steel plate.

[0061] In this embodiment, the binary image data of the steel plate can be acquired by receiving binary image data of the steel plate with the outline to be extracted from a server or terminal, or by processing the binary image data using a laser camera and a corresponding image processing algorithm. It should be noted that the method for acquiring the binary image data of the steel plate in this embodiment can be adaptively selected according to the needs of the actual application scenario.

[0062] Specifically, in one feasible embodiment, the binary image data of the steel plate can be binary image data of the steel plate that only retains the part portion. The binary image data of the steel plate does not include the background pixels of the tray on which the steel plate is placed, to ensure accurate extraction of the outline of the steel plate.

[0063] Step 202: Perform connected component analysis on the binary image data to extract the target contour image of the steel plate part.

[0064] In this embodiment, the target contour image includes an outer contour image and an inner contour image.

[0065] Specifically, in a binary image, a region composed of adjacent pixels is called a connected component. In this embodiment, after acquiring the binary image data of the steel plate part, the target contour image of the steel plate part, including the outer contour image and the inner contour image, can be effectively extracted through connected component analysis.

[0066] In practical applications, the `connected Components WithStats` function in OpenCV can be used for connected component analysis to label connected regions in an image and calculate statistical information for each region. This statistical information includes the bounding rectangle, area, and centroid. It's important to note that the connected component analysis algorithm can be selected based on the specific application scenario to ensure stable extraction of the outer and inner contour point sets of relevant parts of the steel plate component.

[0067] Specifically, for each steel plate part, a target contour image corresponding to its part is generated independently. The target contour image can be as follows: Figure 3 and Figure 4 As shown, Figure 3 and Figure 4 The target contour images of the two parts are shown.

[0068] Step 203: Extract target feature points from the target contour image and perform ordered processing on the target feature points to obtain an ordered feature point set.

[0069] Specifically, target feature points refer to geometrically significant feature points, including boundary inflection points and curvature change points. Boundary inflection points are points on the contour where the direction changes significantly, typically manifested as abrupt changes in local curvature or sharp inflections at the edges. Examples include the four corners of a rectangle and the inflection point of the letter L. Curvature change points are the points on the contour where curvature extrema are located, reflecting changes in the degree of curvature of the contour. For example, the curvature of a circular contour is constant, while the endpoints of the major axis of an elliptical contour are points of curvature minima, and the endpoints of the minor axis are points of curvature maxima.

[0070] In one embodiment, extracting target feature points from a target contour image includes:

[0071] According to the preset gradient threshold range and feature sampling interval, the boundary of the target contour image is scanned by gradient to extract target feature points.

[0072] In this embodiment, a gradient-based feature detection module, ImgGradient, is constructed. A gradient threshold range (e.g., 30 to 60) and feature sampling interval are set for this module. By performing gradient scanning on the boundary of the target contour image using this module, geometrically significant target feature points such as boundary turning points and curvature change points can be extracted. Based on the above scheme, the target feature points obtained in this embodiment can accurately characterize the geometric features of the steel plate contour, laying the foundation for subsequent contour fitting.

[0073] Specifically, after obtaining the target feature points, they need to be ordered to ensure the accuracy and robustness of the contour fitting. It is important to note that feature point ordering is a crucial step in vector modeling.

[0074] Step 204: Perform contour fitting on the ordered feature point set to obtain an initial set of fitted line segments.

[0075] In this embodiment, the contour fitting step for the ordered feature point set includes straight line fitting and circular arc fitting, and the initial set of fitted line segments includes straight line segments and circular arc segments.

[0076] Specifically, the process of circular arc fitting includes:

[0077] First, obtain the set of two-dimensional feature points to be fitted. The mean of the two-dimensional feature point set is centered by shifting the point set to near the origin. The two-dimensional feature point set can originate from image edges, contour sampling, or feature point extraction; the point sequence can be closed or open. The specific formula for calculating the mean of the two-dimensional feature point set is as follows:

[0078]

[0079]

[0080] in, The mean of the x-axis is... The mean of the vertical axis. For the first The x-coordinates of the points For the first The y-coordinates of the points, where... .

[0081] Shifting the point set to near the origin can reduce numerical error and improve fitting stability. The specific formula is as follows:

[0082]

[0083]

[0084]

[0085] in, The mean of the x-axis is... The mean of the vertical axis.

[0086] Second, calculate the second-order moments of the centered point set, and construct the characteristic equation of a cubic polynomial based on the second-order moments.

[0087] Specifically, for the centered point set, the second-order moment is calculated. , , , , and These moments describe the geometric properties of a point set. , This represents the variance of a point along each coordinate axis, i.e., the "diffusion" of the point in the x, y, and z directions. , Let be the covariance of points in two directions, representing the tilt or directional correlation of the point cloud. The larger the covariance, the more consistent the changes of the point cloud along these two directions. These moments are then used to construct the characteristic equation for circle fitting, as shown in the following formula:

[0088]

[0089] The characteristic equation of a cubic polynomial is constructed based on second-order moments, and its roots correspond to the optimal circle fitting parameters. The specific method for constructing the cubic polynomial characteristic equation is as follows:

[0090]

[0091] in, , , These are the coefficients obtained from the combination of moments. Wherein, , , The actual combination method can be determined based on the actual shape and position of the arc in the actual application scenario. , and These are all parameters to be solved in real-world application scenarios.

[0092] Third, the Newton-Raphson method is used to iteratively solve the root of the characteristic equation. The coordinates of the fitted circle center and the radius are calculated based on the convergent root and the second moment. The final arc parameters are obtained by adding back the mean.

[0093] Specifically, the Newton-Raphson method is used to iteratively solve for the roots of the cubic polynomial, starting from the initial value. Begin iterating until convergence or the maximum number of iterations is reached. (Iteration root) This provides key parameters for calculating the center of the fitted circle.

[0094] According to the root of convergence Calculate the coordinates of the center of the circle using moments:

[0095]

[0096]

[0097] in, The x-coordinate of the circle's center is... The ordinate is the center of the circle. Used to measure whether the distribution of point cloud data on the XY plane is degraded. This is the covariance term.

[0098] Adding the average back together yields the final center of the circle:

[0099]

[0100]

[0101]

[0102] in, Let x be the x-coordinate of the final circle's center. The ordinate of the final circle's center. To fit the radius of the circular arc.

[0103] Fourth, calculate the sum of squared residuals from each feature point to the fitted arc to obtain the standard deviation of the fitting error, in order to verify the accuracy of the arc fitting.

[0104] Specifically, the sum of squared residuals from each point to the circle is calculated to obtain the standard deviation of the fitting error:

[0105]

[0106] The specific formula for calculating the standard deviation is:

[0107]

[0108] Specifically, the process of line fitting includes:

[0109] First, select two points from the set of feature points to be fitted to determine the general equation of the line, and calculate the perpendicular distance from the remaining feature points to the line.

[0110] The straight line consists of two points. , The definition, in its general form, is:

[0111]

[0112] in, , , .

[0113] The perpendicular distances from the remaining feature points to the line are:

[0114]

[0115] Second, calculate the average of all vertical distances as the error value for line fitting, and verify the accuracy of line fitting.

[0116] The formula for calculating the average of all vertical distances is:

[0117]

[0118] The above calculation formula can be expressed as:

[0119]

[0120] Third, adjust the set of fitted points based on the error value to obtain the optimal straight line fitting parameters.

[0121] Specifically, by adjusting the set of fitted points based on the error value and removing points with large deviations, the optimal straight line fitting parameters can be obtained.

[0122] Based on the above steps, by completing the straight line fitting and circular arc fitting of the feature points in the ordered feature point set, an initial set of fitted line segments consisting of multiple straight line segments and circular arc segments can be obtained.

[0123] Step 205: Perform line segment fusion processing on the initial fitted line segment set to obtain the fused target line segment set.

[0124] Specifically, iterate through all adjacent line segments in the initial fitted line segment set, refit the adjacent line segments, calculate the error of the refitted line, and if the error is within the preset reasonable error range, it means that the adjacent line segments can be approximated as a line, and merge them into a line segment.

[0125] Based on the above steps, after the traversal is completed, a set of merged line segments is obtained, avoiding the generation of a large number of fragmented line segments, which facilitates subsequent file editing and viewing.

[0126] Step 206: Generate a target contour file in a preset format based on the target line segment set.

[0127] In this embodiment, the preset format can be a DXF format that can be recognized by the CAD nesting system.

[0128] Specifically, the steps for generating the target contour file can be as follows: First, traverse the merged set of line segments and extract the attribute information of each line segment, including the starting coordinates, ending coordinates, arc radius, angle, etc. Second, write the attribute information into a YML file for structured storage. Third, convert the YML file into a DXF format target contour file that can be recognized by the CAD nesting system.

[0129] Specifically, the result of opening the target contour file obtained through fitting is shown in the image below. Figure 5 As shown.

[0130] Based on the above steps, this embodiment provides a steel plate contour extraction method, which realizes vectorized modeling of steel plate contours. Through steps such as feature point extraction, ordering, contour fitting and line segment fusion, visual data is converted into a structured set of line segments and a DXF format file that can be directly recognized by the CAD nesting system is generated, realizing seamless connection with subsequent nesting processes and improving the overall production efficiency of steel plate nesting.

[0131] In one embodiment, such as Figure 6 As shown, the binary image data of the steel plate is obtained, including:

[0132] Step 601: Use a line laser camera to scan the tray on which the steel plates are placed to obtain the original point cloud data of all the steel plates.

[0133] Step 602: Extract all planes corresponding to the steel plates from the original point cloud data based on the PEAC plane algorithm to obtain the 2D recognition image of the steel plates.

[0134] Step 603: Convert the 2D recognition image into a binary image, remove background pixels, and obtain binary image data.

[0135] In this embodiment, the line laser camera enables high-precision scanning of the steel plate, ensuring the integrity and accuracy of the point cloud data. The number of steel plates placed on the tray can be one or more; the actual arrangement of the steel plates on the tray can be designed according to the needs of the specific application scenario. The actual type of line laser camera can be adaptively selected according to the needs of the specific application scenario.

[0136] Specifically, the PEAC plane algorithm is an algorithm for efficiently extracting planes from organized point clouds. The PEAC algorithm constructs a graph structure by uniformly dividing the point cloud into non-overlapping groups of points in image space, where nodes represent a group of points and edges represent neighborhood relationships. Then, agglomerative hierarchical clustering (AHC) is performed on this graph to systematically merge nodes belonging to the same plane until the mean squared error (MSE) of the plane fitting exceeds a threshold. Finally, pixel-level region growing is used to optimize the extracted planes, ensuring the accuracy and stability of the plane segmentation.

[0137] This embodiment uses the PEAC planar algorithm to extract all planes corresponding to the steel plates from the original point cloud data, removes interference from background planes such as pallets, and obtains a 2D recognition image of the steel plates. Subsequently, the 2D recognition image is converted into a binary image, and background pixels are removed by pixel thresholding, retaining only the pixel information of the steel plate parts, in preparation for subsequent contour extraction.

[0138] Specifically, the pixel threshold setting can be selected based on the needs of the actual application scenario, choosing a threshold that can distinguish between the steel plate background area and the part area pixels.

[0139] Based on the above steps, this embodiment can effectively filter out binary image data containing only pixel information of the part during the process of acquiring binary image data of steel plate, remove interference from background pixels, and improve the accuracy of subsequent contour line extraction.

[0140] In one embodiment, such as Figure 7 As shown, connected component analysis is performed on binary image data to extract the target contour image of the steel plate part, including:

[0141] Step 701: Extract the external background connected component from the binary image data using the edge filling algorithm to obtain the outer contour image of the steel plate part.

[0142] Step 702: Remove the pixels corresponding to the external background connected components in the binary image data to obtain the inner contour binary image data.

[0143] Step 703: The inner contour binary image data is processed using a connected component analysis algorithm, and the valid inner contours are filtered according to a preset area threshold to obtain the inner contour image of the steel plate part.

[0144] In this embodiment, the edge filling algorithm can be a flood fill algorithm. By identifying and extracting the external background connected components of the binary image using the floodfill algorithm, the outer contour image of the steel plate part can be obtained. Subsequently, the pixels corresponding to the external background connected components are removed from the binary image, resulting in an image containing only the inner contour of the steel plate part. Finally, a connected component analysis algorithm is used to process the image containing only the inner contour, filtering out valid inner contours according to a preset area threshold and removing invalid contours such as small holes, thus generating the inner contour image of the steel plate part.

[0145] Specifically, in practical applications, the area of ​​holes on steel plates is typically larger than 100 square millimeters. Therefore, a preset area threshold can be used to filter out valid inner contours; that is, inner contour images larger than the preset area threshold are considered valid inner contour images. It should be noted that the actual value of the preset area threshold can be configured according to the needs of the specific application scenario.

[0146] In one embodiment, such as Figure 8 As shown, the target feature points are ordered to obtain an ordered feature point set, including:

[0147] Step 801: Calculate the area of ​​each contour in the set of outer contour images of the target contour image, and select the contour with the largest area as the target contour.

[0148] Specifically, the outer contour set of the target contour image is extracted. If no contour is detected, the input feature points are returned and a warning is issued to avoid subsequent processing failures. The area of ​​each contour in the outer contour set is calculated, and the contour with the largest area is selected as the target contour to prevent small holes inside the contour from interfering with the processing.

[0149] Step 802: Convert the contour data points of the target contour into a matrix for storage and construct a kd-tree.

[0150] Specifically, the contour data points of the target contour can be converted into a matrix of type CV_32F for storage, which facilitates the construction of an index structure. Based on this matrix, a KD-tree index structure (kd-tree) is constructed to improve the efficiency of subsequent nearest neighbor searches.

[0151] Step 803: Perform nearest neighbor search using a kd-tree, construct point pairs based on the index of the search results and the corresponding target feature points, and add the point pairs to the feature container.

[0152] Step 804: Sort the target feature points in the feature container according to the index to obtain an ordered feature point set.

[0153] Specifically, nearest neighbor search is performed using a KD-tree, with the number of leaf nodes set to 32. The index of the search result is used to construct a point pair relationship with the corresponding target feature point and added to the feature container. The target feature points in the feature container are sorted according to the index to obtain an ordered set of feature points.

[0154] In one embodiment, such as Figure 9 As shown, contour fitting is performed on the ordered feature point set to obtain an initial set of fitted line segments, including:

[0155] Step 901: Perform polygon approximation processing based on the ordered feature point set to obtain the polygon approximation point set.

[0156] In this embodiment, simplifying the original ordered feature point set into a polygonal approximation point set effectively reduces the amount of data while preserving key contour features. Specifically, redundant points can be removed using algorithms (such as the Douglas-Peucker algorithm), retaining turning points and key feature points to form a polygonal vertex set. This embodiment reduces subsequent computational complexity through polygonal approximation while avoiding the accumulation of fitting errors caused by excessive data points.

[0157] Step 902: Expand the original contour points into an N×2 floating-point matrix, construct a kd-tree based on the floating-point matrix and perform nearest neighbor search, traverse the ordered feature points in the polygon approximation point set, use the current feature point as the starting index, traverse the feature points in the inner layer to determine the ending index, and calculate the index difference between the starting index and the ending index.

[0158] Specifically, this embodiment converts the original contour points into an N×2 floating-point matrix, which unifies the data format and provides standardized input for efficient search and fitting. By constructing a kd-tree, the points in the floating-point matrix are organized into a spatially partitioned data structure, which accelerates the nearest neighbor search.

[0159] In this embodiment, during the kd-tree construction and nearest neighbor search steps, the number of leaf nodes can be set to 64 to balance tree depth and search efficiency, avoiding slow queries due to excessive depth or decreased accuracy due to excessive shallowness. Furthermore, each nearest neighbor search step returns 5 nearest neighbor points, providing local neighborhood information for subsequent curvature analysis and enhancing robustness.

[0160] Furthermore, this embodiment determines the local curvature features of the feature point set through a two-layer traversal. The outer traversal uses the current point as the starting index, while the inner traversal searches forward to find the ending index, calculating the difference between the starting and ending indices (i.e., the point interval between the two points). The index difference reflects the degree of curvature of the contour between the two points; the smaller the difference, the more drastic the curvature change (such as an arc), and the larger the difference, the closer it is to a straight line.

[0161] Specifically, the starting index is as follows: Figure 10 As shown by the red dot, the key index is as follows: Figure 10 As shown by the green dot, Figure 10 The remaining yellow dots are the contour points to be traversed.

[0162] Step 903: If the index difference is less than the preset threshold, perform circular arc fitting.

[0163] Step 904: If the index difference is greater than or equal to the preset threshold, perform linear fitting.

[0164] Specifically, the preset threshold can be determined based on experience or experimentation to balance the sensitivity of distinguishing between straight lines and arcs. For example, if the preset threshold is set to 80, and the index difference is less than 80, it indicates that the curvature of the corresponding feature point set changes significantly, and an arc fitting is performed on it. If the index difference is greater than or equal to 80, it indicates that the corresponding feature point set is approximately a straight line, and a straight line fitting is performed on it.

[0165] The specific implementation methods for circular arc fitting and straight line fitting can be found in the specific implementation methods described in the foregoing embodiments, and will not be repeated here.

[0166] Step 905: Integrate the arc fitting results and the straight line fitting results to obtain the initial set of fitted line segments.

[0167] In this embodiment, all arc fitting results and line fitting results are integrated to obtain an initial set of fitted line segments, covering all geometric features of the steel plate contour. This provides input for subsequent line segment fusion, error verification, and other steps, ensuring the continuity and accuracy of the final contour.

[0168] Based on the above steps, the contour extraction method provided in this embodiment can distinguish between straight line fitting and circular arc fitting during the contour fitting process, and ensure fitting accuracy through error verification. At the same time, it performs fusion processing on the fitted short line segments to avoid generating a large number of fragmented line segments, making it easier for staff to edit and view the contour file, and improving the convenience of actual use.

[0169] In summary, this embodiment provides a method for extracting the contour of a steel plate. It acquires point cloud data of the steel plate using a line laser camera and combines this with machine vision algorithms to automatically extract the steel plate contour, replacing traditional manual measurement and hand-drawn contour methods. This significantly improves the efficiency of contour data acquisition while avoiding errors caused by human operation, thus improving the accuracy of the contour data. Furthermore, the contour extraction method provided in this embodiment enables vectorized modeling of the steel plate contour. Through steps such as feature point extraction, ordering, contour fitting, and line segment fusion, the visual data is converted into a structured set of line segments, generating a DXF format file that can be directly recognized by a CAD nesting system. This achieves seamless integration with subsequent nesting processes, improving the overall production efficiency of steel plate nesting. This invention can accurately extract the inner and outer contours of irregularly shaped steel plates. Even for steel plate parts with irregular edges, local deformation, or holes, its true contour can be stably obtained through connected component analysis and feature point ordering processing. This solves the problem that manual drawing is difficult to reconstruct the contour of irregularly shaped steel plates, effectively improving the material utilization rate of irregularly shaped steel plates and saving steel plate and labor costs.

[0170] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0171] Based on the same inventive concept, this application also provides a steel plate contour extraction device for implementing the steel plate contour extraction method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of one or more steel plate contour extraction device embodiments provided below can be found in the limitations of the steel plate contour extraction method described above, and will not be repeated here.

[0172] In one embodiment, such as Figure 11 As shown, a steel plate contour extraction device 1100 is provided, including: an acquisition module 1110, an extraction module 1120, a sorting module 1130, a fitting module 1140, a fusion module 1150, and a generation module 1160, wherein:

[0173] The acquisition module 1110 is used to acquire binary image data of the steel plate;

[0174] The extraction module 1120 is used to perform connected component analysis on binary image data to extract the target contour image of the steel plate part; wherein, the target contour image includes an outer contour image and an inner contour image;

[0175] The sorting module 1130 is used to extract target feature points from the target contour image and to sort the target feature points to obtain an ordered feature point set.

[0176] The fitting module 1140 is used to perform contour fitting on the ordered set of feature points to obtain an initial set of fitted line segments.

[0177] The fusion module 1150 is used to perform line segment fusion processing on the initial fitted line segment set to obtain the fused target line segment set.

[0178] The generation module 1160 is used to generate a target contour file in a preset format based on the target line segment set.

[0179] In one embodiment, the acquisition module 1110 is further configured to scan the tray on which the steel plates are placed using a line laser camera to acquire the original point cloud data of all the steel plates; extract the planes corresponding to all the steel plates from the original point cloud data based on the PEAC plane algorithm to obtain a 2D recognition image of the steel plates; convert the 2D recognition image into a binary image, remove background area pixels, and obtain binary image data.

[0180] In one embodiment, the extraction module 1120 is further configured to extract the external background connected components from the binary image data using an edge filling algorithm to obtain the outer contour image of the steel plate part; remove the pixels corresponding to the external background connected components in the binary image data to obtain the inner contour binary image data; process the inner contour binary image data using a connected component analysis algorithm, and filter the valid inner contours according to a preset area threshold to obtain the inner contour image of the steel plate part.

[0181] In one embodiment, the sorting module 1130 is further configured to perform gradient scanning on the boundary of the target contour image according to a preset gradient threshold range and feature sampling interval, and extract target feature points; wherein the target feature points include boundary turning points and curvature change points.

[0182] In one embodiment, the sorting module 1130 is further configured to calculate the area of ​​each contour in the outer contour image set of the target contour image, select the contour with the largest area as the target contour; convert the contour data points of the target contour into a matrix form for storage, and construct a kd-tree; perform nearest neighbor search through the kd-tree, construct point pairs with the corresponding target feature points according to the index of the search results, and add the point pairs to the feature container; sort the target feature points in the feature container according to the index to obtain an ordered feature point set.

[0183] In one embodiment, the fitting module 1140 is further configured to perform polygon approximation processing based on the ordered feature point set to obtain a polygon approximation point set; expand the original contour points into an N×2 floating-point matrix, construct a kd-tree based on the floating-point matrix and perform nearest neighbor search, traverse the ordered feature points in the polygon approximation point set, use the current feature point as the starting index, traverse the feature points in the inner layer to determine the ending index, and calculate the index difference between the starting index and the ending index; if the index difference is less than a preset threshold, perform arc fitting; if the index difference is greater than or equal to the preset threshold, perform line fitting; integrate the arc fitting results and the line fitting results to obtain an initial set of fitted line segments.

[0184] In summary, this embodiment provides a steel plate contour extraction device that acquires point cloud data of the steel plate using a line laser camera and combines it with machine vision algorithms to automatically extract the steel plate contour. This replaces traditional manual measurement and hand-drawn contour methods, significantly improving the efficiency of contour data acquisition while avoiding errors caused by human operation and improving the accuracy of the contour data. Furthermore, the contour extraction device provided in this embodiment achieves vectorized modeling of the steel plate contour. Through steps such as feature point extraction, ordering, contour fitting, and line segment fusion, the visual data is converted into a structured set of line segments, generating a DXF format file that can be directly recognized by a CAD nesting system. This achieves seamless integration with subsequent nesting processes and improves the overall production efficiency of steel plate nesting.

[0185] Each module in the aforementioned steel plate contour extraction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0186] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 12As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a method for extracting the contour of a steel plate. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0187] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0188] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0189] Obtain binary image data of the steel plate;

[0190] Connectivity analysis is performed on the binary image data to extract the target contour image of the steel plate part; wherein, the target contour image includes an outer contour image and an inner contour image;

[0191] Target feature points are extracted from the target contour image, and the target feature points are ordered to obtain an ordered feature point set.

[0192] The ordered set of feature points is fitted with a contour to obtain an initial set of fitted line segments.

[0193] The initial fitted line segment set is subjected to line segment fusion processing to obtain the fused target line segment set;

[0194] Generate a target contour file in a preset format based on the target line segment set.

[0195] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0196] Obtain binary image data of the steel plate;

[0197] Connectivity analysis is performed on the binary image data to extract the target contour image of the steel plate part; wherein, the target contour image includes an outer contour image and an inner contour image;

[0198] Target feature points are extracted from the target contour image, and the target feature points are ordered to obtain an ordered feature point set.

[0199] The ordered set of feature points is fitted with a contour to obtain an initial set of fitted line segments.

[0200] The initial fitted line segment set is subjected to line segment fusion processing to obtain the fused target line segment set;

[0201] Generate a target contour file in a preset format based on the target line segment set.

[0202] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0203] Obtain binary image data of the steel plate;

[0204] Connectivity analysis is performed on the binary image data to extract the target contour image of the steel plate part; wherein, the target contour image includes an outer contour image and an inner contour image;

[0205] Target feature points are extracted from the target contour image, and the target feature points are ordered to obtain an ordered feature point set.

[0206] The ordered set of feature points is fitted with a contour to obtain an initial set of fitted line segments.

[0207] The initial fitted line segment set is subjected to line segment fusion processing to obtain the fused target line segment set;

[0208] Generate a target contour file in a preset format based on the target line segment set.

[0209] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0210] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0211] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A steel sheet profile extraction method characterized by, include: Obtain binary image data of the steel plate; Connectivity analysis is performed on the binary image data to extract the target contour image of the steel plate part; wherein, the target contour image includes an outer contour image and an inner contour image; Target feature points are extracted from the target contour image, and the target feature points are ordered to obtain an ordered feature point set. The ordered set of feature points is fitted with a contour to obtain an initial set of fitted line segments. The initial fitted line segment set is subjected to line segment fusion processing to obtain the fused target line segment set; Generate a target contour file in a preset format based on the target line segment set.

2. The method of claim 1, wherein, The acquisition of binary image data of the steel plate includes: A line laser camera was used to scan the pallet on which the steel plates were placed to obtain the raw point cloud data of all the steel plates. Based on the PEAC plane algorithm, all planes corresponding to the steel plates are extracted from the original point cloud data to obtain a 2D recognition image of the steel plates. The 2D recognition image is converted into a binary image, and background pixels are removed to obtain the binary image data.

3. The method according to claim 2, characterized in that, The step of performing connected component analysis on the binary image data to extract the target contour image of the steel plate part includes: The outer background connected component is extracted from the binary image data using an edge filling algorithm to obtain the outer contour image of the steel plate part; Remove the pixels corresponding to the external background connected components from the binary image data to obtain the inner contour binary image data; The internal contour binary image data is processed by a connected component analysis algorithm, and the valid internal contours are filtered according to a preset area threshold to obtain the internal contour image of the steel plate part.

4. The method according to claim 1, characterized in that, Extracting target feature points from the target contour image includes: According to the preset gradient threshold range and feature sampling interval, the boundary of the target contour image is subjected to gradient scanning to extract the target feature points; wherein, the target feature points include boundary inflection points and curvature change points.

5. The method according to claim 1, characterized in that, The process of ordering the target feature points to obtain an ordered feature point set includes: Calculate the area of ​​each contour in the set of outer contour images of the target contour image, and select the contour with the largest area as the target contour. The contour data points of the target contour are converted into matrix form for storage, and a kd-tree is constructed. Nearest neighbor search is performed using the kd-tree. Point pairs are constructed based on the index of the search results and the corresponding target feature points, and the point pairs are added to the feature container. The target feature points in the feature container are sorted according to the index to obtain an ordered feature point set.

6. The method according to claim 1, characterized in that, The step of contour fitting of the ordered feature point set to obtain an initial set of fitted line segments includes: Based on the ordered feature point set, polygon approximation processing is performed to obtain a polygon approximation point set; The original contour points are expanded into an N×2 floating-point matrix, and a kd-tree is constructed based on the floating-point matrix and a nearest neighbor search is performed. The ordered feature points in the polygon approximation point set are traversed. The current feature point is used as the starting index, and the inner layer traverses the feature points to determine the ending index. The index difference between the starting index and the ending index is calculated. If the index difference is less than a preset threshold, perform circular arc fitting; if the index difference is greater than or equal to the preset threshold, perform linear fitting. By integrating the results of circular arc fitting and straight line fitting, an initial set of fitted line segments is obtained.

7. A steel plate contour extraction device, characterized in that, The device includes: The acquisition module is used to acquire binary image data of the steel plate; The extraction module is used to perform connected component analysis on the binary image data to extract the target contour image of the steel plate part; wherein, the target contour image includes an outer contour image and an inner contour image; The sorting module is used to extract target feature points from the target contour image and to sort the target feature points to obtain an ordered feature point set. The fitting module is used to perform contour fitting on the ordered feature point set to obtain an initial set of fitted line segments. The fusion module is used to perform line segment fusion processing on the initial fitted line segment set to obtain the fused target line segment set. The generation module is used to generate a target contour file in a preset format based on the target line segment set.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the steel plate contour extraction method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the steel plate contour extraction method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the steel plate contour extraction method according to any one of claims 1 to 6.