Pose recognition method and device of cylindrical workpiece, electronic equipment and storage medium
Identifying the pose of cylindrical workpieces through point cloud data and fitting algorithms solves the problem that traditional methods can only identify workpieces with fixed specifications, realizes the identification of workpieces with different specifications, and improves the applicability and accuracy of identification.
Patent Information
- Application Number
- CN202410961972.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-10-11
AI Technical Summary
The traditional cylindrical workpiece pose recognition method can only recognize fixed-specification workpieces with pre-established models, and cannot adapt to workpieces of different specifications, so the applicability is not high.
By obtaining the point cloud data of the scene, the structural characteristics of the cylindrical workpiece are used to calculate the central axis and radius parameters, and combined with the fitting algorithm and screening mechanism, the poses of workpieces of different specifications are identified.
It realizes the pose recognition of workpieces of different specifications, improves the applicability and accuracy of workpiece recognition, and reduces the cost of manual modeling.
Smart Images

Figure CN118762155A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of point cloud data processing, and in particular to a method, device, electronic device and storage medium for recognizing the posture of a cylindrical workpiece. Background Art
[0002] In the scenario where a cylindrical workpiece is transported by an intelligent device (such as a robotic arm or a handling robot), the posture of the cylindrical workpiece needs to be identified so that the intelligent device can safely grasp the workpiece to be transported.
[0003] In the related art, if a cylindrical workpiece of a certain specification is to be recognized in terms of its posture, a technician needs to model the cylindrical workpiece in advance according to its specifications, and then perform matching recognition based on the established model of the cylindrical workpiece. However, the traditional method for recognizing the posture of a cylindrical workpiece can only recognize cylindrical workpieces with pre-established models, that is, it can only recognize the posture of cylindrical workpieces of fixed specifications. When there are cylindrical workpieces of different specifications in the scene, it is impossible to recognize the posture of each cylindrical workpiece in the scene. It can be seen that the traditional method for recognizing the posture of a cylindrical workpiece is not very applicable. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for recognizing the posture of a cylindrical workpiece, so as to improve the applicability of the posture recognition of a cylindrical workpiece. The specific technical solution is as follows:
[0005] In a first aspect of an embodiment of the present application, a method for recognizing a posture of a cylindrical workpiece is first provided, the method comprising:
[0006] Acquire point cloud data of a scene in which a cylindrical workpiece is placed as first point cloud data;
[0007] For each reference point in the first point cloud data, according to the structural features of the cylindrical workpiece, a first parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs is calculated using a normal vector at the reference point and a normal vector at a neighboring point of the reference point; wherein the first parameter represents the position of the center axis of the cylindrical workpiece; a workpiece expression further includes a second parameter representing the radius of the cylindrical workpiece; a neighboring point of a reference point includes: a point in the first point cloud data whose distance to the reference point is less than the first distance;
[0008] Based on the accuracy of each workpiece expression, the workpiece expressions representing the same cylindrical workpiece in each workpiece expression are screened to determine target workpiece expressions representing different cylindrical workpieces from each workpiece expression; wherein the accuracy of a workpiece expression is determined based on the difference between the distance between the first type of point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression and the radius represented by the second parameter in the workpiece expression; the first type of point corresponding to a workpiece expression includes: a point in the first point cloud data whose distance from the central axis represented by the first parameter in the workpiece expression is less than the second distance; the second distance is not less than the radius represented by the second parameter in the workpiece expression;
[0009] For each target workpiece expression, a cylindrical fitting algorithm is used to fit the points of the cylindrical workpiece represented by the target workpiece expression in the first point cloud data to obtain the position of the center point of the cylindrical workpiece represented by the target workpiece expression;
[0010] The position and posture of the cylindrical workpiece represented by the target workpiece expression are obtained by combining the workpiece length and the position of the center point of the cylindrical workpiece represented by the target workpiece expression, and the first parameter and the second parameter in the target workpiece expression.
[0011] In a second aspect of an embodiment of the present application, a posture recognition device for a cylindrical workpiece is provided, the device comprising:
[0012] A first point cloud data acquisition module is used to acquire point cloud data of a scene where a cylindrical workpiece is placed as first point cloud data;
[0013] A first calculation module is used to calculate, for each reference point in the first point cloud data, a first parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs, using a normal vector at the reference point and a normal vector at a neighboring point of the reference point according to the structural features of the cylindrical workpiece; wherein the first parameter represents the position of the center axis of the cylindrical workpiece; a workpiece expression further includes a second parameter representing the radius of the cylindrical workpiece; and a neighboring point of a reference point includes: a point in the first point cloud data whose distance from the reference point is less than the first distance;
[0014] The first screening module is used to screen the workpiece expressions representing the same cylindrical workpiece in each workpiece expression based on the accuracy of each workpiece expression, so as to determine the target workpiece expressions representing different cylindrical workpieces from each workpiece expression; wherein the accuracy of a workpiece expression is determined by: the difference between the distance between the first type of point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression and the radius represented by the second parameter in the workpiece expression; the first type of point corresponding to a workpiece expression includes: the point in the first point cloud data whose distance from the central axis represented by the first parameter in the workpiece expression is less than the second distance; the second distance is not less than the radius represented by the second parameter in the workpiece expression;
[0015] A center point determination module is used to fit the points of the cylindrical workpiece represented by the target workpiece expression in the first point cloud data using a cylindrical fitting algorithm for each target workpiece expression, so as to obtain the position of the center point of the cylindrical workpiece represented by the target workpiece expression;
[0016] The posture determination module is used to obtain the posture of the cylindrical workpiece represented by the target workpiece expression by combining the workpiece length, the position of the center point of the cylindrical workpiece represented by the target workpiece expression, and the first parameter and the second parameter in the target workpiece expression.
[0017] According to a third aspect of the embodiments of the present application, an electronic device is provided, including:
[0018] Memory, used to store computer programs;
[0019] The processor is used to implement any of the above-mentioned methods for recognizing the position and posture of a cylindrical workpiece when executing a program stored in the memory.
[0020] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned methods for recognizing the posture of a cylindrical workpiece is implemented.
[0021] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-described methods for recognizing the posture of a cylindrical workpiece.
[0022] Beneficial effects of the embodiments of the present application:
[0023] The embodiment of the present application provides a method for recognizing the position and posture of a cylindrical workpiece. The first point cloud data includes the point cloud data of a cylindrical workpiece placed in a scene. Since the features of the point cloud data of the cylindrical workpiece conform to the geometric features of the cylinder, the present application can calculate the position of the central axis of the cylindrical workpiece according to the structural features of the cylindrical workpiece, using the normal vector at the reference point and the normal vector at the neighboring point of the reference point, and then combine the radius of the cylindrical workpiece to which the reference point belongs to obtain the first parameter and the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs. Moreover, since there may be a situation where multiple reference points can belong to the same cylindrical workpiece, there may also be a situation where the reference point is located in the area occupied by a non-cylindrical workpiece in the scene, therefore, the accuracy of each workpiece expression can be combined for screening, and the target workpiece expressions representing different cylindrical workpieces can be determined from each workpiece expression. Among them, since the accuracy of a workpiece expression is obtained based on the spatial relationship between the first type of point corresponding to the workpiece expression and the cylindrical workpiece represented by the workpiece expression. That is, the closer the distance between the first type of point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression is to the radius represented by the second parameter in the workpiece expression, the more it indicates that the first type of point corresponding to the workpiece expression meets the structural characteristics of a cylindrical workpiece, and accordingly, the greater the probability that a cylindrical workpiece exists at the position represented by the workpiece expression in the real world to which the first point cloud data belongs. Therefore, the accuracy of a workpiece expression can reflect the confidence that a cylindrical workpiece exists at the position represented by the workpiece expression in the real world to which the first point cloud data belongs. Furthermore, the center point of the cylindrical workpiece represented by each target workpiece expression can be obtained in combination with the first point cloud data, and the position and posture of the cylindrical workpiece represented by each target workpiece expression can be obtained in combination with the workpiece length of the cylindrical workpiece represented by each target workpiece expression. That is to say, the method for recognizing the posture of a cylindrical workpiece provided in the present application can recognize the posture of the cylindrical workpiece contained in the point cloud data through the structural features of the cylindrical workpiece, without the need to perform matching and recognition in the point cloud data based on a pre-established workpiece model. In this way, the posture of workpieces of different specifications in the scene can be recognized, thereby improving the applicability of posture recognition of cylindrical workpieces.
[0024] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0026] Figure 1 A first flow chart of a method for recognizing the position and posture of a cylindrical workpiece provided in an embodiment of the present application;
[0027] FIG2( a ) is a schematic cross-sectional view of a cylindrical workpiece;
[0028] FIG2( b ) is a schematic cross-sectional view of another cylindrical workpiece;
[0029] Figure 3 This is a spatial schematic diagram of a cylindrical workpiece in this application;
[0030] Figure 4 A second flow chart of the method for recognizing the position and posture of a cylindrical workpiece provided in an embodiment of the present application;
[0031] Figure 5 A third flow chart of the method for recognizing the position and posture of a cylindrical workpiece provided in an embodiment of the present application;
[0032] Figure 6 A fourth flow chart of the method for recognizing the position and posture of a cylindrical workpiece provided in an embodiment of the present application;
[0033] Figure 7 A fifth flow chart of the method for recognizing the position and posture of a cylindrical workpiece provided in an embodiment of the present application;
[0034] Figure 8 A structural diagram of a cylindrical workpiece posture recognition device provided in an embodiment of the present application;
[0035] Fig. 9 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0037] In the scenario where a cylindrical workpiece is transported by an intelligent device (such as a robotic arm or a handling robot), the posture of the cylindrical workpiece needs to be identified so that the intelligent device can safely grasp the workpiece to be transported.
[0038] In the related art, if a cylindrical workpiece of a certain specification is to be recognized in terms of its posture, a technician needs to model the cylindrical workpiece in advance according to its specifications, and then perform matching recognition based on the established model of the cylindrical workpiece. However, the traditional method for recognizing the posture of a cylindrical workpiece can only recognize cylindrical workpieces with pre-established models, that is, it can only recognize the posture of cylindrical workpieces of fixed specifications. When there are cylindrical workpieces of different specifications in the scene, it is impossible to recognize the posture of each cylindrical workpiece in the scene. It can be seen that the traditional method for recognizing the posture of a cylindrical workpiece is not very applicable.
[0039] Therefore, how to identify the posture of cylindrical workpieces in the scene to improve the applicability of workpiece posture recognition has become an urgent problem to be solved.
[0040] The present application embodiment provides a method for recognizing the position and posture of a cylindrical workpiece, which can be applied to electronic equipment. Figure 1 , Figure 1 A first flow chart of a method for recognizing the posture of a cylindrical workpiece provided in an embodiment of the present application, the method comprising the following steps:
[0041] S101: Acquire point cloud data of a scene in which a cylindrical workpiece is placed as first point cloud data.
[0042] S102: For each reference point in the first point cloud data, according to the structural features of the cylindrical workpiece, using the normal vector at the reference point and the normal vectors at points adjacent to the reference point, calculate the first parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs.
[0043] Among them, the first parameter represents the position of the center axis of the cylindrical workpiece; a workpiece expression also includes a second parameter representing the radius of the cylindrical workpiece; and the neighboring points of a reference point include: points in the first point cloud data whose distance to the reference point is less than the first distance.
[0044] S103: Based on the accuracy of each workpiece expression, the workpiece expressions representing the same cylindrical workpiece in each workpiece expression are screened to determine target workpiece expressions representing different cylindrical workpieces from each workpiece expression.
[0045] Among them, the accuracy of a workpiece expression is determined by: based on the difference between the distance between the first type of point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression, and the radius represented by the second parameter in the workpiece expression; the first type of point corresponding to a workpiece expression includes: points in the first point cloud data whose distance from the central axis represented by the first parameter in the workpiece expression is less than the second distance; the second distance is not less than the radius represented by the second parameter in the workpiece expression.
[0046] S104: For each target workpiece expression, a cylindrical fitting algorithm is used to fit points in the first point cloud data belonging to the cylindrical workpiece represented by the target workpiece expression to obtain the position of the center point of the cylindrical workpiece represented by the target workpiece expression.
[0047] S105: Combining the workpiece length and the position of the center point of the cylindrical workpiece represented by the target workpiece expression, and the first parameter and the second parameter in the target workpiece expression, obtain the posture of the cylindrical workpiece represented by the target workpiece expression.
[0048] Based on the above processing, the first point cloud data includes the point cloud data of the cylindrical workpiece placed in the scene. Since the characteristics of the point cloud data of the cylindrical workpiece conform to the geometric characteristics of the cylinder, the present application can calculate the position of the central axis of the cylindrical workpiece according to the structural characteristics of the cylindrical workpiece, using the normal vector at the reference point and the normal vector at the neighboring point of the reference point, and then combined with the radius of the cylindrical workpiece to which the reference point belongs, the first parameter and the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs can be obtained. Moreover, since there may be multiple reference points that can belong to the same cylindrical workpiece, there may also be a situation where the reference point is located in the area occupied by the non-cylindrical workpiece in the scene, therefore, the accuracy of each workpiece expression can be combined for screening, and the target workpiece expressions that respectively characterize different cylindrical workpieces can be determined from each workpiece expression. Among them, since the accuracy of a workpiece expression is obtained based on the spatial relationship between the first type of point corresponding to the workpiece expression and the cylindrical workpiece represented by the workpiece expression. That is, the closer the distance between the first type of point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression is to the radius represented by the second parameter in the workpiece expression, the more it indicates that the first type of point corresponding to the workpiece expression meets the structural characteristics of the cylindrical workpiece, and accordingly, the greater the probability that a cylindrical workpiece exists at the position represented by the workpiece expression in the real world to which the first point cloud data belongs. Therefore, the accuracy of a workpiece expression can reflect the confidence that a cylindrical workpiece exists at the position represented by the workpiece expression in the real world to which the first point cloud data belongs. Furthermore, the center point of the cylindrical workpiece represented by each target workpiece expression can be obtained in combination with the first point cloud data, and the workpiece length of the cylindrical workpiece represented by each target workpiece expression can be combined to obtain the posture of the cylindrical workpiece represented by each target workpiece expression. In other words, the posture recognition method of the cylindrical workpiece provided in the present application can recognize the posture of the cylindrical workpiece contained in the point cloud data through the structural characteristics of the cylindrical workpiece, and can also recognize the posture of workpieces of different specifications in the scene, thereby improving the applicability of posture recognition of the cylindrical workpiece.
[0049] In addition, in the related art, in the process of identifying the point cloud data of the scene containing the workpiece, the point cloud data is matched according to the pre-established model to identify the position and posture of the workpiece. In other words, only the position and posture of the workpiece corresponding to the specifications of the model in the scene can be identified. Accordingly, a large amount of labor costs are required in the early stage to establish models of workpieces of different specifications.
[0050] However, as analyzed above, the posture recognition method of the cylindrical workpiece provided in the present application can recognize the posture of the cylindrical workpiece contained in the point cloud data through the structural features of the cylindrical workpiece, without the need to perform matching and recognition in the point cloud data based on a pre-established workpiece model. In this way, the labor cost of posture recognition of the cylindrical workpiece can be reduced, the recognition requirements of cylindrical workpieces of different specifications (sizes) in mixed material scenarios are solved, and the posture recognition requirements of cylindrical workpieces of the same specifications are compatible.
[0051] In the present application, the electronic device may be an intelligent device (such as a robotic arm or a handling robot) that needs to carry workpieces. Alternatively, the electronic device may also be a control platform for the intelligent device. For example, when the intelligent device is a handling robot, the intelligent device may be a robot control platform, and accordingly, the electronic device may communicate with the intelligent device.
[0052] It can be understood that when a cylindrical workpiece to be transported in a scene needs to be transported, the electronic device obtains the posture of the cylindrical workpiece placed in the scene according to the posture recognition method of the cylindrical workpiece provided in this application, and then grasps and transports the cylindrical workpiece to be transported.
[0053] The cylindrical workpiece in the present application can be a workpiece that conforms to the characteristics of a cylinder as a whole, see Figure 2(a), Figure 2(a) is a schematic cross-sectional view of a cylindrical workpiece. The cross-section of the cylindrical workpiece shown in Figure 2(a) is a complete circle, and accordingly, the cylindrical workpiece has two circular bottom surfaces and a side surface (curved surface C1) connecting the two circular bottom surfaces. Alternatively, the cylindrical workpiece in the present application can also be a workpiece that partially conforms to the characteristics of a cylinder, see Figure 2(b), Figure 2(b) is a schematic cross-sectional view of another cylindrical workpiece. The cross-section of the cylindrical workpiece shown in Figure 2(b) is a polygon as shown in the figure, and the polygon is composed of a straight line and 3 / 4 of the circumference. Accordingly, the cylindrical workpiece has two polygonal bottom surfaces and two side surfaces (curved surface C2 and plane C3) connecting the two circular bottom surfaces.
[0054] It is understandable that, for the workpiece that partially conforms to the cylindrical features, in the process of collecting point cloud data of the scene where the workpiece is placed, if the point cloud data corresponding to the part of the workpiece that conforms to the cylindrical features can be collected, then the point cloud data of the workpiece conforms to the geometric features of the cylinder. Therefore, based on the posture recognition method of the cylindrical workpiece provided in this application, the posture of the workpiece that partially conforms to the cylindrical features can be recognized. In other words, the cylindrical workpiece in this application is not limited to the workpiece that conforms to the cylindrical features as a whole, which can further improve the applicability of posture recognition of cylindrical workpieces and improve the efficiency of posture recognition of cylindrical workpieces.
[0055] For step S101, point cloud data (ie, first point cloud data) of a scene where cylindrical workpieces are placed can be collected by a point cloud data collection device. For example, the scene where cylindrical workpieces are placed can be an area in a factory where workpieces to be transported are stored.
[0056] Among them, the number of workpieces placed in the scene is not limited. For example, the number of workpieces placed in the scene can be one or more. Correspondingly, the placement of each workpiece in the scene is not limited. For example, multiple workpieces in the scene can be placed in parallel, or they can be stacked. It can be understood that in a scene where multiple workpieces are stacked, for an obscured cylindrical workpiece, for a part of the collected point cloud data of the cylindrical workpiece, if the part of the point cloud data meets the geometric characteristics of the cylinder, the obscured cylindrical workpiece can be identified based on the posture recognition method of the cylindrical workpiece provided in the present application. It can be seen that the posture recognition method of the cylindrical workpiece provided in the present application can identify the posture of each workpiece in a scene where multiple workpieces are stacked, and can improve the applicability of posture recognition of cylindrical workpieces.
[0057] The point cloud data acquisition device includes but is not limited to: any one of an RGB-D (RedGreenBlue-Depth) camera, a stereo vision camera, and a structured-light camera. The point cloud data acquisition device can be installed on an intelligent device that needs to move the workpiece, or the point cloud data acquisition device can also be independently installed at a fixed position in the above scene.
[0058] It is understandable that the first point cloud data includes point cloud data of cylindrical workpieces in the scene, and also includes point cloud data of areas occupied by non-cylindrical workpieces in the scene, such as point cloud data of background areas such as the ground and walls.
[0059] With respect to step S102 , the reference points may be all the points included in the first point cloud data, or the reference points may be some of the points selected from all the points included in the first point cloud data.
[0060] Correspondingly, the electronic device may select some points from all the points included in the first point cloud data as reference points according to a preset reference point selection method.
[0061] In one implementation, before step S102, the method further includes: sampling points included in the first point cloud data at preset intervals to obtain reference points.
[0062] In an embodiment of the present application, after acquiring the first point cloud data, all points included in the first point cloud data may be numbered, sampled according to a preset numbering interval, and the sampled points may be used as reference points. The preset numbering interval may be set according to actual needs.
[0063] It is understandable that when determining the preset interval, the efficiency and accuracy requirements of the cylindrical workpiece's posture recognition can be weighed, so that the number of reference points obtained by sampling is as small as possible, while ensuring that at least one reference point is distributed on each workpiece in the scene, to avoid missing the posture of the workpiece in the scene. Correspondingly, when the accuracy requirements for posture recognition are high, a smaller preset interval can be set. At this time, the number of reference points obtained is large, and there may be a situation where multiple reference points are distributed on a workpiece; when the efficiency requirements for posture recognition are high, a larger preset interval can be set.
[0064] Alternatively, after obtaining the first point cloud data, a point included in the first point cloud data may be selected according to its spatial position, and the selected point may be used as a reference point. For example, the first point cloud data may be traversed in a 3×3×3 step length, and a point included in the first point cloud data may be selected in the space corresponding to each step length as a reference point.
[0065] Accordingly, for each reference point, a point in the first point cloud data whose distance to the reference point is less than the first distance may be determined as a neighboring point of the reference point.
[0066] The electronic device can process the first point cloud data based on the point cloud normal vector estimation algorithm, and for each point included in the first point cloud data, calculate the normal vector at the point according to the local geometric features at the point. Accordingly, it is possible to obtain the normal vector at each reference point and the normal vectors at each neighboring point of the reference point. Among them, the point cloud normal vector estimation algorithm can be a principal component analysis (PCA, Principal Components Analysis) algorithm, a least squares method, etc.
[0067] For a reference point, a workpiece expression can be determined based on a neighboring point corresponding to the reference point. Correspondingly, for a reference point, if there are multiple neighboring points corresponding to the reference point, the workpiece expression corresponding to the reference point and each neighboring point can be determined, that is, multiple workpiece expressions corresponding to the reference point can be determined.
[0068] Specifically, for a reference point, the first parameter of the workpiece expression of the cylindrical workpiece to which the reference point and the adjacent point belong can be obtained by using the normal vector at the reference point and the normal vector at a neighboring point corresponding to the reference point according to the structural characteristics of the cylindrical workpiece.
[0069] The first parameter in the workpiece expression of the cylindrical workpiece represents: the position of the center axis of the cylindrical workpiece. Accordingly, the unit vector representing the center axis direction of the cylindrical workpiece in the above workpiece expression can be used And any point B on the center axis of the cylindrical workpiece, determine the spatial coordinate system where the first point cloud data passes through point B and is connected to the unit vector A straight line with the same direction can determine the position of the center axis of the cylindrical workpiece. That is, the first parameter in the workpiece expression of any cylindrical workpiece can include: the coordinates of any point on the center axis of the cylindrical workpiece, and the vector representing the direction of the center axis of the cylindrical workpiece. Specifically, for each reference point, according to the structural features of the cylindrical workpiece, the normal vector at the reference point and the normal vector at the neighboring point of the reference point in the first point cloud data are used to calculate the first parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs. This process will be described in detail in the subsequent embodiments.
[0070] In addition, the second parameter in the workpiece expression of the cylindrical workpiece represents: the radius of the cylindrical workpiece. Specifically, for each reference point, the process of obtaining the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs will be described in detail in the subsequent embodiments.
[0071] See also Figure 3 , Figure 3 A1 and A2 are two points on the surface of the cylindrical workpiece. is the normal vector at A1, is the normal vector at A2, point B is any point on the center axis of the cylindrical workpiece, r represents the radius of the cylindrical workpiece, is the unit vector representing the center axis direction of the cylindrical workpiece.
[0072] For a cylindrical workpiece in the scene, the position of the cylindrical workpiece in the first point cloud data can be determined by a workpiece expression. Accordingly, the workpiece expression of a cylindrical workpiece can be expressed as: in, is a unit vector representing the direction of the central axis of the cylindrical workpiece, r represents the radius of the cylindrical workpiece, C represents the midpoint on the central axis of the cylindrical workpiece, and L represents the workpiece length of the cylindrical workpiece.
[0073] For step S103, for a workpiece expression, the distance between each point included in the first point cloud data and the central axis represented by the first parameter in the workpiece expression (which can be called the first to-be-processed distance) can be calculated, and then the points whose corresponding first to-be-processed distance is less than the second distance are determined as the first type of points corresponding to the workpiece expression. The second distance is not less than the radius represented by the second parameter in the workpiece expression. In other words, the first type of points corresponding to a workpiece expression represent: points inside and near the space corresponding to the workpiece expression in the first point cloud data.
[0074] Furthermore, for each first-class point corresponding to the workpiece expression, the difference between the first to-be-processed distance corresponding to each first-class point and the radius represented by the second parameter in the workpiece expression is calculated, and the accuracy of the workpiece expression is determined based on the difference corresponding to each first-class point.
[0075] It can be understood that the accuracy of a workpiece expression is obtained based on the spatial relationship between the first-class point corresponding to the workpiece expression and the cylindrical workpiece represented by the workpiece expression. That is, the closer the distance between the first-class point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression is to the radius represented by the second parameter in the workpiece expression, the smaller the difference corresponding to each first-class point is, indicating that the first-class point corresponding to the workpiece expression meets the structural characteristics of the cylindrical workpiece, and accordingly, the greater the probability that a cylindrical workpiece exists at the position represented by the workpiece expression in the real world to which the first point cloud data belongs. Therefore, the accuracy of a workpiece expression can reflect: the confidence that a cylindrical workpiece exists at the position represented by the workpiece expression in the real world to which the first point cloud data belongs.
[0076] In some embodiments, the accuracy of any artifact expression includes: a first accuracy, and / or a second accuracy.
[0077] The first accuracy of any workpiece expression is calculated by the following steps: calculating the difference between the distance between each first-class point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression, and the radius represented by the second parameter in the workpiece expression; calculating the proportion of the first-class points whose corresponding difference is less than the first threshold as the first accuracy of the workpiece expression.
[0078] In an embodiment of the present application, for each first-type point corresponding to a workpiece expression, a difference corresponding to the first-type point is less than a first threshold, indicating that the distance from the first-type point to the central axis represented by the first parameter in the workpiece expression is close to the radius. At this time, it can be considered that the first-type point is located on the surface of the cylindrical workpiece.
[0079] Correspondingly, a larger proportion of the first-class points whose corresponding difference values are less than the first threshold value indicates that a higher proportion of the first-class points of the workpiece expression that are located on the surface of the cylindrical workpiece represented by the workpiece expression is present, and a greater probability that a cylindrical workpiece exists at the position represented by the workpiece expression in the real world to which the first point cloud data belongs is present, that is, a greater confidence level that a cylindrical workpiece exists at the position represented by the workpiece expression is present.
[0080] In this way, the first accuracy can reflect the proportion of first-class points that meet the geometric characteristics of the cylinder among the first-class points corresponding to the workpiece expression. Correspondingly, it can also reflect the confidence that a cylindrical workpiece exists at the position represented by the workpiece expression in the real world to which the first point cloud data belongs.
[0081] The second accuracy of any workpiece expression is calculated by the following steps: calculating the difference between the distance between each first-class point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression, and the radius represented by the second parameter in the workpiece expression; calculating the sum of the differences corresponding to each first-class point corresponding to the workpiece expression as the second accuracy of the workpiece expression.
[0082] In an embodiment of the present application, for a workpiece expression, after calculating the difference between the first to-be-processed distance of each first-class point corresponding to the workpiece expression and the radius represented by the second parameter in the workpiece expression, the sum of the differences corresponding to each first-class point corresponding to the workpiece expression can be calculated as the second accuracy of the workpiece expression. It can be understood that the smaller the sum, the closer the distance from each first-class point to the central axis represented by the first parameter in the workpiece expression is to the radius, indicating that the closer each first-class point is to the surface of the cylindrical workpiece, and accordingly, the greater the confidence that a cylindrical workpiece exists at the position represented by the workpiece expression in the real world to which the first point cloud data belongs.
[0083] In this way, the second accuracy can reflect the degree of conformity of the first type of points corresponding to the workpiece expression with the geometric features of the cylinder, and can also reflect the confidence that a cylindrical workpiece exists at the position represented by the workpiece expression in the real world to which the first point cloud data belongs.
[0084] In the present application, since there may be multiple reference points that may belong to the same cylindrical workpiece, and there may also be a reference point located in the area occupied by a non-cylindrical workpiece in the scene, the electronic device can obtain the accuracy of each workpiece expression, and then, based on the accuracy of each workpiece expression, screen the workpiece expressions representing the same cylindrical workpiece in each workpiece expression to determine target workpiece expressions representing different cylindrical workpieces from each workpiece expression. There are multiple specific processes for determining target workpiece expressions representing different cylindrical workpieces, which will be described in detail in subsequent embodiments.
[0085] For steps S104-S105, for each target workpiece expression, the position of the cylindrical workpiece represented by the target workpiece expression in the spatial coordinate system where the first point cloud data is located cannot be uniquely determined based on the radius and the position of the central axis of the cylindrical workpiece represented by the target workpiece expression. Accordingly, it is necessary to obtain the workpiece length of the cylindrical workpiece represented by the target workpiece expression and the position of the center point of the cylindrical workpiece represented by the target workpiece expression.
[0086] Correspondingly, for each target workpiece expression, the points in the first point cloud data that belong to the cylindrical workpiece represented by the target workpiece expression (i.e., the third type of points in this application) can be determined, and then, the third type of points corresponding to the target workpiece expression can be fitted using a cylindrical fitting algorithm to obtain the position of the center point of the cylindrical workpiece represented by the target workpiece expression.
[0087] In one implementation, the workpiece lengths of the cylindrical workpieces placed in the scene are consistent. In this case, the electronic device does not need to distinguish the workpiece length of each cylindrical workpiece in the scene. At this time, the technician can pre-record the workpiece lengths of the cylindrical workpieces placed in the scene according to the actual scene, and then the electronic device can obtain the pre-recorded workpiece lengths of the cylindrical workpieces placed in the scene as the workpiece length of the cylindrical workpiece represented by the target workpiece expression. Alternatively, the electronic device can also calculate the workpiece length of each cylindrical workpiece in the scene, and the process of specifically determining the workpiece lengths of the cylindrical workpieces represented by each target workpiece expression will be described in detail in subsequent embodiments.
[0088] In another implementation, the workpiece lengths of the cylindrical workpieces placed in the scene are inconsistent. At this time, for each target workpiece expression, a cylindrical fitting algorithm can be used to fit the points of the cylindrical workpiece represented by the target workpiece expression in the first point cloud data to obtain the workpiece length of the cylindrical workpiece represented by the target workpiece expression. The specific process of determining the workpiece length of the cylindrical workpiece represented by each target workpiece expression will be described in detail in subsequent embodiments.
[0089] Furthermore, the electronic device can determine the unique posture of the cylindrical workpiece represented by the target workpiece expression in the spatial coordinate system where the first point cloud data is located by combining the position of the center point of the cylindrical workpiece represented by the target workpiece expression, the workpiece length of the cylindrical workpiece represented by the target workpiece expression, and the first parameter and the second parameter in the target workpiece expression, that is, obtain the posture of the cylindrical workpiece represented by the target workpiece expression.
[0090] In some embodiments, the radius of cylindrical artifacts placed in the scene is not consistent. Figure 4 , Figure 4 A second flow chart of the method for recognizing the position and posture of a cylindrical workpiece provided in an embodiment of the present application. Figure 1 On the basis of, step S102 comprises:
[0091] S1021: For each reference point in the first point cloud data, respectively calculate the outer product of the normal vector at the reference point and the normal vector at each neighboring point of the reference point to obtain a candidate unit vector corresponding to the reference point and each neighboring point.
[0092] The candidate unit vector represents: the direction of the center axis of the cylindrical workpiece to which the reference point and the adjacent point belong.
[0093] S1022: For each neighboring point of the reference point, determine a point on the center axis of the cylindrical workpiece to which the reference point belongs as the center axis point based on the coordinates of the reference point, the normal vector at the reference point, the coordinates of the neighboring point, and the normal vector at the neighboring point.
[0094] S1023: Based on a preset voting algorithm, vote on each candidate unit vector corresponding to the reference point to obtain a target unit vector of the reference point.
[0095] S1024: Determine the target unit vector of the reference point and the medial axis point corresponding to the neighboring point used in calculating the target unit vector as the first parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs.
[0096] Before step S103, the method further includes:
[0097] S102A: For each reference point in the first point cloud data and each neighboring point corresponding to the reference point, obtain a vector from the mid-axis point corresponding to the reference point and the neighboring point to the reference point as a first intermediate vector.
[0098] S102B: Calculate the modulus of the outer product of the candidate unit vectors corresponding to the reference point and the neighboring point and the first intermediate vector to obtain the candidate radii corresponding to the reference point and the neighboring point.
[0099] S102C: Based on a preset voting algorithm, voting is performed on the candidate radii corresponding to the reference point to obtain a target radius as the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs.
[0100] In an embodiment of the present application, since the radii of the cylindrical workpieces placed in the scene are inconsistent, for the workpiece expression of the cylindrical workpiece to which each reference point belongs, it is necessary to determine the position of the central axis of the cylindrical workpiece to which the reference point belongs (the first parameter of the workpiece expression) and the radius of the cylindrical workpiece to which the reference point belongs (the second parameter of the workpiece expression).
[0101] According to the geometric characteristics of the cylinder, the unit vector in the direction of the central axis of the cylinder is perpendicular to the normal vector at any point on the side surface of the cylinder. Accordingly, for each reference point in the first point cloud data and each neighboring point of the reference point, the outer product of the normal vector at the reference point and the normal vector at the neighboring point is calculated to obtain the candidate unit vector corresponding to the reference point and the neighboring point. Figure 3 As shown, Figure 3 In the example, point A1 is the reference point and point A2 is an adjacent point of point A1. Calculate the alternative unit vectors corresponding to points A1 and A2 in, is the normal vector at A1, is the normal vector at A2.
[0102] Furthermore, based on the coordinates of the reference point, the normal vector at the reference point, the coordinates of the neighboring point, and the normal vector at the neighboring point, a point on the central axis of the cylindrical workpiece to which the reference point belongs can be determined as the central axis point corresponding to the reference point and the neighboring point.
[0103] Specifically, based on the coordinates of the reference point, a straight line passing through the reference point and having the same direction as the normal vector at the reference point (which may be called the first reference straight line) may be determined. And based on the coordinates of the adjacent point, a straight line passing through the adjacent point and having the same direction as the normal vector at the adjacent point (which may be called the first adjacent straight line) may be determined. Furthermore, if the first reference straight line and the first adjacent straight line have an intersection, the intersection is determined as the mid-axis point corresponding to the reference point and the adjacent point. If the first reference straight line and the first adjacent straight line do not have an intersection, the point on the first reference straight line that is closest to the first adjacent straight line (which may be called the first connection point) and the point on the first adjacent straight line that is closest to the first reference straight line (which may be called the second connection point) may be determined. Furthermore, any point on the line connecting the first connection point and the second connection point may be determined as the mid-axis point corresponding to the reference point and the adjacent point. Figure 3 As shown, Figure 3 In the figure, point B is the central axis point corresponding to points A1 and A2.
[0104] In addition, the electronic device can obtain the vector from the mid-axis point corresponding to the reference point and the neighboring point, as the first intermediate vector. Furthermore, according to geometric knowledge, the modulus of the outer product of the candidate unit vector corresponding to the reference point and the neighboring point and the first intermediate vector is the radius of the cylindrical workpiece to which the reference point and the neighboring point belong. Therefore, the modulus of the outer product of the candidate unit vector corresponding to the reference point and the neighboring point and the first intermediate vector can be used as the alternative radius corresponding to the reference point and the neighboring point. Figure 3 In the scenario shown, the first intermediate vector is Alternative radius corresponding to point A1 and point A2
[0105] For each reference point, after obtaining the candidate unit vectors and candidate radii corresponding to the reference point, the candidate unit vectors and candidate radii corresponding to the reference point can be voted based on a preset voting algorithm to obtain the target unit vector and target radius of the reference point. The preset voting algorithm can be a Hough voting algorithm.
[0106] In one implementation, for the reference point, each candidate value pair corresponding to the reference point can be voted, and an alternative value pair is: the alternative unit vector and the alternative radius corresponding to the reference point and a neighboring point of the reference point. Then, the alternative value pair with the highest vote rate (which can be called the target value pair) is determined, and the alternative unit vector in the target value pair is determined as the target unit vector of the reference point, and the target unit vector of the reference point and the medial axis point corresponding to the neighboring point used when calculating the target unit vector are determined as the first parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs. The alternative radius in the target value pair is determined as the target radius, and the target radius is determined as the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs.
[0107] In another implementation, the candidate unit vectors and the candidate radiuses corresponding to the reference point may be voted for respectively. That is, after determining the candidate unit vectors corresponding to the reference point, the candidate unit vectors corresponding to the reference point may be voted for based on a preset voting algorithm, and the candidate unit vector with the highest vote rate may be determined as the target unit vector of the reference point. Similarly, after determining the candidate radiuses corresponding to the reference point, the candidate radiuses corresponding to the reference point may be voted for based on a preset voting algorithm, and the candidate radius with the highest vote rate may be determined as the target radius of the reference point.
[0108] In the above Figure 3 In the scenario shown, for any reference point, after determining the target radius and target unit vector of the reference point, it can be determined that any point B1 on the center axis of the cylindrical workpiece to which the reference point belongs satisfies: Among them, O is the origin of the spatial coordinate system where the first point cloud data is located, and r is the target radius corresponding to point A1. In other words, for a reference point, after the target radius of the reference point is determined, the point on the central axis corresponding to the reference point is also fixed, so there is no need to vote for each central axis point corresponding to the reference point.
[0109] Based on the above processing, when the radii of the cylindrical workpieces placed in the scene are inconsistent, the radius and the position of the central axis of the cylindrical workpiece can be calculated according to the structural characteristics of the cylindrical workpiece using the normal vector at the reference point and the normal vector at the neighboring point of the reference point in the first point cloud data, and the first parameter and the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs can be obtained. In this way, the position and posture of cylindrical workpieces of different specifications can be recognized, and the scope of application of the position and posture recognition method of cylindrical workpieces can be improved.
[0110] In some embodiments, the radii of the cylindrical workpieces placed in the scene are consistent. The above step S102 includes:
[0111] Step 1: For each reference point in the first point cloud data, respectively calculate the outer product of the normal vector at the reference point and the normal vector at each neighboring point of the reference point to obtain the candidate unit vector corresponding to the reference point and each neighboring point.
[0112] The candidate unit vector represents: the direction of the center axis of the cylindrical workpiece to which the reference point and the adjacent point belong.
[0113] Step 2: For each neighboring point of the reference point, determine a point on the center axis of the cylindrical workpiece to which the reference point belongs as the center axis point based on the coordinates of the reference point, the normal vector at the reference point, the coordinates of the neighboring point, and the normal vector at the neighboring point.
[0114] Step 3: Based on a preset voting algorithm, vote on each candidate unit vector corresponding to the reference point to obtain the target unit vector of the reference point.
[0115] Step 4: Determine the target unit vector of the reference point and the medial axis point corresponding to the neighboring point used in calculating the target unit vector as the first parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs.
[0116] Before step S103, the method further includes: for each reference point in the first point cloud data, obtaining the radius of a cylindrical workpiece placed in a pre-recorded scene as a second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs.
[0117] In the embodiment of the present application, since the radii of the cylindrical workpieces placed in the scene are consistent, the radii of the cylindrical workpieces placed in the pre-recorded scene can be obtained. For the workpiece expression of the cylindrical workpiece to which each reference point belongs, the obtained radius can be used as the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs.
[0118] In addition, the process of determining the position of the center axis of the cylindrical workpiece to which the reference point belongs (the first parameter of the workpiece expression) can refer to the above embodiment and will not be described in detail here.
[0119] Based on the above processing, when the radius of the cylindrical workpieces placed in the scene is consistent, the radius of the cylindrical workpiece placed in the recorded scene is obtained as the second parameter in the workpiece expression of the cylindrical workpiece to which each reference point belongs. In this way, the waste of computing resources can be avoided in the process of identifying the workpiece posture.
[0120] It is understandable that when the radii of the cylindrical workpieces placed in the scene are consistent, the electronic device can also calculate the radius of the cylindrical workpiece to which each reference point belongs (i.e., the second parameter in the workpiece expression of the cylindrical workpiece to which each reference point belongs) according to the above steps S102A-S102C. The specific calculation process can refer to the above embodiment and will not be described in detail here.
[0121] In some embodiments, see Figure 5 , Figure 5 The third flow chart of the method for recognizing the position and posture of a cylindrical workpiece provided in the embodiment of the present application. Figure 1 On the basis of, step S103 comprises:
[0122] S1031: For each workpiece expression, determine the minimum convex body formed by points in the first point cloud data that are located in the space represented by the workpiece expression.
[0123] S1032: If there are multiple workpiece expressions that meet the preset screening condition, then based on the accuracy of the multiple workpiece expressions, determine the target workpiece expression of the cylindrical workpiece commonly represented by the multiple workpiece expressions from the multiple workpiece expressions.
[0124] Among them, the preset screening condition indicates that: the overlap rate of the minimum convex bodies corresponding to any two workpiece expressions among the multiple workpiece expressions is greater than the second threshold, and the angle between the central axes represented by the first parameters of any two workpiece expressions among the multiple workpiece expressions is less than the first preset angle.
[0125] S1033: If there is a workpiece expression that does not satisfy the preset screening condition with other workpiece expressions, and the accuracy of the workpiece expression satisfies the preset retention condition, then the workpiece expression is determined to be the target workpiece expression for the cylindrical workpiece it represents.
[0126] In an embodiment of the present application, since there may be multiple reference points that may belong to the same cylindrical workpiece, the electronic device needs to filter the workpiece expressions that represent the same cylindrical workpiece in each workpiece expression, so as to determine the target workpiece expressions that respectively represent different cylindrical workpieces from each workpiece expression.
[0127] Correspondingly, for each workpiece expression, the space represented by the workpiece expression in the spatial coordinate system where the first point cloud data is located can be determined, and then the minimum convex body formed by the points of the first point cloud data located in the space represented by the workpiece expression can be determined, and the minimum convex body (also called convex hull) corresponding to each workpiece expression can be obtained.
[0128] If there are two workpiece expressions that meet the preset screening condition, that is, for the two workpiece expressions, the overlap rate of the minimum convex bodies corresponding to the two workpiece expressions is greater than the second threshold, and the angle between the central axes represented by the first parameters of the two workpiece expressions is less than the first preset angle, then it can be considered that the cylindrical workpieces represented by the two workpiece expressions are the same. The second threshold and the first preset angle are preset according to actual needs.
[0129] Accordingly, if there are multiple workpiece expressions that meet the preset screening condition, it can be considered that the cylindrical workpiece represented by the multiple workpiece expressions is the same. Furthermore, based on the accuracy of the multiple workpiece expressions, the multiple workpiece expressions can be screened to determine a target workpiece expression for representing the cylindrical workpiece.
[0130] In one implementation, when the accuracy of any artifact expression includes a first accuracy and a second accuracy, if there are multiple artifact expressions that satisfy a preset screening condition, then the target artifact expression determined from the multiple artifact expressions satisfies any of the following conditions:
[0131] Condition 1: When the target artifact expression is compared with any other artifact expression in the plurality of artifact expressions, a difference between the first accuracy of the target artifact expression and the first accuracy of the other artifact expression is greater than a third threshold.
[0132] Condition 2: When the target artifact expression is compared with any other artifact expression among the multiple artifact expressions, and the difference between the first accuracy of the target artifact expression and the first accuracy of the other artifact expression is not greater than a third threshold, the second accuracy of the target artifact expression is less than the second accuracy of the other artifact expression.
[0133] For the above-mentioned multiple workpiece expressions that meet the preset filtering conditions, the first workpiece expression with the highest accuracy among the multiple workpiece expressions can be obtained. If the difference between the first accuracy of the workpiece expression and the first accuracy of the other workpiece expressions is greater than the third threshold, at this time, there is a large difference in the confidence that there is a cylindrical workpiece at the position represented by the multiple workpiece expressions. Therefore, the first workpiece expression with the highest accuracy can be determined as the target workpiece expression.
[0134] Correspondingly, if the difference between the first accuracy of the workpiece expression and the first accuracy of the other workpiece expressions is not greater than the third threshold, then the workpiece expression with the smallest second accuracy can be determined as the target workpiece expression.
[0135] In this way, the first accuracy and the second accuracy of the workpiece expression can be combined for screening. Since the first accuracy and the second accuracy evaluate the confidence of the existence of a cylindrical workpiece at the position represented by the workpiece expression from different angles, screening by combining the first accuracy and the second accuracy of the workpiece expression can improve the accuracy of the screening results.
[0136] In another implementation, when the accuracy of any artifact expression includes only the first accuracy, the artifact expression with the highest first accuracy among the multiple artifact expressions may be obtained, and the artifact expression with the highest first accuracy may be directly determined as the target artifact expression.
[0137] In another implementation, when the accuracy of any artifact expression only includes the second accuracy, the artifact expression with the minimum second accuracy among the multiple artifact expressions may be obtained, and the artifact expression with the minimum second accuracy may be directly determined as the target artifact expression.
[0138] If there is a workpiece expression that does not meet the preset screening conditions with other workpiece expressions, that is, among other workpiece expressions, there is no workpiece expression that represents the same cylindrical workpiece as the workpiece expression. If the accuracy of the workpiece expression does not meet the preset retention conditions, it means that the reference point for obtaining the workpiece expression may be located in the area occupied by non-cylindrical workpieces in the scene, so the workpiece expression of the reference point can be screened out. Accordingly, the workpiece expression whose accuracy meets the preset retention conditions can be determined as the target workpiece expression for the cylindrical workpiece it represents.
[0139] In one implementation, the accuracy of a workpiece expression that satisfies a preset retention condition indicates that a first accuracy of the workpiece expression is greater than a first preset accuracy, wherein the first preset accuracy is preset according to actual needs.
[0140] In another implementation, the accuracy of a workpiece expression that satisfies a preset retention condition indicates that the second accuracy of the workpiece expression is less than a second preset accuracy, wherein the second preset accuracy is preset according to actual needs.
[0141] In this way, when a workpiece expression alone represents a cylindrical workpiece, the workpiece expression obtained by excluding the reference point located in the area occupied by the non-cylindrical workpiece in the scene can be used according to the accuracy of the workpiece expression. This can ensure that the cylindrical workpiece represented by the determined target workpiece expression is real, thereby improving the accuracy of the posture recognition of the cylindrical workpiece.
[0142] Based on the above processing, the accuracy of the first point cloud data and each workpiece expression can be combined for screening, and the target workpiece expressions representing different cylindrical workpieces can be determined from each workpiece expression. In this way, the expressions of each cylindrical workpiece that actually exists in the first point cloud data (i.e., the target workpiece expression) can be obtained, thereby improving the accuracy of the position and posture recognition of the cylindrical workpiece.
[0143] In some embodiments, see Figure 6 , Figure 6 This is a fourth flow chart of the method for recognizing the position and posture of a cylindrical workpiece provided in an embodiment of the present application. Figure 1 On the basis of this, step S104 comprises:
[0144] S1041: For each target workpiece expression, determine points in the first point cloud data whose distance from the central axis represented by the first parameter in the target workpiece expression is less than a third distance as second-category points.
[0145] The third distance is not less than the radius represented by the second parameter in the target workpiece expression.
[0146] S1042: Clustering the second-category points corresponding to the target workpiece expression based on a preset clustering algorithm, and determining points belonging to the cylindrical workpiece represented by the target workpiece expression as third-category points.
[0147] S1043: Perform fitting processing on the third type of points corresponding to the target workpiece expression based on a cylindrical fitting algorithm, and calculate and obtain a covariance matrix corresponding to the target workpiece expression.
[0148] Wherein, any covariance matrix includes: a characteristic vector for representing the direction of the central axis of the cylindrical workpiece obtained by fitting.
[0149] S1044: replacing the eigenvector representing the center axis direction of the cylindrical workpiece obtained by fitting in the covariance matrix corresponding to the target workpiece expression with the part used to represent the center axis direction in the first parameter of the target workpiece expression.
[0150] S1045: Based on the replaced covariance matrix, mapping processing is performed on each third-category point corresponding to the target workpiece expression, so that the center axis direction of the cylindrical workpiece represented by each third-category point after mapping is consistent with the direction of the specified coordinate axis.
[0151] The specified coordinate axis is: any coordinate axis in the three-dimensional coordinate system corresponding to the first point cloud data.
[0152] S1046: Determine the point with the largest and the smallest coordinate value on the specified coordinate axis among the mapped third-category points as two endpoints.
[0153] S1047: Perform inverse mapping processing on the midpoint between the two endpoints based on the replaced covariance matrix to obtain the position of the midpoint in the coordinate system of the first point cloud data as the position of the center point of the cylindrical workpiece represented by the target workpiece expression.
[0154] It can be understood that, for each target workpiece expression, the point in the first point cloud data that is farther from the central axis corresponding to the target workpiece expression than the radius usually does not belong to the cylindrical workpiece represented by the target workpiece expression. Therefore, in the process of determining the points in the first point cloud data that belong to the cylindrical workpiece represented by the target workpiece expression, in order to avoid wasting computing resources by clustering all the points in the first point cloud data, the points near the space occupied by the cylindrical workpiece represented by the target workpiece expression (i.e., the second type of points) can be determined in advance. Specifically, the points in the first point cloud data whose distance from the central axis represented by the first parameter in the target workpiece expression is less than the third distance can be determined as the second type of points. Among them, the third distance is not less than the radius represented by the second parameter in the target workpiece expression. That is, the second type of points corresponding to a target workpiece expression represent: points inside and near the space corresponding to the target workpiece expression in the first point cloud data. Furthermore, the electronic device can cluster the second-class points corresponding to the target workpiece expression based on a preset clustering algorithm to obtain a clustering result indicating whether the second-class points belong to the cylindrical workpiece represented by the target workpiece expression. The second-class points belonging to the cylindrical workpiece represented by the target workpiece expression are used as third-class points. The preset clustering algorithm can be a fast Euclidean clustering method.
[0155] The cylindrical fitting algorithm may be a principal component analysis (PCA) algorithm. The cylindrical fitting algorithm may be used to fit the third type of points corresponding to the target workpiece expression, and the covariance matrix corresponding to the target workpiece expression may be calculated. The covariance matrix corresponding to the target workpiece expression includes: a feature vector for representing the fitted cylindrical workpiece in the central axis direction (which may be referred to as the first fitting direction), a feature vector for representing the fitted cylindrical workpiece in a direction perpendicular to the first fitting direction (which may be referred to as the second fitting direction), and a feature vector for representing the fitted cylindrical workpiece in a direction perpendicular to the first fitting direction and the second fitting direction (which may be referred to as the third fitting direction).
[0156] Among them, for a covariance matrix corresponding to a target workpiece expression, the variance distribution of the third type of points corresponding to the target workpiece expression in each direction corresponding to the covariance matrix can be calculated, and then the direction with the largest variance distribution is determined as the central axis direction of the cylindrical workpiece. Accordingly, the eigenvector representing the central axis direction of the fitted cylindrical workpiece in the covariance matrix corresponding to the target workpiece expression can be replaced by the part used to represent the central axis direction in the first parameter of the target workpiece expression (that is, the target unit vector contained in the first parameter of the target workpiece expression).
[0157] Furthermore, the electronic device can perform coordinate system conversion on each third-type point corresponding to the target workpiece expression based on the replaced covariance matrix. That is, the third-type points corresponding to the target workpiece expression are mapped based on the replaced covariance matrix so that the center axis direction of the cylindrical workpiece represented by each third-type point after mapping is consistent with the direction of the specified coordinate axis. The specified coordinate axis is: any coordinate axis in the three-dimensional coordinate system corresponding to the first point cloud data. For example, the specified coordinate axis can be the X-axis in the three-dimensional coordinate system corresponding to the first point cloud data.
[0158] For each third type point of the target workpiece expression after mapping, the point with the largest coordinate value in the specified coordinate axis direction (which can be called the maximum value endpoint) and the point with the largest coordinate value in the specified coordinate axis direction (which can be called the minimum value endpoint) can be determined. Then, the midpoint between the two endpoints in the specified coordinate axis direction is determined. Accordingly, the midpoint can be inversely mapped based on the replaced covariance matrix to obtain the position of the midpoint in the coordinate system of the first point cloud data as the position of the center point of the cylindrical workpiece represented by the target workpiece expression.
[0159] In one implementation, the method further includes: calculating the distance between the two endpoints as the workpiece length of the cylindrical workpiece represented by the target workpiece expression.
[0160] In the embodiment of the present application, when the workpiece lengths of the cylindrical workpieces placed in the scene are inconsistent, the distance between the two end points can be calculated as the workpiece length of the cylindrical workpiece represented by the target workpiece expression. Alternatively, when the workpiece lengths of the cylindrical workpieces placed in the scene are consistent, the electronic device can also calculate the workpiece lengths of each cylindrical workpiece placed in the scene according to the above steps.
[0161] In this way, the cylindrical fitting algorithm can be used to fit the points of the cylindrical workpiece represented by the target workpiece expression in the first point cloud data, and the workpiece length of each cylindrical workpiece placed in the scene can be obtained. The posture of cylindrical workpieces of different workpiece lengths can be recognized, thereby improving the scope of application of posture recognition of cylindrical workpieces.
[0162] Based on the above processing, in the process of calculating the center point of each cylindrical workpiece placed in the scene, the points (second type of points) near the space occupied by the cylindrical workpiece represented by the target workpiece expression can be clustered, which can reduce the amount of calculation when performing clustering processing on each target workpiece expression and avoid wasting computing resources. Subsequently, after obtaining the center point of each cylindrical workpiece placed in the scene, post-processing operations such as grabbing the cylindrical workpiece can be performed from the position of the center point of the cylindrical workpiece.
[0163] Compared with the related art, in which point cloud data is matched according to a pre-established model to identify the pose of the workpiece, the pose recognition method for a cylindrical workpiece provided in the present application can identify the pose of the cylindrical workpiece according to the structural characteristics of the cylindrical workpiece and the point cloud data collected from the real-world scene, without relying on the fixed specification value of the workpiece model. Therefore, the pose recognition method for a cylindrical workpiece provided in the present application can improve the detection accuracy and increase the accuracy of traditional workpiece pose recognition (5 mm) to 1 mm.
[0164] In some embodiments, see Figure 7 , Figure 7 The fifth flow chart of the method for recognizing the position and posture of a cylindrical workpiece provided in the embodiment of the present application. Figure 1 On the basis of, before step S104, the method further includes:
[0165] Step S106: For each target workpiece expression, determine points in the first point cloud data whose distance from the central axis represented by the first parameter in the target workpiece expression is less than a fourth distance as fourth type points.
[0166] Step S107: determining a fifth type of point from each fourth type of point corresponding to the target workpiece expression according to the normal vector at each fourth type of point corresponding to the target workpiece expression.
[0167] Among them, the direction represented by the normal vector at any fifth-category point is different from the direction of the foot of the perpendicular from the fifth-category point to the fifth-category point; the foot of a fifth-category point is: the intersection of a line passing through the fifth-category point and perpendicular to the central axis represented by the first parameter in the target workpiece expression and the central axis represented by the first parameter in the target workpiece expression.
[0168] Step S108: Based on the nonlinear optimization algorithm, the first parameter and the second parameter in the target workpiece expression are adjusted until the target correction function reaches a minimum value, so as to update the target workpiece expression.
[0169] Among them, the target correction function is: obtained based on the sum of the distance differences corresponding to each fifth type point of the target workpiece expression; the distance difference corresponding to a fifth type point represents: the distance between the fifth type point and the corresponding foot of the perpendicular, and the difference between the radius represented by the second parameter in the target workpiece expression.
[0170] In the embodiment of the present application, for each target workpiece expression, the process of determining each fourth-category point corresponding to the target workpiece expression and the normal vector at each fourth-category point can refer to the above embodiment and will not be described in detail here.
[0171] Since the point cloud data acquisition device can only collect point cloud data of a portion of the side surface of the cylindrical workpiece when collecting point cloud data of each cylindrical workpiece in the scene, it is possible to exclude points that cannot be collected by the point cloud data acquisition device from the fourth category points corresponding to the target workpiece expression based on the geometric characteristics of the cylindrical workpiece.
[0172] Specifically, for each fourth-category point, the direction of the foot of the perpendicular from the fourth-category point to the fourth-category point can be determined. If the direction represented by the normal vector at the fourth-category point is the same as the direction of the foot of the perpendicular from the fourth-category point to the fourth-category point, the fourth-category point can be excluded according to the visibility of the point cloud data acquisition device. The foot of a fourth-category point is: the intersection of a line passing through the fourth-category point and perpendicular to the central axis represented by the first parameter in the target workpiece expression and the central axis represented by the first parameter in the target workpiece expression.
[0173] Accordingly, for each fifth-class point, the distance between the fifth-class point and the foot of the perpendicular to the fifth-class point can be calculated as the second distance to be processed of the fifth-class point. Furthermore, based on the difference between the second distance to be processed of each fifth-class point of the target workpiece expression and the radius represented by the second parameter in the target workpiece expression, the target correction function is obtained. For example, for the target workpiece expression, the sum of the squares of the corresponding differences of each fifth-class point can be calculated as the target correction function. Accordingly, the target correction function can be expressed as: Among them, f irepresents the first distance to be used of each fifth type point of the target workpiece expression, r represents the radius of the cylindrical workpiece, A i Indicates the fifth type points corresponding to the target workpiece expression. Point B is any point on the central axis corresponding to the target workpiece expression. Indicates that point B points to A i The vector of the point, It is: the modulus of the outer product of the unit vector representing the direction of the central axis corresponding to the target workpiece expression and the vectors of the fifth type points corresponding to the target workpiece expression pointed by point B.
[0174] Furthermore, the first parameter and the second parameter in the target workpiece expression can be adjusted according to a nonlinear optimization algorithm until the target correction function reaches a minimum value to update the target workpiece expression. The nonlinear optimization algorithm can be a nonlinear regression (LM, Levenberg-Marquardt) algorithm.
[0175] Based on the above processing, for each target workpiece expression, the first parameter and the second parameter in the target workpiece expression can be corrected to minimize the distance between the position of the cylindrical workpiece represented by the target workpiece expression in space and the fifth type of point corresponding to the target workpiece expression. That is, the cylindrical workpiece represented by the corrected target workpiece expression is made to fit as closely as possible with the points near the target workpiece expression in the first point cloud data, which can improve the accuracy of the position and posture recognition of the cylindrical workpiece.
[0176] Based on the same inventive concept, the present application embodiment provides a posture recognition device for a cylindrical workpiece, see Figure 8 , Figure 8 This is a structural diagram of a cylindrical workpiece posture recognition device provided in an embodiment of the present application. The device includes:
[0177] A first point cloud data acquisition module 801 is used to acquire point cloud data of a scene where a cylindrical workpiece is placed as first point cloud data;
[0178] The first calculation module 802 is used to calculate, for each reference point in the first point cloud data, a first parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs, using a normal vector at the reference point and a normal vector at a neighboring point of the reference point according to the structural features of the cylindrical workpiece; wherein the first parameter represents the position of the center axis of the cylindrical workpiece; a workpiece expression further includes a second parameter representing the radius of the cylindrical workpiece; and a neighboring point of a reference point includes: a point in the first point cloud data whose distance to the reference point is less than the first distance;
[0179] The first screening module 803 is used to screen the workpiece expressions representing the same cylindrical workpiece in each workpiece expression based on the accuracy of each workpiece expression, so as to determine the target workpiece expressions representing different cylindrical workpieces from each workpiece expression; wherein the accuracy of a workpiece expression is determined by: the difference between the distance between the first type of point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression and the radius represented by the second parameter in the workpiece expression; the first type of point corresponding to a workpiece expression includes: the point in the first point cloud data whose distance from the central axis represented by the first parameter in the workpiece expression is less than the second distance; the second distance is not less than the radius represented by the second parameter in the workpiece expression;
[0180] The center point determination module 804 is used to perform fitting processing on the points of the cylindrical workpiece represented by the target workpiece expression in the first point cloud data using a cylindrical fitting algorithm for each target workpiece expression, so as to obtain the position of the center point of the cylindrical workpiece represented by the target workpiece expression;
[0181] The posture determination module 805 is used to obtain the posture of the cylindrical workpiece represented by the target workpiece expression by combining the workpiece length, the position of the center point of the cylindrical workpiece represented by the target workpiece expression, and the first parameter and the second parameter in the target workpiece expression.
[0182] In some embodiments, the radii of the cylindrical workpieces placed in the scene are inconsistent;
[0183] The first calculation module 802 is specifically used for:
[0184] For each reference point in the first point cloud data, the outer product of the normal vector at the reference point and the normal vector at each neighboring point of the reference point is calculated to obtain a candidate unit vector corresponding to the reference point and each neighboring point; wherein the candidate unit vector represents: the direction of the center axis of the cylindrical workpiece to which the reference point and the neighboring point belong;
[0185] For each neighboring point of the reference point, according to the coordinates of the reference point, the normal vector at the reference point, the coordinates of the neighboring point, and the normal vector at the neighboring point, determine a point located on the central axis of the cylindrical workpiece to which the reference point belongs as the central axis point;
[0186] Based on a preset voting algorithm, the candidate unit vectors corresponding to the reference point are voted to obtain the target unit vector of the reference point;
[0187] Determine a target unit vector of the reference point and a medial axis point corresponding to a neighboring point used in calculating the target unit vector as the first parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs;
[0188] The device also includes: a radius calculation module;
[0189] The radius calculation module is specifically used to: before screening the workpiece expressions representing the same cylindrical workpiece in the workpiece expressions based on the accuracy of each workpiece expression to determine the target workpiece expressions representing different cylindrical workpieces from the workpiece expressions, for each reference point in the first point cloud data and each adjacent point corresponding to the reference point, obtain a vector from the mid-axis point corresponding to the reference point and the adjacent point pointing to the reference point as a first intermediate vector;
[0190] Calculate the modulus of the outer product of the candidate unit vector corresponding to the reference point and the neighboring point and the first intermediate vector to obtain the candidate radius corresponding to the reference point and the neighboring point;
[0191] Based on a preset voting algorithm, the candidate radii corresponding to the reference point are voted to obtain a target radius, which serves as the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs.
[0192] In some embodiments, the radii of the cylindrical workpieces placed in the scene are consistent;
[0193] The first calculation module 802 is specifically used for:
[0194] For each reference point in the first point cloud data, the outer product of the normal vector at the reference point and the normal vector at each neighboring point of the reference point is calculated to obtain a candidate unit vector corresponding to the reference point and each neighboring point; wherein the candidate unit vector represents: the direction of the center axis of the cylindrical workpiece to which the reference point and the neighboring point belong;
[0195] For each neighboring point of the reference point, according to the coordinates of the reference point, the normal vector at the reference point, the coordinates of the neighboring point, and the normal vector at the neighboring point, determine a point located on the central axis of the cylindrical workpiece to which the reference point belongs as the central axis point;
[0196] Based on a preset voting algorithm, the candidate unit vectors corresponding to the reference point are voted to obtain the target unit vector of the reference point;
[0197] Determine a target unit vector of the reference point and a medial axis point corresponding to a neighboring point used in calculating the target unit vector as the first parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs;
[0198] The device also includes: a radius acquisition module;
[0199] The radius calculation module is specifically used to: before screening the workpiece expressions that represent the same cylindrical workpiece in each workpiece expression based on the accuracy of each workpiece expression to determine the target workpiece expressions that represent different cylindrical workpieces from each workpiece expression, for each reference point in the first point cloud data, obtain the pre-recorded radius of the cylindrical workpiece placed in the scene as the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs.
[0200] In some embodiments, the accuracy of any workpiece expression includes: a first accuracy, and / or a second accuracy;
[0201] The first accuracy of any workpiece expression is calculated by the following steps:
[0202] Calculate the difference between the distance between each first-type point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression and the radius represented by the second parameter in the workpiece expression;
[0203] Calculate the proportion of the first type of points whose corresponding difference values are less than the first threshold as the first accuracy of the workpiece expression;
[0204] The second accuracy of any workpiece expression is calculated by the following steps:
[0205] Calculate the difference between the distance between each first-type point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression and the radius represented by the second parameter in the workpiece expression;
[0206] The sum of the differences corresponding to the first-category points corresponding to the workpiece expression is calculated as the second accuracy of the workpiece expression.
[0207] In some embodiments, the first screening module 803 is specifically used to:
[0208] For each workpiece expression, determining a minimum convex body formed by points in the first point cloud data that are located in a space represented by the workpiece expression;
[0209] If there are multiple workpiece expressions that meet the preset screening condition, then based on the accuracy of the multiple workpiece expressions, a target workpiece expression of a cylindrical workpiece commonly characterized by the multiple workpiece expressions is determined from the multiple workpiece expressions; wherein the preset screening condition indicates that: the overlap rate of the minimum convex bodies corresponding to any two workpiece expressions in the multiple workpiece expressions is greater than a second threshold value, and the angle between the central axes represented by the first parameters of any two workpiece expressions in the multiple workpiece expressions is less than a first preset angle;
[0210] If there is a workpiece expression that does not satisfy the preset screening condition with other workpiece expressions, and the accuracy of the workpiece expression satisfies the preset retention condition, then the workpiece expression is determined to be the target workpiece expression for the cylindrical workpiece it represents.
[0211] In some embodiments, when the accuracy of any artifact expression includes a first accuracy and a second accuracy, if there are multiple artifact expressions that meet the preset screening condition, the target artifact expression determined from the multiple artifact expressions meets any of the following conditions:
[0212] The target artifact expression is compared with any other artifact expression in the plurality of artifact expressions, and a difference between the first accuracy of the target artifact expression and the first accuracy of the other artifact expression is greater than a third threshold;
[0213] The target artifact expression is compared with any other artifact expression in the plurality of artifact expressions, and when a difference between the first accuracy of the target artifact expression and the first accuracy of the other artifact expression is not greater than the third threshold, the second accuracy of the target artifact expression is less than the second accuracy of the other artifact expression;
[0214] The accuracy of a workpiece expression satisfies a preset retention condition, which indicates that a first accuracy of the workpiece expression is greater than a first preset accuracy.
[0215] In some embodiments, the center point determination module 804 is specifically used to:
[0216] For each target workpiece expression, determine, as a second type of point, a point in the first point cloud data whose distance from the central axis represented by the first parameter in the target workpiece expression is less than a third distance; wherein the third distance is not less than the radius represented by the second parameter in the target workpiece expression;
[0217] Clustering the second-category points corresponding to the target workpiece expression based on a preset clustering algorithm, and determining points belonging to the cylindrical workpiece represented by the target workpiece expression as third-category points;
[0218] The third type of points corresponding to the target workpiece expression are fitted based on the cylindrical fitting algorithm to calculate the covariance matrix corresponding to the target workpiece expression; wherein any covariance matrix includes: a characteristic vector for representing the center axis direction of the cylindrical workpiece obtained by fitting;
[0219] The eigenvector representing the center axis direction of the cylindrical workpiece obtained by fitting in the covariance matrix corresponding to the target workpiece expression is replaced by the part used to represent the center axis direction in the first parameter of the target workpiece expression;
[0220] Based on the replaced covariance matrix, mapping processing is performed on each third-category point corresponding to the target workpiece expression, so that the center axis direction of the cylindrical workpiece represented by each third-category point after mapping is consistent with the direction of the specified coordinate axis; wherein the specified coordinate axis is: any coordinate axis in the three-dimensional coordinate system corresponding to the first point cloud data;
[0221] Determine the point with the largest and the smallest coordinate value on the specified coordinate axis among the mapped third-category points as two endpoints;
[0222] The midpoint between the two endpoints is inversely mapped based on the replaced covariance matrix to obtain the position of the midpoint in the coordinate system of the first point cloud data as the position of the center point of the cylindrical workpiece represented by the target workpiece expression.
[0223] In some embodiments, the apparatus further comprises:
[0224] The second calculation module is used to calculate the distance between the two endpoints as the workpiece length of the cylindrical workpiece represented by the target workpiece expression.
[0225] In some embodiments, the apparatus further comprises:
[0226] A selection module is used for, before fitting the points of the cylindrical workpiece represented by the target workpiece expression in the first point cloud data using a cylindrical fitting algorithm to obtain the position of the center point of the cylindrical workpiece represented by the target workpiece expression, determining, for each target workpiece expression, a point in the first point cloud data whose distance from the central axis represented by the first parameter in the target workpiece expression is less than a fourth distance as a fourth type of point;
[0227] A third calculation module is used to determine a fifth type point from each fourth type point corresponding to the target workpiece expression according to the normal vector at each fourth type point corresponding to the target workpiece expression; wherein the direction represented by the normal vector at any fifth type point is different from the direction of the foot of the perpendicular corresponding to the fifth type point; the foot of the perpendicular corresponding to a fifth type point is: the intersection of a line passing through the fifth type point and perpendicular to the central axis represented by the first parameter in the target workpiece expression and the central axis represented by the first parameter in the target workpiece expression;
[0228] An adjustment module is used to adjust the first parameter and the second parameter in the target workpiece expression based on a nonlinear optimization algorithm until the target correction function reaches a minimum value to update the target workpiece expression; wherein the target correction function is obtained based on the sum of the distance differences corresponding to each fifth-category point of the target workpiece expression; the distance difference corresponding to a fifth-category point represents: the distance between the fifth-category point and the corresponding foot of the perpendicular, and the difference in radius represented by the second parameter in the target workpiece expression.
[0229] In some embodiments, the apparatus further comprises:
[0230] A sampling module is used to sample the points included in the first point cloud data at a preset interval to obtain a reference point before calculating the first parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs by using the normal vector at the reference point and the normal vectors at the neighboring points of the reference point according to the structural characteristics of the cylindrical workpiece for each reference point in the first point cloud data.
[0231] The present application also provides an electronic device, such as Fig. 9 As shown, including:
[0232] Memory 901, used for storing computer programs;
[0233] The processor 902 is used to implement the steps of any cylindrical workpiece posture recognition method in the above-mentioned embodiments when executing the program stored in the memory 901.
[0234] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 902, the communication interface, and the memory 901 communicate with each other via the communication bus.
[0235] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0236] The communication interface is used for communication between the above electronic device and other devices.
[0237] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0238] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0239] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for recognizing the posture of a cylindrical workpiece are implemented.
[0240] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the posture recognition method of any cylindrical workpiece in the above-mentioned embodiments.
[0241] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0242] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0243] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0244] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A method for recognizing the position and posture of a cylindrical workpiece, characterized in that: The method comprises: Acquire point cloud data of a scene in which a cylindrical workpiece is placed as first point cloud data; For each reference point in the first point cloud data, according to the structural features of the cylindrical workpiece, a first parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs is calculated using a normal vector at the reference point and a normal vector at a neighboring point of the reference point; wherein the first parameter represents the position of the center axis of the cylindrical workpiece; a workpiece expression further includes a second parameter representing the radius of the cylindrical workpiece; a neighboring point of a reference point includes: a point in the first point cloud data whose distance to the reference point is less than the first distance; Based on the accuracy of each workpiece expression, the workpiece expressions representing the same cylindrical workpiece in each workpiece expression are screened to determine target workpiece expressions representing different cylindrical workpieces from each workpiece expression; wherein the accuracy of a workpiece expression is determined based on the difference between the distance between the first type of point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression and the radius represented by the second parameter in the workpiece expression; the first type of point corresponding to a workpiece expression includes: a point in the first point cloud data whose distance from the central axis represented by the first parameter in the workpiece expression is less than the second distance; the second distance is not less than the radius represented by the second parameter in the workpiece expression; For each target workpiece expression, a cylindrical fitting algorithm is used to fit the points of the cylindrical workpiece represented by the target workpiece expression in the first point cloud data to obtain the position of the center point of the cylindrical workpiece represented by the target workpiece expression; The position and posture of the cylindrical workpiece represented by the target workpiece expression are obtained by combining the workpiece length and the position of the center point of the cylindrical workpiece represented by the target workpiece expression, and the first parameter and the second parameter in the target workpiece expression.
2. The method according to claim 1, characterized in that The radii of the cylindrical workpieces placed in the scene are inconsistent; For each reference point in the first point cloud data, according to the structural features of the cylindrical workpiece, using the normal vector at the reference point and the normal vectors at the neighboring points of the reference point, calculating the first parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs, including: For each reference point in the first point cloud data, the outer product of the normal vector at the reference point and the normal vector at each neighboring point of the reference point is calculated to obtain a candidate unit vector corresponding to the reference point and each neighboring point; wherein the candidate unit vector represents: the direction of the center axis of the cylindrical workpiece to which the reference point and the neighboring point belong; For each neighboring point of the reference point, according to the coordinates of the reference point, the normal vector at the reference point, the coordinates of the neighboring point, and the normal vector at the neighboring point, determine a point located on the central axis of the cylindrical workpiece to which the reference point belongs as the central axis point; Based on a preset voting algorithm, the candidate unit vectors corresponding to the reference point are voted to obtain the target unit vector of the reference point; Determine a target unit vector of the reference point and a medial axis point corresponding to a neighboring point used in calculating the target unit vector as the first parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs; Before screening the workpiece expressions representing the same cylindrical workpiece in the workpiece expressions based on the accuracy of each workpiece expression to determine target workpiece expressions representing different cylindrical workpieces from each workpiece expression, the method further includes: For each reference point in the first point cloud data and each adjacent point corresponding to the reference point, obtain a vector from the mid-axis point corresponding to the reference point and the adjacent point to the reference point as a first intermediate vector; Calculate the modulus of the outer product of the candidate unit vector corresponding to the reference point and the neighboring point and the first intermediate vector to obtain the candidate radius corresponding to the reference point and the neighboring point; Based on a preset voting algorithm, the candidate radii corresponding to the reference point are voted to obtain a target radius, which serves as the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs.
3. The method according to claim 1, characterized in that The radii of the cylindrical workpieces placed in the scene are consistent; For each reference point in the first point cloud data, according to the structural features of the cylindrical workpiece, using the normal vector at the reference point and the normal vectors at the neighboring points of the reference point, calculating the first parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs, including: For each reference point in the first point cloud data, the outer product of the normal vector at the reference point and the normal vector at each neighboring point of the reference point is calculated to obtain a candidate unit vector corresponding to the reference point and each neighboring point; wherein the candidate unit vector represents: the direction of the center axis of the cylindrical workpiece to which the reference point and the neighboring point belong; For each neighboring point of the reference point, according to the coordinates of the reference point, the normal vector at the reference point, the coordinates of the neighboring point, and the normal vector at the neighboring point, determine a point located on the central axis of the cylindrical workpiece to which the reference point belongs as the central axis point; Based on a preset voting algorithm, the candidate unit vectors corresponding to the reference point are voted to obtain the target unit vector of the reference point; Determine a target unit vector of the reference point and a medial axis point corresponding to a neighboring point used in calculating the target unit vector as the first parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs; Before screening the workpiece expressions representing the same cylindrical workpiece in the workpiece expressions based on the accuracy of each workpiece expression to determine target workpiece expressions representing different cylindrical workpieces from each workpiece expression, the method further includes: For each reference point in the first point cloud data, a pre-recorded radius of a cylindrical workpiece placed in the scene is obtained as a second parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs.
4. The method according to claim 1, characterized in that: The accuracy of any workpiece expression includes: a first accuracy, and / or a second accuracy; The first accuracy of any workpiece expression is calculated by the following steps: Calculate the difference between the distance between each first-type point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression and the radius represented by the second parameter in the workpiece expression; Calculate the proportion of the first type of points whose corresponding difference values are less than the first threshold as the first accuracy of the workpiece expression; The second accuracy of any workpiece expression is calculated by the following steps: Calculate the difference between the distance between each first-type point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression and the radius represented by the second parameter in the workpiece expression; The sum of the differences corresponding to the first-category points corresponding to the workpiece expression is calculated as the second accuracy of the workpiece expression.
5. The method according to any one of claims 1 to 4, characterized in that: The workpiece expressions representing the same cylindrical workpiece in each workpiece expression are screened based on the accuracy of each workpiece expression to determine target workpiece expressions representing different cylindrical workpieces from each workpiece expression, including: For each workpiece expression, determining a minimum convex body formed by points in the first point cloud data that are located in a space represented by the workpiece expression; If there are multiple workpiece expressions that meet the preset screening condition, then based on the accuracy of the multiple workpiece expressions, a target workpiece expression of a cylindrical workpiece commonly characterized by the multiple workpiece expressions is determined from the multiple workpiece expressions; wherein the preset screening condition indicates that: the overlap rate of the minimum convex bodies corresponding to any two workpiece expressions in the multiple workpiece expressions is greater than a second threshold value, and the angle between the central axes represented by the first parameters of any two workpiece expressions in the multiple workpiece expressions is less than a first preset angle; If there is a workpiece expression that does not satisfy the preset screening condition with other workpiece expressions, and the accuracy of the workpiece expression satisfies the preset retention condition, then the workpiece expression is determined to be the target workpiece expression for the cylindrical workpiece it represents.
6. The method according to claim 5, characterized in that In the case where the accuracy of any artifact expression includes a first accuracy and a second accuracy, if there are multiple artifact expressions that meet the preset screening condition, then the target artifact expression determined from the multiple artifact expressions meets any of the following conditions: The target artifact expression is compared with any other artifact expression in the plurality of artifact expressions, and a difference between the first accuracy of the target artifact expression and the first accuracy of the other artifact expression is greater than a third threshold; The target artifact expression is compared with any other artifact expression in the plurality of artifact expressions, and when a difference between the first accuracy of the target artifact expression and the first accuracy of the other artifact expression is not greater than the third threshold, the second accuracy of the target artifact expression is less than the second accuracy of the other artifact expression; The accuracy of a workpiece expression satisfies a preset retention condition, which indicates that a first accuracy of the workpiece expression is greater than a first preset accuracy.
7. The method according to claim 1, characterized in that For each target workpiece expression, a cylindrical fitting algorithm is used to fit the points of the cylindrical workpiece represented by the target workpiece expression in the first point cloud data to obtain the position of the center point of the cylindrical workpiece represented by the target workpiece expression, including: For each target workpiece expression, determine, as a second type of point, a point in the first point cloud data whose distance from the central axis represented by the first parameter in the target workpiece expression is less than a third distance; wherein the third distance is not less than the radius represented by the second parameter in the target workpiece expression; Clustering the second-category points corresponding to the target workpiece expression based on a preset clustering algorithm, and determining points belonging to the cylindrical workpiece represented by the target workpiece expression as third-category points; The third type of points corresponding to the target workpiece expression are fitted based on the cylindrical fitting algorithm to calculate the covariance matrix corresponding to the target workpiece expression; wherein any covariance matrix includes: a characteristic vector for representing the center axis direction of the cylindrical workpiece obtained by fitting; The eigenvector representing the center axis direction of the cylindrical workpiece obtained by fitting in the covariance matrix corresponding to the target workpiece expression is replaced by the part used to represent the center axis direction in the first parameter of the target workpiece expression; Based on the replaced covariance matrix, mapping processing is performed on each third-category point corresponding to the target workpiece expression, so that the center axis direction of the cylindrical workpiece represented by each third-category point after mapping is consistent with the direction of the specified coordinate axis; wherein the specified coordinate axis is: any coordinate axis in the three-dimensional coordinate system corresponding to the first point cloud data; Determine the point with the largest and the smallest coordinate value on the specified coordinate axis among the mapped third-category points as two endpoints; The midpoint between the two endpoints is inversely mapped based on the replaced covariance matrix to obtain the position of the midpoint in the coordinate system of the first point cloud data as the position of the center point of the cylindrical workpiece represented by the target workpiece expression.
8. The method according to claim 7, characterized in that The method further comprises: The distance between the two end points is calculated as the workpiece length of the cylindrical workpiece represented by the target workpiece expression.
9. The method according to claim 1, characterized in that: Before fitting the points of the cylindrical workpiece represented by the target workpiece expression in the first point cloud data using a cylindrical fitting algorithm for each target workpiece expression to obtain the position of the center point of the cylindrical workpiece represented by the target workpiece expression, the method further includes: For each target workpiece expression, determining a point in the first point cloud data whose distance from the central axis represented by the first parameter in the target workpiece expression is less than a fourth distance as a fourth type of point; According to the normal vectors at the fourth-type points corresponding to the target workpiece expression, the fifth-type points are determined from the fourth-type points corresponding to the target workpiece expression; wherein the direction represented by the normal vector at any fifth-type point is different from the direction of the foot of the perpendicular corresponding to the fifth-type point; the foot of the perpendicular corresponding to a fifth-type point is: the intersection of a line passing through the fifth-type point and perpendicular to the central axis represented by the first parameter in the target workpiece expression and the central axis represented by the first parameter in the target workpiece expression; Based on a nonlinear optimization algorithm, the first parameter and the second parameter in the target workpiece expression are adjusted until the target correction function reaches a minimum value to update the target workpiece expression; wherein the target correction function is obtained based on the sum of the distance differences corresponding to each fifth-category point of the target workpiece expression; the distance difference corresponding to a fifth-category point represents: the distance between the fifth-category point and the corresponding foot of the perpendicular, and the difference in radius represented by the second parameter in the target workpiece expression.
10. The method according to claim 1, characterized in that Before calculating the first parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs by using the normal vector at the reference point and the normal vectors at the neighboring points of the reference point according to the structural features of the cylindrical workpiece for each reference point in the first point cloud data, the method further comprises: The points included in the first point cloud data are sampled at preset intervals to obtain reference points.
11. A cylindrical workpiece position recognition device, characterized in that: The device comprises: A first point cloud data acquisition module is used to acquire point cloud data of a scene where a cylindrical workpiece is placed as first point cloud data; A first calculation module is used to calculate, for each reference point in the first point cloud data, a first parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs, using a normal vector at the reference point and a normal vector at a neighboring point of the reference point according to the structural features of the cylindrical workpiece; wherein the first parameter represents the position of the center axis of the cylindrical workpiece; a workpiece expression further includes a second parameter representing the radius of the cylindrical workpiece; and a neighboring point of a reference point includes: a point in the first point cloud data whose distance from the reference point is less than the first distance; The first screening module is used to screen the workpiece expressions representing the same cylindrical workpiece in each workpiece expression based on the accuracy of each workpiece expression, so as to determine the target workpiece expressions representing different cylindrical workpieces from each workpiece expression; wherein the accuracy of a workpiece expression is determined by: the difference between the distance between the first type of point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression and the radius represented by the second parameter in the workpiece expression; the first type of point corresponding to a workpiece expression includes: the point in the first point cloud data whose distance from the central axis represented by the first parameter in the workpiece expression is less than the second distance; the second distance is not less than the radius represented by the second parameter in the workpiece expression; A center point determination module is used to fit the points of the cylindrical workpiece represented by the target workpiece expression in the first point cloud data using a cylindrical fitting algorithm for each target workpiece expression, so as to obtain the position of the center point of the cylindrical workpiece represented by the target workpiece expression; The posture determination module is used to obtain the posture of the cylindrical workpiece represented by the target workpiece expression by combining the workpiece length, the position of the center point of the cylindrical workpiece represented by the target workpiece expression, and the first parameter and the second parameter in the target workpiece expression.
12. The device according to claim 11, characterized in that The radii of the cylindrical workpieces placed in the scene are inconsistent; The first calculation module is specifically used for: For each reference point in the first point cloud data, the outer product of the normal vector at the reference point and the normal vector at each neighboring point of the reference point is calculated to obtain a candidate unit vector corresponding to the reference point and each neighboring point; wherein the candidate unit vector represents: the direction of the center axis of the cylindrical workpiece to which the reference point and the neighboring point belong; For each neighboring point of the reference point, according to the coordinates of the reference point, the normal vector at the reference point, the coordinates of the neighboring point, and the normal vector at the neighboring point, determine a point located on the central axis of the cylindrical workpiece to which the reference point belongs as the central axis point; Based on a preset voting algorithm, the candidate unit vectors corresponding to the reference point are voted to obtain the target unit vector of the reference point; Determine a target unit vector of the reference point and a medial axis point corresponding to a neighboring point used in calculating the target unit vector as the first parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs; The device also includes: a radius calculation module; The radius calculation module is specifically used to: before screening the workpiece expressions representing the same cylindrical workpiece in the workpiece expressions based on the accuracy of each workpiece expression to determine the target workpiece expressions representing different cylindrical workpieces from the workpiece expressions, for each reference point in the first point cloud data and each adjacent point corresponding to the reference point, obtain a vector from the mid-axis point corresponding to the reference point and the adjacent point pointing to the reference point as a first intermediate vector; Calculate the modulus of the outer product of the candidate unit vector corresponding to the reference point and the neighboring point and the first intermediate vector to obtain the candidate radius corresponding to the reference point and the neighboring point; Based on a preset voting algorithm, voting is performed on each candidate radius corresponding to the reference point to obtain a target radius as the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs; and / or, The radii of the cylindrical workpieces placed in the scene are consistent; The first calculation module is specifically used for: For each reference point in the first point cloud data, the outer product of the normal vector at the reference point and the normal vector at each neighboring point of the reference point is calculated to obtain a candidate unit vector corresponding to the reference point and each neighboring point; wherein the candidate unit vector represents: the direction of the center axis of the cylindrical workpiece to which the reference point and the neighboring point belong; For each neighboring point of the reference point, according to the coordinates of the reference point, the normal vector at the reference point, the coordinates of the neighboring point, and the normal vector at the neighboring point, determine a point located on the central axis of the cylindrical workpiece to which the reference point belongs as the central axis point; Based on a preset voting algorithm, the candidate unit vectors corresponding to the reference point are voted to obtain the target unit vector of the reference point; Determine a target unit vector of the reference point and a medial axis point corresponding to a neighboring point used in calculating the target unit vector as the first parameter in a workpiece expression of the cylindrical workpiece to which the reference point belongs; The device also includes: a radius acquisition module; The radius calculation module is specifically used to: before screening the workpiece expressions representing the same cylindrical workpiece in the workpiece expressions based on the accuracy of each workpiece expression to determine the target workpiece expressions representing different cylindrical workpieces from the workpiece expressions, for each reference point in the first point cloud data, obtain the radius of the cylindrical workpiece placed in the scene that is pre-recorded as the second parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs; and / or, The accuracy of any workpiece expression includes: a first accuracy, and / or a second accuracy; The first accuracy of any workpiece expression is calculated by the following steps: Calculate the difference between the distance between each first-type point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression and the radius represented by the second parameter in the workpiece expression; Calculate the proportion of the first type of points whose corresponding difference values are less than the first threshold as the first accuracy of the workpiece expression; The second accuracy of any workpiece expression is calculated by the following steps: Calculate the difference between the distance between each first-type point corresponding to the workpiece expression and the central axis represented by the first parameter in the workpiece expression and the radius represented by the second parameter in the workpiece expression; Calculate the sum of the differences corresponding to the first-category points corresponding to the workpiece expression as the second accuracy of the workpiece expression; and / or, The first screening module is specifically used for: For each workpiece expression, determining a minimum convex body formed by points in the first point cloud data that are located in a space represented by the workpiece expression; If there are multiple workpiece expressions that meet the preset screening condition, then based on the accuracy of the multiple workpiece expressions, a target workpiece expression of a cylindrical workpiece commonly characterized by the multiple workpiece expressions is determined from the multiple workpiece expressions; wherein the preset screening condition indicates that: the overlap rate of the minimum convex bodies corresponding to any two workpiece expressions in the multiple workpiece expressions is greater than a second threshold value, and the angle between the central axes represented by the first parameters of any two workpiece expressions in the multiple workpiece expressions is less than a first preset angle; If there is a workpiece expression that does not satisfy the preset screening condition with other workpiece expressions, and the accuracy of the workpiece expression satisfies the preset retention condition, then the workpiece expression is determined to be the target workpiece expression of the cylindrical workpiece represented by it; and / or, In the case where the accuracy of any artifact expression includes a first accuracy and a second accuracy, if there are multiple artifact expressions that meet the preset screening condition, then the target artifact expression determined from the multiple artifact expressions meets any of the following conditions: The target artifact expression is compared with any other artifact expression in the plurality of artifact expressions, and a difference between the first accuracy of the target artifact expression and the first accuracy of the other artifact expression is greater than a third threshold; The target artifact expression is compared with any other artifact expression in the plurality of artifact expressions, and when a difference between the first accuracy of the target artifact expression and the first accuracy of the other artifact expression is not greater than the third threshold, the second accuracy of the target artifact expression is less than the second accuracy of the other artifact expression; The accuracy of a workpiece expression satisfies a preset retention condition, which means: a first accuracy of the workpiece expression is greater than a first preset accuracy; and / or, The center point determination module is specifically used for: For each target workpiece expression, determine, as a second type of point, a point in the first point cloud data whose distance from the central axis represented by the first parameter in the target workpiece expression is less than a third distance; wherein the third distance is not less than a radius represented by the second parameter in the target workpiece expression; Clustering the second-category points corresponding to the target workpiece expression based on a preset clustering algorithm, and determining points belonging to the cylindrical workpiece represented by the target workpiece expression as third-category points; The third type of points corresponding to the target workpiece expression are fitted based on the cylindrical fitting algorithm to calculate the covariance matrix corresponding to the target workpiece expression; wherein any covariance matrix includes: a characteristic vector for representing the center axis direction of the cylindrical workpiece obtained by fitting; The eigenvector representing the center axis direction of the cylindrical workpiece obtained by fitting in the covariance matrix corresponding to the target workpiece expression is replaced by the part used to represent the center axis direction in the first parameter of the target workpiece expression; Based on the replaced covariance matrix, mapping processing is performed on each third-category point corresponding to the target workpiece expression, so that the center axis direction of the cylindrical workpiece represented by each third-category point after mapping is consistent with the direction of the specified coordinate axis; wherein the specified coordinate axis is: any coordinate axis in the three-dimensional coordinate system corresponding to the first point cloud data; Determine the point with the largest and the smallest coordinate value on the specified coordinate axis among the mapped third-category points as two endpoints; Performing inverse mapping processing on the midpoint between the two endpoints based on the replaced covariance matrix to obtain the position of the midpoint in the coordinate system of the first point cloud data as the position of the center point of the cylindrical workpiece represented by the target workpiece expression; and / or, The device also includes: A second calculation module is used to calculate the distance between the two endpoints as the workpiece length of the cylindrical workpiece represented by the target workpiece expression; and / or, The device also includes: A selection module is used for, before fitting the points of the cylindrical workpiece represented by the target workpiece expression in the first point cloud data using a cylindrical fitting algorithm to obtain the position of the center point of the cylindrical workpiece represented by the target workpiece expression, determining, for each target workpiece expression, a point in the first point cloud data whose distance from the central axis represented by the first parameter in the target workpiece expression is less than a fourth distance as a fourth type of point; A third calculation module is used to determine a fifth type point from each fourth type point corresponding to the target workpiece expression according to the normal vector at each fourth type point corresponding to the target workpiece expression; wherein the direction represented by the normal vector at any fifth type point is different from the direction of the foot of the perpendicular corresponding to the fifth type point; the foot of the perpendicular corresponding to a fifth type point is: the intersection of a line passing through the fifth type point and perpendicular to the central axis represented by the first parameter in the target workpiece expression and the central axis represented by the first parameter in the target workpiece expression; An adjustment module is used to adjust the first parameter and the second parameter in the target workpiece expression based on a nonlinear optimization algorithm until the target correction function reaches a minimum value to update the target workpiece expression; wherein the target correction function is obtained based on the sum of the distance differences corresponding to the fifth-category points of the target workpiece expression; the distance difference corresponding to a fifth-category point represents: the difference between the distance between the fifth-category point and the corresponding perpendicular foot and the radius represented by the second parameter in the target workpiece expression; and / or, The device also includes: A sampling module is used to sample the points included in the first point cloud data at a preset interval to obtain a reference point before calculating the first parameter in the workpiece expression of the cylindrical workpiece to which the reference point belongs by using the normal vector at the reference point and the normal vectors at the neighboring points of the reference point according to the structural characteristics of the cylindrical workpiece for each reference point in the first point cloud data.
13. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-10 when executing a program stored in a memory.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Cited By
Cylinder axis detection method and device, electronic equipment and storage medium
CN119850567A
Screw pose estimation method based on three-dimensional point cloud and electronic equipment
CN122737246A
