Method and device for segmenting weld seams of ship workpieces, and computer medium
By slicing and planning point calculations of the point cloud data of ship workpieces, breakpoints are automatically determined, and automatic segmented welding of bending bevels is realized, solving the problem of time-consuming and low efficiency in the existing technology, and improving the Welding efficiency and accuracy.
Patent Information
- Application Number
- CN202410328285.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-21
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-03-21
AI Technical Summary
The prior art is difficult to automatically weld the bent bevel in segments, especially when the degree of bending is relatively serious, which requires manual measurement and operation, which is time-consuming and labor-intensive.
By slicing the point cloud data of the ship's workpiece is equidistantly, selecting the planning points and calculating the planned midpoints, and determining the breakpoints based on the bow height threshold, automatically segmenting the bending bevel.
Automatic segmented welding of bending bevels is realized, reducing manual operation time and labor demand, and improving welding efficiency and accuracy.
Smart Images

Figure CN118115477B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of workpiece processing, and in particular to a weld segmentation method and device for a ship workpiece, and a computer medium. Background Art
[0002] With the development of workpiece processing technology, workpiece processing technology has been continuously updated and improved, and has gradually evolved from simple manual processing to workpiece processing technology characterized by automation and intelligence. The scope of processing objects and technical level have been significantly improved.
[0003] Visual robot automated welding technology is widely used in many industries. With the development of the industry, the requirements for welding technology are getting higher and higher. Therefore, the welding technology of groove welds is gradually becoming more and more important. Welding points refer to the crystals or solid phases formed after the molten pool of welding materials cools and solidifies during the welding process.
[0004] However, when the groove is curved, if the curvature of the groove is severe, different welding processes or welding equipment need to be used according to the curvature of each part of the groove. Or when the curvature of the groove is severe, the welding equipment cannot complete the welding of the groove. If the groove is welded in sections, the employees need to have certain operating experience and need to measure the curvature of the groove frequently, which requires more time and manpower.
[0005] Therefore, how to automatically segment the curved groove is a technical problem that needs to be solved urgently. Summary of the invention
[0006] The present application aims to solve the technical problem of how to automatically segment a curved groove.
[0007] According to one aspect of an embodiment of the present application, the present application provides a weld segmentation method for a ship workpiece, the method comprising:
[0008] In the workpiece point cloud obtained by collecting ship workpiece data, the groove point cloud representing the groove is sliced equidistantly to obtain a slice point cloud, wherein a weld exists in the groove;
[0009] According to the order of data point depth from small to large, two data points are selected in each of the slice point clouds as planning points, and the midpoint of the initial planning point in each of the slice point clouds is obtained as the planning midpoint;
[0010] According to the arrangement order of the position information of each planned midpoint, the first planned midpoint in the unsegmented groove point cloud is used as the segmentation starting point, and the bow height between each planned midpoint and the segmentation starting point is calculated in sequence;
[0011] The first planned midpoint located after the segmentation starting point and with a bow height greater than the bow height threshold is taken as a breakpoint, and the slice point cloud after the breakpoint is taken as a new unsegmented groove point cloud to continue segmentation processing.
[0012] According to one aspect of an embodiment of the present application, in the workpiece point cloud obtained by collecting ship workpiece data, the groove point cloud representing the groove is sliced equidistantly to obtain a slice point cloud, and before a weld exists in the groove, the method further includes:
[0013] A groove point cloud representing the groove is determined in a workpiece point cloud obtained by data collection of a ship workpiece.
[0014] According to one aspect of an embodiment of the present application, determining a groove point cloud representing a groove in a workpiece point cloud obtained by collecting data from a ship workpiece includes:
[0015] Determine two selected points in the same horizontal plane of the workpiece point cloud, and the straight line where the two selected points are located is a first straight line;
[0016] On the horizontal plane where the first straight line is located, the first straight line is parallelly mapped to both sides of the first straight line to obtain a second straight line and a third straight line;
[0017] On the horizontal plane where the selected point is located, straight lines perpendicular to the first straight line passing through the selected point are drawn as a fourth straight line and a fifth straight line;
[0018] A closed figure enclosed by the second straight line, the third straight line, the fourth straight line and the fifth straight line is used as a frame selection figure;
[0019] The prism determined by taking the frame selection figure as the cross section is the frame selection space, and the workpiece point cloud in the frame selection space is the groove point cloud.
[0020] According to one aspect of an embodiment of the present application, in the workpiece point cloud obtained by collecting ship workpiece data, after equidistant slicing of the groove point cloud representing the groove to obtain the sliced point cloud, the method further includes:
[0021] Slicing the groove point cloud to obtain a slice point cloud, and taking a data point in each slice point cloud as a key point according to the order of data point depth from large to small;
[0022] Performing straight line fitting on the key points, and determining key points whose distances from the fitting straight line are within a distance threshold as weld key points;
[0023] The weld position of the ship workpiece is determined according to the position information of the slice point cloud where the weld key point is located.
[0024] According to one aspect of an embodiment of the present application, selecting two data points in each of the slice point clouds as planning points in an ascending order of data point depths includes:
[0025] According to each data point in each of the slice point clouds, plane fitting is performed on each of the slice point clouds to obtain a two-dimensional slice point cloud;
[0026] The two data points with the smallest depth in each of the two-dimensional slice point clouds are used as planning points.
[0027] According to one aspect of an embodiment of the present application, performing plane fitting on each of the slice point clouds according to each data point in each of the slice point clouds to obtain a two-dimensional slice point cloud includes:
[0028] For the slice point cloud, a set number of point sets are determined, and planes determined by each point set are respectively used as initial planes, wherein the data point set is composed of any three data points in the slice point cloud that are not in the same straight line;
[0029] Taking a point in the slice point cloud whose distance from the initial plane is less than a length threshold as a target point of the initial plane;
[0030] The initial plane with the largest number of target points is optimized to obtain the two-dimensional slice point cloud.
[0031] According to one aspect of an embodiment of the present application, taking the two data points with the smallest depth in each of the two-dimensional slice point clouds as planning points includes:
[0032] For each of the two-dimensional slice point clouds, a set number of data point pairs are determined, and a straight line determined by each data point pair is used as an initial straight line;
[0033] Taking data points in the two-dimensional slice point cloud whose distance from the initial straight line is less than a threshold as the inner points of the initial straight line;
[0034] Taking the initial straight line with the largest number of interior points, and mapping each interior point of the initial straight line to the initial straight line to obtain a fitting line segment;
[0035] In the two-dimensional slicing point cloud, the inner points of the fitting line segment are removed, and straight line fitting is performed again to determine other fitting line segments in the two-dimensional slicing point cloud until all data points in the two-dimensional slicing point cloud are inner points of the fitting line segment;
[0036] The two data points with the smallest depth among the intersections of the fitting line segments are used as the planning points of the slice point cloud.
[0037] According to one aspect of an embodiment of the present application, taking the two data points with the smallest depth among the intersections of the fitting line segments as planning points of the slicing point cloud includes:
[0038] The two initial key points with the smallest depth among the intersections of the fitted lines are used as rough planning points;
[0039] The rough planning point with two adjacent rough planning points on the same side of the groove point cloud is used as the planning point to be smoothed;
[0040] The planned point to be smoothed is moved to the middle position between adjacent planned points to be smoothed as a planning point.
[0041] According to one aspect of an embodiment of the present application, the present application provides a weld segmentation device for a ship workpiece, the device comprising:
[0042] A slicing module is configured to perform equidistant slicing on a groove point cloud representing a groove in a workpiece point cloud obtained by collecting ship workpiece data to obtain a slice point cloud, wherein a weld exists in the groove;
[0043] A calculation module is configured to select two data points in each of the slice point clouds as planning points according to the order of the depth of the data points from small to large, and obtain the midpoint of the initial planning point in each of the slice point clouds as the planning midpoint;
[0044] The bow height module is configured to take the first planned midpoint in the unsegmented groove point cloud as the segmentation starting point according to the arrangement order of the position information of each planned midpoint, and sequentially calculate the bow height between each planned midpoint and the segmentation starting point;
[0045] The segmentation module is configured to use the first planned midpoint located after the segmentation starting point and with a bow height greater than the bow height threshold as a breakpoint, and to use the slice point cloud after the breakpoint as a new unsegmented groove point cloud to continue segmentation processing.
[0046] According to one aspect of an embodiment of the present application, the present application provides a computer-readable storage medium having computer-readable instructions stored thereon. When the computer-readable instructions are executed by a processor of a computer, the computer executes any of the above methods.
[0047] In the embodiment of the present application, first, in the workpiece point cloud obtained by collecting ship workpiece data, the groove point cloud representing the groove is sliced equidistantly to obtain a slice point cloud, and there is a weld in the groove; according to the order of data point depth from small to large, two data points are selected in each slice point cloud as planning points, and the midpoint of the initial planning point in each slice point cloud is obtained as the planning midpoint; according to the arrangement order of the position information of each planning midpoint, the first planning midpoint in the unsegmented groove point cloud is used as the segmentation starting point, and the bow height of each planning midpoint and the segmentation starting point is calculated in sequence; the first planning midpoint located after the segmentation starting point and with a bow height greater than the bow height threshold is used as a breakpoint, and the slice point cloud after the breakpoint is used as a new unsegmented groove point cloud for continued segmentation processing. The present application obtains a groove point cloud by converting the groove point cloud into a point cloud, and segments the groove point cloud according to the bending condition of the groove point cloud. When the bending degree reaches a certain limit, the groove point cloud is automatically segmented, and then the curved groove can be automatically segmented.
[0048] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0049] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
[0051] Figure 1 A flow chart of a method for segmenting a weld of a ship workpiece according to an embodiment of the present application is shown.
[0052] Figure 2 A flow chart of determining a groove point cloud representing a groove from a workpiece point cloud obtained by collecting data on a ship workpiece according to an embodiment of the present application is shown.
[0053] Figure 3 A flowchart is shown of selecting two data points in each slice point cloud as planning points according to an ascending order of data point depth according to an embodiment of the present application.
[0054] Figure 4 A flow chart is shown for performing plane fitting on each slice point cloud according to each data point in the slice point cloud to obtain a two-dimensional slice point cloud according to an embodiment of the present application.
[0055] Figure 5 A flowchart of using the two data points with the smallest depth in each two-dimensional slice point cloud as planning points according to an embodiment of the present application is shown.
[0056] Figure 6 A flow chart of smoothing planning points according to an embodiment of the present application is shown.
[0057] Figure 7 A flow chart for determining a weld according to an embodiment of the present application is shown.
[0058] Figure 8 A flow chart of smoothing key points before performing straight line fitting on the key points according to an embodiment of the present application is shown.
[0059] Fig. 9 A schematic diagram of a weld segmentation device for a ship workpiece according to an embodiment of the present application is shown.
[0060] Fig.10 A hardware structure diagram of a method for implementing a weld segmentation method for a ship workpiece according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0061] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present application will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0062] In addition, the described features, structures or characteristics may be combined in one or more example embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present application. However, those skilled in the art will appreciate that the technical solution of the present application may be practiced while omitting one or more of the specific details, or other methods, components, steps, etc. may be adopted. In other cases, known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring the present application and making the various aspects of the present application obscure.
[0063] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0064] See also Figure 1 , Figure 1A flow chart of a method for segmenting a weld of a ship workpiece according to an embodiment of the present application is shown. The present application embodiment provides a method for segmenting a weld of a ship workpiece with implementation steps, including:
[0065] Step S110, in the workpiece point cloud obtained by collecting ship workpiece data, equidistantly slice the groove point cloud representing the groove to obtain a slice point cloud, and there is a weld in the groove;
[0066] Step S120, selecting two data points in each slice point cloud as planning points according to the order of data point depth from small to large, and obtaining the midpoint of the initial planning point in each slice point cloud as the planning midpoint;
[0067] Step S130, according to the arrangement order of the position information of each planned midpoint, the first planned midpoint in the unsegmented groove point cloud is used as the segmentation starting point, and the bow height between each planned midpoint and the segmentation starting point is calculated in sequence;
[0068] Step S140, taking the first planned midpoint located after the segmentation starting point and with a bow height greater than the bow height threshold as a breakpoint, and taking the slice point cloud after the breakpoint as a new unsegmented groove point cloud to continue segmentation processing.
[0069] The above four steps are described in detail below.
[0070] It should be made clear that before welding the ship workpiece, the part to be welded of the ship workpiece is processed into a certain shape. The groove formed after the assembly is called a groove, that is, the groove is a weld to be welded. The main purpose of opening the groove is to achieve complete penetration. In addition, it can also improve the composition and performance of the weld, improve the crystallization conditions, and improve the performance of the joint. For example, the two parts to be welded are chamfered separately, so that the welding point of the two parts changes from flat and matching to a groove shape.
[0071] However, when the groove is curved, if the curvature of the groove is severe, different welding processes or welding equipment need to be applied according to the curvature of each part of the groove. Or when the curvature of the groove is severe, the welding equipment cannot complete the welding of the groove. If the groove is welded in sections, the employees need to have certain operating experience and need to measure the curvature of the groove frequently, which requires more time and manpower. Therefore, this application automatically segments the groove in the following way.
[0072] Before step S110, data is collected on the side of the workpiece where the groove is located, and a number of sampling points are selected on the side of the workpiece where the groove is located, where the number of sampling points or the density of the sampling points distribution can be set according to the user's instruction information, and the instruction information refers to the program instructions generated according to the user's operating behavior.
[0073] It is further necessary to clarify that. For the convenience of describing the method provided in this application, the side of the workpiece where the groove is located is taken as the reference horizontal plane, and the plane parallel to the reference plane is taken as the horizontal plane. The high, low, deep, and shallow in the following text are all relative to the reference horizontal plane. The direction of the groove depression is taken as the lower direction, the opposite direction of the groove depression is taken as the upper direction, and the extending direction of the groove is taken as the left and right direction, also called the longitudinal direction. Similarly, the direction perpendicular to the left and right direction is taken as the front-back direction, also called the transverse direction.
[0074] Taking any point or set point as the origin reference, the three-dimensional coordinates of each sampling point are obtained. At this time, the three-dimensional coordinates of each sampling point are called point cloud data. Point cloud refers to the image formed after the three-dimensional coordinates of each point contained in the point cloud data are materialized in the virtual three-dimensional space. Because the number of "points" is large and dense, it is called "point cloud".
[0075] In one embodiment of the present application, data is collected by a data acquisition device, which forms a light spot on the side of the workpiece where the groove is located by sending a ranging beam to the workpiece, and the location of the light spot is the sampling point selected on the workpiece. The ranging beams can be emitted one by one, or several beams can be emitted in parallel.
[0076] It should be made clear that in this process, in order to better collect data at each position in the groove, a ranging beam is emitted to the side of the groove in a direction perpendicular to the reference horizontal plane, and then the sampling point is determined. Finally, the three-dimensional coordinates corresponding to each sampling point are obtained according to the measurement results of the data acquisition device, that is, the point cloud data is obtained. The point cloud data is materialized in the virtual three-dimensional space to obtain the workpiece point cloud.
[0077] Since the purpose of this application is to segment the weld in the groove by segmenting the groove, this application needs to be analyzed based on the groove. Only a part of the workpiece point cloud is used to describe the groove. If the workpiece point cloud is analyzed directly, it will result in too much point cloud data to be analyzed, which greatly wastes computing resources. Therefore, the part representing the groove in the workpiece point cloud is separated, and only the point cloud representing the groove is analyzed, which greatly reduces the consumption of computing resources.
[0078] If there are still too many point clouds representing the groove, then a part or several parts of the point clouds representing the groove are intercepted from all the point clouds representing the groove as the groove point clouds to be analyzed. Specifically, at least two points are determined as selected points in the workpiece point cloud, and the workpiece point cloud representing the groove between the selected points is intercepted as the groove point cloud. It should be clear that the selected point can be a data point constituting the workpiece point cloud, or it can be any point on the workpiece point cloud that is not a data point.
[0079] It should be further clarified that if more than two points are selected as selected points, two parts of point clouds representing the groove are obtained, and these groove point clouds can be analyzed in parallel. It is also possible to analyze each part of the groove point cloud representing the groove one by one according to the user's instruction information or the preset working mode.
[0080] When separating the groove point cloud, two points are determined as selected points in the same horizontal plane of the workpiece point cloud according to the user's instruction information. The selected points that need to be clarified can be data points in the workpiece point cloud or any points in the virtual space where the workpiece point cloud is located.
[0081] It should be further clarified that the groove generally appears as a rectangular groove in the horizontal plane. In one embodiment of the present application, in response to the user's command information, the selected point will usually be located on the same side or the opposite side edge of the point cloud representing the groove part in the workpiece point cloud. When performing horizontal mapping, the mapping direction is perpendicular to the straight line where the selected point is located.
[0082] Each selected point is synchronously mapped in the horizontal direction, that is, each selected point is synchronously translated on the horizontal plane where the selected point is located, and each selected point is horizontally mapped with the same distance and direction to obtain the mapping point corresponding to each selected point. The mapping point is obtained by horizontal translation of the selected point, that is, the plane determined by the mapping point and the selected point is parallel to the reference horizontal plane, and the mapping point and the selected point are connected as nodes to form a box selection figure parallel to the reference horizontal plane.
[0083] The prism determined by the cross section of the framed graphic is the framed space, and the workpiece point cloud in the framed space is the point cloud representing the groove part in the workpiece point cloud, which is the groove point cloud.
[0084] It should be further explained that when determining the groove point cloud, all point clouds representing the groove in the workpiece point cloud can be separated as the groove point cloud. Point clouds representing a portion of the groove can also be separated as the groove point cloud. By determining groove point clouds of different sizes, different computing resources can be adapted. The above method realizes the separation of point clouds representing the groove, or the separation of point clouds representing a portion of the groove.
[0085] It should be clear that, for determining the frame selection figure, the mapping point and the selected point can be directly connected to form a closed figure as the frame selection figure, or other transformations can be performed on the selected points to obtain the frame selection figure.
[0086] In one embodiment of the present application, two points are determined as selected points in the same horizontal plane of the workpiece point cloud according to the user's instruction information. It should be clear that the selected point can be a data point in the workpiece point cloud or any point in the virtual space where the workpiece point cloud is located. The selected point is located at the same side edge of the point cloud representing the groove part in the workpiece point cloud, and the first straight line formed by the selected point is in the left and right direction.
[0087] The two selected points are synchronously mapped in the front-to-back direction on the horizontal plane where they are located, that is, each selected point is synchronously translated in the front-to-back direction on the horizontal plane where the selected point is located to obtain the mapping point corresponding to each selected point.
[0088] The straight line where the mapping point is located is the mapping straight line, and the mapping straight line and the first straight line are opposite sides to form a frame selection figure parallel to the horizontal plane. The prism determined by the cross section of the frame selection figure is the frame selection space, and the workpiece point cloud in the frame selection space is the point cloud representing the groove part in the workpiece point cloud, which is the groove point cloud.
[0089] In another embodiment of the present application, a straight line is determined based on two selected points selected according to the user instruction information as a specific straight line, the two selected points are on both sides of the point cloud representing the groove part in the workpiece point cloud, the specific straight line presents a front-to-back direction, and the specific straight line spans the point cloud representing the groove part. The specific straight line is moved to the left and right by a certain distance on the horizontal plane where the specific straight line is located, respectively, to obtain a first mapping straight line and a second mapping straight line, and the point cloud representing the groove between the first mapping straight line and the second mapping straight line is the groove point cloud to be determined.
[0090] Passing through two selected points respectively, on the horizontal plane where the selected points are located, two lines perpendicular to the specific line are determined as the third mapping line and the fourth mapping line. The first mapping line and the third mapping line, the second mapping line and the third mapping line, the first mapping line and the fourth mapping line, and the second mapping line and the fourth mapping line are intersected in pairs to determine four intersection points, and a closed figure determined by the four intersection points as vertices is a frame selection figure.
[0091] In another embodiment of the present application, in response to the user's instruction information, at least two points are determined in the workpiece point cloud as selected points, and the surface passing through the selected points and perpendicular to the horizontal plane is used as a cross section, and at least two cross sections can be obtained. In the workpiece point cloud intercepted in the middle of the cross section, the part representing the groove is the groove point cloud.
[0092] Specifically, taking one side of the workpiece where the groove is located as the reference horizontal plane, the point cloud of the part with a more obvious depth change in the workpiece point cloud intercepted by the two sections is the groove point cloud. Because during data collection, only the side of the workpiece where the groove is located is used as the reference plane for data collection, so in the obtained workpiece point cloud, only the depth change of the part representing the groove is more obvious, and most of the data points of the non-groove part are located in the same horizontal plane. Even if the data points of the non-groove part are not located in the same horizontal plane due to the collection accuracy and the unevenness of the workpiece, the depth change of the data points of the non-groove part will not be too obvious. Based on the above principle, in one embodiment of the present application, taking one side of the workpiece where the groove is located as the reference horizontal plane, the point cloud formed by the data points whose depth change exceeds the set change amount in the workpiece point cloud intercepted by the two sections is the groove point cloud.
[0093] See also Figure 2 , Figure 2 A flowchart of determining a groove point cloud representing a groove in a workpiece point cloud obtained by data collection on a ship workpiece according to an embodiment of the present application is shown. The embodiment of the present application provides a step of determining a groove point cloud representing a groove in a workpiece point cloud obtained by data collection on a ship workpiece, including:
[0094] Step S201, determining two selected points in the same horizontal plane of the workpiece point cloud, and the straight line where the two selected points are located is the first straight line;
[0095] Step S202, on the horizontal plane where the first straight line is located, the first straight line is parallel mapped to both sides of the first straight line to obtain a second straight line and a third straight line;
[0096] Step S203, on the horizontal plane where the selected point is located, draw straight lines perpendicular to the first straight line through the selected point, which are the fourth straight line and the fifth straight line;
[0097] Step S204, taking a closed figure enclosed by the second straight line, the third straight line, the fourth straight line and the fifth straight line as a frame selection figure;
[0098] Step S205, taking the framed graphic as a prism determined by the cross section as the framed space, and the workpiece point cloud in the framed space as the groove point cloud.
[0099] The above five steps are described in detail below.
[0100] In step S201, in response to the user's instruction information, two selected points are determined in the same horizontal plane of the workpiece point cloud, and the straight line where the two selected points are located is the first straight line. In response to the user's instruction information, the two selected points are located at the edges of the opposite sides of the point cloud representing the groove part in the workpiece point cloud, and the first straight line is the front-back direction. The line segment formed with the two selected points as endpoints spans the point cloud representing the groove part.
[0101] In step S202, the first straight line is mapped parallel to both sides of the first straight line in the horizontal plane where the first straight line is located to obtain the second straight line and the third straight line. That is, the first straight line is moved to the left and right by a certain distance in the horizontal plane where the first straight line is located to obtain the second straight line and the third straight line.
[0102] In step S203, on the horizontal plane where the selected point is located, straight lines perpendicular to the first straight line are drawn through the selected point, which are the fourth straight line and the fifth straight line.
[0103] In step S204, a closed figure enclosed by the second straight line, the third straight line, the fourth straight line and the fifth straight line is used as a frame selection figure. The second straight line and the fourth straight line, the second straight line and the fifth straight line, the third straight line and the fourth straight line, and the third straight line and the fifth straight line are intersected in pairs to determine four intersection points, and a closed figure determined with the four intersection points as vertices is the frame selection figure.
[0104] In step S205, a prism determined by taking the framed graphic as a cross section is used as a framed space, and the workpiece point cloud in the framed space is a groove point cloud.
[0105] In step S110, the groove point cloud is sliced to obtain a slice point cloud. In one embodiment of the present application, in order to better determine the degree of bend of the groove, the groove point cloud is equidistantly cut in a direction perpendicular to the left and right directions of the groove to obtain a slice point cloud.
[0106] In an embodiment of the present application, when the groove is curved, the groove point cloud is also curved. In order to perform equidistant cutting on the groove point cloud in a direction perpendicular to the left and right directions of the groove, after determining the position for slicing the groove point cloud, the groove point cloud is equidistantly sliced along the direction perpendicular to the tangent of the position.
[0107] In step S120, the groove point cloud is sliced, and the curvature change of the groove can be measured by fitting these points into a curve based on the three-dimensional coordinates of the points with the same specific position in the slice point cloud, such as taking the lowest point in the slice point cloud as the reference point. The curvature change of this curve is the curvature change of the groove point cloud.
[0108] In order to better determine the curvature change of the groove point cloud, it is necessary to set a point with the same specific position in the slice point cloud, and the point needs to be able to accurately represent the position of the slice point cloud in the groove point cloud.
[0109] This application selects two data points with the shallowest depth in each slice point cloud as planning points according to the order of data point depth from small to large. The midpoint of the initial planning point in each slice point cloud is the planning midpoint. The planning midpoint is used as the point with the same specific position in the slice point cloud. The curve where multiple planning midpoints are located can better represent the curvature of the slope.
[0110] See also Figure 3 , Figure 3 The flowchart of selecting two data points as planning points in each slice point cloud according to the order of data point depth from small to large according to one embodiment of the present application is shown. The embodiment of the present application provides a step S120 of selecting two data points as planning points in each slice point cloud according to the order of data point depth from small to large, including:
[0111] Step S121, performing plane fitting on each slice point cloud according to each data point in each slice point cloud to obtain a two-dimensional slice point cloud;
[0112] Step S122: taking the two data points with the smallest depth in each two-dimensional slice point cloud as planning points.
[0113] The above two steps are described in detail below.
[0114] In step S121, for the acquired slice point cloud, each slice point cloud contains several data points. And because the slice point cloud is derived from the groove point cloud, the groove point cloud is in a three-dimensional state, and correspondingly, the slice point cloud is also in a three-dimensional state. When the two data points with the smallest depth are determined as planning points for the slice point cloud in a three-dimensional state, the accuracy in finding planning points will be low due to the presence of many noise points, and when the highest (that is, the smallest depth) data point is determined for the slice point cloud in a three-dimensional state, the use of computing resources will also be greater than that of the slice point cloud in a two-dimensional state. Therefore, according to each data point in each slice point cloud, each slice point cloud is plane-fitted, a plane is determined in the slice point cloud, and each data point is mapped to the plane to obtain a two-dimensional slice point cloud.
[0115] See also Figure 4 , Figure 4 A flow chart of performing plane fitting on each slice point cloud according to each data point in the slice point cloud to obtain a two-dimensional slice point cloud according to an embodiment of the present application is shown. The embodiment of the present application provides a step S121 of performing plane fitting on each slice point cloud according to each data point in the slice point cloud to obtain a two-dimensional slice point cloud, including:
[0116] Step S301, for the slice point cloud, determine a set number of data point sets, and use the planes determined by each data point set as the initial plane, wherein the data point set is composed of any three data points in the slice point cloud that are not in the same straight line;
[0117] Step S302, taking a point in the slice point cloud whose distance from the initial plane is less than a length threshold as a target point of the initial plane;
[0118] Step S303, optimizing the initial plane with the largest number of target points to obtain a two-dimensional slice point cloud.
[0119] The above three steps are described in detail below.
[0120] In step S301, for each slice point cloud, a set number of data point sets are determined based on the data points contained therein. A data point set refers to any three data points that are not in the same straight line. Each data point set can determine a plane, and these planes are used as initial planes.
[0121] The determination of the set number is based on the currently available computer resources. If the current computer resources are more, the set number will be set larger until all data points are exhausted. If the current computer resources are less, the set number will be set smaller within the preset number range, and the lowest is the minimum value within the preset number range. If the current computer resources are very small, in order to ensure processing accuracy, the minimum value within the preset number range will be used as the set number to generate a data point set, and then point cloud processing will be performed, and at the same time the user will be reminded that the process is slow.
[0122] It should be clear that for the preset number range, the upper limit is the number of data point sets obtained by exhausting each data point in the sliced point cloud, and the lower limit is the number that ensures the accuracy of point cloud processing.
[0123] In step S302, it can be known from step S301 that there are several initial planes in each slice point cloud, and the data points whose distance to the initial plane is less than the length threshold are taken as the target points of the initial plane, and the number of target points of each initial plane in the slice point cloud is calculated.
[0124] In step S303, the initial plane with the largest number of target points in the slice point cloud is used as the fitting plane, and the data points with a distance less than the length threshold from the fitting plane are mapped to the fitting plane to obtain the two-dimensional slice plane to which the fitting plane belongs. This enables the two-dimensional slice point cloud to more comprehensively represent the slice point cloud corresponding to the two-dimensional slice point cloud.
[0125] In one embodiment of the present application, if the number of target points in the slice point cloud is greater than or equal to the number threshold, it means that the number of target points is sufficient to fully represent the slice point cloud, and the error of the obtained two-dimensional slice point cloud is too large due to too few target points to fully represent the slice point cloud, resulting in the method of the present disclosure being inaccurate. Therefore, when the number of target points in the slice point cloud is greater than or equal to the number threshold, the target points can be mapped to the initial plane with the largest number of target points as the two-dimensional slice point cloud of the slice point cloud to which the initial plane belongs.
[0126] If the number of target points in the slice point cloud is less than the number threshold, it means that the number of target points is not enough to fully represent the slice point cloud. Since there are too few target points to fully represent the slice point cloud, the error of the obtained two-dimensional slice point cloud is too large, resulting in the inaccuracy of the disclosed method. Therefore, if the number of target points in the initial plane with the largest number of target points is less than the number threshold, the length threshold range is expanded until the number of target points is greater than or equal to the number threshold, and then the target points outside the initial plane are projected into the initial plane to obtain a two-dimensional slice point cloud.
[0127] In another embodiment of the present application, in order to allow the two-dimensional slice point cloud to represent the corresponding slice point cloud to the maximum extent, each data point outside the initial plane is projected into the initial plane to obtain a two-dimensional slice point cloud.
[0128] In step S122, the two-dimensional data point in the two-dimensional slice point cloud that is highest compared to the reference horizontal plane, that is, the two-dimensional data point with the minimum depth, is determined as a planning point.
[0129] See also Figure 5 , Figure 5 A flowchart of using the two data points with the smallest depth in each two-dimensional slice point cloud as planning points according to an embodiment of the present application is shown. The present application embodiment provides a step S122 of using the two data points with the smallest depth in each two-dimensional slice point cloud as planning points, including:
[0130] Step S401, for each two-dimensional slice point cloud, a set number of data point pairs are determined, and the straight lines determined by each data point pair are respectively used as initial straight lines;
[0131] Step S402, taking data points in the two-dimensional slice point cloud whose distance from the initial straight line is less than a threshold as inner points of the initial straight line;
[0132] Step S403, taking the initial straight line with the largest number of inliers, and mapping each inlier of the initial straight line to the initial straight line to obtain a fitting line segment;
[0133] Step S404, removing the inner points of the fitting line segment in the two-dimensional slice point cloud, performing straight line fitting again, and determining other fitting line segments in the two-dimensional slice point cloud until all data points in the two-dimensional slice point cloud are inner points of the fitting line segment;
[0134] Step S405: taking the two data points with the smallest depth among the intersections of the fitting line segments as planning points for slicing the point cloud.
[0135] The above five steps are described in detail below.
[0136] Groove point cloud refers to a set of data points representing several sampling points of the groove in virtual space. The sampling points are distributed on the surface of the groove, and the groove point cloud is sliced in a direction perpendicular to the left and right directions of the groove. The obtained sliced point cloud reflects the contour of the groove.
[0137] However, when determining the planning points in the two-dimensional slice point cloud, the shape of the two-dimensional slice point cloud and the groove cross section may be greatly different due to the influence of some noise points, and the contour of the two-dimensional slice point cloud does not completely match the edge of the groove cross section.
[0138] At the same time, due to errors in data collection and data distortion when fitting the slice point cloud, the two-dimensional slice point cloud cannot well represent the contour of the groove cross section. There will be some discrete points scattered throughout the two-dimensional slice point cloud, which makes it possible that the highest point in the two-dimensional slice point cloud, that is, the point with the smallest depth, may be a noise point, which will lead to errors in the determination of the planning points.
[0139] Therefore, after determining the two-dimensional slicing point cloud, a straight line is fitted to each data point in the two-dimensional slicing point cloud, and then the trajectories of multiple fitting straight lines in the two-dimensional slicing point cloud are determined. Finally, each data point in the two-dimensional slicing point cloud is mapped to the trajectory of each fitting straight line, and a figure similar to the cross-sectional shape of the groove is obtained. The figure composed of these fitting straight lines is the shape of the cross-sectional shape of the groove. At this time, the intersection points between the fitting straight lines are taken as the initial key points, and the two initial key points with the smallest depth are the planning points, which represent the two data points with the smallest depth of the slicing point cloud corresponding to the two-dimensional slicing point cloud.
[0140] Specifically, in step S401, a set number of point pairs are determined for each two-dimensional slice point cloud, and the straight lines determined by each point pair are respectively used as initial straight lines.
[0141] The determination of the set number is based on the currently available computer resources. If the current computer resources are more, the set number will be set larger until all data points are exhausted. If the current computer resources are less, the set number will be set smaller within the preset number range, and the lowest value is the minimum value within the preset number range. If the current computer resources are very small, in order to ensure processing accuracy, the minimum value within the preset number range will be used as the set number to generate point pairs, and then point cloud processing will be performed, and at the same time the user will be reminded that the process is slow.
[0142] In step S402, points in the two-dimensional slice point cloud whose distance from the initial straight line is less than a threshold are taken as inner points of the initial straight line.
[0143] In step S403, according to the number of inliers of each initial straight line, the initial straight line with the largest number of inliers is selected as the fitting straight line, and the inliers of the fitting straight line are gathered (mapped) onto the initial straight line, thereby obtaining a fitting line segment.
[0144] In step S404, the data points distributed on the fitting line and the inner points of the fitting line are removed or ignored in the two-dimensional slice point cloud where the fitting line is located, and the straight line fitting as described in steps S401 to S403 is continued until all the data in the two-dimensional slice point cloud where the fitting line is located is mapped to the initial straight line as an inner point, and a plurality of fitting line segments are obtained.
[0145] The figure formed by the combination of these fitting line segments is the shape of the groove cross section corresponding to the two-dimensional slice point cloud where the fitting line segments are located.
[0146] In step S405, the intersection points of the fitting line segments are taken as initial key points, and the initial key points with the smallest depth are taken as planning points.
[0147] In one embodiment of the present application, when determining the planning points, the presence of noise points will affect the determination of the planning points, causing deviations in the position information of the planning points, that is, the three-dimensional coordinates. Therefore, when determining the planning points, it is also necessary to smooth the initial key points with the smallest depth to eliminate the influence of the noise points on the planning points.
[0148] See also Figure 6 , Figure 6 A flow chart of smoothing planning points according to an embodiment of the present application is shown. The present application embodiment provides steps for smoothing planning points, including:
[0149] Step S501, taking two initial key points with the smallest depth among the intersections of the fitting lines as rough planning points;
[0150] Step S502, taking a rough planning point with two adjacent rough planning points on the same side of the groove point cloud as a planning point to be smoothed;
[0151] Step S503: Move the planned point to be smoothed to the middle position between the adjacent planned points to be smoothed as a planned point.
[0152] The above three steps are described in detail below.
[0153] In step S501, two data points with the smallest depth among the intersections of the fitting lines are used as rough planning points. At this time, the rough planning points are affected by noise points, and their position information, that is, the three-dimensional coordinates, are not very accurate.
[0154] In step S502, since the groove is mostly in a straight line or regular line state, the distribution of the rough planning points in the groove point cloud will also show a regular line. Each slice point cloud has two rough planning points, which are located on both sides of the groove point cloud. The rough planning points on both sides of the groove point cloud are smoothed respectively.
[0155] Each rough planning point has one or two adjacent rough planning points. The outermost rough planning point has only one adjacent rough planning point, and the other rough planning points have two adjacent rough planning points. If only one adjacent rough planning point is used as a reference, the smoothing process of the rough planning point will be affected by noise points due to too few references, and the smoothing process will result in poor smoothing effect. Therefore, only the rough planning points with two adjacent rough planning points are used as the planning points to be smoothed.
[0156] In step S503, the smoothing order is determined according to the three-dimensional coordinates of each planning point to be smoothed. Each planning point to be smoothed is smoothed in turn. According to the three-dimensional coordinates of the key points adjacent to the planning point to be smoothed, the midpoint coordinates between the adjacent key points are obtained, and the planning point to be smoothed is moved to the midpoint coordinates to complete the smoothing of the planning point to be smoothed. The above technical means are used to smooth all the planning points to be smoothed, so that the planning points are more accurate and the groove point cloud can be segmented more accurately.
[0157] In step S130, the three-dimensional coordinates of the planned midpoint are determined according to the three-dimensional coordinates of the planned point. According to the three-dimensional coordinates of the planned midpoint, that is, the position information of the planned midpoint, the planned midpoints are sorted according to the extension direction of the groove. In an embodiment of the present application, if the extension direction of the groove is the left-right direction, the left-right relationship is determined according to the relative position relationship between the planned midpoints, and then the sorting is performed in sequence. This allows the sorted planned midpoints to be connected in sequence, and the extension direction of the curve obtained after linear fitting is the same as the extension direction of the groove. That is, if the groove is in the left-right direction, the sorted planned midpoints are connected in sequence, and the extension direction of the curve obtained after linear fitting is also the left-right direction, which makes the extension direction of the curve obtained after linear fitting the same as the extension direction of the groove, and then the curvature of the groove can be determined by the position information of the planned midpoint.
[0158] The three-dimensional coordinates of the planning point are determined based on the position of the two-dimensional slice point cloud to which the planning point belongs and the transformation relationship between the two-dimensional slice point cloud and the slice point cloud, so as to determine the three-dimensional coordinates of the planning point in the slice point cloud to which it belongs, that is, the position of the planning point in the groove point cloud.
[0159] Exemplarily, the three-dimensional coordinates of the planned midpoint are (x, y, z). In the embodiment of the present application, the direction of the groove extension is the left-right direction. If the X axis is the left-right direction, the size of (x) is used as a reference to sort the planned midpoints. It should be clarified that the direction of the groove can be determined according to the midpoint tangent of the midpoint position of the line where the groove is located. The direction of the midpoint tangent is the direction of the groove. It can also be a certain axis of the coordinate system where the groove point cloud is located. That is, the midpoint tangent can be used as a certain axis of the coordinate system where the point cloud is located, so as to facilitate the sorting of the planned midpoints.
[0160] According to the arrangement order of each planning midpoint, the first planning midpoint in the unsegmented groove point cloud is used as the segmentation starting point. First, the bow height between the adjacent planning midpoint and the segmentation starting point is calculated. The bow height refers to the vertical line segment from the midpoint of the arc that constitutes the bow to the chord that constitutes the bow, which is used to indicate the degree of curvature of the planning midpoint compared to the segmentation starting point. If the bow height between the adjacent planning midpoint and the segmentation starting point is less than the bow height threshold, it means that the degree of curvature between the planning midpoint and the segmentation starting point is small, and segmentation is not necessary. Then, the curvature between the next planning midpoint and the planning starting point is calculated according to the arrangement order of the planning midpoints.
[0161] In step S140, until the first planned midpoint located after the segmentation starting point and with a bow height greater than the bow height threshold between the segmentation starting point and the segmentation starting point is used as a breakpoint, the slice point clouds where the planned midpoints between the breakpoint and the segmentation starting point are divided into the same section of groove point cloud, and this section of groove point cloud belongs to the groove point cloud after segmentation. This indicates that the curvature of the groove corresponding to this section of groove point cloud can be applied to the same welding process and welding equipment, which will not affect the welding effect and will not cause damage to the welding equipment.
[0162] The slice point cloud after the breakpoint is used as a new unsegmented groove point cloud for segmentation processing, that is, the first planned midpoint adjacent in sequence after the breakpoint is used as the new segmentation starting point, and then the breakpoint is continued to be found in the subsequent segmented groove point cloud to segment the groove point cloud. Until all groove point clouds are segmented. According to the position of the two-dimensional slice point cloud to which the breakpoint belongs, and the transformation relationship between the two-dimensional slice point cloud and the slice point cloud, the position of the breakpoint in the slice point cloud to which it belongs, that is, the position of the breakpoint in the groove point cloud. Finally, according to the transformation relationship between the groove point cloud coordinate system and the workpiece coordinate system in physical time, the corresponding position of the breakpoint in the groove is determined to achieve the segmentation of the groove.
[0163] In this way, the groove can be divided into sections according to the curvature of the groove. When the overall curvature of the groove is large, which makes welding impossible or the welding effect is poor, or damages the welding equipment, the groove can be divided into sections and welded separately, or different welding processes are used for each section, so that the welding effect is better and the welding equipment is not damaged.
[0164] In another embodiment of the present application, there may be welding spots or holes in the groove (welding spots and holes are non-weldable parts of the groove), so in order to weld the groove, it is necessary to reconfirm the location of the welds that can be welded in the groove.
[0165] The essence of the groove is a groove-shaped weld that needs to be welded. The positions of the weld points and holes in the groove are non-weldable parts. Taking the side of the workpiece where the groove is located as the reference horizontal plane, if there is a weld point in the groove, the weld point will cover the bottom of the groove, which will also cause the lowest point of the weld point to be higher than the lowest point of the weld in the groove, that is, the lowest point of the weld point in the groove will be higher than the lowest point of the weld. At the same time, for the holes in the groove, the lowest point of the hole in the groove will be much lower than the lowest point of the weld.
[0166] In the above case, we only need to take the lowest point in the slice point cloud as the key point, and then by analyzing the height difference between each key point, we can determine whether the key point corresponds to a welding point, a hole or a weld, and then determine whether the slice point cloud to which the key point belongs belongs to the weld in the groove.
[0167] Therefore, after step S405, the intersection of each fitting straight line is used as the initial key point, and the initial key with the largest depth is used as the key point. Alternatively, after step S110, the method described in steps S121-S122, steps S301-S303, and S401-S405 is used to use the deepest point in the slice point cloud as the key point to confirm the weld position in the groove in turn.
[0168] For details, please refer to Figure 7 , Figure 7 A flow chart of determining a weld according to an embodiment of the present application is shown. The present application embodiment provides steps for determining a weld, including:
[0169] Step S601, slicing the groove point cloud to obtain a slice point cloud, and taking a data point in each slice point cloud as a key point according to the order of data point depth from large to small;
[0170] Step S602, performing straight line fitting on the key points, and determining the key points whose distances to the fitting straight line are within a distance threshold as the weld key points;
[0171] Step S603, determining the position of the weld in the groove according to the position information of the slice point cloud where the key points of the weld are located.
[0172] In step S601, the groove point cloud is sliced to obtain a slice point cloud. In one embodiment of the present application, in order to better determine the location of the weld in the groove point cloud, the groove point cloud is equidistantly cut in a direction perpendicular to the left and right directions of the groove to obtain a slice point cloud. The lowest point in the slice point cloud is taken as the key point. The acquisition of the key point can refer to the method described in steps S121-S122, S301-S303, and S401-S405, after taking the intersection of each fitting straight line as the initial key point, and taking the initial key with the largest depth as the key point.
[0173] In step S602, in order to eliminate the influence of noise points and the deviation of each key point due to calculation accuracy, it is more accurate to determine whether the key point corresponds to a weld.
[0174] This application eliminates the influence by performing straight line fitting on all key points, and can screen the key points representing the weld. Specifically, among all the key points, a set number of key point pairs are determined, and the straight lines where each key point is located are respectively used as the initial key straight line, and the key points that are less than the set distance from the initial key straight line are used as the corresponding points of the initial key straight line, and the initial key straight line with the largest number of corresponding points is taken as the key straight line. In the groove point cloud, the key straight line is the initial key straight line with the most key points around it. The part representing the weld and the hole is much less than the part representing the weld, so the key points representing the corresponding weld are also more than the key points corresponding to the weld part, so the corresponding points of the key straight line are used to represent the key points of the weld. As the key points corresponding to the key straight line, the key points that are closer to the key straight line indicate that these corresponding points are corresponding to the weld part like the key line segment. The key points outside the corresponding points of the key line segment and higher than the key straight line depth threshold interval are the key points of the weld, and the slice point cloud where the key points of the weld are located is the location of the weld. The key points below the key line depth threshold interval are hole key points, and the slice point cloud where the hole key points are located is the location of the hole.
[0175] With the depth of the key straight line as a reference, a depth threshold interval is set. For example, the depth of the key straight line is taken as the middle value, and the depth threshold interval is 5 mm above and below. For key points whose depth is obviously greater than the depth threshold interval, their corresponding holes can be directly determined. For key points whose depth is obviously less than the depth threshold interval, their corresponding welds can be directly determined, thereby determining the parts of the groove that do not need to be welded.
[0176] See also Figure 8 , Figure 8 A flow chart of smoothing key points before performing straight line fitting on the key points according to an embodiment of the present application is shown. The embodiment of the present application provides steps of smoothing key points before performing straight line fitting on the key points, including:
[0177] Step S701, according to the relative position relationship of each key point, a key point having two adjacent key points is used as a key point to be smoothed;
[0178] Step S702: If the position deviation between the key point to be smoothed and the adjacent key points is less than or equal to the deviation threshold, the key point to be smoothed is moved to the middle position between the adjacent key points to perform smoothing processing on the key point to be smoothed.
[0179] The above two steps are described in detail below.
[0180] The reason for smoothing each key point before performing straight line fitting on the key points is that the depth threshold interval is set with reference to the depth of the key line. For example, the depth of the key line is used as the middle value, and the depth threshold interval is 5mm above and below. For key points whose depth is obviously greater than the depth threshold interval, their corresponding holes can be directly determined. For key points whose depth is obviously less than the depth threshold interval, their corresponding welding points can be directly determined, and then the parts of the groove that do not need to be welded can be determined. However, for each key point adjacent to the depth threshold interval, considering that each key point may be affected by light, groove flatness, and precision, it is impossible to accurately determine whether they are key points corresponding to welding points or holes for each key point adjacent to the depth threshold interval. Therefore, by smoothing each key point, the judgment of whether each key point is greater than or less than the depth threshold interval is more accurate.
[0181] In step S701, for the key points determined in the two-dimensional slice point cloud, according to the transformation relationship between the two-dimensional slice point cloud and the slice point cloud, the three-dimensional coordinates of the key points in the slice point cloud, that is, the three-dimensional coordinates of the key points in the groove point cloud, can be determined. Among them, the transformation relationship between the two-dimensional slice point cloud and the slice point cloud refers to the coordinate transformation generated when each data point (when clustered) is mapped when the slice point cloud is fitted with a surface.
[0182] The three-dimensional coordinates of each key point are determined according to the two-dimensional coordinates of each key point in the two-dimensional slice point cloud and the transformation relationship between the slice point cloud and the two-dimensional slice point cloud.
[0183] Since each key point is the lowest data point of each slice point cloud, that is, the data point distributed at the bottom of the groove. According to the relative position relationship between each key point, the key points adjacent to each key point can be determined. Since the grooves are mostly straight or regular lines, the distribution of key points in the groove point cloud will also show a line pattern. Each key point has one or two adjacent key points. The outermost key point has only one adjacent key point, and the other key points have two adjacent key points. If only one adjacent key point is used as a reference, the smoothing of the key point will be easily affected by noise points due to too few references, and the smoothing will make the smoothing effect poor. Therefore, only key points with two adjacent key points are used as key points to be smoothed.
[0184] In step S702, the smoothing order is determined according to the three-dimensional coordinates of each key point to be smoothed. Each key point to be smoothed is smoothed in sequence. Specifically, when smoothing the key point to be smoothed, the position deviation of the key point to be smoothed and its adjacent key points is first calculated. The position deviation refers to the height difference between the key point to be smoothed and the adjacent key points. If the position deviation of the key point to be smoothed and any of its adjacent key points is greater than the deviation threshold, that is, at this time, there are key points with obviously larger depth or smaller depth in the key point to be smoothed and its adjacent key points. If smoothing is still performed, it will affect the subsequent determination of whether these key points belong to weld key points, so there is no need to perform smoothing again.
[0185] If the position deviation between the key point to be smoothed and the adjacent key point is less than or equal to the deviation threshold, the midpoint coordinates between the adjacent key points are obtained according to the three-dimensional coordinates of the key points adjacent to the key point to be smoothed, and the key point to be smoothed is moved to the above midpoint coordinates to complete the smoothing of the key point to be smoothed. The above technical means are used to smooth all the key points to be smoothed, so that it is more accurate to judge whether the key point corresponds to the weld.
[0186] In step S603, the slice point cloud where the key points of the weld are located is used as the weld point cloud, that is, the slice point cloud corresponds to the weld, and the part of the groove point cloud representing the weld is determined according to the position of the weld point cloud in the groove point cloud, and then the weld position of the workpiece is determined according to the position of the point cloud representing the weld in the groove point cloud. The weld skips the weld points and holes, avoiding damage to the welding device and the workpiece.
[0187] It should be clarified that the technical solution for segmenting the groove point cloud and the technical solution for determining the weldable welds in the groove can be executed simultaneously or in sequence, without any restrictions on the order of execution.
[0188] See also Fig. 9 , Fig. 9A schematic diagram of a weld segmentation device for a ship workpiece according to an embodiment of the present application is shown.
[0189] The slicing module 910 is configured to perform equidistant slicing on the groove point cloud representing the groove in the workpiece point cloud obtained by collecting the ship workpiece data to obtain a slice point cloud, wherein the groove has a weld;
[0190] The calculation module 920 is configured to select two data points in each of the slice point clouds as planning points according to the order of the depth of the data points from small to large, and obtain the midpoint of the initial planning point in each of the slice point clouds as the planning midpoint;
[0191] The bow height module 930 is configured to use the first planned midpoint in the unsegmented groove point cloud as the segmentation starting point according to the arrangement order of the position information of each planned midpoint, and sequentially calculate the bow height between each planned midpoint and the segmentation starting point;
[0192] The segmentation module 940 is configured to use the first planned midpoint located after the segmentation starting point and with a bow height greater than the bow height threshold as a breakpoint, and to use the slice point cloud after the breakpoint as a new unsegmented groove point cloud to continue segmentation processing.
[0193] The weld segmentation method of the ship workpiece in the embodiment of the present application can be performed by Fig.10 The hardware device shown is implemented. Fig.10 To describe the hardware device according to the embodiment of the present application. Fig.10 The hardware device shown is only an example and should not bring any limitation to the functions and scope of application of the embodiments of the present application.
[0194] like Fig.10 As shown, the hardware device may be in the form of a general computing device. The components of the hardware device may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, and a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810).
[0195] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present invention described in the description of the exemplary method described above in this specification. For example, the processing unit 810 can perform the following steps: Figure 1 The steps shown in .
[0196] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .
[0197] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0198] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0199] The hardware device may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may communicate with one or more devices that enable a user to interact with the hardware device, and / or may communicate with any device that enables the hardware device to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 850. Furthermore, the hardware device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the hardware device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0200] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0201] In an exemplary embodiment of the present application, a computer program medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is enabled to execute the method described in the above method embodiment.
[0202] According to one embodiment of the present application, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0203] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0204] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0205] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0206] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0207] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0208] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0209] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0210] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the inventions applied for herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that the present application does not apply for. The specification and embodiments are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.
Claims
1. A method for segmenting a weld of a ship workpiece, characterized in that: The method comprises: In the workpiece point cloud obtained by collecting data of the ship workpiece, equidistantly slicing the groove point cloud representing the groove to obtain a slice point cloud, wherein a weld exists in the groove; According to each data point in each of the slice point clouds, plane fitting is performed on each of the slice point clouds to obtain a two-dimensional slice point cloud; For each of the two-dimensional slice point clouds, a set number of data point pairs are determined, and a straight line determined by each data point pair is used as an initial straight line; Taking data points in the two-dimensional slice point cloud whose distance from the initial straight line is less than a threshold as the inner points of the initial straight line; Taking the initial straight line with the largest number of interior points, and mapping each interior point of the initial straight line to the initial straight line to obtain a fitting line segment; In the two-dimensional slicing point cloud, the inner points of the fitting line segment are removed, and straight line fitting is performed again to determine other fitting line segments in the two-dimensional slicing point cloud until all data points in the two-dimensional slicing point cloud are inner points of the fitting line segment; The two data points with the smallest depth among the intersections of the fitting line segments are used as the planning points of the slice point cloud; The midpoint of the planning points in each of the slice point clouds is obtained as the planning midpoint; According to the arrangement order of the position information of each planned midpoint, the first planned midpoint in the unsegmented groove point cloud is used as the segmentation starting point, and the bow height between each planned midpoint and the segmentation starting point is calculated in sequence; The first planned midpoint located after the segmentation starting point and with a bow height greater than the bow height threshold is taken as a breakpoint, and the slice point cloud after the breakpoint is taken as a new unsegmented groove point cloud to continue segmentation processing.
2. The method according to claim 1, characterized in that In the workpiece point cloud obtained by collecting ship workpiece data, the groove point cloud representing the groove is sliced equidistantly to obtain a slice point cloud, and before a weld exists in the groove, the method further includes: A groove point cloud representing the groove is determined in a workpiece point cloud obtained by collecting data on a ship workpiece.
3. The method according to claim 2, characterized in that The step of determining a groove point cloud representing a groove from a workpiece point cloud obtained by collecting data from a ship workpiece comprises: Determine two selected points in the same horizontal plane of the workpiece point cloud, and the straight line where the two selected points are located is a first straight line; On the horizontal plane where the first straight line is located, the first straight line is parallelly mapped to both sides of the first straight line to obtain a second straight line and a third straight line; On the horizontal plane where the selected point is located, straight lines perpendicular to the first straight line are drawn through the selected point, which are the fourth straight line and the fifth straight line; A closed figure enclosed by the second straight line, the third straight line, the fourth straight line and the fifth straight line is used as a frame selection figure; The prism determined by taking the frame selection figure as the cross section is the frame selection space, and the workpiece point cloud in the frame selection space is the groove point cloud.
4. The method according to claim 1, characterized in that: In the workpiece point cloud obtained by collecting ship workpiece data, after equidistant slicing of the groove point cloud representing the groove to obtain the sliced point cloud, the method further includes: Slicing the groove point cloud to obtain a slice point cloud, and taking a data point in each slice point cloud as a key point according to the order of data point depth from large to small; Performing straight line fitting on the key points, and determining key points whose distances from the fitting straight line are within a distance threshold as weld key points; The weld position of the ship workpiece is determined according to the position information of the slice point cloud where the weld key point is located.
5. The method according to claim 1, characterized in that According to each data point in each slice point cloud, plane fitting is performed on each slice point cloud to obtain a two-dimensional slice point cloud, including: For the slice point cloud, a set number of point sets are determined, and planes determined by each point set are respectively used as initial planes, wherein the data point set is composed of any three data points in the slice point cloud that are not in the same straight line; Points in the slice point cloud whose distances from the initial plane are less than a length threshold are used as target points of the initial plane; the initial plane with the largest number of target points is optimized to obtain the two-dimensional slice point cloud.
6. The method according to claim 1, characterized in that The method of using the two data points with the smallest depth among the intersections of the fitting line segments as planning points of the slicing point cloud includes: The two initial key points with the smallest depth among the intersections of the fitted lines are used as rough planning points; The rough planning point with two adjacent rough planning points on the same side of the groove point cloud is used as the planning point to be smoothed; The planned point to be smoothed is moved to the middle position between adjacent planned points to be smoothed as a planning point.
7. A weld segmentation device for a ship workpiece, characterized in that: The device comprises: A slicing module is configured to perform equidistant slicing on a groove point cloud representing a groove in a workpiece point cloud obtained by collecting ship workpiece data to obtain a slice point cloud, wherein a weld exists in the groove; The calculation module is configured to perform plane fitting on the slice point clouds according to each data point in each slice point cloud to obtain a two-dimensional slice point cloud; determine a set number of data point pairs for each two-dimensional slice point cloud, and use the straight line determined by each data point pair as the initial straight line; use the data points in the two-dimensional slice point cloud that are less than a distance threshold from the initial straight line as the inner points of the initial straight line; take the initial straight line with the largest number of inner points, and map each inner point of the initial straight line to the initial straight line to obtain a fitting line segment; remove the inner points of the fitting line segment in the two-dimensional slice point cloud, perform straight line fitting again, and determine other fitting line segments in the two-dimensional slice point until each data point in the two-dimensional slice point cloud is an inner point of the fitting line segment; use the two data points with the smallest depth in the intersection of each fitting line segment as the planning points of the slice point cloud; and obtain the midpoint of the planning point in each slice point cloud as the planning midpoint; The bow height module is configured to take the first planned midpoint in the unsegmented groove point cloud as the segmentation starting point according to the arrangement order of the position information of each planned midpoint, and sequentially calculate the bow height between each planned midpoint and the segmentation starting point; The segmentation module is configured to use the first planned midpoint located after the segmentation starting point and with a bow height greater than the bow height threshold as a breakpoint, and to use the slice point cloud after the breakpoint as a new unsegmented groove point cloud to continue segmentation processing.
8. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Weld joint parameter identification method and device, electronic equipment and storage medium
CN114119611A
Weld joint identification method and device, welding robot and storage medium
CN115409808A