Robot positioning dispensing method based on flat bellows trough recognition

Through the robot positioning dispensing method based on flat corrugated pipe trough identification, the random sampling consistency algorithm and the region growing algorithm are used to segment the trough point cloud, and the principal component analysis algorithm is combined to determine the dispensing posture, which solves the problem of traditional dispensing operations in flat corrugated pipes. It eliminates the problems of inaccurate positioning and poor consistency and achieves efficient and precise dispensing operations.

CN118455030BActive Publication Date: 2024-09-20QUANZHOU HUAZHONG UNIV OF SCI & TECH INST OF MFG +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410922379.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-09-20
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

Traditional dispensing operations on flat corrugated pipes have problems such as inaccurate positioning, poor consistency, low efficiency, and high labor intensity. Moreover, existing technology cannot effectively cope with the complex three-dimensional trough characteristics of flat corrugated pipes, making it difficult to achieve ideal dispensing operations. accuracy and consistency.

Method used

A robot positioning dispensing method based on flat corrugated tube trough recognition is used. By obtaining the original point cloud data, the trough point cloud is segmented using the random sampling consistency algorithm and the improved region growing algorithm, and the centroid point and direction are calculated using the principal component analysis algorithm. Vector, determine the position and orientation of the dispensing tool, and obtain the dispensing path through the 3D line scan camera to achieve precise positioning of the robot for dispensing.

Benefits of technology

It improves the efficiency and accuracy of robot dispensing operations, ensures the consistency of dispensing, reduces production costs, reduces noise interference, and enhances the stability of identification of trough positions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118455030B
    Figure CN118455030B
Patent Text Reader

Abstract

The invention relates to the technical field of trough identification and glue dispensing of corrugated pipes, and specifically to a robot positioning glue dispensing method based on trough identification of flat corrugated pipes, comprising: modeling the plane where the flat corrugated pipe is located to obtain a plane model, and determining the trough point cloud of the flat corrugated pipe through the spatial position of each point in original point cloud data and the plane model; using an improved regional growing algorithm to accurately segment the trough point cloud, and the centroid point, main direction vector and secondary main direction vector of each trough point cloud cluster calculated according to a principal component analysis algorithm are not only used to sort the trough point cloud clusters, but also used to determine the glue dispensing posture of the trough point cloud cluster after sorting by a glue dispensing tool, and then the glue dispensing path is calculated according to the transformation relationship between the 3D line scan camera coordinate system and the glue dispensing tool coordinate system for the glue dispensing posture, and the glue dispensing path is transmitted to the robot to perform the glue dispensing operation, thereby solving the problems of inaccurate trough positioning, low glue dispensing efficiency and poor consistency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of corrugated pipe trough identification and glue dispensing, and in particular to a robot positioning glue dispensing method based on flat corrugated pipe trough identification. Background Art

[0002] With the continuous improvement of modern manufacturing industry's requirements for product quality, production efficiency and process refinement, especially in the field of flat bellows, the sealing performance of the trough is crucial. Traditional dispensing operations usually rely on manual operations, and there are problems such as inaccurate positioning, poor consistency, low efficiency and high labor intensity. Although some bellows processing equipment in the prior art can be automated, it is often unable to effectively deal with the complex three-dimensional trough characteristics of flat bellows, and lacks the technical means to identify and locate the trough position in real time and accurately, resulting in the dispensing operation being difficult to achieve the ideal accuracy and consistency. Even if a robot is used for teaching dispensing, there is a problem that when the flat bellows is clamped, the flat bellows will deform and warp, resulting in the displacement of the taught dispensing position. At the same time, due to its special three-dimensional structure, the trough position of the flat bellows is of different depths and shapes, which increases the difficulty of identification and positioning.

[0003] Therefore, developing a method that can automatically identify the trough position and accurately position and dispense glue by a robot is of great significance for improving production efficiency, ensuring product quality, and reducing production costs. Summary of the invention

[0004] The purpose of this application is to propose a robot positioning dispensing method based on flat bellows trough recognition in response to the above-mentioned technical problems.

[0005] In a first aspect, the present invention provides a robot positioning dispensing method based on flat bellows trough recognition, comprising the following steps:

[0006] Obtaining original point cloud data of the flat bellows;

[0007] The plane where the flat bellows is located is modeled using a random sampling consistency algorithm based on the original point cloud data to obtain the plane model and the normal vector of the plane model, and the normal vector of each point in the original point cloud data and the angle between it and the normal vector of the plane model are calculated, and the trough point cloud of the flat bellows is determined based on the preset angle range and the spatial position of each point in the original point cloud data and the plane model;

[0008] The improved region growing algorithm is used to segment the trough point cloud to obtain trough point cloud clusters. The centroid point, main direction vector and sub-main direction vector of each trough point cloud cluster are calculated according to the principal component analysis algorithm. The trough point cloud clusters are sorted according to the main direction vectors of all trough point cloud clusters to obtain sorted trough point cloud clusters.

[0009] According to the centroid point, main direction vector and secondary main direction vector of the sorted trough point cloud cluster, the dispensing posture of the dispensing tool in the sorted trough point cloud cluster is determined, and the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system is obtained. According to the dispensing posture of all dispensing tools in the sorted trough point cloud cluster and the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, the dispensing path is calculated, and the dispensing path is transmitted to the robot to perform the dispensing operation.

[0010] Preferably, the plane where the flat bellows is located is modeled using a random sampling consistency algorithm based on the original point cloud data to obtain a plane model and a normal vector of the plane model, and the normal vector of each point in the original point cloud data and the angle between the normal vector of the plane model are calculated, and the trough point cloud of the flat bellows is determined according to a preset angle range and the spatial position of each point in the original point cloud data and the plane model, specifically including:

[0011] Construct a plane model of the plane where the flat bellows is located, as shown in the following formula:

[0012] ax + by + cz = d ;

[0013] in, a, b, c are the unit normal vectors of the plane, and satisfy a 2 +b 2 +c 2 = 1, d is the distance from the origin to the plane, d Greater than 0, ( x , y , z ) represents the coordinates of a point on the plane;

[0014] Select at least three points in the original point cloud data, and determine whether the selected at least three points are collinear. If so, reselect at least three points. Otherwise, calculate the parameters of the plane model based on the coordinates of at least three points. a, b, c, d ;

[0015] Calculate the distance from each point in the original point cloud data except for at least three points to the plane model, as shown in the following formula:

[0016] d s = | ax s + by s + cz s -d |;

[0017] in, d s Represents the original point cloud data s The distance from a point to the plane model, s =1,2,…, n , n Represents the number of points other than at least three points in the original point cloud data, ( x s , y s , z s ) represents the first s The coordinates of the points;

[0018] According to the preset distance threshold and the distance from the sth point in all original point cloud data to the plane model d s The remaining points except at least three points in the original point cloud data are screened to obtain the in-points and out-points. All the in-points constitute the in-point set and the number of in-points is counted.

[0019] Repeat the above steps for M iterations to obtain M sets of in-place points. The set of in-place points with the largest number of in-place points is taken as the optimal subset, and the parameters of the plane model are recalculated based on the optimal subset. a, b, c, d , get the plane model and plane normal vector of the plane where the flat bellows is located n plane =(a, b, c) ;

[0020] Calculate the original point cloud data i Points P i In the local neighborhood of j Neighborhood points Q ij With point P i The position vector of point P i Neighborhood vector of V ij , as shown below:

[0021] V ij =Q ij -P i ;

[0022] in, j =1,2,…, k , k Indicate point P iThe number of local neighborhood points of ;

[0023] According to all points P i The first covariance matrix is ​​constructed from the neighborhood vectors C 1, as shown in the following formula:

[0024] ;

[0025] in, is the neighborhood vector V ij The transpose of

[0026] For the first covariance matrix C 1 Perform eigenvalue decomposition and obtain the following formula:

[0027] ;

[0028] in, U i is an orthogonal matrix containing the eigenvectors, Λ i is a diagonal matrix whose diagonal elements correspond to eigenvalues; select the eigenvector corresponding to the largest eigenvalue e i1 As a point P i The principal curvature direction of the surface at point P i The normal vector of is normalized and expressed as:

[0029] ;

[0030] Calculation Point P i The normal vector N i With the plane normal vector n plane =(a, b, c) The angle of P i The normal vector N i With the plane normal vector n plane =(a, b, c) The angle between the points is less than the first angle threshold or greater than the second angle threshold and P i is below the plane model, then point P i Located in the trough of the flat bellows;

[0031] Traverse the points in the original point cloud data and repeat the above steps to obtain the trough point cloud of the flat bellows.

[0032] As a preferred method, the improved region growing algorithm is used to segment the trough point cloud to obtain the trough point cloud cluster, which specifically includes:

[0033] For the trough point cloud w Points P w The surface is fitted to obtain the parameterized surface function r(u, v) ,in, u , v is the coordinate of the parameterized surface, and calculates the parameterized surface function r(u, v) The partial derivative and its second-order partial derivative of , , , , , and are respectively recorded as r u 、r v 、r uu 、r uv 、r vv , according to the surface function r(u, v) The partial derivatives of are combined to get the point P w The unit normal vector of the surface , as shown below:

[0034] ;

[0035] Calculation Point P w The mean curvature Z and Gaussian curvature H To identify local features, mean curvature Z As shown below:

[0036] ;

[0037] Gaussian curvature H As shown below:

[0038] ;

[0039] in, E , F , G , L , M , N They are:

[0040] ;

[0041] ;

[0042] ;

[0043] ;

[0044] ;

[0045] ;

[0046] Calculation Point P w The maximum and minimum curvatures are as follows:

[0047] ;

[0048] in, K 1 represents a point P w The maximum curvature in all directions, K 2 indicates point P w Minimum curvature in all directions;

[0049] Construct the second covariance matrix C 2 , as shown below:

[0050] ;

[0051] in, P wj Indicate point P w Neighborhood j Points, express P w The centroid of the points in the neighborhood is as follows:

[0052] ;

[0053] Calculate the second covariance matrix C 2 The eigenvector corresponding to the smallest eigenvalue of P w The normal vector ;

[0054] Repeat the above steps to calculate the normal vector and curvature of each point in the trough point cloud, and take the point with the smallest curvature as the current seed point;

[0055] Set the seed point set and cluster area point set, traverse all points in the neighborhood of the current seed point, and calculate the normal vector of the current seed point The normal vector of the points in its neighborhood The angle between α , as shown below:

[0056] ;

[0057] In response to determining the angle α If it is greater than the normal vector angle threshold, the points in the neighborhood are ignored;

[0058] In response to determining the angle α If the angle is smaller than the normal vector angle threshold and the curvature of the points in the neighborhood is smaller than the curvature threshold, the points in the neighborhood are added to the seed point set;

[0059] In response to determining the angle α If the angle is smaller than the normal vector angle threshold and the curvature of the points in the neighborhood is greater than the curvature threshold, the points in the neighborhood are added to the clustering area point set;

[0060] Repeat the above four steps for all seed points in the seed point set until no point satisfies the constraints of the normal vector angle threshold and the curvature threshold, and the region growing process ends;

[0061] In response to determining that the number of points in the clustering region point set is between the minimum and maximum number of clustering points, all points in the clustering region point set form a trough point cloud cluster, otherwise all points in the clustering region point set are removed.

[0062] Preferably, the centroid point, the main direction vector and the secondary main direction vector of each trough point cloud cluster are calculated according to the principal component analysis algorithm, and the trough point cloud clusters are sorted according to the main direction vectors of all trough point cloud clusters to obtain sorted trough point cloud clusters, which specifically includes:

[0063] Calculate the centroid of the valley point cloud cluster , as shown below:

[0064] ;

[0065] in, t =1,2,…, m , m Indicates the number of trough point cloud cluster points;

[0066] Calculate the midpoint of the valley point cloud cluster Q t With the centroid The position vector of Neighborhood vector of V t , as shown below:

[0067] ;

[0068] According to the centroid The neighborhood vectors of construct the third covariance matrix C 3 , as shown below:

[0069] ;

[0070] For the third covariance matrix C 3 Perform eigenvalue decomposition and get the following formula:

[0071] ;

[0072] in, U t is an orthogonal matrix containing the eigenvectors, Λ t It is a diagonal matrix whose diagonal elements are corresponding eigenvalues. The eigenvalues ​​are sorted from large to small, and the eigenvectors corresponding to the first two eigenvalues ​​are selected as the main direction vector and the secondary main direction vector of the trough point cloud cluster respectively;

[0073] Traverse all trough point cloud clusters and repeat the above steps to obtain the centroid points, main direction vectors and secondary main direction vectors of all trough point cloud clusters. Sorting is performed according to the Y value of the main direction vector of all trough point cloud clusters to obtain the sorted trough point cloud clusters.

[0074] Preferably, the dispensing posture of the dispensing tool in the sorted trough point cloud cluster is determined according to the centroid point, the main direction vector and the secondary main direction vector of the sorted trough point cloud cluster, the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system is obtained, and the dispensing path is calculated according to the dispensing posture of all dispensing tools in the sorted trough point cloud cluster and the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, and the dispensing path is transmitted to the robot to perform the dispensing operation, which specifically includes:

[0075] During the calibration process, the dispensing trajectory template and calibration point cloud data are obtained, and the center point pose of the dispensing trajectory template is calculated based on the dispensing trajectory template. M dst , calculate a point on the 3D line scan camera coordinate system based on the calibration point cloud data T src And its posture R src , forming the calibration point pose matrix M src =[ R src |T src ], the center point pose of the dispensing trajectory template M dst And the calibration point pose matrix M src Satisfy the following formula:

[0076] M dst = M total · M src ;

[0077] in, M total Indicates the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system;

[0078] The main direction vector and the secondary main direction vector of the sorted trough point cloud cluster are corrected according to the correction rules to obtain the corrected main direction vector and the corrected secondary principal direction vector , the revised rules are as follows:

[0079] If the Z-axis component of the main direction vector of the sorted trough point cloud cluster is positive, the main direction vector of the sorted trough point cloud cluster remains unchanged, otherwise the Z-axis component of the main direction vector of the sorted trough point cloud cluster takes its opposite number; if the Y-axis component of the secondary main direction vector of the sorted trough point cloud cluster is positive, the secondary main direction vector of the sorted trough point cloud cluster remains unchanged, otherwise the Y-axis component of the secondary main direction vector of the sorted trough point cloud cluster takes its opposite number;

[0080] According to the corrected main direction vector and the corrected secondary principal direction vector Calculate the rotation matrix of the dispensing tool R , the expression is as follows:

[0081] ;

[0082] ;

[0083] ;

[0084] ;

[0085] in, Represents the main direction vector of the sorted valley point cloud cluster, Represents the secondary main direction vector of the sorted trough point cloud cluster, V 1、 V 2、 V 3 Represents the rotation matrix of the dispensing tool R The first, second, and third column vectors of ;

[0086] The centroid point of the sorted valley point cloud cluster As the translation matrix T of the dispensing tool, according to the rotation matrix of the dispensing tool R and translation matrix T Get the rotation and translation matrix of the dispensing tool in the 3D line scan camera coordinate system, that is, the dispensing posture of the dispensing tool in the sorted trough point cloud cluster in the 3D line scan camera coordinate system Mc , as shown below:

[0087] Mc =[ R|T ];

[0088] The dispensing position of the dispensing tool in the sorted valley point cloud cluster in the 3D line scan camera coordinate system Mc Transform to the dispensing tool coordinate system to obtain the dispensing posture of the dispensing tool in the dispensing tool coordinate system after sorting the trough point cloud cluster Mr , as shown below:

[0089] Mr = M total · Mc ;

[0090] Repeat the above steps to calculate the dispensing posture of the dispensing tool in all sorted trough point cloud clusters in the dispensing tool coordinate system, and form a dispensing path, which is then transmitted to the robot to perform the dispensing operation.

[0091] As a preference, it also includes:

[0092] Use a 3D line scan camera to scan the flat bellows and remove the noise point cloud to obtain the point cloud data before straight-through filtering;

[0093] The point cloud data before calculating the straight-through filter is x 、 y 、 z The maximum and minimum values ​​of the three dimensions are obtained x min、 x max、 y min、 y max、 z min、 z max ;

[0094] For point cloud data before direct filtering x 、 y 、 zThrough-filtering is performed in three dimensional directions to obtain point cloud data after through-filtering, that is, the original point cloud data of the flat bellows, wherein the coordinates of the points in the point cloud data after through-filtering satisfy the following formula:

[0095] .

[0096] In a second aspect, the present invention provides a robot positioning dispensing device based on flat bellows trough recognition, comprising:

[0097] A data acquisition module is configured to obtain raw point cloud data of the flat bellows;

[0098] The trough recognition module is configured to model the plane where the flat bellows is located using a random sampling consistency algorithm based on the original point cloud data, obtain the plane model and the normal vector of the plane model, and calculate the normal vector of each point in the original point cloud data and the angle between the normal vector of the plane model and the normal vector of the plane model, and determine the trough point cloud of the flat bellows according to a preset angle range and the spatial position of each point in the original point cloud data and the plane model;

[0099] The trough positioning and segmentation module is configured to segment the trough point cloud using the improved region growing algorithm to obtain trough point cloud clusters, calculate the centroid point, the main direction vector and the secondary main direction vector of each trough point cloud cluster according to the principal component analysis algorithm, and sort the trough point cloud clusters according to the main direction vectors of all trough point cloud clusters to obtain sorted trough point cloud clusters;

[0100] The dispensing module is configured to determine the dispensing posture of the dispensing tool in the sorted trough point cloud cluster according to the centroid point, main direction vector and secondary main direction vector of the sorted trough point cloud cluster, obtain the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, calculate the dispensing path according to the dispensing posture of all dispensing tools in the sorted trough point cloud cluster and the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, and transmit the dispensing path to the robot to perform the dispensing operation.

[0101] In a third aspect, the present invention provides an electronic device comprising one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.

[0102] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.

[0103] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in any implementation manner in the first aspect.

[0104] Compared with the prior art, the present invention has the following beneficial effects:

[0105] (1) The robot positioning and dispensing method based on flat bellows trough identification proposed in the present invention models the plane where the flat bellows is located to obtain the normal vector of the plane model, separates the normal vector representing the flat bellows as a whole from the complex point cloud data, and segments the trough point cloud by calculating the spatial position of the midpoint of the original point cloud data and the plane model. The improved regional growing algorithm and principal component analysis algorithm are combined to accurately locate and identify a single trough point cloud cluster, and sort them to ensure the dispensing order, thereby determining the centroid point of the trough point cloud cluster and generating the dispensing direction, thereby improving the efficiency of the robot dispensing operation and ensuring the dispensing accuracy and consistency.

[0106] (2) After determining the centroid point of the trough point cloud cluster and generating the dispensing direction, the robot positioning dispensing method based on flat bellows trough recognition proposed in the present invention checks the signs of the main direction vector and the secondary main direction vector of the sorted trough point cloud cluster and makes corrections. The coordinate system established by normalizing and orthogonalizing the corrected main direction vector and the corrected secondary main direction vector can be used as the posture of the dispensing tool, and the centroid point of the trough point cloud cluster can be used as the spatial position of the end of the dispensing tool, thereby determining the posture of the dispensing tool in the 3D line scan camera coordinate system. The posture of the dispensing tool in the dispensing tool coordinate system is calculated based on the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, and the robot performs the dispensing operation according to the posture of the dispensing tool in the dispensing tool coordinate system.

[0107] (3) The robot positioning and dispensing method based on flat bellows trough recognition proposed in the present invention performs straight-through filtering on the point cloud obtained by scanning the flat bellows with a 3D line scan camera to obtain point cloud data after straight-through filtering, thereby filtering out irrelevant point clouds of the fixture and bottom surface of subsequent scans. The actual width of the flat bellows can be calculated based on the point cloud data after straight-through filtering for database comparison and calling the dispensing trajectory template, which is beneficial to reducing noise and increasing the stability of identifying the trough position. BRIEF DESCRIPTION OF THE DRAWINGS

[0108] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0109] Figure 1A schematic flow chart of a robot positioning dispensing method based on flat bellows trough recognition according to an embodiment of the present application;

[0110] Figure 2 A schematic diagram of a trough point cloud of a flat bellows in a robot positioning dispensing method based on trough identification of a flat bellows according to an embodiment of the present application;

[0111] Figure 3 A schematic diagram of the dispensing posture of the sorted trough point cloud cluster of the robot positioning dispensing method based on the flat bellows trough recognition according to the embodiment of the present application;

[0112] Figure 4 A schematic diagram of a robot positioning dispensing device based on flat bellows trough recognition according to an embodiment of the present application;

[0113] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0114] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0115] Figure 1 A robot positioning dispensing method based on flat bellows trough recognition provided by an embodiment of the present application is shown, comprising the following steps:

[0116] S1, obtain the original point cloud data of the flat bellows.

[0117] In a specific embodiment, a 3D line scan camera is used to scan the flat bellows and remove noise point clouds to obtain point cloud data before through-filtering;

[0118] The point cloud data before calculating the straight-through filter is x 、 y 、 z The maximum and minimum values ​​of the three dimensions are obtained x min、 x max、 y min、 y max、 z min、 z max ;

[0119] For point cloud data before direct filtering x 、 y 、 z Through-filtering is performed in three dimensional directions to obtain point cloud data after through-filtering, that is, the original point cloud data of the flat bellows, wherein the coordinates of the points in the point cloud data after through-filtering satisfy the following formula:

[0120] .

[0121] Specifically, a robot positioning and dispensing system based on flat bellows trough recognition includes a robot, a 3D line scan camera, a host computer, a dispensing tool, and a flat bellows to be dispensed. The flat bellows to be dispensed is scanned using a line structured light vision sensor, i.e., a 3D line scan camera, to obtain a point cloud of the flat bellows, and an adaptive flat bellows width algorithm is used to analyze all the scanned point clouds, specifically including: when the 3D line scan camera scans the front half of the flat bellows, the point cloud is first statistically filtered to remove noise point clouds, and then the point cloud in the vertical direction of the scanning direction is calculated. x 、 y 、 z The maximum and minimum values ​​in the three dimensions are obtained x min、 x max、 y min、 y max、 z min、 z max . While scanning the point cloud in the subsequent steps, the through filtering is adaptively performed according to the maximum and minimum values ​​in the three-dimensional directions to filter out the irrelevant point clouds of the fixture and bottom surface of the subsequent scans. The actual width of the flat bellows can be calculated for the point cloud data after through filtering, which is used for database comparison and the conditions for calling the template trajectory, which is conducive to reducing noise and increasing the stability of identifying the trough position. The robot positioning and dispensing method based on the trough identification of the flat bellows provided in the embodiment of the present application uses a 3D line scan camera based on the non-contact principle for three-dimensional reconstruction, and has significant characteristics such as high detection accuracy, fast detection speed and convenient operation. By linking with the articulated robot, fine control of the camera posture can be achieved to ensure that all detail areas of the scanned flat bellows fall within the effective field of view and depth of field of the 3D line scan camera, thereby accurately capturing and reproducing the texture features of the surface of the bellows in detail, and utilizing the spatial six-degree-of-freedom flexibility of the industrial six-axis robot to dispense glue at the position acquired in real time.

[0122] S2, based on the original point cloud data, use the random sampling consistency algorithm to model the plane where the flat bellows is located, obtain the plane model and the normal vector of the plane model, and calculate the normal vector of each point in the original point cloud data and the angle between it and the normal vector of the plane model, and determine the trough point cloud of the flat bellows according to the preset angle range and the spatial position of each point in the original point cloud data and the plane model.

[0123] In a specific embodiment, the plane where the flat bellows is located is modeled using a random sampling consistency algorithm based on the original point cloud data to obtain a plane model and a normal vector of the plane model, and the normal vector of each point in the original point cloud data and the angle between the normal vector of the plane model are calculated. The trough point cloud of the flat bellows is determined according to the preset angle range and the spatial position of each point in the original point cloud data and the plane model, specifically including:

[0124] Construct a plane model of the plane where the flat bellows is located, as shown in the following formula:

[0125] ax + by + cz = d ;

[0126] in, a, b, c are the unit normal vectors of the plane, and satisfy a 2 +b 2 +c 2 = 1, d is the distance from the origin to the plane, d Greater than 0, ( x , y , z ) represents the coordinates of a point on the plane;

[0127] Select at least three points in the original point cloud data, and determine whether the selected at least three points are collinear. If so, reselect at least three points. Otherwise, calculate the parameters of the plane model based on the coordinates of at least three points. a, b, c, d ;

[0128] Calculate the distance from each point in the original point cloud data except for at least three points to the plane model, as shown in the following formula:

[0129] d s = | ax s + by s + cz s -d |;

[0130] in,d s Represents the original point cloud data s The distance from a point to the plane model, s =1,2,…, n , n Represents the number of points other than at least three points in the original point cloud data, ( x s , y s , z s ) represents the first s The coordinates of the points;

[0131] According to the preset distance threshold and the distance from the sth point in all original point cloud data to the plane model d s The remaining points except at least three points in the original point cloud data are screened to obtain the in-points and out-points. All the in-points constitute the in-point set and the number of in-points is counted.

[0132] Repeat the above steps for M iterations to obtain M sets of in-place points. The set of in-place points with the largest number of in-place points is taken as the optimal subset, and the parameters of the plane model are recalculated based on the optimal subset. a, b, c, d , get the plane model and plane normal vector of the plane where the flat bellows is located n plane =(a, b, c) ;

[0133] Calculate the original point cloud data i Points P i In the local neighborhood of j Neighborhood points Q ij With point P i The position vector of point P i Neighborhood vector of V ij , as shown below:

[0134] V ij =Q ij -P i ;

[0135] in, j =1,2,…, k , k Indicate point P i The number of local neighborhood points of ;

[0136] According to all points P i The first covariance matrix is ​​constructed from the neighborhood vectors C 1, as shown in the following formula:

[0137] ;

[0138] in, is the neighborhood vector V ij The transpose of

[0139] For the first covariance matrix C 1 Perform eigenvalue decomposition and obtain the following formula:

[0140] ;

[0141] in, U i is an orthogonal matrix containing the eigenvectors, Λ i is a diagonal matrix whose diagonal elements correspond to eigenvalues; select the eigenvector corresponding to the largest eigenvalue e i1 As a point P i The principal curvature direction of the surface at point P i The normal vector of is normalized and expressed as:

[0142] ;

[0143] Calculation Point P i The normal vector N i With the plane normal vector n plane =(a, b, c) The angle of P i The normal vector N i With the plane normal vector n plane =(a, b, c) The angle between the points is less than the first angle threshold or greater than the second angle threshold and P i is below the plane model, then point P i Located in the trough of the flat bellows;

[0144] Traverse the points in the original point cloud data and repeat the above steps to obtain the trough point cloud of the flat bellows.

[0145] Specifically, the random sampling consensus algorithm (RANSAC) uses random sampling to build an initial model, and iterates the algorithm multiple times by calculating the distance to find the optimal parameter estimate. In order to ensure that at least one benign sample subset is obtained under a given confidence level, the random sampling consensus algorithm stipulates that the subset needs to be iterated at least M times. Among them, the probability P of this benign sample subset needs to satisfy a specific relationship P>ε, where ε represents the error rate of the data. Since the parameters of the plane model are calculated a、 b, c, d At least three non-collinear points are required, and the minimum data set size required to calculate the model is 3. The probability P is calculated as follows:

[0146] P=1-(1-(1-ε) 3 ) M ;

[0147] Among them, M represents the number of iterations; the probability P represents the probability that after M iterations, at least one of the data in the minimum data set is completely "inside points". The number of iterations M can be calculated as shown in the following formula:

[0148] .

[0149] By modeling the plane where the flat bellows is located, the normal vector of the plane model is obtained, and the normal vector representing the entire flat bellows is separated from the complex point cloud data, so as to obtain the plane spatial position and angle where the flat bellows is located, so as to facilitate the subsequent filtering of the midpoints of the original point cloud data.

[0150] Specifically, in each iteration process, all d s The standard deviation of is used to evaluate the stability of the model; and the preset distance threshold can be set to d s multiple of the standard deviation of .

[0151] Specifically, for a point in the point cloud data, the surrounding neighborhood points should be roughly distributed on a small plane centered on the point and perpendicular to the normal direction of the surface. By counting the coordinate differences or gradients of the neighborhood points, the normal direction of the plane can be estimated. The method of calculating point cloud normals based on local neighborhood statistics is usually used to infer the surface normal direction at each point from the point cloud data. i Points P i Define a local neighborhood, usually a spherical region with a radius of r or contain a fixed amount k The nearest neighbor of , this local neighborhood contains the point P i Several points aroundQ ij , together forming the point P i The local surface of . In constructing the first covariance matrix C 1, denominator k- 1 is to estimate the covariance unbiasedly. The covariance matrix reflects the second-order statistical relationship between the vectors in the neighborhood. It contains information about the local curvature and direction of the surface. P i The normal vector N i Describes the point P i Orientation information of the surface. Figure 2 The schematic diagram of the trough point cloud of the flat bellows in the embodiment of the present application is shown. P i The normal vector N i With the plane normal vector n plane =(a, b, c) Angle, filter and keep points P i The normal vector N i With the plane normal vector n plane =(a, b, c) The angle is less than the first angle threshold or greater than the second angle threshold, and the point cloud of the crest and trough of the flat bellows is obtained. Further, the crest point cloud higher than the plane model is filtered out, and finally the trough point cloud of the flat bellows is obtained.

[0152] S3, use the improved region growing algorithm to segment the trough point cloud to obtain trough point cloud clusters, calculate the centroid point, main direction vector and secondary main direction vector of each trough point cloud cluster according to the principal component analysis algorithm, and sort the trough point cloud clusters according to the main direction vectors of all trough point cloud clusters to obtain sorted trough point cloud clusters.

[0153] In a specific embodiment, the improved region growing algorithm is used to segment the trough point cloud to obtain the trough point cloud cluster, which specifically includes:

[0154] For the trough point cloud w Points P w The surface is fitted to obtain the parameterized surface function r(u, v) ,in, u , v is the coordinate of the parameterized surface, and calculates the parameterized surface function r(u, v) The partial derivative and its second-order partial derivative of , , , , , and are respectively recorded as r u 、r v 、r uu 、r uv 、r vv , according to the surface function r(u, v) The partial derivatives of are combined to get the point P w The unit normal vector of the surface , as shown below:

[0155] ;

[0156] Calculation Point P w The mean curvature Z and Gaussian curvature H To identify local features, mean curvature Z As shown below:

[0157] ;

[0158] Gaussian curvature H As shown below:

[0159] ;

[0160] in, E , F , G , L , M , N They are:

[0161] ;

[0162] ;

[0163] ;

[0164] ;

[0165] ;

[0166] ;

[0167] Calculation Point P w The maximum and minimum curvatures are as follows:

[0168] ;

[0169] in, K 1 represents a point P w The maximum curvature in all directions, K 2 indicates point P w Minimum curvature in all directions;

[0170] Construct the second covariance matrix C 2 , as shown below:

[0171] ;

[0172] in, P wj Indicate point P w Neighborhood j Points, express P w The centroid of the points in the neighborhood is as follows:

[0173] ;

[0174] Calculate the second covariance matrix C 2 The eigenvector corresponding to the smallest eigenvalue of P w The normal vector ;

[0175] Repeat the above steps to calculate the normal vector and curvature of each point in the trough point cloud, and take the point with the smallest curvature as the current seed point;

[0176] Set the seed point set and cluster area point set, traverse all points in the neighborhood of the current seed point, and calculate the normal vector of the current seed point The normal vector of the points in its neighborhood The angle between α , as shown below:

[0177] ;

[0178] In response to determining the angle α If it is greater than the normal vector angle threshold, the points in the neighborhood are ignored;

[0179] In response to determining the angle α If the angle is smaller than the normal vector angle threshold and the curvature of the points in the neighborhood is smaller than the curvature threshold, the points in the neighborhood are added to the seed point set;

[0180] In response to determining the angle α If the angle is smaller than the normal vector angle threshold and the curvature of the points in the neighborhood is greater than the curvature threshold, the points in the neighborhood are added to the clustering area point set;

[0181] Repeat the above four steps for all seed points in the seed point set until no point satisfies the constraints of the normal vector angle threshold and the curvature threshold, and the region growing process ends;

[0182] In response to determining that the number of points in the clustering region point set is between the minimum and maximum number of clustering points, all points in the clustering region point set form a trough point cloud cluster, otherwise all points in the clustering region point set are removed.

[0183] In a specific embodiment, the centroid point, the main direction vector and the secondary main direction vector of each trough point cloud cluster are calculated according to the principal component analysis algorithm, and the trough point cloud clusters are sorted according to the main direction vectors of all trough point cloud clusters to obtain the sorted trough point cloud clusters, which specifically includes:

[0184] Calculate the centroid of the valley point cloud cluster , as shown below:

[0185] ;

[0186] in, t =1,2,…, m , m Indicates the number of trough point cloud cluster points;

[0187] Calculate the midpoint of the valley point cloud cluster Q t With the centroid The position vector of Neighborhood vector of V t , as shown below:

[0188] ;

[0189] According to the centroid The neighborhood vectors of construct the third covariance matrix C 3 , as shown below:

[0190] ;

[0191] For the third covariance matrix C 3 Perform eigenvalue decomposition and get the following formula:

[0192] ;

[0193] in, Ut is an orthogonal matrix containing the eigenvectors, Λ t It is a diagonal matrix whose diagonal elements are corresponding eigenvalues. The eigenvalues ​​are sorted from large to small, and the eigenvectors corresponding to the first two eigenvalues ​​are selected as the main direction vector and the secondary main direction vector of the trough point cloud cluster respectively;

[0194] Traverse all trough point cloud clusters and repeat the above steps to obtain the centroid points, main direction vectors and secondary main direction vectors of all trough point cloud clusters. Sorting is performed according to the Y value of the main direction vector of all trough point cloud clusters to obtain the sorted trough point cloud clusters.

[0195] Specifically, the traditional region growing algorithm (RG) is a segmentation method based on the neighborhood characteristics of point cloud data. Its core is to gradually aggregate adjacent points with similar attribute characteristics into different point cloud regions. The improved region growing algorithm used in this method can use the minimum and maximum number of cluster points, normal vector angle threshold, and curvature threshold as conditions to determine the conditions for adding cluster area point sets, so as to segment and extract each trough point cloud cluster and obtain the spatial position of each trough point cloud cluster of the flat bellows, where high curvature corresponds to sharp edges or corners, and low curvature corresponds to flat areas. The principal component analysis algorithm (PCA) performs multi-dimensional orthogonal linear transformation based on statistical features. The transformed original data is linearly independent in each dimension and is used for dimensionality reduction of high-dimensional data. By analyzing the covariance structure of the point cloud data, the direction with the largest data variation is found, which is the main direction. In an embodiment of the present application, trough point cloud clusters are segmented by a regional growing algorithm to achieve precise positioning and identification of the spatial position of a single trough point cloud cluster; further, the trough point cloud clusters are sorted according to the main direction vectors of all trough point cloud clusters to form ordered trough point cloud clusters after segmentation, and while accurately positioning and identifying a single trough point cloud cluster, the orderliness and accuracy of trough identification are ensured, thereby ensuring the order of glue dispensing, determining the center of mass of the trough point cloud cluster and generating the glue dispensing direction, improving the efficiency of the robot's glue dispensing operation, and ensuring the accuracy and consistency of glue dispensing; and the main direction is usually consistent with the extension direction of the trough, ensuring that the glue is evenly spread along the trough.

[0196] S4, determine the dispensing posture of the dispensing tool in the sorted trough point cloud cluster according to the centroid point, main direction vector and secondary main direction vector of the sorted trough point cloud cluster, obtain the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, calculate the dispensing path according to the dispensing posture of all dispensing tools in the sorted trough point cloud cluster and the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, and transmit the dispensing path to the robot to perform the dispensing operation.

[0197] In a specific embodiment, the dispensing posture of the dispensing tool in the sorted trough point cloud cluster is determined according to the centroid point, the main direction vector and the secondary main direction vector of the sorted trough point cloud cluster, the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system is obtained, and the dispensing path is calculated according to the dispensing posture of all dispensing tools in the sorted trough point cloud cluster and the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, and the dispensing path is transmitted to the robot to perform the dispensing operation, which specifically includes:

[0198] During the calibration process, the dispensing trajectory template and calibration point cloud data are obtained, and the center point pose of the dispensing trajectory template is calculated based on the dispensing trajectory template. M dst , calculate a point on the 3D line scan camera coordinate system based on the calibration point cloud data T src And its posture R src , forming the calibration point pose matrix M src =[ R src |T src ], the center point pose of the dispensing trajectory template M dst And the calibration point pose matrix M src Satisfy the following formula:

[0199] M dst = M total · M src ;

[0200] in, M total Indicates the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system;

[0201] The main direction vector and the secondary main direction vector of the sorted trough point cloud cluster are corrected according to the correction rules to obtain the corrected main direction vector and the corrected secondary principal direction vector , the revised rules are as follows:

[0202] If the Z-axis component of the main direction vector of the sorted trough point cloud cluster is positive, the main direction vector of the sorted trough point cloud cluster remains unchanged, otherwise the Z-axis component of the main direction vector of the sorted trough point cloud cluster takes its opposite number; if the Y-axis component of the secondary main direction vector of the sorted trough point cloud cluster is positive, the secondary main direction vector of the sorted trough point cloud cluster remains unchanged, otherwise the Y-axis component of the secondary main direction vector of the sorted trough point cloud cluster takes its opposite number;

[0203] According to the corrected main direction vector and the corrected secondary principal direction vector Calculate the rotation matrix of the dispensing tool R , the expression is as follows:

[0204] ;

[0205] ;

[0206] ;

[0207] ;

[0208] in, Represents the main direction vector of the sorted valley point cloud cluster, Represents the secondary main direction vector of the sorted trough point cloud cluster, V 1、 V 2、 V 3 Represents the rotation matrix of the dispensing tool R The first, second, and third column vectors of ;

[0209] The centroid point of the sorted valley point cloud cluster As the translation matrix T of the dispensing tool, according to the rotation matrix of the dispensing tool R and translation matrix T Get the rotation and translation matrix of the dispensing tool in the 3D line scan camera coordinate system, that is, the dispensing posture of the dispensing tool in the sorted trough point cloud cluster in the 3D line scan camera coordinate system Mc , as shown below:

[0210] Mc =[ R|T ];

[0211] The dispensing position of the dispensing tool in the sorted valley point cloud cluster in the 3D line scan camera coordinate system Mc Transform to the dispensing tool coordinate system to obtain the dispensing posture of the dispensing tool in the dispensing tool coordinate system after sorting the trough point cloud cluster Mr , as shown below:

[0212] Mr = M total · Mc ;

[0213] Repeat the above steps to calculate the dispensing posture of the dispensing tool in all sorted trough point cloud clusters in the dispensing tool coordinate system, and form a dispensing path, which is then transmitted to the robot to perform the dispensing operation.

[0214] Specifically, according to the characteristics of the principal component analysis algorithm, the main direction vector of each sorted trough point cloud cluster is orthogonal to the secondary main direction vector, so the coordinate system can be established by normalizing and orthogonalizing the main direction vector and the secondary main direction vector. In order to ensure that the main direction vector and the secondary main direction vector satisfy a specific orthogonal relationship and a direction on a specific axis, in an embodiment of the present application, the main direction vector and the secondary main direction vector are calculated by correction and cross product, and the results of the cross product calculation are arranged in a specific order, so that the coordinate system established by the main direction vector and the secondary main direction vector is consistent with the direction of the tool coordinate system. Figure 3 A schematic diagram of the dispensing posture of the sorted trough point cloud cluster in an embodiment of the present application is shown. Since the corrected main direction vector is the extension direction of the trough, and the corrected secondary main direction vector is the direction of the dispensing tool facing the trough, the coordinate system established by the main direction vector and the secondary main direction vector can be used as the posture of the end dispensing tool, and the center of mass point of the sorted trough point cloud cluster is used as the spatial position of the end of the dispensing tool, so the posture of the dispensing tool can be determined.

[0215] Specifically, an adaptive flat bellows width algorithm is adopted in the embodiment of the present application, which can dynamically select the pre-taught dispensing trajectory template according to the change of the actual width of the bellows, and obtain the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system according to the center point posture and calibration point cloud data of the dispensing trajectory template. The dispensing path is calculated according to the dispensing posture of the trough point cloud cluster of all dispensing tools after sorting and the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system. The algorithm processing cycle is short, and the processing results can be scanned in real time to realize dispensing while scanning, and ensure accurate dispensing on bellows of different specifications.

[0216] The above steps S1-S4 do not necessarily represent the order between the steps, but are represented by step symbols, and the order between the steps can be adjusted.

[0217] Further references Figure 4 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a robot positioning dispensing device based on flat bellows trough recognition, and the device embodiment is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0218] The embodiment of the present application provides a robot positioning glue dispensing device based on flat bellows trough recognition, comprising:

[0219] The data acquisition module 1 is configured to obtain the original point cloud data of the flat bellows;

[0220] The trough recognition module 2 is configured to model the plane where the flat bellows is located using a random sampling consistency algorithm according to the original point cloud data, obtain the plane model and the normal vector of the plane model, and calculate the normal vector of each point in the original point cloud data and the angle between it and the normal vector of the plane model, and determine the trough point cloud of the flat bellows according to the preset angle range and the spatial position of each point in the original point cloud data and the plane model;

[0221] The trough positioning and segmentation module 3 is configured to segment the trough point cloud using the improved region growing algorithm to obtain trough point cloud clusters, calculate the centroid point, the main direction vector and the secondary main direction vector of each trough point cloud cluster according to the principal component analysis algorithm, and sort the trough point cloud clusters according to the main direction vectors of all trough point cloud clusters to obtain sorted trough point cloud clusters;

[0222] The dispensing module 4 is configured to determine the dispensing posture of the dispensing tool in the sorted trough point cloud cluster according to the centroid point, main direction vector and secondary main direction vector of the sorted trough point cloud cluster, obtain the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, calculate the dispensing path according to the dispensing posture of all dispensing tools in the sorted trough point cloud cluster and the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, and transmit the dispensing path to the robot to perform the dispensing operation.

[0223] Figure 5 Schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present invention. Figure 5 As shown, the electronic device of this embodiment includes: a processor 501 and a memory 502; wherein the memory 502 is used to store computer-executable instructions; the processor 501 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant description in the above method embodiment.

[0224] Optionally, the memory 502 may be independent or integrated with the processor 501 .

[0225] When the memory 502 is independently provided, the electronic device further includes a bus 503 for connecting the memory 502 and the processor 501 .

[0226] An embodiment of the present invention further provides a computer storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the above method is implemented.

[0227] An embodiment of the present invention further provides a computer program product, including a computer program. When the computer program is executed by a processor, the above method is implemented.

[0228] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0229] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0230] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit. The above-mentioned module-composed unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0231] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.

[0232] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0233] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0234] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0235] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0236] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.

[0237] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0238] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A robot positioning dispensing method based on flat bellows trough recognition, characterized in that: The following steps are involved: Obtaining original point cloud data of the flat bellows; Modeling the plane where the flat bellows is located using a random sampling consistency algorithm based on the original point cloud data to obtain a plane model and a normal vector of the plane model, and calculating the normal vector of each point in the original point cloud data and the angle between the normal vector and the plane model, and determining the trough point cloud of the flat bellows based on a preset angle range and the spatial position of each point in the original point cloud data and the plane model; The trough point cloud is segmented by using a modified region growing algorithm to obtain trough point cloud clusters, the centroid point, the main direction vector and the secondary main direction vector of each trough point cloud cluster are calculated according to a principal component analysis algorithm, and the trough point cloud clusters are sorted according to the main direction vectors of all the trough point cloud clusters to obtain sorted trough point cloud clusters; According to the centroid point, main direction vector and secondary main direction vector of the sorted trough point cloud cluster, the dispensing posture of the dispensing tool in the sorted trough point cloud cluster is determined, and the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system is obtained. According to the dispensing posture of all the dispensing tools in the sorted trough point cloud cluster and the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, the dispensing path is calculated, and the dispensing path is transmitted to the robot to perform the dispensing operation.

2. The robot positioning dispensing method based on flat bellows trough recognition according to claim 1 is characterized in that: The plane where the flat bellows is located is modeled using a random sampling consistency algorithm based on the original point cloud data to obtain a plane model and a normal vector of the plane model, and the normal vector of each point in the original point cloud data and the angle between the normal vector and the plane model are calculated, and the trough point cloud of the flat bellows is determined according to a preset angle range and the spatial position of each point in the original point cloud data and the plane model. Specifically, it includes: A plane model of the plane where the flat bellows is located is constructed as shown in the following formula: ax+by+cz=d ; in, a, b, c are the unit normal vectors of the plane, and satisfy a 2 +b 2 +c 2 = 1, d is the distance from the origin to the plane, d Greater than 0, ( x , y , z ) represents the coordinates of a point on the plane; Select at least three points from the original point cloud data, determine whether the selected at least three points are collinear, if so, reselect at least three points, otherwise calculate the parameters of the plane model according to the coordinates of the at least three points a, b, c, d ; The distances from the remaining points in the original point cloud data except the at least three points to the plane model are calculated as shown in the following formula: d s = | ax s +by s +cz s -d |; in, d s Represents the original point cloud data s The distance from a point to the plane model, s =1,2,…, n , n represents the number of remaining points in the original point cloud data except the at least three points, ( x s , y s , z s ) represents the first s The coordinates of the points; According to the preset distance threshold and the distance from the sth point in all the original point cloud data to the plane model d s Screening the remaining points in the original point cloud data except the at least three points to obtain in-zone points and out-of-zone points, wherein all the in-zone points constitute an in-zone point set and the number of in-zone points is counted; Repeat the above steps for M iterations to obtain M sets of in-place points. The set of in-place points with the largest number of in-place points is taken as the optimal subset, and the parameters of the plane model are recalculated based on the optimal subset. a, b, c, d , get the plane model and plane normal vector of the plane where the flat bellows is located n plane =(a,b,c) ; Calculate the first i Points P i In the local neighborhood of j Neighborhood points Q ij With point P i The position vector of point P i Neighborhood vector of V ij , as shown below: V ij =Q ij -P i ; in, j =1,2,…, k , k Indicate point P i The number of local neighborhood points of ; According to all the points P i The first covariance matrix is ​​constructed from the neighborhood vectors C 1, as shown in the following formula: ; in, is the neighborhood vector V ij The transpose of For the first covariance matrix C 1 Perform eigenvalue decomposition and obtain the following formula: ; in, U i is an orthogonal matrix containing the eigenvectors, Λ i is a diagonal matrix whose diagonal elements correspond to eigenvalues; select the eigenvector corresponding to the largest eigenvalue e i1 As a point P i The principal curvature direction of the surface at point P i The normal vector of is normalized and expressed as: ; Calculate the point P i The normal vector N i With the plane normal vector n plane =(a,b,c) The angle between P i The normal vector N i With the plane normal vector n plane =(a,b,c) The angle between the points is less than the first angle threshold or greater than the second angle threshold and the point P i is located below the plane model, then the point P i Located in the trough of the flat bellows; The points in the original point cloud data are traversed, and the above steps are repeated to obtain the trough point cloud of the flat bellows.

3. The robot positioning dispensing method based on flat bellows trough recognition according to claim 1 is characterized in that: The improved region growing algorithm is used to segment the trough point cloud to obtain the trough point cloud cluster, specifically including: For the first w Points P w The surface is fitted to obtain the parameterized surface function r(u,v) ,in, u , v is the coordinate of the parameterized surface, and calculates the parameterized surface function r(u,v) The partial derivative and its second-order partial derivative of , , , , , and are respectively recorded as r u 、r v 、r uu 、r uv 、r vv , according to the surface function r(u,v) The partial derivatives of P w The unit normal vector of the surface , as shown below: ; Calculate the point P w The mean curvature Z and Gaussian curvature H To identify local features, the mean curvature Z As shown below: ; The Gaussian curvature H As shown below: ; in, E , F , G , L , M , N They are: ; ; ; ; ; ; Calculate the point P w The maximum and minimum curvatures are as follows: ; in, K 1 represents a point P w The maximum curvature in all directions, K 2 indicates point P w Minimum curvature in all directions; Construct the second covariance matrix C 2 , as shown below: ; in, P wj Indicate point P w Neighborhood j Points, express P w The centroid of the points in the neighborhood is as follows: ; Calculate the second covariance matrix C 2 The eigenvector corresponding to the smallest eigenvalue of P w The normal vector ; Repeat the above steps to calculate the normal vector and curvature of each point in the trough point cloud, and take the point with the smallest curvature as the current seed point; Set the seed point set and cluster area point set, traverse all points in the neighborhood of the current seed point, and calculate the normal vector of the current seed point The normal vector of the points in its neighborhood The angle between α , as shown below: ; In response to determining the angle α If the angle is greater than the normal vector angle threshold, the points in the neighborhood are ignored; In response to determining the angle α If the angle of the point in the neighborhood is smaller than the normal vector angle threshold and the curvature of the point in the neighborhood is smaller than the curvature threshold, the point in the neighborhood is added to the seed point set; In response to determining the angle α If the angle of the point in the neighborhood is smaller than the normal vector angle threshold and the curvature of the point in the neighborhood is greater than the curvature threshold, the point in the neighborhood is added to the clustering area point set; Repeat the above four steps for all seed points in the seed point set until no point satisfies the constraints of the normal vector angle threshold and the curvature threshold, and the region growing process ends; In response to determining that the number of points in the clustering region point set is between the minimum and maximum number of clustering points, all points in the clustering region point set form a trough point cloud cluster, otherwise all points in the clustering region point set are removed.

4. The robot positioning dispensing method based on flat bellows trough recognition according to claim 1 is characterized in that: The method of calculating the centroid point, the main direction vector and the secondary main direction vector of each trough point cloud cluster according to the principal component analysis algorithm, and sorting the trough point cloud clusters according to the main direction vectors of all the trough point cloud clusters to obtain sorted trough point cloud clusters specifically includes: Calculate the centroid of the trough point cloud cluster , as shown below: ; in, t =1,2,…, m , m represents the number of cluster points of the trough point cloud; Calculate the midpoint of the trough point cloud cluster Q t With the centroid The position vector of Neighborhood vector of V t , as shown below: ; According to the centroid point The neighborhood vectors of construct the third covariance matrix C 3 , as shown below: ; For the third covariance matrix C 3 Perform eigenvalue decomposition and get the following formula: ; in, U t is an orthogonal matrix containing the eigenvectors, Λ t is a diagonal matrix whose diagonal elements are corresponding eigenvalues, the eigenvalues ​​are sorted from large to small, and the eigenvectors corresponding to the first two eigenvalues ​​are selected as the main direction vector and the secondary main direction vector of the trough point cloud cluster respectively; Traverse all the trough point cloud clusters, repeat the above steps, obtain the centroid points, main direction vectors and secondary main direction vectors of all the trough point cloud clusters, sort them according to the Y value of the main direction vector of all the trough point cloud clusters, and obtain the sorted trough point cloud clusters.

5. The robot positioning dispensing method based on flat bellows trough recognition according to claim 1 is characterized in that: The method further comprises: determining the dispensing posture of the dispensing tool in the sorted trough point cloud cluster according to the centroid point, the main direction vector and the secondary main direction vector of the sorted trough point cloud cluster, obtaining the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, calculating the dispensing path according to the dispensing posture of all the dispensing tools in the sorted trough point cloud cluster and the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system, and transmitting the dispensing path to the robot to perform the dispensing operation, specifically comprising: During the calibration process, the dispensing trajectory template and the calibration point cloud data are obtained, and the center point pose of the dispensing trajectory template is calculated according to the dispensing trajectory template. M dst , a point on the 3D line scan camera coordinate system is calculated based on the calibration point cloud data T src And its posture R src , forming the calibration point pose matrix M src =[ R src |T src ], the center point position of the dispensing trajectory template M dst And the calibration point pose matrix M src Satisfy the following formula: M dst = M total · M src ; in, M total Indicates the transformation relationship between the 3D line scan camera coordinate system and the dispensing tool coordinate system; The main direction vector and the secondary main direction vector of the sorted trough point cloud cluster are corrected according to the correction rule to obtain the corrected main direction vector and the corrected secondary principal direction vector , the revised rules are as follows: If the Z-axis component of the main direction vector of the sorted trough point cloud cluster is positive, the main direction vector of the sorted trough point cloud cluster remains unchanged, otherwise the Z-axis component of the main direction vector of the sorted trough point cloud cluster takes its opposite number; if the Y-axis component of the secondary main direction vector of the sorted trough point cloud cluster is positive, the secondary main direction vector of the sorted trough point cloud cluster remains unchanged, otherwise the Y-axis component of the secondary main direction vector of the sorted trough point cloud cluster takes its opposite number; According to the corrected main direction vector and the corrected secondary principal direction vector Calculate the rotation matrix of the dispensing tool R , the expression is as follows: ; ; ; ; in, Represents the main direction vector of the sorted valley point cloud cluster, Represents the secondary main direction vector of the sorted trough point cloud cluster, V 1、 V 2、 V 3 Respectively represent the rotation matrix of the dispensing tool R The first, second, and third column vectors of ; The centroid point of the sorted valley point cloud cluster As the translation matrix T of the dispensing tool, according to the rotation matrix of the dispensing tool R and translation matrix T The rotation and translation matrix of the dispensing tool in the 3D line scan camera coordinate system is obtained, that is, the dispensing posture of the dispensing tool in the trough point cloud cluster after the sorting in the 3D line scan camera coordinate system Mc , as shown below: Mc =[ R|T ]; The dispensing posture of the dispensing tool in the 3D line scan camera coordinate system is calculated as follows: Mc Transform to the dispensing tool coordinate system to obtain the dispensing posture of the dispensing tool in the dispensing tool coordinate system after the sorting trough point cloud cluster Mr , as shown below: Mr = M total · Mc ; Repeat the above steps to calculate the dispensing posture of the dispensing tool in all the sorted trough point cloud clusters in the dispensing tool coordinate system, and form a dispensing path, and transmit the dispensing path to the robot to perform the dispensing operation.

6. The robot positioning dispensing method based on flat bellows trough recognition according to claim 1 is characterized in that: Also includes: Use a 3D line scan camera to scan the flat bellows and remove the noise point cloud to obtain the point cloud data before straight-through filtering; Calculate the point cloud data before the straight-through filtering x 、 y 、 z The maximum and minimum values ​​of the three dimensions are obtained x min、 x max、 y min、 y max、 z min、 z max ; The point cloud data before the straight-through filtering is x 、 y 、 z Through filtering is performed in three dimensional directions to obtain point cloud data after through filtering, that is, the original point cloud data of the flat bellows, wherein the coordinates of the points in the point cloud data after through filtering satisfy the following formula: 。 7. A robot positioning dispensing device based on flat bellows trough recognition, characterized in that: include: A data acquisition module is configured to obtain raw point cloud data of the flat bellows; A trough identification module is configured to model the plane where the flat bellows is located using a random sampling consistency algorithm according to the original point cloud data, obtain a plane model and a normal vector of the plane model, and calculate the normal vector of each point in the original point cloud data and the angle between the normal vector and the plane model, and determine the trough point cloud of the flat bellows according to a preset angle range and the spatial position of each point in the original point cloud data and the plane model; A trough positioning and segmentation module is configured to segment the trough point cloud using a modified region growing algorithm to obtain trough point cloud clusters, calculate the centroid point, the main direction vector and the secondary main direction vector of each trough point cloud cluster according to a principal component analysis algorithm, and sort the trough point cloud clusters according to the main direction vectors of all the trough point cloud clusters to obtain sorted trough point cloud clusters; The glue dispensing module is configured to determine the glue dispensing posture of the glue dispensing tool in the sorted trough point cloud cluster according to the centroid point, main direction vector and secondary main direction vector of the sorted trough point cloud cluster, obtain the transformation relationship between the 3D line scan camera coordinate system and the glue dispensing tool coordinate system, calculate the glue dispensing path according to the glue dispensing posture of all the glue dispensing tools in the sorted trough point cloud cluster and the transformation relationship between the 3D line scan camera coordinate system and the glue dispensing tool coordinate system, and transmit the glue dispensing path to the robot to perform the glue dispensing operation.

8. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.