Template structure part contour acquisition method and system, electronic device, storage medium
By performing coarse positioning and simplification on the template structural components, the straight line intersection points of the template structural components are obtained, which solves the problem of large weld deviation search error in robot programming, realizes efficient and accurate independent unit contour acquisition, and supports robot teachless programming and path planning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA RAILWAY CONSTR HEAVY IND
- Filing Date
- 2023-04-18
- Publication Date
- 2026-06-16
AI Technical Summary
Existing robot programming methods have significant errors when using sensors to search for weld deviations during the welding process, especially when the workpiece is in a complex position or has many different models. This results in large programming errors and a significant amount of programming time and workload.
By coarsely locating the template structural components, multiple height abrupt change points are obtained as feature points. After simplification, straight line intersections are formed. These intersections and feature points are used to obtain the contours of each independent unit, reducing redundant data and improving calculation accuracy and efficiency.
Accurately obtaining the individual unit contours of the template structure provides a precise data foundation for subsequent robot programming, reducing computational complexity and improving programming efficiency.
Smart Images

Figure CN116309533B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robot programming technology, and in particular to a method and system for obtaining the contour of a template structure, an electronic device, and a computer-readable storage medium. Background Technology
[0002] Industrial robots are widely used in intelligent welding. Typically, welding robots require path programming before welding. Currently, robot programming is mainly done through online teaching or offline programming, which is time-consuming and labor-intensive, suitable for welding batches of products but not for welding single pieces, small batches, or workpieces with many models. Furthermore, in the construction machinery industry, the positional consistency of workpieces and weld seams is poor. The commonly used method is to use sensors for weld seam deviation search and compensation. However, when the workpiece position deviates significantly due to complex rotational deviations or torsional deformation, the error in sensor-based weld seam deviation search is substantial, leading to significant errors in robot programming. Additionally, when there are many workpiece models or the workpiece structure is complex, using sensors for weld seam search makes robot programming more complex and labor-intensive. Summary of the Invention
[0003] This invention provides a method and system for obtaining the contour of a template structure, an electronic device, and a computer-readable storage medium to solve the technical problem of large errors when using sensors to search for weld deviations in existing robot programming.
[0004] According to one aspect of the present invention, a method for obtaining the contour of a template structural component is provided, comprising the following:
[0005] Coarsely locate the template structural components to obtain the positions of multiple height abrupt change points in the template structural components, and use the height abrupt change points as feature points;
[0006] The feature points are simplified, and multiple line intersections are obtained based on the lines formed by the simplified feature points. The simplified feature points describe the edges of independent units in the template structure.
[0007] The contours of each independent unit in the template structure are obtained based on multiple straight line intersections and simplified feature points.
[0008] Furthermore, the process of coarsely positioning the template structure to obtain the positions of multiple height abrupt change points in the template structure specifically involves:
[0009] Distance search is performed along the X and Y directions of the template structure to obtain the positions of the first and last height change points in the X and Y directions, respectively. The change distance of the height change point is the height of the stiffener of the template structure.
[0010] The X-axis dimension of the template structure is obtained based on the positions of the first and last height abrupt change points in the X-direction, and the Y-axis dimension of the template structure is obtained based on the positions of the first and last height abrupt change points in the Y-direction.
[0011] The longitudinal scanning spacing is set based on the X-direction dimension, and the transverse scanning spacing is set based on the Y-direction dimension. Distance scanning is performed step by step in the X-direction with the longitudinal scanning spacing and in the Y-direction with the transverse scanning spacing, thereby obtaining the positions of multiple height change points on the template structure.
[0012] Furthermore, when performing distance search, only search for mutation locations where the mutation distance decreases or only search for mutation locations where the mutation distance increases.
[0013] Furthermore, the process of simplifying the feature points and obtaining multiple line intersection points based on the lines formed by the simplified feature points includes the following:
[0014] Feature points are classified into horizontal feature points and vertical feature points;
[0015] The first and last feature points on each scan line are defined as edge points and are not simplified. The remaining horizontal and vertical feature points are simplified respectively.
[0016] Multiple straight lines are constructed based on the simplified feature points. All straight lines form a group of straight lines. Feature points outside the group of straight lines are removed, and multiple intersection points of straight lines are obtained based on the group of straight lines.
[0017] Furthermore, the process of simplifying the remaining horizontal and vertical feature points respectively is as follows:
[0018] For a vertical feature point, its feature association region is calculated based on the position of the vertical feature point. The coordinates of the four vertices of the feature association region are (x, y, y). p -l1-Δl,y p +l2+Δl), (x p -l1-Δl,y p -l2-Δl), (x p +l1+Δl,y p +l2+Δl), (x p +l1+Δl,y p -l2-Δl), where (x p y p) represents the position of the p-th vertical coordinate point, l1 represents the vertical scan spacing, l2 represents the horizontal scan spacing, and Δl represents the preset threshold. If the feature association area contains vertical feature points on the previous and next vertical scan lines, and the three vertical feature points are on the same straight line, and there are no horizontal feature points outside the straight line in the feature association area, then it indicates that these three vertical feature points describe an edge of an independent unit in the template structure and should be retained; if there are horizontal feature points on the straight line or if there are horizontal feature points that coincide with vertical feature points in the feature association area, then the horizontal feature points should be removed.
[0019] For a lateral feature point, its feature association region is calculated based on its position. The coordinates of the four vertices of the feature association region are (x, y, y). q -l1-Δl,y q +l2+Δl), (x q -l1-Δl,y q -l2-Δl), (x q +l1+Δl,y q +l2+Δl), (x q +l1+Δl,y q -l2-Δl), where (x q y q ) represents the position of the qth horizontal coordinate point, l1 represents the vertical scanning interval, l2 represents the horizontal scanning interval, and Δl represents the preset threshold. If the horizontal feature points on the previous and next horizontal scanning lines are included in the feature association area, and the three horizontal feature points are on the same straight line, and there are no vertical feature points outside the straight line in the feature association area, it indicates that the three horizontal feature points describe another edge of the independent unit in the template structure. If there are vertical feature points on the straight line or if there are vertical feature points that coincide with horizontal feature points in the feature association area, then the vertical feature points are removed.
[0020] Repeat the above process to obtain all feature points of the edges used to describe the independent units in the template structure.
[0021] Furthermore, the process of obtaining the contours of each independent unit in the template structure based on multiple straight line intersections and simplified feature points specifically involves:
[0022] The angle between vectors at the intersection of lines and their neighboring feature points is calculated to determine the number of independent units that each line intersection participates in constructing. Each line intersection and two adjacent feature points form a set of vectors. If the angle between n sets of vectors formed by the line intersection is less than 180°, then the line intersection is determined to have participated in constructing n independent units.
[0023] Select the intersection point of the lines that participate in the construction of only one independent unit as the starting vertex, and find the other intersection points of the lines that participate in the construction of the independent unit based on the closed-loop principle to obtain the outline of the independent unit;
[0024] Remove all vector groups involved in constructing the independent unit. When the number of vector groups formed by the intersection of a line is 0, remove the intersection of the line. Repeat the above steps until the outline of all independent units is obtained.
[0025] Furthermore, the process of selecting the intersection point of the lines that participate in the construction of only one independent unit as the starting vertex, and finding the remaining intersection points of the lines that participate in the construction of that independent unit based on the closed-loop principle to obtain the outline of that independent unit is specifically as follows:
[0026] Choose the intersection of the lines that will only be used to construct a single unit as the starting vertex p1;
[0027] Choose any line from the group of lines containing the starting vertex p1, and connect the next line on that line that is closest to p1 to the intersection point p2;
[0028] Select the next intersection point p3 of the straight lines and connect points p2 and p3. The angle between line segment p2p3 and line segment p1p2 is less than 180°. Determine whether point p3 and point p1 are collinear. If they are collinear, the contour of this independent unit is obtained. If they are not collinear, proceed to the next step.
[0029] Select the next intersection point p4 and connect points p3 and p4. Points p4 and p1 are located on the same side of line segment p2p3. Determine whether points p4 and p1 are on the same straight line formed by the feature points, i.e., whether they are collinear. If they are collinear, the contour of this independent unit is obtained. If they are not collinear, repeat this step until a line intersection point p that satisfies the closure condition is found. n p n Points p1 and p2 are located on the same side of line segment p2p3, and p... n Point p1 is collinear with point p1, thus obtaining the contour of this independent unit.
[0030] In addition, the present invention also provides a contour acquisition system for template structural components, comprising:
[0031] The coarse positioning module is used to coarsely position the template structural components, obtain the positions of multiple height change points in the template structural components, and use the height change points as feature points.
[0032] The intersection point acquisition module is used to simplify the feature points and obtain multiple line intersection points based on the lines formed by the simplified feature points. The simplified feature points describe the edges of independent units in the template structure.
[0033] The contour acquisition module is used to obtain the contours of each independent unit in the template structure based on multiple line intersections and simplified feature points.
[0034] In addition, the present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the steps of the method described above by calling the computer program stored in the memory.
[0035] In addition, the present invention provides a computer-readable storage medium for storing a computer program for obtaining the outline of a template structure, wherein the computer program executes the steps of the method described above when running on a computer.
[0036] The present invention has the following effects:
[0037] The contour acquisition method for template structural components of the present invention first performs coarse positioning on the template structural component to obtain the positions of multiple height abrupt change points in the template structural component, and uses these height abrupt change points as feature points, with the positions of the height abrupt change points representing the positions of the stiffeners. Then, the feature points are simplified, removing redundant and noisy data, retaining only the feature points describing the edges of independent units, greatly reducing the amount of data for subsequent processing and improving computational efficiency and accuracy. Multiple straight lines formed by the simplified feature points intersect pairwise to obtain multiple line intersection points, which are the vertices of the independent units. Finally, based on the multiple line intersection points and the simplified feature points, the contour of each independent unit in the template structural component can be obtained. The contour acquisition method for template structural components of the present invention first uses sensors to identify the positions of feature points in the template structural component. After processing and calculating the feature point positions, the contour data of each independent unit in the template structural component can be accurately obtained, providing an accurate data foundation for subsequent robot teach-free programming, point location determination, and path planning.
[0038] In addition, the contour acquisition system for template structural components of the present invention also has the above-mentioned advantages.
[0039] In addition to the objectives, features, and advantages described above, the present invention has other objectives, features, and advantages. The invention will now be described in further detail with reference to the figures. Attached Figure Description
[0040] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0041] Figure 1 This is a schematic diagram of the template structure of the present invention.
[0042] Figure 2 This is a flowchart illustrating the method for obtaining the contour of a template structure component according to a preferred embodiment of the present invention.
[0043] Figure 3 yes Figure 2 A schematic diagram of the sub-process of step S1.
[0044] Figure 4 This is a schematic diagram showing that the sensor keeps parallel to the surface of the template structure when scanning the structure in a preferred embodiment of the present invention.
[0045] Figure 5 This is a schematic diagram of the feature point positions obtained by scanning the feature points of the template structure in a preferred embodiment of the present invention.
[0046] Figure 6 yes Figure 2 A schematic diagram of the sub-process of step S2.
[0047] Figure 7 This is a schematic diagram illustrating the principle of simplifying feature points in a preferred embodiment of the present invention.
[0048] Figure 8 This is a schematic diagram of the feature point positions after simplification of the feature points in a preferred embodiment of the present invention.
[0049] Figure 9 This is a schematic diagram showing the intersection of straight lines located within the feature association region in a preferred embodiment of the present invention.
[0050] Figure 10 This is a schematic diagram showing the positions of the intersection of the straight lines and their adjacent feature points in a preferred embodiment of the present invention.
[0051] Figure 11 yes Figure 2 A schematic diagram of the sub-process of step S3 in the process.
[0052] Figure 12 This is a schematic diagram of the intersection of straight lines in a preferred embodiment of the present invention participating in the construction of an independent unit.
[0053] Figure 13 This is a schematic diagram of another straight line intersection point participating in the construction of two independent units in a preferred embodiment of the present invention.
[0054] Figure 14 This is a schematic diagram of another straight line intersection point participating in the construction of four independent units in a preferred embodiment of the present invention.
[0055] Figure 15 This is a schematic diagram illustrating the principle of obtaining the outline of one of the independent units in a preferred embodiment of the present invention.
[0056] Figure 16This is a schematic diagram of the module structure of a template structure component contour acquisition system according to another embodiment of the present invention. Detailed Implementation
[0057] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, the present invention can be implemented in many different ways as defined and covered below.
[0058] Understandable, such as Figure 1 As shown, the template structure in this invention consists of multiple independent units, each composed of ribs. In actual production, rib assembly errors can occur, leading to displacement, rotation, and twisting of the robot's processing position. The overall outer contour of the template structure is generally a regular shape, such as a rectangle, square, or circle, typically a rectangle. Figure 1 The example uses the overall outline of a rectangle, but no specific limitations are made here. Furthermore, the outline of each individual unit is also a regular shape, such as a rectangle, square, triangle, or convex polygon. Figure 1 The example uses a rectangular independent unit, but in actual production, the outline of an independent unit is more often a convex polygon.
[0059] like Figure 2 As shown, a preferred embodiment of the present invention provides a method for obtaining the contour of a template structure, including the following:
[0060] Step S1: Perform coarse positioning on the template structure to obtain the positions of multiple height abrupt change points in the template structure, and use the height abrupt change points as feature points;
[0061] Step S2: Simplify the feature points and obtain multiple line intersections based on the lines formed by the simplified feature points. The simplified feature points describe the edges of independent units in the template structure.
[0062] Step S3: Obtain the contour of each independent unit in the template structure based on multiple line intersections and simplified feature points.
[0063] It is understood that the contour acquisition method for the template structure in this embodiment first performs coarse positioning on the template structure to obtain the positions of multiple height abrupt change points in the template structure, and uses these height abrupt change points as feature points, with the positions of the height abrupt change points representing the positions of the stiffeners. Then, the feature points are simplified, removing redundant and noisy data, retaining only the feature points describing the edges of independent units, greatly reducing the amount of data for subsequent processing and improving computational efficiency and accuracy. Multiple straight lines formed by the simplified feature points intersect pairwise to obtain multiple line intersection points, which are the vertices of the independent units. Finally, based on the multiple line intersection points and the simplified feature points, the contour of each independent unit in the template structure can be obtained. The contour acquisition method for the template structure of this invention first uses sensors to identify the positions of feature points in the template structure. After processing and calculating the feature point positions, the contour data of each independent unit in the template structure can be accurately obtained, providing an accurate data foundation for subsequent robot teach-free programming, point location determination, and path planning.
[0064] Understandable, such as Figure 3 As shown, in step S1, the process of coarsely positioning the template structure to obtain the positions of multiple height abrupt change points in the template structure specifically involves:
[0065] Step S11: Perform distance search along the X and Y directions of the template structure to obtain the positions of the first and last height change points in the X and Y directions, respectively. The change distance of the height change point is the height of the stiffener of the template structure.
[0066] Step S12: Obtain the X-direction dimension of the template structure based on the position of the first and last height change point in the X direction, and obtain the Y-direction dimension of the template structure based on the position of the first and last height change point in the Y direction;
[0067] Step S13: Set the longitudinal scanning spacing based on the X-direction dimension and the transverse scanning spacing based on the Y-direction dimension. Perform distance scanning in the X-direction stepwise with the longitudinal scanning spacing and in the Y-direction stepwise with the transverse scanning spacing to obtain the positions of multiple height change points on the template structure.
[0068] Specifically, a first distance search is performed along the X and Y directions of the template structure using a laser displacement sensor or a line laser sensor. This yields the positions of the first and last height abrupt change points in the X direction (pb1(x1,y1,z1) and pb2(x2,y2,z2), and the first and last height abrupt change points in the Y direction (pb3(x3,y3,z3) and pb4(x4,y4,z4). These four height abrupt change points can then be used for coarse positioning of the template structure, determining its dimensional range. In practical applications, the sensor is mounted at the end effector of the robot arm, and the robot drives the sensor's movement, ensuring its speed and accuracy. The sensor's inherent characteristics are used to determine the distance between the sensor and the structure. Furthermore, during the distance search, it is crucial to ensure that the sensor does not interfere with the structure and that the template structure is within the sensor's search range.
[0069] Optionally, this invention obtains the location of height abrupt change points by detecting whether there is a sudden change in the distance value between the sensor and the structural component. Due to the thickness of the rib plate in the structural component, when searching for height abrupt change points using a laser displacement sensor, only abrupt change points where the distance decreases are searched, not those where the distance increases; or, only abrupt change points where the distance increases are searched, not those where the distance decreases, to avoid searching for two height abrupt change points due to the thickness of the rib plate. Furthermore, when the robot holds the laser displacement sensor to scan the structural component, the sensor is parallel or nearly parallel to the surface of the structural component to reduce the influence of the Z-coordinate of the abrupt change point. Figure 4 As shown, when the sensor detects a sudden change in distance that is equal to or approximately equal to the height of the stiffener, the location of the height change point can be confirmed.
[0070] Then, using the height abrupt change points pb1 and pb2, the X-direction dimension Δx = x2 - x1 of the template structure can be calculated, and the Y-direction dimension Δy = y4 - y3 can be calculated using the height abrupt change points pb3 and pb4. Next, according to the scanning accuracy requirements, the longitudinal scanning spacing l1 is set based on the X-direction dimension, and the transverse scanning spacing l2 is set based on the Y-direction dimension. The scanning is then performed gradually along the X-direction using the longitudinal scanning spacing l1 and gradually along the Y-direction using the transverse scanning spacing l2, thereby obtaining the positions of multiple height abrupt change points on the template structure. Finally, the height abrupt change points are used as feature points, and the resulting schematic diagram of the feature point positions of the template structure is shown below. Figure 5 As shown.
[0071] It is understood that step S1 obtains several feature point positions of the template structure, which represent the positions of the stiffeners and can be used to describe the edges of each independent unit. However, these feature points contain redundant or noisy data points. If the edges of each independent unit are determined based on all feature point positions, the computational complexity will be high and the accuracy will be poor. Therefore, in step S2, the feature points obtained in step S1 need to be simplified to reduce the amount of data processed subsequently, thereby improving computational efficiency and accuracy. Optionally, as... Figure 6 As shown, in step S2, the process of simplifying the feature points and obtaining multiple line intersection points based on the lines formed by the simplified feature points includes the following:
[0072] Step S21: Classify the feature points into horizontal feature points and vertical feature points;
[0073] Step S22: Define the first and last feature points on each scan line as edge points without simplification, and simplify the remaining horizontal and vertical feature points respectively.
[0074] Step S23: Construct multiple straight lines based on the simplified feature points. All straight lines form a line group. Remove feature points outside the line group and obtain multiple line intersection points based on the line group.
[0075] Specifically, all feature points are first classified. Scan lines perpendicular to the X-axis are defined as vertical scan lines, and feature points on vertical scan lines are defined as vertical feature points. Similarly, scan lines perpendicular to the Y-axis are defined as horizontal scan lines, and feature points on horizontal scan lines are defined as horizontal feature points. Thus, feature points are classified into horizontal and vertical feature points. Multiple vertical scan lines are distinguished using the X-coordinate, while multiple vertical scan points on a vertical scan line are distinguished using the Y-coordinate. Similarly, multiple horizontal scan lines are distinguished using the Y-coordinate, while multiple horizontal scan points on a horizontal scan line are distinguished using the X-coordinate. Therefore, the nth vertical feature point on the mth vertical scan line can be represented as V1{m, n}, and the jth horizontal feature point on the ith horizontal scan line can be represented as V2{i, j}.
[0076] Then, as Figure 7 As shown, the first and last feature points on each scan are defined as edge points and are not simplified. The remaining horizontal and vertical feature points are simplified separately. Specifically, the process of simplifying the remaining horizontal and vertical feature points is as follows:
[0077] For a vertical feature point, its feature association region is calculated based on the position of the vertical feature point. The coordinates of the four vertices of the feature association region are (x, y, y). p -l1-Δl,y p +l2+Δl), (x p -l1-Δl,y p -l2-Δl), (x p +l1+Δl,y p +l2+Δl), (x p +l1+Δl,y p -l2-Δl), where (x p y p Let $p$ represent the position of the p-th vertical coordinate point, $l1$ represent the vertical scan interval, $l2$ represent the horizontal scan interval, and $Δl$ represent a preset threshold. If the feature association region contains a vertical feature point from the previous and next vertical scan lines, and the three vertical feature points are on the same straight line, and there are no horizontal feature points outside the straight line within the feature association region, then these three vertical feature points describe an edge of an independent unit in the template structure, and these three vertical feature points should be retained. If there is a horizontal feature point on the straight line or a horizontal feature point in the feature association region that coincides with a vertical feature point, it means that the horizontal feature point's description of the edge of the independent unit is overdefined, belonging to an over-limited point or a coincident point, and thus the horizontal feature point is removed to simplify the algorithm. In addition, if there is a horizontal feature point outside the straight line where the three vertical feature points are collinear within the feature association region, it means that the region is at the edge boundary, and no simplification processing is performed.
[0078] For lateral feature points, their feature association regions are calculated based on their positions. The coordinates of the four vertices of the feature association region are (x, y, ...). q -l1-Δl,y q +l2+Δl), (x q -l1-Δl,y q -l2-Δl), (x q +l1+Δl,y q +l2+Δl), (x q +l1+Δl,y q -l2-Δl), where (x q y qLet q represent the position of the q-th horizontal coordinate point, l1 represent the vertical scan spacing, l2 represent the horizontal scan spacing, and Δl represent a preset threshold. If the feature association region contains horizontal feature points from the previous and next horizontal scan lines, and the three horizontal feature points are on the same straight line, and there are no vertical feature points outside the straight line within the feature association region, then these three horizontal feature points describe another edge of an independent unit in the template structure. If there are vertical feature points on the straight line or if there are vertical feature points that coincide with horizontal feature points within the feature association region, it means that the description of the edge of the independent unit by the vertical feature point is overdefined, belonging to an over-limited point or a coincident point. In this case, the vertical feature point is removed to simplify the algorithm. In addition, if there are vertical feature points outside the straight line where the three horizontal feature points are collinear within the feature association region, it means that the region is at the edge boundary, and no simplification processing is performed.
[0079] Repeat the above process to obtain all feature points used to describe the edges of independent units in the template structure. A simplified diagram of the feature point locations on the template structure is shown below. Figure 8 As shown.
[0080] Furthermore, the condition for determining whether three points are collinear is: Let the coordinates of the three points be A(x, y). A y A B(x) B y B ), C(x) C y C Find the distance l between any two points. AB l AC l BC If l AC =l AB +l BC or l AC =l AB -l BC If the distance between two points is , then the three points are collinear. The formula for the distance between two points is:
[0081]
[0082] It is understandable that the simplified feature points are sufficient to describe the edges of independent cells. Multiple straight lines are formed using these feature points, creating a line group. Feature points outside this group are treated as noise and removed. The lines in each line group intersect pairwise, resulting in multiple intersection points. These intersection points can then describe the vertices of the independent cells. The coordinates of these intersection points lie within the feature association region of the feature points of the two intersecting lines. Figure 9 As shown.
[0083] Optionally, after obtaining multiple line intersection points, only the feature points adjacent to the line intersection points are retained, and the remaining feature points are removed to further simplify the algorithm. The positional diagram of the line intersection points and their neighboring feature points on the template structure is shown below. Figure 10 As shown.
[0084] Understandable, such as Figure 11 As shown, in step S3, the process of obtaining the contours of each independent unit in the template structure based on multiple straight line intersections and simplified feature points specifically involves:
[0085] Step S31: Calculate the vector angle between the intersection of the lines and its neighboring feature points, and determine the number of independent units that each line intersection participates in constructing. Each line intersection and two adjacent feature points form a set of vectors. If the angle between n sets of vectors formed by the line intersection is less than 180°, then it is determined that the line intersection participates in constructing n independent units.
[0086] Step S32: Select the intersection point of the lines that participate in the construction of only one independent unit as the starting vertex, and find the other intersection points of the lines that participate in the construction of the independent unit based on the closed-loop principle to obtain the outline of the independent unit;
[0087] Step S33: Remove all vector groups involved in constructing the independent unit. When the number of vector groups formed by the intersection of a line is 0, remove the intersection of the line. Repeat the above steps until the outline of all independent units is obtained.
[0088] Specifically, by calculating the vector angle between the intersection point of a line and its neighboring feature points, it can be determined whether the line intersection point participates in constructing the common edge of adjacent independent units, and the number of independent units the line intersection point participates in constructing. Each line intersection point forms a vector group with two adjacent feature points. If the angle between n vector groups formed by the line intersection point is less than 180°, then the line intersection point is determined to have participated in constructing n independent units. For example, Figure 12 The intersection of the straight lines in the diagram contributes to the construction of an independent unit. Figure 13 The intersection of the straight lines in the diagram contributes to the construction of two independent units. Figure 14 The intersection points of the straight lines in the diagram contribute to the construction of four independent units.
[0089] Then, the intersection point of the lines that participate in constructing only one independent unit is selected as the starting vertex. Based on the closed-loop principle, the remaining intersection points of the lines that participate in constructing that independent unit are found, thus obtaining the outline of that independent unit. The specific process is as follows:
[0090] Choose the intersection of the lines that will only be used to construct a single unit as the starting vertex p1;
[0091] Choose any line from the group of lines containing the starting vertex p1, and connect the next line on that line that is closest to p1 to the intersection point p2;
[0092] Select the next intersection point p3 of the straight lines and connect points p2 and p3. The angle between line segment p2p3 and line segment p1p2 is less than 180°. Determine whether point p3 and point p1 are on the same straight line formed by the feature points, i.e. whether they are collinear. If they are collinear, the contour of the independent unit is obtained, i.e. the contour of the independent unit is a triangle. If they are not collinear, proceed to the next step.
[0093] Select the next intersection point p4 and connect points p3 and p4. Points p4 and p1 are located on the same side of line segment p2p3. Determine whether points p4 and p1 are collinear. If they are collinear, the contour of this independent unit is obtained, i.e., the contour of this independent unit is a quadrilateral. If they are not collinear, repeat this step until a line intersection point p that satisfies the closure condition is found. n p n Points p1 and p2 are located on the same side of line segment p2p3, and p... n Point p1 is collinear with point p1, thus obtaining the contour of this independent unit.
[0094] Then, after obtaining the contour of an independent unit, all vector groups involved in constructing that independent unit are removed. When the number of vector groups formed by the intersection of a certain line is 0, the intersection of the line is removed. The above steps are repeated until the contours of all independent units are obtained.
[0095] For example, such as Figure 15As shown, first, the intersection point of the lines in the upper left corner is selected as the starting vertex p1. Then, the horizontal line containing p1 is selected as the next expansion direction. Next, the nearest intersection point p2 on this horizontal line to p1 is selected. At p2, there are two directions. The direction with an angle less than 180° with line segment p1p2 is selected as the next expansion direction, and the nearest intersection point p3 is selected. Then, p2 and p3 are connected. Since p3 is not collinear with p1, meaning the outline of this independent unit is not closed, expansion continues. At this point, there are three expansion directions at p3. The first direction is to continue expanding along the direction of line segment p2p3 to find the next intersection point. The second direction is to expand to the upper right to find the next intersection point. The third direction is to expand to the lower right to find the next intersection point. However, the first and second expansion directions cannot simultaneously satisfy the conditions of having an angle less than 180° with line segment p2p3 and being on the same side of line segment p2p3 as p1. Only the third expansion direction satisfies these conditions. Then, along the third expansion direction, we find the next straight line intersection point p4. Since p4 and p1 are not collinear at this point, we continue to expand. There are two expansion directions at p4: one is to the upper left and the other is to the lower right. However, the next straight line intersection point found by expanding to the lower right is on both sides of line segment p3p4 with p1, which does not meet the requirements. On the other hand, the next straight line intersection point p5 found by expanding to the upper left is on the same side of line segment p3p4 with p1, and the angle between this direction and line segment p3p4 is less than 180°. So we connect p4 and p5. At this point, p5 and p1 are collinear, which means that the outline of this independent unit is closed, and its outline is p1-p2-p3-p4-p5. After obtaining the outline of the independent unit, all vector groups involved in the construction of the independent unit are removed. When the number of vector groups formed by the intersection of a certain line is 0, the intersection of the line is removed. Specifically, point p1 is removed, and the number of vector groups formed by points p2, p3, p4, and p5 is reduced by 1. At this time, points p2, p4, and p5 each only participated in the construction of one independent unit, while point p3 participated in the construction of three independent units.
[0096] In addition, such as Figure 16 As shown, another embodiment of the present invention also provides a contour acquisition system for template structural components, preferably employing the contour acquisition method described above, including:
[0097] The coarse positioning module is used to coarsely position the template structural components, obtain the positions of multiple height change points in the template structural components, and use the height change points as feature points.
[0098] The intersection point acquisition module is used to simplify the feature points and obtain multiple line intersection points based on the lines formed by the simplified feature points. The simplified feature points describe the edges of independent units in the template structure.
[0099] The contour acquisition module is used to obtain the contours of each independent unit in the template structure based on multiple line intersections and simplified feature points.
[0100] As can be understood, the contour acquisition system for template structural components in this embodiment first performs coarse positioning on the template structural component to obtain the positions of multiple height abrupt change points within the component. These height abrupt change points are then used as feature points, and their positions represent the positions of the stiffeners. Next, the feature points are simplified, removing redundant and noisy data and retaining only the feature points describing the edges of independent units. This significantly reduces the amount of data required for subsequent processing, improving computational efficiency and accuracy. Multiple straight lines formed by the simplified feature points intersect pairwise to obtain multiple line intersection points, which are the vertices of the independent units. Finally, based on these line intersection points and the simplified feature points, the contours of each independent unit within the template structural component are obtained. The contour acquisition system for template structural components of this invention first uses sensors to identify the positions of feature points on the template structural component. After processing and calculating these feature point positions, the contour data of each independent unit within the template structural component can be accurately obtained, providing an accurate data foundation for subsequent robot-less programming, point location determination, and path planning.
[0101] In addition, another embodiment of the present invention provides an electronic device including a processor and a memory, wherein the memory stores a computer program, and the processor executes the steps of the method described above by calling the computer program stored in the memory.
[0102] In addition, another embodiment of the present invention provides a computer-readable storage medium for storing a computer program for obtaining the outline of a template structure, wherein the computer program executes the steps of the method described above when running on a computer.
[0103] Common computer-readable storage media include: floppy disks, flexible disks, hard disks, magnetic tapes, any other magnetic media, CD-ROMs, any other optical media, punch cards, paper tape, any other physical media with perforated patterns, random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), flash erasable programmable read-only memory (FLASH-EPROM), any other memory chips or cartridges, or any other media readable by a computer. Instructions may further be transmitted or received by a transmission medium. The term transmission medium can include any tangible or intangible medium used to store, encode, or carry instructions for machine execution, and includes digital or analog communication signals or intangible media that facilitate communication of such instructions. Transmission media include coaxial cables, copper wires, and optical fibers, which contain conductors for transmitting a bus of computer data signals.
[0104] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0105] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0106] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0107] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0108] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0109] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0110] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for obtaining the contour of a template structural component, characterized in that, Includes the following: Coarsely locate the template structural components to obtain the positions of multiple height abrupt change points in the template structural components, and use the height abrupt change points as feature points; The feature points are simplified, and multiple line intersections are obtained based on the lines formed by the simplified feature points. The simplified feature points describe the edges of independent units in the template structure. The contours of each independent unit in the template structure are obtained based on multiple straight line intersections and simplified feature points. The process of simplifying feature points and obtaining multiple line intersections based on the lines formed by the simplified feature points includes the following: Feature points are classified into horizontal feature points and vertical feature points; The first and last feature points on each scan line are defined as edge points and are not simplified. The remaining horizontal and vertical feature points are simplified respectively. Multiple straight lines are constructed based on the simplified feature points. All straight lines form a group of straight lines. Feature points outside the group of straight lines are removed, and multiple intersection points of straight lines are obtained based on the group of straight lines. The process of simplifying the remaining horizontal and vertical feature points is as follows: For a vertical feature point, its feature association region is calculated based on the position of the vertical feature point. The coordinates of the four vertices of the feature association region are (x, y, y). p -l1-Δl,y p +l2+Δl), (x p -l1-Δl,y p -l2-Δl), (x p +l1+Δl,y p +l2+Δl), (x p +l1+Δl,y p -l2-Δl), where (x p y p ) represents the position of the p-th vertical coordinate point, l1 represents the vertical scan spacing, l2 represents the horizontal scan spacing, and Δl represents the preset threshold. If the feature association area contains vertical feature points on the previous and next vertical scan lines, and the three vertical feature points are on the same straight line, and there are no horizontal feature points outside the straight line in the feature association area, then it indicates that these three vertical feature points describe an edge of an independent unit in the template structure and should be retained; if there are horizontal feature points on the straight line or if there are horizontal feature points that coincide with vertical feature points in the feature association area, then the horizontal feature points should be removed. For a lateral feature point, its feature association region is calculated based on its position. The coordinates of the four vertices of the feature association region are (x, y, y). q -l1-Δl,y q +l2+Δl), (x q -l1-Δl,y q -l2-Δl), (x q +l1+Δl,y q +l2+Δl), (x q +l1+Δl,y q -l2-Δl), where (x q y q ) represents the position of the qth horizontal coordinate point, l1 represents the vertical scanning interval, l2 represents the horizontal scanning interval, and Δl represents the preset threshold. If the horizontal feature points on the previous and next horizontal scanning lines are included in the feature association area, and the three horizontal feature points are on the same straight line, and there are no vertical feature points outside the straight line in the feature association area, it indicates that the three horizontal feature points describe another edge of the independent unit in the template structure. If there are vertical feature points on the straight line or if there are vertical feature points that coincide with horizontal feature points in the feature association area, then the vertical feature points are removed. Repeat the above process to obtain all feature points of the edges used to describe the independent units in the template structure.
2. The method for obtaining the contour of a template structural component as described in claim 1, characterized in that, The process of coarsely positioning the template structure to obtain the positions of multiple height abrupt change points in the template structure is as follows: Distance search is performed along the X and Y directions of the template structure to obtain the positions of the first and last height change points in the X and Y directions, respectively. The change distance of the height change point is the height of the stiffener of the template structure. The X-axis dimension of the template structure is obtained based on the positions of the first and last height abrupt change points in the X-direction, and the Y-axis dimension of the template structure is obtained based on the positions of the first and last height abrupt change points in the Y-direction. The longitudinal scanning spacing is set based on the X-direction dimension, and the transverse scanning spacing is set based on the Y-direction dimension. Distance scanning is performed step by step in the X-direction with the longitudinal scanning spacing and in the Y-direction with the transverse scanning spacing, thereby obtaining the positions of multiple height change points on the template structure.
3. The method for obtaining the contour of a template structural component as described in claim 2, characterized in that, When performing a distance search, only search for mutation locations where the mutation distance decreases or only search for mutation locations where the mutation distance increases.
4. The method for obtaining the contour of a template structural component as described in claim 1, characterized in that, The process of obtaining the contours of each independent unit in the template structure based on multiple line intersections and simplified feature points is as follows: The angle between vectors at the intersection of lines and their neighboring feature points is calculated to determine the number of independent units that each line intersection participates in constructing. Each line intersection and two adjacent feature points form a set of vectors. If the angle between n sets of vectors formed by the line intersection is less than 180°, then the line intersection is determined to have participated in constructing n independent units. Select the intersection point of the lines that participate in the construction of only one independent unit as the starting vertex, and find the other intersection points of the lines that participate in the construction of the independent unit based on the closed-loop principle to obtain the outline of the independent unit; Remove all vector groups involved in constructing the independent unit. When the number of vector groups formed by the intersection of a line is 0, remove the intersection of the line. Repeat the above steps until the outline of all independent units is obtained.
5. The method for obtaining the contour of a template structure as described in claim 4, characterized in that, The process of selecting the intersection point of the lines that participate in the construction of only one independent unit as the starting vertex, and finding the remaining intersection points of the lines that participate in the construction of that independent unit based on the closed-loop principle to obtain the outline of that independent unit is as follows: Choose the intersection of the lines that will only be used to construct a single unit as the starting vertex p1; Choose any line from the group of lines containing the starting vertex p1, and connect the next line on that line that is closest to p1 to the intersection point p2; Select the next intersection point p3 of the straight lines and connect points p2 and p3. The angle between line segment p2p3 and line segment p1p2 is less than 180°. Determine whether point p3 and point p1 are on the same straight line formed by the feature points, i.e. whether they are collinear. If they are collinear, the contour of the independent unit is obtained. If they are not collinear, proceed to the next step. Select the next intersection point p4 and connect points p3 and p4. Points p4 and p1 are located on the same side of line segment p2p3. Determine whether points p4 and p1 are collinear. If they are collinear, the contour of this independent unit is obtained. If they are not collinear, repeat this step until a line intersection point p that satisfies the closure condition is found. n p n Points p1 and p2 are located on the same side of line segment p2p3, and p... n Point p1 is collinear with point p1, thus obtaining the contour of this independent unit.
6. A contour acquisition system for template structural components, employing the contour acquisition method for template structural components as described in any one of claims 1 to 5, characterized in that, include: The coarse positioning module is used to coarsely position the template structural components, obtain the positions of multiple height change points in the template structural components, and use the height change points as feature points. The intersection point acquisition module is used to simplify the feature points and obtain multiple line intersection points based on the lines formed by the simplified feature points. The simplified feature points describe the edges of independent units in the template structure. The contour acquisition module is used to obtain the contours of each independent unit in the template structure based on multiple line intersections and simplified feature points.
7. An electronic device, characterized in that, The method includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the steps of the method as described in any one of claims 1 to 5 by calling the computer program stored in the memory.
8. A computer-readable storage medium for storing a computer program for acquiring the contour of a template structure, characterized in that, The computer program, when run on a computer, performs the steps of the method as described in any one of claims 1 to 5.