Point cloud registration method, device and electronic device based on single plane features
By using single plane features and multiple rotation methods in point cloud registration, the optimal rotation method is determined, which solves the complex plane registration problem in the existing technology and improves the speed and efficiency of point cloud registration.
Patent Information
- Application Number
- CN202410551726.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-05-07
AI Technical Summary
When the existing point cloud registration method based on plane features detects a large number of planes in the target point cloud and the point cloud to be registered, the process of determining two pairs of corresponding planes is complicated and the calculation complexity is high, resulting in registration speed and Low efficiency.
Using a method based on single-plane features, the first standard plane in the point cloud to be registered and the second standard plane in the target point cloud are determined, and the target point cloud is rotated according to multiple rotation methods, and the optimal point cloud is determined based on the registration results. Optimal rotation method to achieve registration between point clouds.
The speed and efficiency of point cloud registration are improved, the registration process is simplified, the computational complexity is reduced, and fast and accurate point cloud registration is achieved.
Smart Images

Figure CN118134979B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of point cloud data processing, and in particular to a point cloud registration method, device and electronic equipment based on single plane features. Background Art
[0002] In the field of point cloud processing technology, the registration between two different point clouds is often involved. The registration between point clouds is usually based on the plane features of the point clouds. In the existing registration methods based on plane features, two parallel planes are generally used for registration. Specifically, for example, for the point cloud Q to be registered and the target point cloud P, all planes existing in the target point cloud P are first detected, represented as P P, 1 ,...,P P, n , n Represents the number of planes detected in the target point cloud P. Then detect all planes existing in the point cloud to be registered Q, denoted as P Q, 1 ,..., P Q, m , m Represents the number of planes detected in the point cloud Q to be registered. Then find the two corresponding pairs of planes among these planes, namely P P, i1 , P Q, i1 , P P, i2 , P Q, i2 , P P, i1 With P Q, i1 is a pair of corresponding planes, P P, i2 With P Q, i2 is a pair of corresponding planes. Then the two pairs of corresponding planes are used to calculate the rotation matrix and translation vector to achieve the registration between point cloud P and point cloud Q.
[0003] The existing plane-based point cloud registration method requires two pairs of corresponding planes in the target point cloud and the point cloud to be registered to achieve the registration between the point clouds. When a large number of planes are detected in the target point cloud and the point cloud to be registered, the process of determining the two pairs of corresponding planes in these planes through plane features is very complicated. Generally, it is necessary to comprehensively utilize multiple features of the planes and try multiple combinations of planes to determine which two pairs of planes are corresponding, which generally consumes a lot of computing time and has high computational complexity. Summary of the invention
[0004] The objects of the present invention include, for example, providing a point cloud registration method, device and electronic device based on single plane features, which can improve the registration speed and efficiency.
[0005] The embodiments of the present invention can be implemented as follows:
[0006] In a first aspect, the present invention provides a point cloud registration method based on single plane features, the method comprising:
[0007] Obtaining a point cloud to be registered and a target point cloud, wherein the point cloud to be registered has a first bottom surface parallel to an xy plane of a ground coordinate system, and the target point cloud has a second bottom surface parallel to one of the coordinate planes of the ground coordinate system;
[0008] Determine a first standard plane in the point cloud to be registered, where the first standard plane is not parallel to the first bottom surface;
[0009] Rotating the target point cloud in a plurality of different rotation modes, and determining a second standard plane in the target point cloud in various rotation modes, wherein the second standard plane is not parallel to the second bottom surface;
[0010] Implementing registration between the point cloud to be registered and the target point cloud according to the first standard plane and the second standard plane in various rotation modes, and determining an optimal rotation mode according to the registration result;
[0011] The point cloud to be registered is registered with the target point cloud based on the optimal rotation method.
[0012] In an optional implementation, the step of determining a first standard plane in the point cloud to be registered includes:
[0013] Detecting all planes in the point cloud to be registered, and obtaining the normal vector of each plane;
[0014] Filtering out planes whose angles between their normal vectors and the z-axis of the ground coordinate system are within a preset angle range from all planes;
[0015] Determine the plane with the largest area among the screened planes as the first standard plane.
[0016] In an optional embodiment, the step of realizing registration between the point cloud to be registered and the target point cloud according to the first standard plane and the second standard plane in various rotation modes includes:
[0017] For each rotation mode, determining a rotation axis and a rotation angle according to a normal vector of the first standard plane and a normal vector of a second standard plane under the rotation mode;
[0018] Rotating the point cloud to be registered according to the rotation axis and the rotation angle to obtain a rotated point cloud;
[0019] Based on the rotated point cloud and the target point cloud, precise alignment of the rotated point cloud is achieved to obtain a precise alignment point cloud.
[0020] In an optional implementation, the step of determining the optimal rotation mode according to the registration result includes:
[0021] For each rotation mode, the error between the precisely registered point cloud and the target point cloud rotated in the rotation mode is calculated.
[0022] A minimum error among multiple errors is obtained, and a rotation mode corresponding to the minimum error is determined as an optimal rotation mode, wherein the second bottom surface in the target point cloud after rotation under the optimal rotation mode is parallel to the xy plane in the ground coordinate system.
[0023] In an optional embodiment, the step of achieving precise registration of the rotated point cloud based on the rotated point cloud and the target point cloud to obtain a precise registration point cloud comprises:
[0024] Performing transformation processing on the rotated point cloud based on a set initial transformation matrix;
[0025] For each point in the rotated point cloud, query and obtain a matching point in the target point cloud corresponding to the point, and calculate the distance between the point and the matching point;
[0026] Based on the distance corresponding to each point in the rotated point cloud, obtaining a distance error between the rotated point cloud and the target point cloud;
[0027] The transformation matrix is updated under the guidance of the set distance error minimization function, and the rotated point cloud is transformed with the updated transformation matrix until the optimal transformation matrix is obtained when the preset conditions are met, and the rotated point cloud is transformed with the optimal transformation matrix to obtain a precisely aligned point cloud.
[0028] In an optional implementation, the step of registering the to-be-registered point cloud with the target point cloud based on the optimal rotation method includes:
[0029] Obtaining an initial registration matrix and an initial registration vector between the point cloud to be registered and the target point cloud rotated in the optimal rotation mode;
[0030] Performing a preliminary registration on the to-be-registered point cloud based on the preliminary registration matrix and the preliminary registration vector, and performing a fine registration on the to-be-registered point cloud after the preliminary registration with the target point cloud to obtain a fine registration matrix and a fine registration vector;
[0031] The final registration matrix and registration vector are calculated according to the preliminary registration matrix, preliminary registration vector, fine registration matrix and fine registration vector;
[0032] The point cloud to be registered is registered with the target point cloud based on the final registration matrix and the registration vector.
[0033] In an optional implementation, the step of performing preliminary registration on the point cloud to be registered based on the preliminary registration matrix and the preliminary registration vector includes:
[0034] Obtaining a reverse rotation mode that is reverse to the optimal rotation mode;
[0035] Performing preliminary registration on the point cloud to be registered based on the preliminary registration matrix and the preliminary registration vector;
[0036] The point cloud to be registered after the initial registration is reversely rotated according to the reverse rotation method.
[0037] In an optional implementation, the step of obtaining the point cloud to be registered includes:
[0038] Obtaining a collected point cloud, and converting the collected point cloud from a camera coordinate system to a robot base coordinate system;
[0039] According to the relationship between the robot base coordinate system and the ground coordinate system, the collected point cloud is converted from the robot base coordinate system to the ground coordinate system to obtain the point cloud to be registered in the ground coordinate system.
[0040] In a second aspect, the present invention provides a point cloud registration device based on single plane features, the device comprising:
[0041] An acquisition module, used for acquiring a point cloud to be registered and a target point cloud, wherein the point cloud to be registered has a first bottom surface parallel to an xy plane of a ground coordinate system, and the target point cloud has a second bottom surface parallel to one of the coordinate planes of the ground coordinate system;
[0042] A first determination module is used to determine a first standard plane in the point cloud to be registered, where the first standard plane is not parallel to the first bottom surface;
[0043] A rotation module, used for rotating the target point cloud in a plurality of different rotation modes, and determining a second standard plane in the target point cloud in various rotation modes, wherein the second standard plane is not parallel to the second bottom surface;
[0044] A second determination module is used to realize the registration between the to-be-registered point cloud and the target point cloud according to the first standard plane and the second standard plane in various rotation modes, and determine the optimal rotation mode according to the registration result;
[0045] A registration module is used to register the to-be-registered point cloud with the target point cloud based on the optimal rotation method.
[0046] In a third aspect, the present invention provides an electronic device, comprising a machine-readable storage medium and a processor, wherein the machine-readable storage medium stores machine-executable instructions, and when the processor executes the machine-executable instructions, the electronic device implements the method described in any one of the aforementioned embodiments.
[0047] The beneficial effects of the embodiments of the present invention include, for example:
[0048] The present invention provides a point cloud registration method, device and electronic device based on single plane features, and obtains a point cloud to be registered and a target point cloud, wherein the point cloud to be registered has a first bottom surface parallel to the xy plane of the ground coordinate system, and the target point cloud has a second bottom surface parallel to one of the coordinate planes of the ground coordinate system. A first standard plane that is not parallel to the first bottom surface in the point cloud to be registered is determined, the target point cloud is rotated according to a plurality of different rotation modes, and a second standard plane in the target point cloud under various rotation modes is determined. The registration between the point cloud to be registered and the target point cloud is achieved according to the first standard plane and the second standard plane under various rotation modes, and the optimal rotation mode is determined according to the registration result. Finally, the point cloud to be registered is registered to the target point cloud based on the optimal rotation mode. The scheme rotates the target point cloud according to different rotation modes, and performs point cloud registration based on the standard plane, and finds the optimal rotation mode to achieve the final registration. The scheme has the advantages of fast registration speed and high efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 A flow chart of a point cloud registration method based on single plane features provided by the present invention;
[0051] Figure 2 for Figure 1 Flowchart of the sub-steps included in S1;
[0052] Figure 3 for Figure 1 A flowchart of the sub-steps included in S2;
[0053] Figure 4 A schematic diagram of a workpiece model provided by the present invention;
[0054] Figure 5 for Figure 1 Flowchart of the sub-steps contained in S4;
[0055] Figure 6 for Figure 5 A flowchart of the sub-steps included in S43;
[0056] Figure 7 for Figure 1Another flow chart of the sub-steps included in S4;
[0057] Figure 8 for Figure 1 Flowchart of the sub-steps included in S5;
[0058] Fig. 9 for Figure 8 A flowchart of the sub-steps included in S52;
[0059] Fig.10 A functional module block diagram of a point cloud registration device based on single plane features provided by the present invention;
[0060] Fig.11 This is a structural block diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0062] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. 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.
[0063] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0064] In the description of the present invention, it should be noted that the terms “first”, “second”, etc., if used, are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0065] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0066] See also Figure 1, is a flow chart of a point cloud registration method based on a single plane feature provided by an embodiment of the present invention. The point cloud registration method based on a single plane feature can be performed by a point cloud registration device based on a single plane feature. The point cloud registration device based on a single plane feature can be implemented by software and / or hardware and can be configured in an electronic device, which can be a computer device. The detailed steps of the point cloud registration method based on a single plane feature are described as follows.
[0067] S1, obtaining a point cloud to be registered and a target point cloud, wherein the point cloud to be registered has a first bottom surface parallel to an xy plane of a ground coordinate system, and the target point cloud has a second bottom surface parallel to one of the coordinate planes of the ground coordinate system.
[0068] S2: Determine a first standard plane in the point cloud to be registered, where the first standard plane is not parallel to the first bottom surface.
[0069] S3, rotating the target point cloud in a plurality of different rotation modes, and determining a second standard plane in the target point cloud in various rotation modes, wherein the second standard plane is not parallel to the second bottom surface.
[0070] S4, realizing registration between the point cloud to be registered and the target point cloud according to the first standard plane and the second standard plane in various rotation modes, and determining an optimal rotation mode according to the registration result.
[0071] S5: aligning the point cloud to be registered with the target point cloud based on the optimal rotation method.
[0072] In this embodiment, the point cloud to be registered can be a point cloud extracted from an image obtained by photographing the workpiece model using a photographing device, and the target point cloud can be a point cloud derived from the same workpiece model using relevant model software in a computer device.
[0073] In welding application scenarios, the placement of the workpiece model is not arbitrary. Although the workpiece model may have certain differences in posture each time it is placed, each time it is placed, a same plane of the workpiece model will be placed on the ground, such as a plane with a larger area in the workpiece model. In the constructed ground coordinate system, the xy plane of the ground coordinate system is the ground. Therefore, in this embodiment, the point cloud to be registered has a first bottom surface parallel to the xy plane of the ground coordinate system.
[0074] In addition, the workpiece model often includes a plane that is not parallel to the first bottom surface, such as a plane that is perpendicular to the first bottom surface. In this embodiment, the plane is named the first standard plane. In this way, the first bottom surface and the first standard plane constitute a group of planes that are not parallel to each other.
[0075] Correspondingly, the target point cloud also has a second bottom surface and a second standard plane that is not parallel to the second bottom surface. However, since the target point cloud is derived through relevant software, the placement of the workpiece model corresponding to the target point cloud is not arranged according to certain rules as in the actual welding scene. Therefore, the second bottom surface in the target point cloud is not necessarily parallel to the xy plane of the ground coordinate system.
[0076] However, since the construction of the workpiece model in the software also has certain specifications, it can be determined that the second bottom surface in the target point cloud is parallel to one of the coordinate planes of the ground coordinate system. For example, the second bottom surface can be parallel to the xy plane, or the second bottom surface is parallel to the xz plane, or the second bottom surface is parallel to the yz plane.
[0077] In the actual processing process, it is not certain which coordinate plane the second bottom surface in the target point cloud is parallel to, so the target point cloud can be rotated in a variety of different rotation methods. In different rotation methods, the second standard plane in the target point cloud will also rotate accordingly.
[0078] The first bottom surface and the first standard plane in the point cloud to be registered constitute a group of non-parallel planes, while the second bottom surface and the second standard plane in the target point cloud constitute a group of non-parallel planes.
[0079] In this embodiment, registration information may be obtained based on the first standard plane and the second standard plane in different rotation modes, so as to achieve registration between the point cloud to be registered and the target point cloud.
[0080] Since a plurality of different rotation methods are used to rotate the target point cloud, it can be considered that among the plurality of rotation methods, the position and posture of the target point cloud after rotation by one of the rotation methods is most similar to the position and posture of the point cloud to be registered, that is, the registration result between the target point cloud after rotation by the rotation method and the point cloud to be registered is the best. In this embodiment, the rotation method can be determined as the optimal rotation method.
[0081] On the basis of determining the optimal rotation method, it is equivalent to determining the original position and posture of the target point cloud. On this basis, the registration between the point cloud to be registered and the target point cloud can be achieved based on the optimal rotation method.
[0082] The point cloud registration method based on single plane features provided in this embodiment determines the first bottom surface in the point cloud to be registered and the first standard plane that is not parallel to the first bottom surface, and then rotates the target point cloud according to a variety of different rotation methods to determine the second bottom surface and the second standard plane of the target point cloud. The point cloud is registered based on the standard planes in the point cloud to be registered and the target point cloud, and the optimal rotation method is found to achieve the final registration. This solution has the advantages of fast registration speed and high efficiency.
[0083] See also Figure 2 In this embodiment, the above step of obtaining the point cloud to be registered can be implemented by:
[0084] S11, obtaining a collected point cloud, and converting the collected point cloud from a camera coordinate system to a robot base coordinate system.
[0085] S12, according to the relationship between the robot base coordinate system and the ground coordinate system, converting the collected point cloud from the robot base coordinate system to the ground coordinate system to obtain the point cloud to be registered in the ground coordinate system.
[0086] In this embodiment, the collected point cloud is a point cloud extracted from an image after the workpiece model is photographed by a photographing device. Since the photographing and collection is performed by the photographing device, the collected point cloud is a point cloud in the camera coordinate system.
[0087] In welding scenarios, robots are required to perform relevant operations on the workpiece model, and the operation control information of the robot needs to be based on the information in the robot base coordinate system. Therefore, the collected point cloud needs to be converted from the camera coordinate system to the robot base coordinate system.
[0088] When performing the registration of the point cloud to be registered and the target point cloud, considering that there is always a plane in the point cloud to be registered that can remain parallel to the ground, in order to use this plane as a reference, the collected point cloud can be converted from the robot base coordinate system to the ground coordinate system to obtain the point cloud to be registered in the ground coordinate system.
[0089] In addition, for the target point cloud, relevant information of the target point cloud in the ground coordinate system can be obtained in the relevant software.
[0090] The plane in the point cloud to be registered that is parallel to the xy plane of the ground coordinate system is the first bottom surface, and the second bottom surface in the target point cloud is parallel to one of the coordinate planes of the ground coordinate system.
[0091] On this basis, determine the first standard plane in the point cloud to be registered that is not parallel to the first bottom surface. This step can be achieved in the following way. Please refer to Figure 3 :
[0092] S21, detecting all planes existing in the point cloud to be registered, and obtaining the normal vector of each of the planes.
[0093] S22, screening out planes from all planes, the planes whose angles between their normal vectors and the z-axis of the ground coordinate system are within a preset angle range.
[0094] S23, determining the plane with the largest area among the screened planes as the first standard plane.
[0095] In this embodiment, currently commonly used plane detection algorithms may be used to detect all planes in the point cloud to be registered, such as a random Hough transform method, a random sampling consensus (RANSAC) method, a deterministic voting method, etc., without specific limitation.
[0096] Please refer to Figure 4 ,From the above, we can see that when the workpiece model is placed according to the specification, its first bottom surface ( Figure 4 The bottom surface of the workpiece model in the figure is parallel to the xy plane, while the first standard plane and the first bottom surface are not parallel to each other. For example, the first standard plane ( Figure 4 The standard plane in the workpiece model in the figure can be perpendicular to the first bottom surface. The first standard plane should be substantially parallel to the z-axis of the ground coordinate system. Based on this, the normal vectors of each detected plane can be obtained, and the angle between the normal vector of each plane and the z-axis of the ground coordinate system can be detected to determine whether the angle is within a preset angle range. The preset angle range can be a certain range of 90 degrees, so as to ensure that the first standard plane is not parallel to the first bottom surface, for example, the first standard plane is perpendicular to the first bottom surface.
[0097] The detected planes that meet the above conditions are screened out, and then the area of the screened plane is obtained. The area of the plane can be obtained according to the number of three-dimensional points contained near the plane.
[0098] Among them, the plane with the largest area among the screened planes is the first standard plane.
[0099] Since the position of the second bottom surface in the obtained target point cloud is uncertain, the second bottom surface may be parallel to any coordinate plane in the ground coordinate system. Therefore, in this embodiment, the target point cloud is rotated according to a plurality of different rotation modes.
[0100] For example, assuming that the second bottom surface is parallel to the xy plane, if the second standard plane is above the second bottom surface, then there is no need to rotate the target point cloud, and it can be understood that the rotation angle is 0. In addition, assuming that the second bottom surface is parallel to the xy plane, if the second standard plane is below the second bottom surface, then the target point cloud is rotated 180 degrees around the x-axis, that is, the target point cloud is reversed.
[0101] In the above two cases, the second standard plane may be parallel to the xz plane or to the yz plane.
[0102] In addition, assuming that the second bottom surface is parallel to the xz plane and the second standard plane is located on the right side of the second bottom surface, the target point cloud can be rotated 90 degrees counterclockwise around the x-axis.
[0103] Assuming that the second bottom surface is parallel to the xz plane and the second standard plane is located on the left side of the second bottom surface, the target point cloud can be rotated 90 degrees clockwise around the x-axis.
[0104] Assuming that the second bottom surface is parallel to the yz plane and the second standard plane is located behind the second bottom surface, the target point cloud can be rotated 90 degrees counterclockwise around the y axis.
[0105] Assuming that the second bottom surface is parallel to the yz plane and the second standard plane is located in front of the second bottom surface, the target point cloud can be rotated 90 degrees clockwise around the y axis.
[0106] It can be seen that the target point cloud may have the above-mentioned multiple situations, and it is not certain which of the above-mentioned situations the target point cloud is in during processing. Therefore, the target point cloud can be rotated by 0 degrees (i.e., no rotation), 90 degrees clockwise or counterclockwise around the x-axis, 90 degrees clockwise or counterclockwise around the y-axis, etc.
[0107] After processing in various rotation modes, the registration between the point cloud to be registered and the target point cloud is realized based on the first standard plane and the second standard plane in various rotation modes. Figure 5 In this embodiment, this step can be implemented in the following way:
[0108] S41: For each rotation mode, determine a rotation axis and a rotation angle according to a normal vector of the first standard plane and a normal vector of a second standard plane under the rotation mode.
[0109] S42, rotating the point cloud to be registered according to the rotation axis and the rotation angle to obtain a rotated point cloud.
[0110] S43, realizing precise alignment of the rotated point cloud based on the rotated point cloud and the target point cloud to obtain a precise alignment point cloud.
[0111] In this embodiment, the target point cloud can be marked as P0, and the point cloud to be registered can be marked as Q. In each rotation mode, the normal vector of the rotated second standard plane can be obtained: n P0 , the normal vector of the first standard plane can be marked as n The rotation axis and the rotation angle can be determined according to the normal vector of the first standard plane and the normal vector of the second standard plane.
[0112] The rotation axis is calculated as a P0 = n × n P0 , the rotation angle can be two, and the calculation methods are respectively α P0,0 = acos( n ·n P0 )and α P0,1 = acos( n · n P0 ) + π.
[0113] Taking the above-mentioned second bottom surface being parallel to the xy plane as an example, in this case, the second standard plane may be parallel to the xz plane. In this case, the normal vector of the second standard plane is n P0,1 = (0, 1, 0). According to n and n P0,1 Calculate the axis of rotation a P0,1 = n × n P0,1 , and then calculate the two rotation angles α P0,1, 0 = acos( n · n P0, 1 )and α P0,1,1 = acos( n · n P0,1 ) + π.
[0114] In addition, when the second bottom surface is parallel to the xy plane, the second standard plane may also be parallel to the yz plane. In this case, the normal vector of the second standard plane is n P0,2 = (1, 0, 0). According to n and n P0,2 Calculate the axis of rotation a P0,2 = n × n P0,2 , and then calculate the two rotation angles α P0,2,0 = acos( n · n P0,2 )and α P0,2,1 = acos( n · n P0,2 ) + π.
[0115] For each rotation mode, the point cloud to be registered is rotated based on the rotation axis and rotation angle calculated under the rotation mode to obtain a rotated point cloud, which can be marked as Q'. Then, precise registration is performed based on the rotated point cloud and the target point cloud to obtain a precise registration point cloud, which can be marked as Q''.
[0116] See also Figure 6 In this embodiment, when precise registration of the rotating point cloud is realized based on the rotating point cloud and the target point cloud, it can be realized by the following methods:
[0117] S431: Perform transformation processing on the rotated point cloud based on the set initial transformation matrix.
[0118] S432: for each point in the rotated point cloud, query and obtain a matching point in the target point cloud corresponding to the point, and calculate a distance between the point and the matching point.
[0119] S433: Obtain a distance error between the rotated point cloud and the target point cloud based on the distance corresponding to each point in the rotated point cloud.
[0120] S434, updating the transformation matrix guided by the set distance error minimization function, and transforming the rotated point cloud with the updated transformation matrix until the optimal transformation matrix is obtained when the preset conditions are met, and transforming the rotated point cloud with the optimal transformation matrix to obtain a precisely aligned point cloud.
[0121] In this embodiment, a transformation matrix is set, and the transformation matrix can be updated according to the registration result. After the rotation point cloud is transformed based on the transformation matrix, the matching points corresponding to each point in the rotation point cloud in the target point cloud can be obtained. For example, for any point in the rotation point cloud, each point in the target point cloud can be traversed, the distance between the two can be calculated, and the point with the smallest distance can be used as the matching point of the arbitrary point.
[0122] In this way, the distance between the two is calculated based on each set of matched point pairs, and the sum of the distances of all matched point pairs is counted to obtain the overall distance error between the rotated point cloud and the target point cloud.
[0123] In addition, a distance error minimization function is set, which is constructed based on the distance error between the rotated point cloud and the target point cloud, and the basis for updating the transformation matrix is to make the distance error minimization function as small as possible. Based on this, the transformation matrix can be updated, and the above process can be executed back with the updated transformation matrix, and then the value of the distance error minimization function is calculated. When the preset conditions are met, the transformation matrix at this time is the optimal transformation matrix, and the rotated point cloud transformed by the optimal transformation matrix is the precise registration point cloud.
[0124] The preset condition may be that the distance error minimization function reaches convergence, or the number of iterations reaches a preset maximum number, etc.
[0125] After obtaining the precisely registered point cloud under each rotation mode, the optimal rotation mode can be determined based on the registration results under each rotation mode. Figure 7 In this embodiment, this step can be implemented in the following way:
[0126] S44, for the precisely registered point cloud obtained in each rotation mode, calculating the error between the precisely registered point cloud and the target point cloud rotated in the rotation mode.
[0127] S45, obtaining a minimum error among multiple errors, and determining a rotation mode corresponding to the minimum error as an optimal rotation mode, wherein the second bottom surface in the target point cloud after rotation under the optimal rotation mode is parallel to the xy plane in the ground coordinate system.
[0128] For each rotation mode, the error between the precisely registered point cloud determined under the rotation mode and the rotated target point cloud can be calculated. The error can be calculated by finding the corresponding point in the rotated target point cloud for each point in the precisely registered point cloud, and then calculating the distance between the two. The distances corresponding to each point in the precisely registered point cloud are superimposed to obtain the error between the precisely registered point cloud and the rotated target point cloud.
[0129] An error can be obtained under each rotation mode. The smaller the error, the closer the precise registration point cloud is to the rotated target point cloud, and the better the registration result. Therefore, the rotation mode corresponding to the minimum error is determined as the optimal rotation mode.
[0130] From the above, it can be seen that the second bottom surface of the point cloud to be registered is parallel to the xy plane, and the target point cloud under the optimal rotation method should be similar to the pose of the point cloud to be registered. Therefore, the second bottom surface of the target point cloud rotated under the optimal rotation method is parallel to the xy plane.
[0131] After determining the optimal rotation method for the target point cloud, the point cloud to be registered can be registered to the target point cloud based on the optimal rotation method. Figure 8 In this embodiment, this step can be implemented in the following way:
[0132] S51, obtaining an initial registration matrix and an initial registration vector between the point cloud to be registered and the target point cloud rotated in the optimal rotation mode.
[0133] S52, performing preliminary registration on the to-be-registered point cloud based on the preliminary registration matrix and the preliminary registration vector, and performing fine registration on the to-be-registered point cloud after the preliminary registration with the target point cloud to obtain a fine registration matrix and a fine registration vector.
[0134] S53, calculating a final registration matrix and a final registration vector according to the preliminary registration matrix, the preliminary registration vector, the fine registration matrix and the fine registration vector.
[0135] S54: registering the to-be-registered point cloud with the target point cloud based on the final registration matrix and registration vector.
[0136] In this embodiment, after determining the optimal rotation method, the target point cloud rotated by the optimal rotation method can be determined. Based on the point cloud to be registered and the target point cloud rotated by the optimal rotation method, the initial registration matrix and the initial registration vector can be determined.
[0137] The preliminary registration matrix and preliminary registration vectors can be calculated based on the salient features in the point cloud to be registered and the target point cloud after being rotated by the optimal rotation method. For example, the preliminary registration matrix and preliminary registration vectors can be calculated based on corresponding planes, corresponding point pairs, or corresponding surfaces of other shapes in the two.
[0138] On this basis, the preliminary registration matrix and preliminary registration vector can be used to perform preliminary registration on the point cloud to be registered. Fig. 9 In this embodiment, it can be achieved by the following methods:
[0139] S521, obtaining a reverse rotation mode that is reverse to the optimal rotation mode.
[0140] S522: Perform preliminary registration on the point cloud to be registered based on the preliminary registration matrix and the preliminary registration vector.
[0141] S523: reversely rotate the to-be-registered point cloud after the initial registration according to the reverse rotation method.
[0142] In this embodiment, the optimal rotation mode is recorded as R P , the reverse rotation method opposite to the optimal rotation method can be recorded as First, the point cloud to be registered is preliminarily registered based on the preliminarily registered matrix and the preliminarily registered vector, and then the preliminarily registered point cloud is reversely rotated according to the reverse rotation method. In this way, the preliminarily registered and reversely rotated point cloud and the target point cloud can have the same orientation.
[0143] On this basis, the point cloud to be registered after the initial registration is precisely registered with the target point cloud, and the precise registration method can be implemented by using the commonly used ICP (Iterative Closest Point) algorithm. In this way, the precise registration matrix and precise registration vector can be obtained.
[0144] In this embodiment, it is assumed that the initial registration matrix and the initial registration vector are R , T, the fine registration matrix and fine registration vector are R fine , T fineThe final registration matrix can be , the final registration vector can be .
[0145] On the basis of obtaining the final registration matrix and registration vector, the point cloud to be registered can be directly registered with the target point cloud based on the final registration matrix and registration vector.
[0146] The point cloud registration method based on single plane features provided in this embodiment performs point cloud registration based on the standard plane in the workpiece model, avoiding the problem of complicated registration process in the prior art that requires at least two sets of plane features for registration. In this solution, when the position of the standard plane is unknown, the target point cloud is rotated by adopting a variety of different rotation methods, so that the standard plane is also rotated. Then, the optimal rotation method is determined by the error between the point cloud to be registered and the target point cloud under various rotation methods, and then the registration between the point cloud to be registered and the target point cloud is achieved based on the optimal rotation method.
[0147] Based on the same inventive concept, please refer to Fig.10 , showing a schematic diagram of functional modules of a point cloud registration device based on single-plane features provided in an embodiment of the present invention. This embodiment can divide the functional modules of the point cloud registration device based on single-plane features according to the above-mentioned method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic, which is only a logical functional division, and there may be other division methods in actual implementation.
[0148] For example, when each functional module is divided into corresponding functional modules, Fig.10 The point cloud registration device based on single plane features shown is only a schematic diagram of the device. The point cloud registration device based on single plane features may include an acquisition module, a first determination module, a rotation module, a second determination module and a registration module. The functions of each functional module of the point cloud registration device based on single plane features are described in detail below.
[0149] An acquisition module, used for acquiring a point cloud to be registered and a target point cloud, wherein the point cloud to be registered has a first bottom surface parallel to an xy plane of a ground coordinate system, and the target point cloud has a second bottom surface parallel to one of the coordinate planes of the ground coordinate system;
[0150] It can be understood that the acquisition module can be used to execute the above S1. For the detailed implementation of the acquisition module, reference can be made to the relevant content of the above S1.
[0151] A first determination module is used to determine a first standard plane in the point cloud to be registered, where the first standard plane is not parallel to the first bottom surface;
[0152] It can be understood that the first determination module can be used to execute the above S2. The detailed implementation of the first determination module can refer to the relevant content of the above S2.
[0153] A rotation module, used for rotating the target point cloud in a plurality of different rotation modes, and determining a second standard plane in the target point cloud in various rotation modes, wherein the second standard plane is not parallel to the second bottom surface;
[0154] It can be understood that the rotation module can be used to execute the above S3. The detailed implementation of the rotation module can refer to the relevant content of the above S3.
[0155] A second determination module is used to realize the registration between the to-be-registered point cloud and the target point cloud according to the first standard plane and the second standard plane in various rotation modes, and determine the optimal rotation mode according to the registration result;
[0156] It can be understood that the second determination module can be used to execute the above S4. The detailed implementation of the second determination module can refer to the relevant content of the above S4.
[0157] A registration module is used to register the to-be-registered point cloud with the target point cloud based on the optimal rotation method.
[0158] It can be understood that the registration module can be used to execute the above S5. For the detailed implementation of the registration module, reference can be made to the relevant content of the above S5.
[0159] In a possible implementation, the first determining module may be used to:
[0160] Detecting all planes in the point cloud to be registered, and obtaining the normal vector of each plane;
[0161] Filtering out planes whose angles between their normal vectors and the z-axis of the ground coordinate system are within a preset angle range from all planes;
[0162] Determine the plane with the largest area among the screened planes as the first standard plane.
[0163] In a possible implementation, the second determining module may be used to:
[0164] For each rotation mode, determining a rotation axis and a rotation angle according to a normal vector of the first standard plane and a normal vector of a second standard plane under the rotation mode;
[0165] Rotating the point cloud to be registered according to the rotation axis and the rotation angle to obtain a rotated point cloud;
[0166] Based on the rotated point cloud and the target point cloud, precise alignment of the rotated point cloud is achieved to obtain a precise alignment point cloud.
[0167] In a possible implementation, the second determining module may be specifically used to:
[0168] For each rotation mode, the error between the precisely registered point cloud and the target point cloud rotated in the rotation mode is calculated.
[0169] A minimum error among multiple errors is obtained, and a rotation mode corresponding to the minimum error is determined as an optimal rotation mode, wherein the second bottom surface in the target point cloud after rotation under the optimal rotation mode is parallel to the xy plane in the ground coordinate system.
[0170] In a possible implementation, the second determining module may be specifically used to:
[0171] Performing transformation processing on the rotated point cloud based on a set initial transformation matrix;
[0172] For each point in the rotated point cloud, query and obtain a matching point in the target point cloud corresponding to the point, and calculate the distance between the point and the matching point;
[0173] Based on the distance corresponding to each point in the rotated point cloud, obtaining a distance error between the rotated point cloud and the target point cloud;
[0174] The transformation matrix is updated under the guidance of the set distance error minimization function, and the rotated point cloud is transformed with the updated transformation matrix until the optimal transformation matrix is obtained when the preset conditions are met, and the rotated point cloud is transformed with the optimal transformation matrix to obtain a precisely aligned point cloud.
[0175] In a possible implementation, the above registration module may be used to:
[0176] Obtaining an initial registration matrix and an initial registration vector between the point cloud to be registered and the target point cloud rotated in the optimal rotation mode;
[0177] Performing a preliminary registration on the to-be-registered point cloud based on the preliminary registration matrix and the preliminary registration vector, and performing a fine registration on the to-be-registered point cloud after the preliminary registration with the target point cloud to obtain a fine registration matrix and a fine registration vector;
[0178] The final registration matrix and registration vector are calculated according to the preliminary registration matrix, preliminary registration vector, fine registration matrix and fine registration vector;
[0179] The point cloud to be registered is registered with the target point cloud based on the final registration matrix and the registration vector.
[0180] In a possible implementation, the above registration module may be used to:
[0181] Obtaining a reverse rotation mode that is reverse to the optimal rotation mode;
[0182] Performing preliminary registration on the point cloud to be registered based on the preliminary registration matrix and the preliminary registration vector;
[0183] The point cloud to be registered after the initial registration is reversely rotated according to the reverse rotation method.
[0184] In a possible implementation, the above-mentioned obtaining module may be used to:
[0185] Obtaining a collected point cloud, and converting the collected point cloud from a camera coordinate system to a robot base coordinate system;
[0186] According to the relationship between the robot base coordinate system and the ground coordinate system, the collected point cloud is converted from the robot base coordinate system to the ground coordinate system to obtain the point cloud to be registered in the ground coordinate system.
[0187] See also Fig.11 , is a block diagram of an electronic device provided in an embodiment of the present invention, the electronic device may be a computer device, etc., and the electronic device includes a memory, a processor, and a communication module. The memory, the processor, and the communication module are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines.
[0188] The memory is used to store programs or data. The memory can be, but is not limited to, random access memory (RAM), read only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electric erasable programmable read-only memory (EEPROM), etc.
[0189] The processor is used to read / write data or programs stored in the memory, and execute the point cloud registration method based on single plane features provided by any embodiment of the present invention.
[0190] The communication module is used to establish a communication connection between the electronic device and other communication terminals through the network, and is used to send and receive data through the network.
[0191] It should be understood that Fig.11 The structure shown is only a schematic diagram of the structure of the electronic device. The electronic device may also include Fig.11 More or fewer components as shown, or with Fig.11 Different configurations shown.
[0192] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are executed, the point cloud registration method based on single plane features provided in the above embodiment is implemented.
[0193] Specifically, the computer-readable storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the computer-readable storage medium is executed, the above-mentioned point cloud registration method based on single plane features can be executed. Regarding the process involved when the computer-readable storage medium and its executable instructions are executed, reference can be made to the relevant description in the above-mentioned method embodiment, which will not be described in detail here.
[0194] In summary, the point cloud registration method, device and electronic device based on single plane features provided by the embodiments of the present invention obtain a point cloud to be registered and a target point cloud, wherein the point cloud to be registered has a first bottom surface parallel to the xy plane of the ground coordinate system, and the target point cloud has a second bottom surface parallel to one of the coordinate planes of the ground coordinate system. Determine the first standard plane that is not parallel to the first bottom surface in the point cloud to be registered, rotate the target point cloud according to a variety of different rotation methods, and determine the second standard plane in the target point cloud under various rotation methods. According to the first standard plane and the second standard plane under various rotation methods, the registration between the point cloud to be registered and the target point cloud is achieved, and the optimal rotation method is determined according to the registration result. Finally, the point cloud to be registered is registered to the target point cloud based on the optimal rotation method. This scheme rotates the target point cloud in different rotation methods, and performs point cloud registration based on the standard plane as a reference, finds the optimal rotation method and then achieves the final registration. This scheme has the advantages of fast registration speed and high efficiency.
[0195] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A point cloud registration method based on single plane features, characterized in that: The method comprises: Obtaining a point cloud to be registered and a target point cloud, wherein the point cloud to be registered has a first bottom surface parallel to an xy plane of a ground coordinate system, and the target point cloud has a second bottom surface parallel to one of the coordinate planes of the ground coordinate system; Determine a first standard plane in the point cloud to be registered, where the first standard plane is not parallel to the first bottom surface; Rotating the target point cloud in a plurality of different rotation modes, and determining a second standard plane in the target point cloud in various rotation modes, wherein the second standard plane is not parallel to the second bottom surface; Implementing registration between the point cloud to be registered and the target point cloud according to the first standard plane and the second standard plane in various rotation modes, and determining an optimal rotation mode according to the registration result; Based on the optimal rotation method, registering the to-be-registered point cloud to the target point cloud; The step of registering the point cloud to be registered with the target point cloud based on the optimal rotation method includes: Obtaining a preliminary registration matrix and preliminary registration vector between the point cloud to be registered and the target point cloud rotated in the optimal rotation mode; performing preliminary registration on the point cloud to be registered based on the preliminary registration matrix and preliminary registration vector, and performing precise registration on the point cloud to be registered after the preliminary registration with the target point cloud to obtain a precise registration matrix and precise registration vector; calculating a final registration matrix and registration vector based on the preliminary registration matrix, preliminary registration vector, precise registration matrix and precise registration vector; and registering the point cloud to be registered to the target point cloud based on the final registration matrix and registration vector; The step of performing preliminary registration on the point cloud to be registered based on the preliminary registration matrix and the preliminary registration vector comprises: Obtain a reverse rotation method that is reverse to the optimal rotation method; perform a preliminary registration on the point cloud to be registered based on the preliminary registration matrix and the preliminary registration vector; and reversely rotate the point cloud to be registered after the preliminary registration according to the reverse rotation method.
2. The point cloud registration method based on single plane features according to claim 1, characterized in that: The step of determining the first standard plane in the point cloud to be registered comprises: Detecting all planes in the point cloud to be registered, and obtaining the normal vector of each plane; Filtering out planes whose angles between their normal vectors and the z-axis of the ground coordinate system are within a preset angle range from all planes; Determine the plane with the largest area among the screened planes as the first standard plane.
3. The point cloud registration method based on single plane features according to claim 1, characterized in that: The step of realizing registration between the point cloud to be registered and the target point cloud according to the first standard plane and the second standard plane in various rotation modes comprises: For each rotation mode, determining a rotation axis and a rotation angle according to a normal vector of the first standard plane and a normal vector of a second standard plane under the rotation mode; Rotating the point cloud to be registered according to the rotation axis and the rotation angle to obtain a rotated point cloud; Based on the rotated point cloud and the target point cloud, precise alignment of the rotated point cloud is achieved to obtain a precise alignment point cloud.
4. The point cloud registration method based on single plane features according to claim 3, characterized in that: The step of determining the optimal rotation mode according to the registration result comprises: For each rotation mode, the error between the precisely registered point cloud and the target point cloud rotated in the rotation mode is calculated. A minimum error among multiple errors is obtained, and a rotation mode corresponding to the minimum error is determined as an optimal rotation mode, wherein the second bottom surface in the target point cloud after rotation under the optimal rotation mode is parallel to the xy plane in the ground coordinate system.
5. The point cloud registration method based on single plane features according to claim 3, characterized in that: The step of achieving precise registration of the rotated point cloud based on the rotated point cloud and the target point cloud to obtain a precise registration point cloud comprises: Performing transformation processing on the rotated point cloud based on a set initial transformation matrix; For each point in the rotated point cloud, query and obtain a matching point in the target point cloud corresponding to the point, and calculate a distance between the point and the matching point; Based on the distance corresponding to each point in the rotated point cloud, obtaining a distance error between the rotated point cloud and the target point cloud; The transformation matrix is updated under the guidance of the set distance error minimization function, and the rotated point cloud is transformed with the updated transformation matrix until the optimal transformation matrix is obtained when the preset conditions are met, and the rotated point cloud is transformed with the optimal transformation matrix to obtain a precisely aligned point cloud.
6. The point cloud registration method based on single plane features according to any one of claims 1 to 5, characterized in that: The step of obtaining the point cloud to be registered comprises: Obtaining a collected point cloud, and converting the collected point cloud from a camera coordinate system to a robot base coordinate system; According to the relationship between the robot base coordinate system and the ground coordinate system, the collected point cloud is converted from the robot base coordinate system to the ground coordinate system to obtain the point cloud to be registered in the ground coordinate system.
7. A point cloud registration device based on single plane features, characterized in that: The device is used to implement the point cloud registration method based on single plane features as described in any one of claims 1 to 6, comprising: An acquisition module, used for acquiring a point cloud to be registered and a target point cloud, wherein the point cloud to be registered has a first bottom surface parallel to an xy plane of a ground coordinate system, and the target point cloud has a second bottom surface parallel to one of the coordinate planes of the ground coordinate system; A first determination module is used to determine a first standard plane in the point cloud to be registered, where the first standard plane is not parallel to the first bottom surface; A rotation module, used for rotating the target point cloud in a plurality of different rotation modes, and determining a second standard plane in the target point cloud in various rotation modes, wherein the second standard plane is not parallel to the second bottom surface; A second determination module is used to realize the registration between the to-be-registered point cloud and the target point cloud according to the first standard plane and the second standard plane in various rotation modes, and determine the optimal rotation mode according to the registration result; A registration module is used to register the to-be-registered point cloud with the target point cloud based on the optimal rotation method.
8. An electronic device, characterized in that: The electronic device includes a machine-readable storage medium and a processor, wherein the machine-readable storage medium stores machine-executable instructions, and when the processor executes the machine-executable instructions, the electronic device implements the method described in any one of claims 1 to 6.
Citation Information
Patent Citations
Point cloud data automatic registration method and device based on plane feature
CN110443836A
Point cloud registration method combining rotating platform and ICP
CN111161327A
Plane constraint introduced low-overlapping-rate weak-feature three-dimensional measurement point cloud precise registration method
CN116245921A
Point cloud registration method and device based on plane fitting and electronic equipment
CN117173227A
Three-dimensional plane point cloud coarse registration method, system, medium and equipment
CN117788529A
