Three-dimensional model matching method and device and electronic equipment
By converting the three-dimensional model into point cloud data and performing feature extraction and registration, the problem of inefficiency in matching traditional three-dimensional models is solved, and a more efficient, accurate and automated matching process is achieved.
Patent Information
- Application Number
- CN202411524568.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-28
AI Technical Summary
The traditional three-dimensional model matching method is inefficient, time-consuming, and requires a lot of computing resources and manpower, and lacks automation.
By converting the 3D model to be matched into point cloud data containing key points, preprocessing and feature extraction, registering with the features of the historical 3D model using registration parameters to evaluate the similarity to determine the matching result.
It improves the efficiency and accuracy of three-dimensional model matching, reduces dependence on professional modeling software, reduces the consumption of manpower and computing resources, and enhances the degree of automation.
Smart Images

Figure CN119540581A_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of model matching, and in particular to a three-dimensional model matching method, device, electronic device and computer-readable storage medium. [Background technology]
[0002] With the development of computer vision and graphics processing technology, 3D model matching has become increasingly important in many fields. For example, in cultural heritage protection, construction monitoring, robot navigation, and augmented reality, accurate matching of 3D models is required to achieve various applications.
[0003] In the traditional 3D model matching method, the 3D model to be matched and the historical 3D model need to be imported into professional modeling software for pairwise comparison, and the interference check tool is used to identify the geometric interference between the two models. The similarity between the models is evaluated by the results of the interference check. However, importing the models into the modeling software is very time-consuming, and pairwise comparison of multiple models will further increase the processing time, resulting in the inefficiency of the traditional 3D model matching method. [Summary of the invention]
[0004] In order to effectively solve the problem of low efficiency of the three-dimensional model matching method in the prior art, the present invention provides a three-dimensional model matching method.
[0005] A three-dimensional model matching method, comprising:
[0006] The three-dimensional model to be matched is converted into first point cloud data containing key points of the three-dimensional model through preset software;
[0007] Preprocessing the first point cloud data, and setting registration parameters according to the preprocessing result;
[0008] Performing feature extraction on the first point cloud data to obtain a first feature of the first point cloud data;
[0009] The first feature is respectively registered with each second feature in a preset feature library according to the registration parameter, and the similarity between each second feature and the first feature is determined according to the registration result; the second feature is a feature obtained after feature extraction of the second point cloud data corresponding to the historical three-dimensional model;
[0010] The matching result of the to-be-matched three-dimensional model is determined according to the similarity between each of the second features and the first feature.
[0011] Optionally, the step of respectively registering the first feature with each second feature in a preset feature library according to the registration parameter, and determining the similarity between each second feature and the first feature according to the registration result includes:
[0012] Performing global registration on the first feature and each of the second features respectively to obtain a third feature corresponding to the second feature; the third feature is a feature obtained by applying a global registration transformation matrix to the first feature;
[0013] The similarity between each group of the second feature and the third feature is determined as the similarity between the corresponding second feature and the first feature.
[0014] Optionally, after globally registering the first feature with each of the second features to obtain a third feature corresponding to the second feature, the method further includes:
[0015] Locally registering each of the third features with the corresponding second features respectively to obtain a fourth feature corresponding to the second feature; the fourth feature is a feature obtained by applying a local registration transformation matrix to the third feature;
[0016] The similarity between each group of the second feature and the fourth feature is determined as the similarity between the corresponding second feature and the first feature.
[0017] Optionally, the step of respectively registering the first feature with each second feature in a preset feature library according to the registration parameter, and determining the similarity between each second feature and the first feature according to the registration result includes:
[0018] Locally registering the first feature with each of the second features respectively to obtain a fifth feature corresponding to the second feature; the fifth feature is a feature obtained by applying a local registration transformation matrix to the first feature;
[0019] The similarity between each group of the second feature and the fifth feature is determined as the similarity between the corresponding second feature and the first feature.
[0020] Optionally, the step of preprocessing the first point cloud data and setting the registration parameters according to the preprocessing result includes:
[0021] Preprocessing the first point cloud data to obtain third point cloud data; the point cloud density of the third point cloud data is within a preset density range;
[0022] Calculating an initial voxel value according to the surface area and the number of point clouds of the third point cloud data, and performing coordinate transformation on the third point cloud data to obtain fourth point cloud data;
[0023] Globally registering the third point cloud data with the fourth point cloud data according to the initial voxel value;
[0024] Determine whether the similarity between the third point cloud data and the fourth point cloud data is 1 according to the global registration result;
[0025] If not, the initial voxel value is updated by using a greedy algorithm, and the step of globally registering the third point cloud data with the fourth point cloud data according to the initial voxel value is returned to be executed;
[0026] If so, the registration parameters are set according to the initial voxel values.
[0027] Optionally, the step of determining the matching result of the to-be-matched three-dimensional model according to the similarity between each of the second features and the first feature includes:
[0028] Arrange each of the second features in descending order of the similarity;
[0029] Determine the historical three-dimensional model corresponding to the second feature ranked in the top n in similarity as the matching result of the three-dimensional model to be matched;
[0030] Wherein, n is a preset value.
[0031] Optionally, determining the matching result of the to-be-matched three-dimensional model according to the similarity includes:
[0032] The historical three-dimensional model corresponding to the second feature whose similarity is greater than a preset threshold is determined as the matching result of the three-dimensional model to be matched.
[0033] A three-dimensional model matching device, comprising:
[0034] A conversion module, used for converting the to-be-matched three-dimensional model into first point cloud data containing key points of the three-dimensional model through preset software;
[0035] A setting module, used for preprocessing the first point cloud data and setting registration parameters according to the preprocessing results;
[0036] A feature extraction module, used for performing feature extraction on the first point cloud data to obtain a first feature of the first point cloud data;
[0037] A registration module, used to register the first feature with each second feature in a preset feature library according to the registration parameters, and determine the similarity between each second feature and the first feature according to the registration result; the second feature is a feature obtained after feature extraction of the second point cloud data corresponding to the historical three-dimensional model;
[0038] A matching module is used to determine a matching result of the to-be-matched three-dimensional model according to a similarity between each of the second features and the first feature.
[0039] An electronic device, comprising:
[0040] A processor and a memory, wherein the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the three-dimensional model matching method as described in any one of the above items is implemented.
[0041] A computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements any one of the three-dimensional model matching methods described above.
[0042] The three-dimensional model matching method provided by the embodiment of the present invention has at least the following beneficial effects:
[0043] The present invention converts the three-dimensional model to be matched into first point cloud data containing key points of the three-dimensional model through preset software, pre-processes the first point cloud data, sets registration parameters according to the pre-processing results, then extracts the first feature of the first point cloud data, and registers the first feature with the second feature of the historical three-dimensional model according to the registration parameters to determine the corresponding similarity, and finally determines the matching result of the three-dimensional model to be matched according to the similarity. The present invention effectively improves the automation and efficiency of the matching process by converting the three-dimensional model matching into feature matching. By extracting features from the first point cloud data to obtain the first feature, and then registering it with the second feature in the preset feature library, the similarity between the model to be matched and the historical model can be quickly and accurately evaluated. The whole process reduces the dependence on professional modeling software, reduces the consumption of manpower and computing resources, and improves the efficiency and accuracy of three-dimensional model matching.
Brief Description of the Drawings
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 A flowchart of a three-dimensional model matching method provided by an embodiment of the present invention;
[0046] Figure 2 for Figure 1 A flowchart of a practical expression of S02 in a provided three-dimensional model matching method;
[0047] Figure 3 A schematic diagram of the structure of a three-dimensional model matching device provided in an embodiment of the present invention. [Specific implementation method]
[0048] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0049] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0051] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0052] With the development of computer vision and graphics processing technology, 3D model matching has become increasingly important in many fields. For example, in cultural heritage protection, construction monitoring, robot navigation, and augmented reality, accurate matching of 3D models is required to achieve various applications.
[0053] The steps of the traditional method include:
[0054] 1) Model import: Import the 3D model to be matched and the historical model into the modeling software. This step involves file format conversion and model loading, which can be time-consuming due to the complexity of the model and software compatibility issues.
[0055] 2) Interference Check: Use the built-in interference check tool to compare the two models. Interference check evaluates the spatial relationship between the two models by calculating the geometric interference between them. This process requires setting appropriate parameters, such as the accuracy and range of interference detection.
[0056] 3) Result evaluation: Based on the results of the interference check, the similarity between the two models is evaluated. This usually involves visualizing and quantifying the interference area to determine the degree of difference between the models.
[0057] Disadvantages of traditional methods include:
[0058] 1) Time-consuming: Importing large models into modeling software is a time-consuming process in itself. In addition, comparing multiple models pairwise will further increase the processing time.
[0059] 2) High resource usage: Professional modeling software usually requires high computing resources and may occupy a large amount of memory and processor resources when processing large models.
[0060] 3) High labor costs: Operating modeling software requires professional technicians, which increases labor costs. At the same time, manual operation also increases the possibility of errors.
[0061] 4) Lack of Automation: Traditional comparison methods lack automation and require manual intervention at every step, which limits processing speed and consistency.
[0062] Therefore, the present invention provides a three-dimensional model matching method to solve the above problems.
[0063] Please refer to Figure 1 , is a flow chart of a three-dimensional model matching method provided by an embodiment of the present invention, comprising the following steps:
[0064] Step S01: convert the three-dimensional model to be matched into first point cloud data containing key points of the three-dimensional model through preset software.
[0065] In this embodiment, the purpose of converting the 3D model to be matched into the first point cloud data containing the key points of the 3D model through the preset software is to utilize the characteristics of the point cloud data for efficient calculation and analysis. Point cloud data has a simple and flexible representation method and is suitable for a variety of computing tasks. This embodiment reduces the computational burden of processing complex geometric surfaces by applying point cloud data to the 3D model matching process, while retaining sufficient geometric information for effective comparison and analysis. In addition, point cloud data is easily compatible with the registration algorithm, making the 3D model matching process more automated and accurate.
[0066] In some embodiments, the preset software may specifically be UG (Unigraphics NX, a product engineering solution software).
[0067] Traditional point cloud data processing usually involves a large amount of data directly obtained from a 3D scanner or sensor. Due to its high density and details, this data often leads to huge computing and storage requirements. However, this embodiment uses professional CAD / CAM (computer-aided design and computer-aided manufacturing system) software such as UG to convert the 3D model into the first point cloud data containing key points, which significantly reduces the amount of data while retaining the key geometric features of the model, thereby improving the efficiency of data processing and reducing the demand for computing resources, so that complex 3D models can be processed even with limited computing power. In addition, due to the reduction in data volume, the calculation time of subsequent feature extraction, alignment and analysis steps will also be greatly shortened, thereby speeding up the entire workflow and improving overall work efficiency.
[0068] Step S02: preprocess the first point cloud data and set the registration parameters according to the preprocessing result.
[0069] In this embodiment, the first point cloud data is preprocessed before point cloud registration, and appropriate registration parameters are set according to the preprocessing results of the first point cloud data to improve the efficiency and accuracy of the registration. At the same time, adjusting the parameters of the registration algorithm according to the characteristics of the first point cloud data, such as the search radius, the number of iterations, and the error threshold, helps to improve the convergence speed and robustness of the algorithm, especially when processing point cloud data that is not completely overlapped and has noise. Reasonable parameter settings can reduce the error accumulation in the registration process and improve the accuracy of the registration results, thereby making the three-dimensional model matching more reliable and efficient.
[0070] Please refer to Figure 2 ,for Figure 1 A flowchart of a practical expression of S02 in a three-dimensional model matching method is provided.
[0071] In some embodiments, in order to further improve the efficiency and accuracy of the registration, the point cloud registration process can be optimized by adjusting the voxel size, that is, the step of preprocessing the first point cloud data and setting the registration parameters according to the preprocessing result mentioned in step S02, which may specifically include the following steps: Figure 2 Steps shown:
[0072] Step S021, pre-processing the first point cloud data to obtain third point cloud data.
[0073] In this embodiment, the point cloud density of the third point cloud data is within a preset density range. The first point cloud data is preprocessed to obtain the third point cloud data. This process specifically adjusts the point cloud density to ensure that it falls within the preset density range. Specifically, the density of the point cloud data is controlled by obtaining the density information of the original point cloud and comparing it with the preset density threshold. Upsampling or downsampling is selected according to the comparison result. The advantage is that it focuses on adjusting the density of the point cloud without performing other complex preprocessing steps, such as denoising or removing outliers, thereby simplifying the processing flow and improving the efficiency and reliability of data processing. By preprocessing the first point cloud data, a third point cloud data with uniform density and reasonable distribution can be obtained, which provides high-quality input data for subsequent point cloud alignment and other analysis work.
[0074] Step S022, calculating the initial voxel value according to the surface area and the number of point clouds of the third point cloud data, and performing coordinate transformation on the third point cloud data to obtain fourth point cloud data.
[0075] The surface area and the number of point clouds of the first point cloud data are obtained, and an initial voxel value is calculated according to the surface area and the number of point clouds of the first point cloud data.
[0076] The voxel value affects the degree of downsampling of the point cloud, which in turn affects the quality and efficiency of feature extraction and point cloud registration. This embodiment can estimate a voxel size that reflects the density and features of the point cloud by considering the surface area and number of points of the point cloud, thereby ensuring effective data simplification while retaining key geometric information, thereby improving the adaptability and robustness of point cloud processing and optimizing the performance of the registration algorithm.
[0077] In some embodiments, the calculation of the initial voxel value may be:
[0078] voxel = N / area
[0079] Wherein, voxel is the initial voxel value, N is the number of point clouds in the first point cloud data, and area is the surface area of the first point cloud data.
[0080] Step S023: globally register the third point cloud data with the fourth point cloud data according to the initial voxel value.
[0081] Global registration is used to find the best alignment between point clouds without an accurate initial alignment. The goal of global registration is to determine the best rotation and translation relationship between two or more point clouds so that they are aligned as closely as possible in space.
[0082] In this embodiment, the first point cloud data is downsampled by using the initial voxel value to create a fourth point cloud data with a lower resolution, which is then globally registered with the first point cloud data to detect and verify the rationality of the initial voxel value, ensuring that the generated fourth point cloud data is consistent with the original first point cloud data in terms of spatial form and geometric features. Through global registration, the impact of the initial voxel value on the accuracy of the point cloud data can be evaluated, thereby providing accurate basic data for subsequent local registration and feature matching. If the registration result shows that the two are highly consistent, it means that the initial voxel value is suitable for subsequent processing; if not, the voxel value needs to be adjusted to obtain a better registration effect.
[0083] Step S024, judging whether the similarity between the third point cloud data and the fourth point cloud data is 1 according to the global registration result;
[0084] If not, execute step S025; if so, execute step S026.
[0085] The purpose of this embodiment is to find the optimal voxel size to ensure the accuracy and efficiency of point cloud registration. By comparing the similarity between the third point cloud data and the fourth point cloud data, it is detected whether the two are completely consistent. A similarity of 1 indicates a complete match. If not, it means that the current voxel value may be too large or too small, resulting in insufficient registration accuracy. At this time, a greedy algorithm is used to adjust the voxel value to find a better downsampling density, and then return to the step of globally registering the third point cloud data and the fourth point cloud data according to the initial voxel value to re-register. If so, it means that the current voxel value can already capture the features of the point cloud well. Next, this voxel value is used to set the registration parameters for the next step of registration.
[0086] Step S025: Update the initial voxel value using a greedy algorithm.
[0087] After executing step S025, the process returns to executing step S023, and globally aligns the third point cloud data with the fourth point cloud data according to the initial voxel value.
[0088] In this embodiment, when the similarity is not 1, it means that the registration is not accurate enough, and the voxel value needs to be readjusted, and re-verification is performed after the voxel value is adjusted until the similarity between the first point cloud data and the fourth point cloud data is 1.
[0089] In some embodiments, updating the initial voxel value using a greedy algorithm may include the steps of:
[0090] 1) Setting the objective function: Define an objective function, i.e., the similarity score of global registration, and expect to maximize the similarity score.
[0091] 2) Determine the adjustment strategy: The adjustment strategy of the greedy algorithm includes increasing or decreasing the voxel value. Increasing the voxel value will result in a coarser downsampling, while decreasing the voxel value will produce a more detailed point cloud.
[0092] 3) Greedy selection: In each step, the greedy algorithm will choose to increase or decrease the voxel value to make the current similarity score locally optimal. For example, if it is found that reducing the voxel value can improve the registration similarity, then the voxel value will be reduced.
[0093] 4) Iterative update: Repeat the greedy selection process until the similarity has reached 1.
[0094] 5) Verification and return: After each update of the voxel value, the fourth point cloud data is regenerated and globally registered with the first point cloud data, and the similarity is verified to be improved. If there is no improvement or the improvement is not significant, the iteration may be stopped and the current best voxel value is returned; if the similarity is improved, the iteration continues.
[0095] For example, the initial voxel value is 1cm and the registration similarity is 0.8. The greedy algorithm may try to reduce the voxel value to 0.5cm, perform registration again, and find that the similarity has increased to 0.9. Therefore, the algorithm considers this to be a better voxel value, uses it as the new initial voxel value, and continues to try a voxel value of 0.25cm until it finds a voxel value that makes the registration similarity closest to 1. In this way, the greedy algorithm can find a local optimal solution in each step of selection, thereby gradually approaching the global optimal solution.
[0096] Step S026, setting registration parameters according to the initial voxel values.
[0097] In this embodiment, in order to optimize the performance of the registration algorithm and ensure that the algorithm can strike a balance between efficiency and accuracy when performing feature matching and transformation estimation, the corresponding registration parameters are set according to the initial voxel value when the similarity between the third point cloud data and the fourth point cloud data is 1. That is, before comparing the target model with the database model in this embodiment, the algorithm first performs a self-similarity comparison on the target model to ensure the availability of the selected key parameters. This adaptive parameter determination method improves the flexibility and accuracy of the matching process, reduces the amount of calculation when processing large-scale point cloud data, and avoids the loss of important features due to excessive voxel size or contains too much noise due to too small voxel size. By adjusting the registration parameters according to the voxel value, the accuracy and robustness of the registration can be improved, ensuring that the final registration result is both accurate and reliable.
[0098] Based on the above technical solution, this embodiment calculates the initial voxel value by accurately obtaining the basic information of the third point cloud data, such as the surface area and the number of point clouds, and generates the fourth point cloud data for global registration based on this, which can realize flexible processing of point cloud data of different scales and densities. The voxel value is iteratively optimized by the greedy algorithm until the similarity between the point clouds is maximized, ensuring the accuracy and robustness of the registration process. Finally, the registration parameters are set using the optimized voxel values, which not only improves the registration efficiency, but also enhances the adaptability to complex or noisy point cloud data, thereby reducing the consumption of computing resources while ensuring the registration quality.
[0099] In some embodiments, the first point cloud data is preprocessed, and the registration parameters are set according to the preprocessing result, which may specifically include the following steps:
[0100] 1) Determine the number of points in the first point cloud data so as to select a suitable data structure and algorithm to process the data.
[0101] 2) Analyzing the density of the first point cloud data, that is, the average distance between points, helps determine the sampling strategy required in subsequent processing.
[0102] 3) Check whether the spatial distribution of the first point cloud data is uniform. If it is not uniform, measures can be taken to balance the distribution to avoid deviations in the registration process.
[0103] 4) Identify and evaluate the noise level in the first point cloud data, which may affect the accuracy of feature extraction and registration.
[0104] 5) Based on the above analysis results, set the parameters of the registration algorithm, such as the initial alignment estimate, number of iterations, tolerance, etc.
[0105] By executing the above steps, this embodiment can ensure that the registration parameters match the characteristics of the first point cloud data, thereby improving the success rate and efficiency of the registration.
[0106] Step S03: extract features from the first point cloud data to obtain first features of the first point cloud data.
[0107] In this embodiment, the process of extracting features from the first point cloud data to obtain the first feature is to convert the complex three-dimensional model data into a numerical descriptor that can represent its local shape and structure, with the purpose of reducing the amount of calculation for subsequent processing and extracting key information that is useful for understanding the point cloud data. The first feature can specifically be a feature that is invariant to transformations in the point cloud (such as rotation, translation, and scaling), which means that no matter how the point cloud moves or rotates, its feature descriptor remains consistent, thereby providing a stable foundation for subsequent point cloud registration, recognition, and classification tasks, thereby improving the efficiency and accuracy of point cloud processing.
[0108] In some embodiments, the neighborhood of each point in the first point cloud data can be determined by using an algorithm in a point cloud processing library (such as a PCL point cloud processing library or an Open3D point cloud processing library), and then the geometric and intensity features of each point and its neighborhood are calculated, and then these features are used to generate descriptors, and finally these descriptors are integrated into the first feature. The obtained first feature can encode the local shape and structure of the point cloud, and is invariant to transformations such as rotation and translation, so as to provide key information for point cloud registration and other analysis tasks.
[0109] Step S04: align the first feature with each second feature in the preset feature library according to the alignment parameters, and determine the similarity between each second feature and the first feature according to the alignment result.
[0110] In this embodiment, the second feature is a feature obtained after feature extraction of the second point cloud data corresponding to the historical three-dimensional model. This embodiment compares the extracted first feature (i.e., the feature descriptor of the first point cloud data) with the second feature in the pre-established feature library (i.e., the feature descriptor of the second point cloud data corresponding to the historical three-dimensional model) to evaluate the similarity between the two. Through feature registration and similarity evaluation, the model closest to the current model is selected from a large amount of historical data, thereby achieving fast and accurate model matching.
[0111] In some embodiments, in order to improve the registration speed and thus improve the efficiency of three-dimensional model matching, the first feature can be globally registered with each second feature in the preset feature library, and the similarity between each second feature and the first feature is determined according to the global registration result, that is, the step mentioned in step S04, in which the first feature is registered with each second feature in the preset feature library according to the registration parameters, and the similarity between each second feature and the first feature is determined according to the registration result, which can specifically include:
[0112] Step S041, globally aligning the first feature with each second feature to obtain a third feature corresponding to the second feature.
[0113] In this embodiment, the third feature is a feature obtained by applying a global registration transformation matrix to the first feature, and the registration result may include:
[0114] Transformation matrix: describes how to move one point cloud to the coordinate system of another point cloud, including rotation and translation parameters. This transformation matrix can be rigid or non-rigid, depending on the characteristics of the point cloud data and the registration algorithm.
[0115] Registered point cloud: After applying the transformation matrix, the source point cloud and the target point cloud are spatially aligned to form a unified point cloud model. This model can be used for further analysis, visualization, modeling or other applications.
[0116] Matching score: Registration algorithms usually provide a matching score or error metric to evaluate the quality of the registration. This score can be based on the distance, angle difference, or other error metric between the registered point clouds.
[0117] Inliers and exliers: During the registration process, the algorithm identifies inliers and exliers. Inliers are points that were correctly matched, while exliers are points that were incorrectly matched. Inliers are used to estimate the transformation matrix, while exliers are usually removed or corrected.
[0118] Optimized model parameters: During the iterative registration process, the transformation parameters are continuously optimized until convergence conditions are reached, such as the error caused by the transformation is less than a certain threshold or the maximum number of iterations is reached.
[0119] In some embodiments, as mentioned in step S041, globally registering the first feature with each second feature to obtain a third feature corresponding to the second feature may specifically include the following steps:
[0120] 1) Select an appropriate global registration algorithm, such as the RANdom SAmple Consensus (RANSAC) algorithm.
[0121] 2) Provide a rough initial estimate for the global registration algorithm, or let the global registration algorithm find the initial alignment through random samples.
[0122] 3) Use feature matching techniques, such as nearest neighbor search, to match each feature point in the first feature with a point in the second feature.
[0123] 4) Based on the matched feature point pairs, use the least square method or other optimization method to estimate the optimal rotation and translation matrix that aligns the first feature to the second feature.
[0124] 5) Apply the estimated global registration transformation matrix to the point cloud data of the first feature to generate new point cloud data, i.e., the third feature.
[0125] In this embodiment, the similarity of the registration results is about 80%-90%.
[0126] Step S042: Determine the similarity between each group of second features and third features as the similarity between the corresponding second features and first features.
[0127] In this embodiment, by comparing the similarity between the source point cloud features (third features) and the target point cloud features (second features) after the global registration transformation, the similarity between the original source point cloud features (first features) and the target point cloud features is evaluated, and then the similarity between the first point cloud data and each second point cloud data is determined, providing an accurate reference for three-dimensional model matching.
[0128] Based on the above steps, this embodiment greatly improves the efficiency of three-dimensional model registration by globally registering the first feature with each second feature in the preset feature library and determining the similarity between the two based on the registration result.
[0129] On the basis of the above embodiments, in some embodiments, in order to further improve the registration accuracy, local registration can also be performed on the basis of global registration. That is, after executing step S041, the following steps can also be performed:
[0130] Step S043: locally align each third feature with the corresponding second feature to obtain a fourth feature corresponding to the second feature.
[0131] In this embodiment, the fourth feature is a feature obtained by applying a local registration transformation matrix to the third feature. The fourth feature is obtained by locally registering the third feature after global registration with the corresponding second feature to achieve more accurate alignment. Local registration focuses on the details of the point cloud within a small range. By applying a local transformation matrix, any remaining deviations and errors can be corrected to ensure that the correspondence between features is more accurate. The purpose of this is to improve the quality of registration, especially when there are still slight differences after global registration, the matching accuracy can be further improved through local registration.
[0132] In some embodiments, the process of locally registering each third feature with the corresponding second feature to obtain the fourth feature mentioned in step S043 may specifically include the following steps:
[0133] 1) Select an appropriate local registration algorithm, such as the Iterative Closest Point (ICP) algorithm or other advanced registration methods.
[0134] 2) Use the result of global registration as the initial estimate of local registration, that is, the third feature is used as the source point cloud and the second feature is used as the target point cloud.
[0135] 3) For each point in the source point cloud, find the nearest point in the target point cloud and establish a corresponding relationship.
[0136] 4) Based on the corresponding point pairs, the optimal rotation matrix and translation vector are estimated using the least squares method or other optimization techniques.
[0137] 5) Apply the estimated local transformation matrix to each point of the third feature to generate the fourth feature.
[0138] Based on the above steps, on the basis of global registration, the third feature is further registered by using a local registration algorithm to obtain the final transformation matrix and similarity.
[0139] Step S044: updating the similarity between each second feature and the first feature to the similarity between each corresponding group of second features and the fourth feature.
[0140] Based on the above technical solution, this embodiment further performs local registration on the basis of global registration to obtain a more refined registration feature (fourth feature) and updates the similarity evaluation, which can improve the accuracy and robustness of model matching. Through local registration, the results of global registration can be refined, errors in a small range can be corrected, and feature matching can be ensured to be more accurate. Updating the similarity evaluation can reflect a more refined registration effect, thereby more accurately measuring the similarity between the model to be matched and the historical model, and providing a more reliable basis for the final matching decision.
[0141] In some embodiments, in order to simplify the registration algorithm logic and ensure the accuracy of the registration, the first feature may be locally registered with each second feature in the preset feature library, and the similarity between each second feature and the first feature may be determined according to the local registration result, that is, the step mentioned in step S04, in which the first feature is registered with each second feature in the preset feature library according to the registration parameter, and the similarity between each second feature and the first feature is determined according to the registration result, which may specifically include:
[0142] Locally aligning the first feature with each second feature, respectively, to obtain a fifth feature corresponding to the second feature; the fifth feature is a feature obtained by applying a local alignment transformation matrix to the first feature;
[0143] The similarity between each group of the second feature and the fifth feature is determined as the similarity between the corresponding second feature and the first feature.
[0144] In this embodiment, by locally registering the first feature with each second feature in the preset feature library, generating a fifth feature, and updating the similarity evaluation based on this, a more refined point cloud feature alignment and a more accurate similarity measurement can be achieved. This embodiment can correct errors in a small range through local registration, ensure that feature matching is more accurate, and thus improve the quality and reliability of registration. In addition, the updated similarity evaluation can more realistically reflect the geometric consistency between the first feature and the second feature, providing a more accurate basis for matching and identifying three-dimensional models.
[0145] In some embodiments, the process of establishing a preset feature library may include:
[0146] Convert each historical three-dimensional model into corresponding second point cloud data;
[0147] Perform feature extraction on each second point cloud data respectively to obtain a second feature corresponding to each second point cloud data;
[0148] A preset feature library is established according to each second feature.
[0149] In this embodiment, by converting each historical three-dimensional model into corresponding second point cloud data, and extracting features from these point cloud data to obtain corresponding second features, and then aggregating these second features to establish a preset feature library, an efficient and systematic feature comparison mechanism is provided for three-dimensional model matching. The establishment of the preset feature library enables a large amount of historical model data to be quickly retrieved and compared through precise feature descriptors when matching a new model, and then the most similar historical model can be quickly found. This embodiment improves the efficiency of three-dimensional model matching and saves time and resources. In addition, by reducing the interference of human factors, the reliability of the matching results is enhanced, and the automation and accuracy of the matching process are greatly improved.
[0150] Step S05: determining a matching result of the to-be-matched three-dimensional model according to the similarity between each second feature and the first feature.
[0151] In this embodiment, by comparing the similarity between the first feature and the second feature, one or more similar models to the current model to be matched are found from a series of candidate historical 3D models, thereby achieving accurate matching. By quantifying the similarity, the matching historical 3D model can be objectively evaluated and selected, which improves the automation and accuracy of the matching process, reduces the interference of human factors, and ensures the reliability of the matching results.
[0152] In some embodiments, as mentioned in step S05, the matching result of the to-be-matched three-dimensional model is determined according to the similarity between each second feature and the first feature, which may specifically be:
[0153] Arrange each second feature in descending order of similarity;
[0154] The historical three-dimensional model corresponding to the second feature ranked in the top n in similarity is determined as the matching result of the three-dimensional model to be matched;
[0155] Wherein, n is a preset value.
[0156] In this embodiment, by sorting each second feature from high to low by similarity, and selecting the top n historical three-dimensional models in similarity as the matching results of the model to be matched, the candidate model most similar to the model to be matched can be quickly identified. By setting the preset value n, the number of matching results can be controlled to balance the breadth and accuracy of the matching. This embodiment improves the efficiency and accuracy of the matching process, ensuring that even in the presence of multiple similar models, the most relevant ones can be given priority, thereby providing the most likely options for subsequent decisions or operations. At the same time, the value of n can be adjusted according to different application requirements to adapt to different matching scenarios and accuracy requirements, thereby increasing the flexibility of the matching process.
[0157] In some embodiments, as mentioned in step S05, the matching result of the to-be-matched three-dimensional model is determined according to the similarity between each second feature and the first feature, which may specifically be:
[0158] The historical three-dimensional model corresponding to the second feature whose similarity is greater than a preset threshold is determined as the matching result of the three-dimensional model to be matched.
[0159] In this embodiment, by determining the historical 3D model corresponding to the second feature with a similarity greater than a preset threshold as the matching result of the 3D model to be matched, it is possible to ensure that the selected matching model has a sufficiently high consistency with the model to be matched in terms of geometric features. By setting a similarity threshold, those matches with low similarity and possible inaccuracy can be filtered out, thereby improving the quality of the matching results. This makes the matching process more rigorous and reliable, ensuring that the model finally selected is within an acceptable error range.
[0160] Based on the above technical solution, the present invention converts the three-dimensional model to be matched into first point cloud data containing key points of the three-dimensional model through preset software, pre-processes the first point cloud data, sets the registration parameters according to the pre-processing results, and then extracts the first feature of the first point cloud data, and registers the first feature with the second feature of the historical three-dimensional model according to the registration parameters to determine the corresponding similarity, and finally determines the matching result of the three-dimensional model to be matched according to the similarity. The present invention effectively improves the automation and efficiency of the matching process by converting the three-dimensional model matching into feature matching. By extracting features from the first point cloud data to obtain the first feature, and then registering it with the second feature in the preset feature library, the similarity between the model to be matched and the historical model can be quickly and accurately evaluated. The whole process reduces the dependence on professional modeling software, reduces the consumption of manpower and computing resources, and improves the efficiency and accuracy of three-dimensional model matching.
[0161] Please refer to Figure 3 , is a schematic diagram of the structure of a three-dimensional model matching device provided by an embodiment of the present invention, the three-dimensional model matching device comprising:
[0162] The conversion module 100 is used to convert the three-dimensional model to be matched into first point cloud data containing key points of the three-dimensional model through preset software;
[0163] A setting module 200 is used to preprocess the first point cloud data and set the registration parameters according to the preprocessing result;
[0164] A feature extraction module 300 is used to extract features from the first point cloud data to obtain a first feature of the first point cloud data;
[0165] The registration module 400 is used to register the first feature with each second feature in the preset feature library according to the registration parameters, and determine the similarity between each second feature and the first feature according to the registration result; the second feature is a feature obtained after feature extraction of the second point cloud data corresponding to the historical three-dimensional model;
[0166] The matching module 500 is used to determine the matching result of the to-be-matched three-dimensional model according to the similarity between each second feature and the first feature.
[0167] Based on the above embodiments, in a specific embodiment, the registration module 400 can be specifically used for:
[0168] Perform global registration on the first feature and each second feature respectively to obtain a third feature corresponding to the second feature; the third feature is a feature obtained by applying a global registration transformation matrix to the first feature;
[0169] The similarity between each group of second features and third features is determined as the similarity between the corresponding second features and first features.
[0170] Based on the above embodiment, in a specific embodiment, the registration module 400 can also be used for:
[0171] Locally align each third feature with the corresponding second feature to obtain a fourth feature corresponding to the second feature; the fourth feature is a feature obtained by applying a local alignment transformation matrix to the third feature;
[0172] The similarity between each group of the second feature and the fourth feature is determined as the similarity between the corresponding second feature and the first feature.
[0173] Based on the above embodiments, in a specific embodiment, the registration module 400 can be specifically used for:
[0174] Locally aligning the first feature with each second feature, respectively, to obtain a fifth feature corresponding to the second feature; the fifth feature is a feature obtained by applying a local alignment transformation matrix to the first feature;
[0175] The similarity between each group of the second feature and the fifth feature is determined as the similarity between the corresponding second feature and the first feature.
[0176] Based on the above embodiments, in a specific embodiment, the setting module 200 can be specifically used for:
[0177] Acquire the surface area and the number of point clouds of the first point cloud data, and calculate the initial voxel value according to the surface area and the number of point clouds of the first point cloud data;
[0178] Generate fourth point cloud data according to the initial voxel value and the first point cloud data, and globally align the first point cloud data with the fourth point cloud data;
[0179] Determine whether the similarity between the first point cloud data and the fourth point cloud data is 1 according to the global registration result;
[0180] If not, the initial voxel value is updated using a greedy algorithm, and the step of generating the fourth point cloud data according to the initial voxel value is returned to be executed;
[0181] If so, the registration parameters are set according to the initial voxel values.
[0182] Based on the above embodiments, in a specific embodiment, the matching module 500 can be specifically used for:
[0183] Arrange each second feature in descending order of similarity;
[0184] The historical three-dimensional model corresponding to the second feature ranked in the top n in similarity is determined as the matching result of the three-dimensional model to be matched;
[0185] Wherein, n is a preset value.
[0186] Based on the above embodiments, in a specific embodiment, the matching module 500 can be specifically used for:
[0187] The historical three-dimensional model corresponding to the second feature whose similarity is greater than a preset threshold is determined as the matching result of the three-dimensional model to be matched.
[0188] An embodiment of the present invention provides an electronic device, including a processor and a memory, the memory is used to store at least one instruction, and when the instruction is loaded and executed by the processor, the above-mentioned three-dimensional model matching method is implemented. Its execution method and beneficial effects are similar and will not be repeated here.
[0189] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned three-dimensional model matching method is implemented. Its execution method and beneficial effects are similar and will not be repeated here.
[0190] It should be noted that although the above describes the various steps in a specific order, it does not mean that the various steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.
[0191] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A three-dimensional model matching method, characterized in that: include: The three-dimensional model to be matched is converted into first point cloud data containing key points of the three-dimensional model through preset software; Preprocessing the first point cloud data, and setting registration parameters according to the preprocessing result; Performing feature extraction on the first point cloud data to obtain a first feature of the first point cloud data; The first feature is respectively registered with each second feature in a preset feature library according to the registration parameter, and the similarity between each second feature and the first feature is determined according to the registration result; the second feature is a feature obtained after feature extraction of the second point cloud data corresponding to the historical three-dimensional model; The matching result of the to-be-matched three-dimensional model is determined according to the similarity between each of the second features and the first feature.
2. The method according to claim 1, characterized in that The step of respectively registering the first feature with each second feature in a preset feature library according to the registration parameters, and determining the similarity between each second feature and the first feature according to the registration result, comprises: Performing global registration on the first feature and each of the second features respectively to obtain a third feature corresponding to the second feature; the third feature is a feature obtained by applying a global registration transformation matrix to the first feature; The similarity between each group of the second feature and the third feature is determined as the similarity between the corresponding second feature and the first feature.
3. The method according to claim 2, characterized in that After globally registering the first feature with each of the second features to obtain a third feature corresponding to the second feature, the method further includes: Locally registering each of the third features with the corresponding second features respectively to obtain a fourth feature corresponding to the second feature; the fourth feature is a feature obtained by applying a local registration transformation matrix to the third feature; The similarity between each of the second features and the first feature is updated to the similarity between each corresponding group of the second features and the fourth feature.
4. The method according to claim 1, characterized in that: The step of respectively registering the first feature with each second feature in a preset feature library according to the registration parameters, and determining the similarity between each second feature and the first feature according to the registration result, comprises: Locally registering the first feature with each of the second features respectively to obtain a fifth feature corresponding to the second feature; the fifth feature is a feature obtained by applying a local registration transformation matrix to the first feature; The similarity between each group of the second feature and the fifth feature is determined as the similarity between the corresponding second feature and the first feature.
5. The method according to claim 1, characterized in that The step of preprocessing the first point cloud data and setting the registration parameters according to the preprocessing result includes: Preprocessing the first point cloud data to obtain third point cloud data; the point cloud density of the third point cloud data is within a preset density range; Calculating an initial voxel value according to the surface area and the number of point clouds of the third point cloud data, and performing coordinate transformation on the third point cloud data to obtain fourth point cloud data; Globally registering the third point cloud data with the fourth point cloud data according to the initial voxel value; Determine whether the similarity between the third point cloud data and the fourth point cloud data is 1 according to the global registration result; If not, the initial voxel value is updated by using a greedy algorithm, and the step of globally registering the third point cloud data with the fourth point cloud data according to the initial voxel value is returned to be executed; If so, the registration parameters are set according to the initial voxel values.
6. The method according to claim 1, characterized in that The step of determining the matching result of the to-be-matched three-dimensional model according to the similarity between each of the second features and the first feature comprises: Arrange each of the second features in descending order of the similarity; Determine the historical three-dimensional model corresponding to the second feature ranked in the top n in similarity as the matching result of the three-dimensional model to be matched; Wherein, n is a preset value.
7. The method according to claim 1, characterized in that The determining the matching result of the to-be-matched three-dimensional model according to the similarity includes: The historical three-dimensional model corresponding to the second feature whose similarity is greater than a preset threshold is determined as the matching result of the three-dimensional model to be matched.
8. A three-dimensional model matching device, characterized in that: include: A conversion module, used for converting the to-be-matched three-dimensional model into first point cloud data containing key points of the three-dimensional model through preset software; A setting module, used for preprocessing the first point cloud data and setting registration parameters according to the preprocessing results; A feature extraction module, used for performing feature extraction on the first point cloud data to obtain a first feature of the first point cloud data; A registration module, used to register the first feature with each second feature in a preset feature library according to the registration parameters, and determine the similarity between each second feature and the first feature according to the registration result; the second feature is a feature obtained after feature extraction of the second point cloud data corresponding to the historical three-dimensional model; A matching module is used to determine a matching result of the to-be-matched three-dimensional model according to a similarity between each of the second features and the first feature.
9. An electronic device, characterized in that: include: processor; Memory; A computer program is stored in the memory, and when the computer program is executed, the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Three-dimensional visual digital intelligent base platform based on multi-source data integration
CN120451455A
Similarity detection method of three-dimensional model and electronic equipment
CN121582613A
A similarity detection method of a three-dimensional model and an electronic device
CN121582613B