Three-dimensional point cloud positioning registration method, device, equipment and medium

Through the three-dimensional point cloud positioning registration method, feature point cloud and downsampling technology are used, combined with iterative computing and transformation matrix, the problem of insufficient adaptability of two-dimensional vision in industrial detection is solved, and high-precision registration of complex structures and different postures is achieved, which improves the flexibility of detection tasks.

CN119722765APending Publication Date: 2025-03-28SHENZHEN JIEENSHI INTELLIGENT TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411928419.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Existing two-dimensional vision technologies are inadequate in industrial inspection and are difficult to quickly adjust to meet new inspection tasks, especially when dealing with products with complex structures and different postures.

Method used

A three-dimensional point cloud positioning registration method is proposed. By selecting the feature point cloud in the source point cloud, the template point cloud ROI is determined, and downsampling it to form a reference template point cloud. Then, the detection ROI of the point cloud to be matched is set, the iterative parameters and transformation matrix are initialized, and the point cloud data is iteratively calculated based on the transformation matrix until the preset registration accuracy or maximum number of iterations is reached, and the final transformation matrix is ​​output for registration.

Benefits of technology

It realizes high-precision registration for complex structures and different postures, reduces the calculation amount, improves processing speed, enhances real-time response capabilities, overcomes the problem of two-dimensional vision being sensitive to object posture changes, and significantly improves the adaptability of new scenarios and products and the flexibility of detection tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722765A_ABST
    Figure CN119722765A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, in particular to a three-dimensional point cloud positioning registration method and device, equipment and a medium, and the method comprises the steps: selecting feature point clouds in source point clouds, and determining a template point cloud ROI according to the distribution of the feature point clouds; performing down-sampling on the template point cloud ROI to form a reference template point cloud; setting a detection ROI of the to-be-matched point cloud, initializing an iteration parameter, calculating a normal vector of the detection ROI, and initializing a transformation matrix; based on the transformation matrix, carrying out iterative calculation on point cloud data in the detection ROI of the reference template point cloud and the to-be-matched point cloud; outputting a final transformation matrix until the set maximum number of iterations or the preset registration precision is reached; and completing registration of the to-be-matched point cloud data based on the final transformation matrix. According to the method, the limitation of the existing two-dimensional vision technology in industrial detection can be solved, and high-precision registration under a complex structure and different postures is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a three-dimensional point cloud positioning and registration method, device, equipment and medium. Background Art

[0002] Computer vision technology has made significant progress in industrial inspection, especially two-dimensional image positioning technology such as matching based on grayscale and contour information, which has performed well in improving inspection results and reducing costs. However, with the growth of demand and technological advancement, two-dimensional vision has encountered bottlenecks: it lacks depth perception and has difficulty handling products of different heights or complex structures; it is sensitive to changes in the posture of objects, and even slight changes in angles may cause matching failures; when faced with occlusion problems, its recognition ability is limited; and its performance is greatly affected by ambient lighting. More importantly, two-dimensional vision is not adaptable enough to new scenes or products, and it is difficult to quickly adjust to meet new inspection tasks.

[0003] Therefore, the existing two-dimensional vision is not adaptable enough to new scenes or products, and it is difficult to quickly adjust to meet the technical problems of new detection tasks, which needs to be solved urgently. Summary of the invention

[0004] The main purpose of this application is to provide a three-dimensional point cloud positioning and registration method, device, equipment and medium, aiming to solve the technical problem that the existing two-dimensional vision is insufficiently adaptable to new scenes or products and difficult to quickly adjust to meet new detection tasks.

[0005] In order to achieve the above-mentioned invention object, the present application proposes a three-dimensional point cloud positioning and registration method, the method comprising:

[0006] Select the feature point cloud in the source point cloud, and determine the template point cloud ROI according to the distribution of the feature point cloud;

[0007] Downsampling the template point cloud ROI to form a reference template point cloud;

[0008] Set the detection ROI of the point cloud to be matched, initialize the iteration parameters, calculate the detection ROI normal vector, and initialize the transformation matrix;

[0009] Based on the transformation matrix, iteratively calculate the point cloud data within the detection ROI of the reference template point cloud and the point cloud to be matched;

[0010] Until the maximum number of iterations is reached or the preset registration accuracy is reached, the final transformation matrix is ​​output;

[0011] The registration of the point cloud data to be matched is completed based on the final transformation matrix.

[0012] Furthermore, the step of selecting a feature point cloud from the source point cloud and determining a template point cloud ROI according to the distribution of the feature point cloud includes:

[0013] Use the source point cloud as the reference point cloud data for the current positioning;

[0014] According to the reference point cloud data, a point cloud having preset texture and edge information is selected as a feature point cloud;

[0015] According to the spatial distribution of the feature point cloud, the corresponding region of interest is selected to obtain the template point cloud ROI.

[0016] Furthermore, the step of downsampling the template point cloud ROI to form a reference template point cloud includes:

[0017] Set the downsampling size based on the determined template point cloud ROI and the x-resolution, y-resolution and z-resolution of the point cloud;

[0018] Generate a downsampling grid based on the set downsampling size;

[0019] All point cloud data in each down-sampling grid are statistically aggregated to remove invalid point clouds to form the reference template point cloud.

[0020] Furthermore, the steps of setting the detection ROI of the point cloud to be matched, initializing iteration parameters, calculating the detection ROI normal vector, and initializing the transformation matrix include:

[0021] Get the data of the point cloud to be matched;

[0022] According to the position fluctuation of the source point cloud and the point cloud to be matched, set the detection ROI of the current point cloud to be matched;

[0023] Initialize iteration parameters;

[0024] For each point pi within the detection ROI, find all neighboring points within the set search radius r;

[0025] Use the least squares method to perform plane fitting on the neighboring points, and obtain the normal vector of the fitted plane as the normal vector of point pi;

[0026] If the number of neighboring points is less than the first preset number or does not exist, the corresponding point is marked as an invalid point, and the point cloud data within the detection ROI with normal vector information is obtained;

[0027] Based on the iteration parameters, an initial relationship between the current template point cloud and the point cloud to be matched is obtained, and a transformation matrix is ​​initialized based on the initial relationship.

[0028] Furthermore, the step of iteratively calculating the point cloud data within the detection ROI of the reference template point cloud and the point cloud to be matched based on the transformation matrix includes:

[0029] Using the initialized transformation matrix, the reference template point cloud data and the point cloud data within the detection ROI of the point cloud to be matched are used as input to start the iterative loop;

[0030] Transform the reference template point cloud according to the current transformation matrix, update the transformation matrix, and perform an iterative loop based on the updated transformation matrix;

[0031] Determine whether to stop the iteration based on the preset iteration stop condition.

[0032] Furthermore, the step of outputting the final transformation matrix until a set maximum number of iterations or a preset registration accuracy is reached includes:

[0033] Identify the iteration number of the current iteration loop;

[0034] Determine whether the current number of iterations has reached the preset maximum number of iterations;

[0035] Calculate the distance mean and standard deviation of the point cloud data within the detection ROI of the current reference template point cloud and the point cloud to be matched;

[0036] Determining whether the distance mean and standard deviation are within a preset registration threshold;

[0037] If it is within the preset registration range, determine whether the absolute value of the current registration error and the registration error of the previous iteration is less than the first absolute value

[0038] If it is less than the first absolute value, it is determined that the preset registration accuracy is achieved;

[0039] If the number of current iteration cycles has reached the preset maximum number of iterations or the preset registration accuracy has been reached, the final transformation matrix is ​​output.

[0040] Furthermore, the step of completing the registration of the to-be-matched point cloud data based on the final transformation matrix includes:

[0041] Use the final transformation matrix to rotate and offset the matching point cloud data;

[0042] The final transformed registration point cloud data is obtained to complete the point cloud registration.

[0043] The second aspect of the present application provides a three-dimensional point cloud positioning and registration device, comprising:

[0044] The selection module is used to select the feature point cloud in the source point cloud and determine the template point cloud ROI according to the distribution of the feature point cloud;

[0045] A sampling module, used for down-sampling the template point cloud ROI to form a reference template point cloud;

[0046] The setting module is used to set the detection ROI of the point cloud to be matched, initialize the iteration parameters, calculate the detection ROI normal vector, and initialize the transformation matrix;

[0047] An iteration module, used for iteratively calculating the point cloud data within the detection ROI of the reference template point cloud and the point cloud to be matched based on the transformation matrix;

[0048] The output module is used to output the final transformation matrix until the maximum number of iterations is set or the preset registration accuracy is reached;

[0049] A registration module is used to complete the registration of the to-be-matched point cloud data based on the final transformation matrix.

[0050] The third aspect of the present application also includes a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0051] The fourth aspect of the present application also includes a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the above methods when executed by a processor.

[0052] Beneficial Effects

[0053] This application can effectively solve the limitations of existing two-dimensional vision technology in industrial detection. By accurately selecting the feature point cloud in the source point cloud and determining the template point cloud ROI, high-precision registration under complex structures and different postures is ensured. Downsampling the template point cloud ROI reduces the amount of calculation, speeds up the processing speed, and retains key geometric features, achieving a balance between efficiency and accuracy. Set the detection ROI of the point cloud to be matched and initialize the iteration parameters, and reasonably configure parameters such as the maximum number of iterations to ensure that the algorithm quickly finds a satisfactory solution and enhances the real-time response capability. The iterative calculation based on the transformation matrix strictly controls the error and gradually approaches the optimal solution, overcoming the problem that two-dimensional vision is sensitive to changes in the posture of the object. Finally, the iteration is terminated by setting the maximum number of iterations or presetting the registration accuracy, and a stable and reliable transformation matrix is ​​output, avoiding mismatching caused by factors such as ambient lighting. This method not only improves the registration accuracy of complex structural parts in industrial detection, but is also applicable to fields such as robot vision and virtual reality, providing an efficient, accurate and adaptable solution, significantly improving the adaptability of new scenes and products and the flexibility of detection tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1A schematic diagram of a flow chart of a three-dimensional point cloud positioning and registration method according to an embodiment of the present application;

[0055] Figure 2 This is a schematic structural block diagram of a three-dimensional point cloud positioning and registration device according to an embodiment of the present application;

[0056] Figure 3 This is a flow chart of point cloud downsampling processing in one embodiment of the present invention;

[0057] Figure 4 Schematic diagram of downsampling a point cloud in one embodiment of the present invention;

[0058] Figure 5 A flowchart of calculating a point cloud normal vector in one embodiment of the present invention;

[0059] Figure 6 A flowchart of obtaining a transformation matrix for an image and completing registration in one embodiment of the present invention;

[0060] Figure 7 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.

[0061] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0063] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "above", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when an element is said to be "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any module and all combinations of one or more associated listed items.

[0064] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.

[0065] Reference Figure 1 The embodiment of the present invention provides a three-dimensional point cloud positioning and registration method, including steps S1-S6, specifically:

[0066] S1. Select the feature point cloud in the source point cloud and determine the template point cloud ROI according to the distribution of the feature point cloud;

[0067] S2. Down-sampling the template point cloud ROI to form a reference template point cloud;

[0068] S3, set the detection ROI of the point cloud to be matched, initialize the iteration parameters and calculate the detection ROI normal vector, and initialize the transformation matrix;

[0069] S4, based on the transformation matrix, iteratively calculating the point cloud data within the detection ROI of the reference template point cloud and the point cloud to be matched;

[0070] S5, until the set maximum number of iterations or the preset registration accuracy is reached, the final transformation matrix is ​​output;

[0071] S6. Complete the registration of the to-be-matched point cloud data based on the final transformation matrix.

[0072] As described in step S1 above, in this embodiment, the source point cloud data is first obtained and used as the original reference point cloud data of the current positioning. Based on these original reference point cloud data, point clouds with certain texture and edge information are selected as feature point clouds. Specifically, point clouds with obvious texture changes or edge information are selected, because these point clouds are usually located in places with complex surface structures and rich details (such as corners, boundaries, etc.) of the object surface, which can provide stable matching clues. Then, according to the position and characteristics of these feature point clouds, a suitable region of interest (ROI) is selected. The selection of ROI needs to consider its size, shape and position to ensure that it is large enough to cover all important feature point clouds, but not too large to cause waste of computing resources. On this basis, the feature point cloud in the final selected ROI will be used as the initial reference template point cloud to provide input for subsequent registration algorithm iterations. For example, in industrial inspection scenarios, feature point clouds can be selected by analyzing the fine structure of the surface of mechanical parts, and a rotated rectangle can be defined as ROI based on these point clouds, thereby laying the foundation for high-precision three-dimensional point cloud registration. In addition, in order to ensure a balance between registration efficiency and effect, the type of ROI can be rectangular, rotated rectangular, circular, polygonal or annular, etc., depending on the needs of the actual application scenario. In this way, not only can the amount of calculation be effectively reduced, but also the success rate and accuracy of registration can be improved.

[0073] As described in step S2 above, based on the feature point cloud region ROI determined in step S1, the downsampling scale is set, and the saved feature point cloud is downsampled to form the final reference template point cloud. Specifically, first, according to the x-resolution, y-resolution and z-resolution of the point cloud, a suitable downsampling size is set. The selection of this size is crucial because it directly affects the accuracy and efficiency of subsequent registration: if the size is too large, detail information may be lost, affecting the registration effect; if the size is too small, the computational burden will increase and the processing speed will be reduced. Therefore, it is necessary to find a balance between accuracy and efficiency. Next, a downsampling grid is generated, and each grid cell represents a potential new point position, which is used to carry information aggregated from the original point cloud. For each non-empty grid cell (i.e., it contains at least one original point), if the number of point cloud data counted in the grid is greater than 1, the coordinate values ​​(x, y, z) of these point clouds are averaged and used as the new point coordinates of the grid cell; if the number of points in a grid is less than or equal to 1, the grid is considered to be an invalid point or the original point is kept unchanged and does not participate in further processing. After the above process, a new set of downsampled points is obtained, which together constitute the final reference template point cloud. This step not only achieves effective compression of point cloud data, but also ensures that key features are retained, thereby providing a high-quality basic template for subsequent iterative matching. In addition, during the entire downsampling process, any point cloud data that is considered invalid (for example, those points located in empty grid cells) will not be included in the final reference template point cloud to ensure that only the most valuable information is retained, thereby improving the success rate and accuracy of the registration.

[0074] Reference Figure 3 , which is a flowchart of the point cloud downsampling process. First, the template point cloud in step S1 is obtained, and the downsampling scales △x, △y, △z parameters of x, y, and z are set for the template point cloud. Based on the set downsampling scales, a downsampling grid is generated, where the schematic diagram of the downsampling grid is shown in Figure 4 As shown, the data of all point clouds in the sampling grid are statistically analyzed, such as Figure 4 The red dots in the diagram are the current points in the grid, and the black dots are the point cloud data searched in the downsampled grid. These black point cloud data meet the scale range in the z direction of the downsampled grid. If the number of point cloud data counted in the grid is greater than 1, then Figure 4 Sum the x, y, and z values ​​of all black point clouds to get Σx i ,Σy i ,Σz i , and the sums obtained are averaged to obtain the final point cloud coordinates after the current downsampling grid is downsampled, that is, the point cloud after downsampling is p′(x0, y o , z o), where x0 = ∑x i / n、y0=∑y i / n、z0=Σz i / n, where n is the number of point clouds searched in the downsampling grid. The position of the green dot in Figure 3 represents the position of the point cloud p′(x0, y0, z0) after downsampling.

[0075] If the number of point cloud data counted in the downsampled grid is less than 1, it means that the current point is invalid, and the next downsampled grid calculation is performed until all generated downsampled grid calculations are completed, and finally the point cloud after downsampling is generated.

[0076] As described in the above step S3, the detection ROI of the point cloud data to be matched is different from the ROI of the template point cloud. The purpose of setting the ROI of the point cloud to be matched is to reduce the operation time of the algorithm, improve the operation efficiency of the algorithm and avoid useless calculations. The standard for setting the ROI detection range is generally based on the requirements of product detection and the maximum and minimum offsets that may appear in the x-axis and y-axis directions. The final ROI is set. The setting of this ROI will control the maximum range of matching. The range exceeding this ROI is not included in the registration range. The scale standard of this ROI is a three-dimensional space standard, including three scale standards of x-axis, y-axis and z-axis. The ROI of the current point cloud to be matched is set. This ROI is generally larger than the ROI of the template point cloud. The purpose is to ensure that the template point cloud can always find point cloud data similar to the template feature point cloud in this ROI when the external conditions change; after determining the ROI scale of the point cloud to be registered, the maximum number of iterations, iteration coefficient, search radius and iteration error threshold of the corresponding matching are set according to the parameters of the current ROI setting , where the maximum number of iterations is the condition that effectively guarantees the forced end of the iteration. When the maximum number of iterations increases, the iteration time may be extended. When the maximum number of iterations decreases, the total iteration time may be reduced. The iteration coefficient refers to a coefficient that controls the convergence of the iteration. The search radius means that each point cloud computing is centered on the current point, and all point cloud data with the search radius as the radius are obtained to participate in the calculation. Generally, the larger the search radius, the larger the calculation amount and the lower the calculation efficiency. The smaller the search radius, the less the calculation amount and the higher the calculation efficiency. However, both too high and too low search radii will affect the calculation results. The iterative error threshold refers to a parameter that affects the termination of the iteration. This parameter is used to determine whether the optimal solution is obtained by comparing the iteration error obtained by the last calculation with the iteration error of the current calculation. Based on a series of iterative setting parameters, the relationship between the current template point cloud and the current point cloud is obtained, and the transformation matrix is ​​initialized. The transformation matrix contains the transformation relationship from the template feature point cloud to the current point cloud, which is used as the initial transformation relationship for subsequent iterative operations. The initial matrix expression is as follows:

[0077]

[0078] The first three rows and three columns are the rotation matrix in the registration matrix, the fourth column is the offset of the registration transformation, x_det is the offset of the x-axis, y_det is the offset of the y-axis, and z_det is the offset of the z-axis.

[0079] Figure 5 The calculation flow chart of the point cloud normal vector is as follows: first, for the acquired point cloud data, the search radius is set, the number of loops is set according to the number of point clouds, the current point cloud is obtained in the order of the loop, and the point cloud in the space is searched with the position of the current point cloud and the set radius, and all point clouds within the current search radius are counted. If the number is greater than 1, the least squares plane fitting is performed on the statistical point cloud, where the plane equation is: Ax+by+cz+d=0, and the fitted plane direction vectors a, b, and c are used as the normal vector n of the current point cloud respectively. x 、n y 、n z ,

[0080] If the conditions are not met, it is deemed that the current point cloud does not have a normal vector. In this application, it is regarded as an invalid point cloud for processing, and all point cloud data are looped through to finally complete the normal vector calculation of all point clouds.

[0081] As described in step S4 above, the registration algorithm loop is started, and the loop automatically calculates the relevant parameters. The end of the loop depends entirely on the last calculation result. For example, in the loop iteration setting, the end iteration error is 0.0001, and the error is compared with the result of each loop iteration calculation. If the current calculated iteration error is greater than the end iteration error, the next iteration will be performed. If the absolute value of the difference between the current iteration error and the end iteration error satisfies the condition that it is less than e -6 , each round of the loop will update the current iteration error; let the current point cloud be p(x0, y0, z0), the query radius be r, query all point cloud data within the current radius, calculate the point p′(x1, y1, z1) closest to point p in the current query point cloud, and then calculate the square of the distance between point p and point p′ as L=(x0-x1) 2 +(y0-y1) 2 +(z0-z1) 2 , the result of summing the distances between all points and the nearest neighbor in the query radius is ∈=∑L, the current error Error=∈ / n, where n is the number of feature point clouds. The transformation matrix used in this application is in the form of 4x4, as follows:

[0082]

[0083] Among them, a0, a1, a2, b0, b1, b2, c0, c1, c2 are the registration rotation transformation relationships, and x_det, y_det, z_det are the offsets of the x-axis, y-axis, and z-axis in the registration transformation. The initial point cloud is transformed based on the transformation matrix to obtain the transformed point cloud.

[0084] As described in the above steps S5-S6, each loop iteration generates a transformation matrix M i , where i is the order of loop iteration. In this application, at the end of the iteration, the final transformation matrix is ​​obtained, where the transformation matrix is ​​calculated as: M i =M0*M1*M2…*M i-1 ; The final transformation matrix M i , and perform matrix transformation with the original data to obtain the transformed point cloud. According to the transformation relationship obtained in each iteration, and the transformed point cloud data of the current iteration relationship is completed, the distance statistics of the corresponding points of the last transformed point cloud and the target point cloud are completed. There are two conditions for judging the end of iteration in this application. The first one is that the number of iterations exceeds the preset maximum number of iterations, and the registration ends. The second one is that the three conditions must be met at the same time, and the absolute value of the current registration error and the error of the last registration is less than e -6 , the mean and standard deviation of the distance between the feature point cloud and the feature point cloud to be registered respectively meet the preset conditions, and the registration is completed; firstly, feature points are extracted from the transformed point cloud and the target point cloud. The feature points are used to determine the correspondence between the two point clouds. According to the determined corresponding feature points, the mean and standard deviation of the distance between the transformed feature points and the feature points of the target point cloud are calculated; if the registration is completed, the final registration matrix is ​​output. The registration matrix in this application is defined as: a certain point cloud component in the point cloud to be registered is composed of p i (x i ,y i , z i , nx i ,ny i , nz i ,); p of a point cloud in the template point cloud j (x j ,y j , z j ), intermediate matrices A(n,6), B(n,1), where i and j are the corresponding serial numbers in the point cloud, n is the number of source point clouds, x, y, and z are the components of the three axes in the three-dimensional space, and nx, ny, and nz are the components of the normal vector of the point cloud on the three coordinate axes.

[0085] n_ix=p i .nx i ;

[0086] n_iy=pi .ny i ;

[0087] n_iz=p i .nz i ;

[0088] d_ix=p i .x i ;

[0089] d_iy=p i .y i ;

[0090] d_iz=p i .z i ;

[0091] s_ix=p j ·x j ;

[0092] s_iy=p j ·y j ;

[0093] s_iz=∑p j .z j ;

[0094] A(i,0)=∑n_iz*s_iy-n_iy*s_iz;

[0095] A(i,1)=∑n_ix*s_iz-niz*six;

[0096] A(i,2)=∑n_iy*s_ix-n_ix*s_iy;

[0097] A(i,3)=∑n_ix;

[0098] A(i,4)=∑n_iy;

[0099] A(i,5)=∑n_iz;

[0100] B(i)=∑n_ix*d_ix+n_iy*d_iy+n_iz*d_iz-n_ix*s_ix-n_iy*s_iy-n_iz*s_iz;

[0101] The SVD decomposition of matrix A and matrix B gives matrix X, and the transformation matrix is ​​defined as:

[0102]

[0103] Reference Figure 6, is the flow chart of the registration. First, the number of iterations is judged. If the current number of iterations exceeds the preset number of iterations, the current registration matrix is ​​the final registration matrix and the registration is terminated. If this condition is not met, the mean and standard deviation of the distance between the feature point pairs calculated in step 6 need to be counted. If the registration error is less than e -6 , and the mean and standard deviation of the distance between the corresponding points of the feature point cloud are both less than 0.01, then the conditions for completing the registration are met, the registration is ended, and the final registration transformation matrix relationship is obtained. If one of the conditions is not met, the next round of iterative calculation is continued until the final relationship is met. Based on the final registration matrix, the target point cloud to be registered is rotated and offset, and the final transformed registration point cloud data is obtained to complete the point cloud registration.

[0104] Based on steps S1-S6, the limitations of existing two-dimensional vision technology in industrial inspection can be effectively solved. By accurately selecting the feature point cloud in the source point cloud and determining the template point cloud ROI, high-precision registration under complex structures and different postures is ensured. Downsampling the template point cloud ROI reduces the amount of calculation, speeds up the processing speed, and retains key geometric features, achieving a balance between efficiency and accuracy. Set the detection ROI of the point cloud to be matched and initialize the iteration parameters, and reasonably configure parameters such as the maximum number of iterations to ensure that the algorithm quickly finds a satisfactory solution and enhances the real-time response capability. The iterative calculation based on the transformation matrix strictly controls the error and gradually approaches the optimal solution, overcoming the problem that two-dimensional vision is sensitive to changes in the posture of the object. Finally, the iteration is terminated by setting the maximum number of iterations or presetting the registration accuracy, and a stable and reliable transformation matrix is ​​output, avoiding mismatching caused by factors such as ambient lighting. This method not only improves the registration accuracy of complex structural parts in industrial inspection, but is also applicable to fields such as robot vision and virtual reality, providing an efficient, accurate and adaptable solution, significantly improving the adaptability of new scenes and products and the flexibility of detection tasks.

[0105] In one embodiment, the step of selecting a feature point cloud from the source point cloud and determining a template point cloud ROI according to the distribution of the feature point cloud includes:

[0106] S10, using the source point cloud as the reference point cloud data for current positioning;

[0107] S11, selecting a point cloud having preset texture and edge information as a feature point cloud according to the reference point cloud data;

[0108] S12. According to the spatial distribution of the feature point cloud, a corresponding region of interest is selected to obtain the template point cloud ROI.

[0109] In this embodiment, first, the source point cloud is used as the reference point cloud data for the current positioning to ensure that all subsequent operations are based on a consistent basis. Then, based on the reference point cloud data, a point cloud with preset texture and edge information is selected as a feature point cloud. These feature point clouds are usually located in places where the surface structure of the object is complex and rich in details, such as corners or boundaries, and can provide stable matching clues. Finally, based on the spatial distribution of the feature point cloud, the corresponding region of interest (ROI) is selected to obtain the template point cloud ROI. The selection of this ROI needs to consider its size, shape and position to ensure that all important feature point clouds are covered while avoiding the inclusion of background or other irrelevant information. In this way, this embodiment not only improves the accuracy of the registration, but also provides a high-quality basic template for subsequent iterative matching, which is suitable for various application scenarios that require high-precision three-dimensional point cloud processing.

[0110] In one embodiment, the step of downsampling the template point cloud ROI to form a reference template point cloud includes:

[0111] S20, setting a downsampling size based on the determined template point cloud ROI and the x-resolution, y-resolution, and z-resolution of the point cloud;

[0112] S21, generating a downsampling grid based on the set downsampling size;

[0113] S202 , statistically aggregate all point cloud data in each down-sampling grid, remove invalid point clouds, and form the reference template point cloud.

[0114] In this embodiment, first, a suitable downsampling size is set based on the determined template point cloud ROI and the x-resolution, y-resolution and z-resolution of the point cloud. The size needs to find a balance between accuracy and efficiency to ensure that neither the detail information is lost due to excessive size nor the unnecessary computational burden is increased due to being too small. Next, according to the set downsampling size, a downsampling grid is generated, each grid cell represents a potential new point position, which is used to carry the information aggregated from the original point cloud. These grids cover the entire template point cloud ROI to ensure that all areas are considered. Finally, all point cloud data in each downsampling grid are statistically aggregated, invalid point clouds (such as points located in empty grid cells) are removed, and new point coordinates are formed by averaging, etc., and finally a simplified reference template point cloud that retains key features is obtained. This process not only reduces the amount of calculation and speeds up the processing speed, but also ensures the quality and representativeness of the point cloud data used in the subsequent alignment process.

[0115] In one embodiment, the steps of setting a detection ROI of the point cloud to be matched, initializing iteration parameters and calculating a normal vector of the detection ROI, and initializing a transformation matrix include:

[0116] S30, obtaining data of the point cloud to be matched;

[0117] S31, setting the detection ROI of the current point cloud to be matched according to the position fluctuation of the source point cloud and the point cloud to be matched;

[0118] S32, initializing iteration parameters;

[0119] S33, for each point pi in the detection ROI, search for all neighboring points within the set search radius r;

[0120] S34, performing plane fitting on the neighboring points using the least squares method, and obtaining a normal vector of the fitting plane as the normal vector of the point pi;

[0121] S35, if the number of neighboring points is less than the first preset number or does not exist, the corresponding point is marked as an invalid point, and the point cloud data within the detection ROI with normal vector information is obtained;

[0122] S36. Based on the iteration parameters, obtain the initial relationship between the current template point cloud and the point cloud to be matched, and initialize the transformation matrix based on the initial relationship.

[0123] In this embodiment, first, the data of the point cloud to be matched is obtained to ensure that all subsequent operations are based on consistent basic data. Then, according to the position fluctuations of the source point cloud and the point cloud to be matched, the detection ROI of the current point cloud to be matched is set. The setting of this ROI needs to take into account the product inspection requirements and the maximum and minimum offsets that may occur in the x-axis and y-axis directions to ensure that the template point cloud can find similar point cloud data within this ROI while avoiding the inclusion of irrelevant information. Then, the iteration parameters are initialized, including the maximum number of iterations, iteration coefficient, search radius, and iteration error threshold. These parameters control the speed and accuracy of the iteration process, ensuring that the algorithm finds a satisfactory solution in the shortest time while avoiding redundant calculations.

[0124] Subsequently, for each point pi within the detection ROI, all neighboring points are searched within the set search radius r. In this way, local geometric features are effectively captured, providing a basis for subsequent normal vector calculation. The least squares method is used to fit the neighboring points to a plane, and the normal vector of the fitting plane is obtained as the normal vector of point pi, ensuring that each point has an accurate direction descriptor, thereby enhancing the accuracy of the registration. If the number of neighboring points is less than the first preset number or does not exist, the corresponding point is marked as an invalid point, and the point cloud data within the detection ROI with normal vector information is obtained. This processing method ensures that only valid points participate in subsequent calculations, thereby improving the success rate and reliability of the registration. Finally, based on the iteration parameters, the initial relationship between the current template point cloud and the point cloud to be matched is obtained, and the transformation matrix is ​​initialized based on the initial relationship. The transformation matrix is ​​usually in the form of 4x4, including two parts: rotation transformation and translation transformation, which are used to describe the preliminary conversion relationship between the two. This initialization step provides a stable starting point for subsequent iterations, ensuring the efficiency and stability of the entire registration process. Through the above steps, this embodiment can not only effectively set the detection ROI and initialization parameters, but also accurately calculate the normal vector and initialize the transformation matrix, thereby laying a solid foundation for high-precision three-dimensional point cloud registration.

[0125] In one embodiment, the step of iteratively calculating the point cloud data within the detection ROI of the reference template point cloud and the point cloud to be matched based on the transformation matrix includes:

[0126] S40, using the initialized transformation matrix, taking the reference template point cloud data and the point cloud data within the detection ROI of the point cloud to be matched as input, and starting an iterative loop;

[0127] S41, transforming the reference template point cloud according to the current transformation matrix, updating the transformation matrix, and performing an iterative cycle based on the updated transformation matrix;

[0128] S42: Determine whether to stop iteration according to a preset iteration stop condition.

[0129] In this embodiment, first, the initialization transformation matrix is ​​used to take the reference template point cloud data and the point cloud data within the detection ROI of the point cloud to be matched as input to start the iteration loop. This step ensures that all subsequent calculations are based on consistent basic data and provides starting conditions for the iteration process. Then, in each iteration, the reference template point cloud is transformed according to the current transformation matrix, and the transformation matrix is ​​updated. Specifically, each iteration generates a new transformation matrix, which reflects the current optimal transformation relationship. In order to accumulate all transformation effects, the new transformation matrix is ​​multiplied with the previous transformation matrix to form a comprehensive transformation matrix. This step ensures that each iteration can gradually approach the optimal solution and provides an updated basis for the next iteration. Finally, according to the preset iteration stop conditions, it is determined whether to stop the iteration. These conditions include reaching the maximum number of iterations or the registration error is lower than the set threshold (such as 0.0001), and the mean and standard deviation of the distance between the feature point cloud and the target point cloud meet the preset conditions (such as less than 0.01). If any of the conditions is met, the iteration is terminated and the final transformation matrix is ​​output; otherwise, the next round of iteration is continued until a satisfactory solution is found. This mechanism ensures that the algorithm finds the optimal solution in the shortest time while avoiding unnecessary waste of computing resources. Through the above steps, this embodiment not only achieves efficient iterative calculation, but also ensures high accuracy and reliability of the registration result, and is suitable for application scenarios that require frequent processing of three-dimensional point cloud data.

[0130] In one embodiment, the step of outputting the final transformation matrix until a set maximum number of iterations or a preset registration accuracy is reached includes:

[0131] S50, identifying the number of iterations of the current iteration loop;

[0132] S51, determining whether the current number of iterations has reached a preset maximum number of iterations;

[0133] S52, calculating the distance mean and standard deviation of the point cloud data within the detection ROI of the current reference template point cloud and the point cloud to be matched;

[0134] S53, determining whether the distance mean and standard deviation are within a preset registration threshold;

[0135] S54: If it is within the preset registration range, determine whether the absolute value of the current registration error and the registration error of the previous iteration is less than the first absolute value.

[0136] S55: if it is less than the first absolute value, it is determined that the preset registration accuracy is achieved;

[0137] S56: If the number of current iteration cycles has reached a preset maximum number of iterations or a preset registration accuracy, output the final transformation matrix.

[0138] In this embodiment, first, the number of iterations of the current iteration loop is identified, and the system records the specific number of each iteration to accurately track the iteration progress. Next, it is determined whether the current number of iterations has reached the preset maximum number of iterations. If the current number of iterations has reached the preset maximum value, the next step is entered; otherwise, the iterative calculation is continued. Then, the mean and standard deviation of the distance between the point cloud data in the detection ROI of the current reference template point cloud and the point cloud to be matched are calculated, and the current registration effect is evaluated by comparing the corresponding point distances between the transformed point cloud and the target point cloud.

[0139] Subsequently, it is determined whether the distance mean and standard deviation are within the preset registration threshold. If both the mean and standard deviation meet the preset conditions (for example, the distance mean and standard deviation are less than 0.01, respectively), it is further checked whether the absolute value difference between the current registration error and the registration error of the previous iteration is less than the first absolute value threshold (for example, 0.0001). This check ensures that the registration process has converged to a stable state. If the above absolute value difference is less than the first absolute value threshold, it is determined that the preset registration accuracy is achieved. Finally, if the number of current iteration cycles has reached the preset maximum number of iterations or the preset registration accuracy has been reached, the final transformation matrix is ​​output. The transformation matrix contains the optimal rotation transformation and translation transformation information from the template point cloud to the point cloud to be matched, which is used to describe the optimal conversion relationship between the two, and can be used for subsequent point cloud processing tasks, such as visualization, analysis or other applications.

[0140] Through the above steps, this embodiment not only ensures that the algorithm can find the optimal solution in the shortest time, but also provides efficient and reliable registration results.

[0141] In one embodiment, the step of completing the registration of the to-be-matched point cloud data based on the final transformation matrix includes:

[0142] S60, using the final transformation matrix to perform rotation and offset transformation on the matching point cloud data;

[0143] S61, obtaining the final transformed registration point cloud data to complete the point cloud registration.

[0144] In this embodiment, first, the final transformation matrix is ​​used to rotate and offset the point cloud data to be matched. Specifically, for each point in the target point cloud to be registered, the transformed point P' is calculated according to the final transformation matrix T. This process ensures that all points involved in the registration are adjusted according to the optimal solution.

[0145] Next, obtain the final transformed registration point cloud data to complete the point cloud registration. Apply the above transformation to all valid points in the point cloud to be matched (excluding invalid point cloud data) to obtain a transformed point cloud data set. These data can be used for subsequent analysis, visualization or other processing tasks, and saved as the final registration result. In addition, in order to verify the registration effect, the registration accuracy can be evaluated by comparing the mean and standard deviation of the corresponding point distances between the transformed point cloud and the target point cloud to ensure that the results meet expectations. Through the above steps, this embodiment can achieve high-precision spatial alignment.

[0146] Reference Figure 2 , is a structural block diagram of a three-dimensional point cloud positioning and registration device in an embodiment of the present application, the device includes:

[0147] A selection module 100 is used to select a feature point cloud in a source point cloud and determine a template point cloud ROI according to the distribution of the feature point cloud;

[0148] A sampling module 200 is used to downsample the template point cloud ROI to form a reference template point cloud;

[0149] A setting module 300 is used to set the detection ROI of the point cloud to be matched, initialize the iteration parameters and calculate the detection ROI normal vector, and initialize the transformation matrix;

[0150] An iteration module 400 is used to iteratively calculate the point cloud data within the detection ROI of the reference template point cloud and the point cloud to be matched based on the transformation matrix;

[0151] The output module 500 is used to output the final transformation matrix until a set maximum number of iterations is reached or a preset registration accuracy is reached;

[0152] The registration module 600 is used to complete the registration of the to-be-matched point cloud data based on the final transformation matrix.

[0153] Reference Figure 7 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 7As shown. The computer device includes a processor, an internal memory, a storage medium (non-volatile storage medium) and a network interface connected via a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes the above-mentioned storage medium (non-volatile storage medium) and the internal memory. The storage medium (non-volatile storage medium) stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the storage medium (non-volatile storage medium). The database of the computer device is used to store usage data in the process of a three-dimensional point cloud positioning and registration method, etc. The network interface of the computer device is used to communicate with an external terminal through a network connection. Furthermore, the above-mentioned computer device can also be provided with an input device and a display screen, etc. When the above computer program is executed by the processor, a three-dimensional point cloud positioning and registration method is implemented, which includes the following steps: selecting a feature point cloud in the source point cloud, and determining the template point cloud ROI according to the distribution of the feature point cloud; downsampling the template point cloud ROI to form a reference template point cloud; setting the detection ROI of the point cloud to be matched, initializing iteration parameters and calculating the detection ROI normal vector, and initializing the transformation matrix; based on the transformation matrix, iteratively calculating the point cloud data within the detection ROI of the reference template point cloud and the point cloud to be matched; until the set maximum number of iterations is reached or the preset registration accuracy is reached, the final transformation matrix is ​​output; and the registration of the point cloud data to be matched is completed based on the final transformation matrix. Those skilled in the art will understand that Figure 7 The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.

[0154] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a three-dimensional point cloud positioning and registration method is implemented, including the following steps: selecting a feature point cloud in a source point cloud, and determining a template point cloud ROI according to the distribution of the feature point cloud; downsampling the template point cloud ROI to form a reference template point cloud; setting a detection ROI for the point cloud to be matched, initializing iteration parameters and calculating the detection ROI normal vector, and initializing a transformation matrix; based on the transformation matrix, iteratively calculating the point cloud data within the detection ROI of the reference template point cloud and the point cloud to be matched; until the set maximum number of iterations or the preset registration accuracy is reached, the final transformation matrix is ​​output; and the registration of the point cloud data to be matched is completed based on the final transformation matrix. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0155] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0156] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.

[0157] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A three-dimensional point cloud positioning and registration method, characterized in that: The method comprises: Select the feature point cloud in the source point cloud, and determine the template point cloud ROI according to the distribution of the feature point cloud; Downsampling the template point cloud ROI to form a reference template point cloud; Set the detection ROI of the point cloud to be matched, initialize the iteration parameters, calculate the detection ROI normal vector, and initialize the transformation matrix; Based on the transformation matrix, iteratively calculate the point cloud data within the detection ROI of the reference template point cloud and the point cloud to be matched; Until the maximum number of iterations is reached or the preset registration accuracy is reached, the final transformation matrix is ​​output; The registration of the point cloud data to be matched is completed based on the final transformation matrix.

2. The three-dimensional point cloud positioning and registration method according to claim 1, characterized in that: The step of selecting a feature point cloud from the source point cloud and determining the template point cloud ROI according to the distribution of the feature point cloud includes: Use the source point cloud as the reference point cloud data for the current positioning; According to the reference point cloud data, a point cloud having preset texture and edge information is selected as a feature point cloud; According to the spatial distribution of the feature point cloud, the corresponding region of interest is selected to obtain the template point cloud ROI.

3. The three-dimensional point cloud positioning and registration method according to claim 1, characterized in that: The step of downsampling the template point cloud ROI to form a reference template point cloud comprises: Set the downsampling size based on the determined template point cloud ROI and the x-resolution, y-resolution and z-resolution of the point cloud; Generate a downsampling grid based on the set downsampling size; All point cloud data in each down-sampling grid are statistically aggregated to remove invalid point clouds to form the reference template point cloud.

4. The three-dimensional point cloud positioning and registration method according to claim 1, characterized in that: The steps of setting the detection ROI of the point cloud to be matched, initializing iteration parameters and calculating the detection ROI normal vector, and initializing the transformation matrix include: Get the data of the point cloud to be matched; According to the position fluctuation of the source point cloud and the point cloud to be matched, set the detection ROI of the current point cloud to be matched; Initialize iteration parameters; For each point pi within the detection ROI, find all neighboring points within the set search radius r; Use the least squares method to perform plane fitting on the neighboring points, and obtain the normal vector of the fitted plane as the normal vector of point pi; If the number of neighboring points is less than the first preset number or does not exist, the corresponding point is marked as an invalid point, and the point cloud data within the detection ROI with normal vector information is obtained; Based on the iteration parameters, an initial relationship between the current template point cloud and the point cloud to be matched is obtained, and a transformation matrix is ​​initialized based on the initial relationship.

5. The three-dimensional point cloud positioning and registration method according to claim 1, characterized in that: The step of iteratively calculating the point cloud data within the detection ROI of the reference template point cloud and the point cloud to be matched based on the transformation matrix includes: Using the initialized transformation matrix, the reference template point cloud data and the point cloud data within the detection ROI of the point cloud to be matched are used as input to start the iterative loop; Transform the reference template point cloud according to the current transformation matrix, update the transformation matrix, and perform an iterative loop based on the updated transformation matrix; Determine whether to stop the iteration based on the preset iteration stop condition.

6. The three-dimensional point cloud positioning and registration method according to claim 1, characterized in that: The step of outputting the final transformation matrix until the set maximum number of iterations or the preset registration accuracy is reached includes: Identify the iteration number of the current iteration loop; Determine whether the current number of iterations has reached the preset maximum number of iterations; Calculate the distance mean and standard deviation of the point cloud data within the detection ROI of the current reference template point cloud and the point cloud to be matched; Determining whether the distance mean and standard deviation are within a preset registration threshold; If it is within the preset registration range, determine whether the absolute value of the current registration error and the registration error of the previous iteration is less than the first absolute value If it is less than the first absolute value, it is determined that the preset registration accuracy is achieved; If the number of current iteration cycles has reached the preset maximum number of iterations or the preset registration accuracy has been reached, the final transformation matrix is ​​output.

7. The three-dimensional point cloud positioning and registration method according to claim 1, characterized in that: The step of completing the registration of the to-be-matched point cloud data based on the final transformation matrix comprises: Use the final transformation matrix to rotate and offset the matching point cloud data; The final transformed registration point cloud data is obtained to complete the point cloud registration.

8. A three-dimensional point cloud positioning and registration device, characterized in that: include: The selection module is used to select the feature point cloud in the source point cloud and determine the template point cloud ROI according to the distribution of the feature point cloud; A sampling module, used for down-sampling the template point cloud ROI to form a reference template point cloud; The setting module is used to set the detection ROI of the point cloud to be matched, initialize the iteration parameters, calculate the detection ROI normal vector, and initialize the transformation matrix; An iteration module, used for iteratively calculating the point cloud data within the detection ROI of the reference template point cloud and the point cloud to be matched based on the transformation matrix; The output module is used to output the final transformation matrix until the maximum number of iterations is set or the preset registration accuracy is reached; A registration module is used to complete the registration of the to-be-matched point cloud data based on the final transformation matrix.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

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

Citation Information

Cited By

  • Transformation matrix optimization method and device in point cloud registration, storage medium and equipment

    CN120431138A