Equipment size measurement method based on point cloud, computer equipment and storage medium
By identifying and deleting outlier data points in laser point cloud data, and performing downsampling, registration and segmentation processing, key feature points are extracted, and the problems of poor accuracy and low efficiency of equipment size measurement in the prior art are solved, thereby achieving high accuracy and high efficiency of equipment size measurement.
Patent Information
- Application Number
- CN202411696037.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-11-25
AI Technical Summary
When measuring the size of existing laser point cloud technology, there are problems of poor accuracy and low efficiency, mainly due to the influence of noise and redundant information caused by environmental factors.
A point cloud-based device size measurement method is proposed, including identifying and deleting outlier data points in laser point cloud data, performing downsampling, registration and segmentation processing, extracting key feature points, and finally calculating the geometric dimensions of the device.
By removing noise and redundant information, data quality and processing efficiency are improved, the accuracy and consistency of device size measurement are enhanced, and the refined measurement of device geometry is achieved.
Smart Images

Figure CN119832051A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of equipment measurement, and in particular to a method for measuring equipment dimensions based on point cloud, a computer device, and a storage medium. Background Art
[0002] Power equipment, such as substation equipment, is an important part of the power system. The accurate measurement of its geometric dimensions is of great significance for equipment maintenance, overhaul, upgrade, and installation design of new equipment. With the rapid development of 3D scanning technology, especially the application of LiDAR scanning technology, new solutions are provided for equipment dimension measurement. LiDAR scanning equipment can quickly obtain point cloud data on the surface of the equipment. The point cloud data contains the geometric information of the equipment surface and can measure the geometric dimensions of the equipment.
[0003] However, during the point cloud data collection process, due to the influence of environmental factors (such as light, wind, equipment surface material, etc.), the collected point cloud data often contains a lot of noise and redundant information, which seriously affects the accuracy and efficiency of subsequent processing. Summary of the invention
[0004] Based on this, a device dimension measurement method based on point cloud, a computer device and a storage medium are proposed, aiming to solve the technical problems of poor accuracy and low efficiency of existing device dimension measurement based on laser point cloud technology.
[0005] A first aspect of the present application provides a device size measurement method based on point cloud, the method comprising:
[0006] Identify outlier data points in the laser point cloud data of the device under test;
[0007] Deleting all outlier data points from the laser point cloud data to obtain target point cloud data;
[0008] Downsampling the target point cloud data to obtain sampled point cloud data;
[0009] Performing registration processing on the sampled point cloud data to obtain registered point cloud data;
[0010] Segmenting the registered point cloud data;
[0011] Extract key feature points from the segmented point cloud data;
[0012] The geometric dimensions of the device under test are calculated according to the key feature points.
[0013] Optionally, before identifying outlier data points in the laser point cloud data of the device under test, the method further includes:
[0014] Acquire multi-angle laser point cloud data of the device to be tested;
[0015] Acquire common feature points in the multi-angle laser point cloud data;
[0016] The multi-angle laser point cloud data are fused based on the common feature points to obtain the laser point cloud data of the device to be tested.
[0017] Optionally, the identifying outlier data points in the laser point cloud data of the device under test includes:
[0018] For each data point in the laser point cloud data, determining a target neighborhood of the data point;
[0019] Obtaining the average distance between the data point and all data points in the corresponding target neighborhood;
[0020] Comparing the average distance with a preset average distance threshold to obtain a comparison result;
[0021] It is determined whether the corresponding data point is an outlier data point according to the average distance and a preset average distance threshold.
[0022] Optionally, downsampling the target point cloud data to obtain sampled point cloud data includes:
[0023] Initializing a three-dimensional voxel grid, wherein the size of the three-dimensional voxel grid is determined according to a preset downsampling resolution;
[0024] Traverse all data points in the target point cloud data and assign each traversed data point to a corresponding voxel grid:
[0025] For each voxel grid, one representative data point is retained;
[0026] All the retained representative data points are combined into new point cloud data to obtain sampled point cloud data.
[0027] Optionally, the performing registration processing on the sampled point cloud data to obtain the registered point cloud data includes:
[0028] Selecting a data point from the sampled point cloud data as a reference data point, and selecting data points in the sampled point cloud data other than the reference data point as data points to be registered;
[0029] The reference data point and each of the data points to be registered form a data point pair;
[0030] For each data point pair, initialize a transformation matrix;
[0031] Determine a target point pair set from the plurality of data point pairs;
[0032] An error function is calculated according to the target point pair set, wherein the error function represents the deviation between the data point to be registered and the reference data point after being transformed by the transformation matrix;
[0033] Iteratively updating the transformation matrix to minimize the error function;
[0034] When the iteration meets the preset iteration stop condition, the target transformation matrix is obtained;
[0035] The target transformation matrix is used to align the data points to be aligned.
[0036] Optionally, segmenting the registered point cloud data includes:
[0037] Selecting an unprocessed data point from the registered point cloud data as an initial seed point;
[0038] Traversing each neighboring point of the initial seed point, and calculating the spatial distance and normal direction difference between the neighboring point and the midpoint in the current region;
[0039] When the spatial distance and normal direction difference of the adjacent points are both less than a preset threshold, the adjacent points are added to the current area and marked as processed;
[0040] The neighboring points of the newly added point are traversed until no new neighboring points are added to the current area, and then the current area is segmented.
[0041] Optionally, extracting the key feature points from the segmented point cloud data includes:
[0042] The segmented point cloud data is standardized to obtain standardized point cloud data;
[0043] generating a covariance matrix based on the standardized point cloud data;
[0044] Calculating the eigenvalues and corresponding eigenvectors of the covariance matrix;
[0045] Select the first k largest eigenvalues from the eigenvalues;
[0046] Obtain the target eigenvectors corresponding to the first k largest eigenvalues;
[0047] The key feature points are obtained according to a preset mapping matrix and the target feature vector.
[0048] Optionally, the method further includes:
[0049] Based on the geometric dimensions and the key feature points, a three-dimensional model of the device under test is generated.
[0050] A second aspect of the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the point cloud-based device size measurement method when executing the computer program.
[0051] A third aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the point cloud-based device size measurement method are implemented.
[0052] This application first obtains purer and more accurate target point cloud data by identifying and deleting outlier data points in the laser point cloud data of the device to be tested. Deleting outlier data points effectively reduces noise and redundant information, improves data quality, and thus improves the accuracy of device geometric dimension measurement. Downsampling the target point cloud data reduces the number of data points, reduces the computational complexity of subsequent processing, and improves overall processing efficiency. The downsampled point cloud data is registered to unify point cloud data collected from different perspectives or at different times into the same coordinate system, which enhances the consistency and comparability of the data and provides an accurate benchmark for subsequent feature extraction and size calculation. The registered point cloud data is segmented, and key feature points are extracted based on the segmented point cloud data. Finally, based on the extracted key feature points, a refined measurement of the device geometry is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 It is a flow chart of the device dimension measurement method based on point cloud provided in an embodiment of the present application.
[0055] Figure 2 It is a functional module diagram of the device dimension measurement device based on point cloud provided in an embodiment of the present application.
[0056] Figure 3 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0058] Figure 1 A schematic flow chart of a point cloud-based device size measurement method provided in an embodiment of the present application. The point cloud-based device size measurement method includes the following steps.
[0059] S11, identifying outlier data points in the laser point cloud data of the device under test.
[0060] The device under test refers to a device or object that needs to be measured for geometric dimensions. In the context of laser scanning measurement, the device under test can be any object that needs to obtain three-dimensional shape, size or surface feature information, such as mechanical equipment, building structures, automotive parts, artworks, etc. In the application scenario of power facilities, the device under test can be power equipment, such as substation equipment.
[0061] Laser point cloud data is a collection of three-dimensional coordinate points obtained by scanning the surface of the device under test with a laser radar device. Laser point cloud data contains the shape, size and feature information of the surface of the device under test. Each point cloud contains three-dimensional coordinate (XYZ) information.
[0062] Since the shape and structure of the equipment are often complex, scanning at a single angle often cannot fully capture its features. Therefore, a high-precision and high-resolution laser radar scanning device can be used to perform an all-round scan of the equipment under test. The all-round scanning method can obtain point cloud data (multi-angle laser point cloud data) of the equipment under test at various angles, thereby more comprehensively understanding the shape and structure of the equipment under test.
[0063] In an optional embodiment, for multi-angle laser point cloud data, a feature matching-based algorithm can be used to fuse point cloud data acquired at different angles into a complete point cloud data set. Specifically, common feature points in the multi-angle laser point cloud data can be obtained, and the multi-angle laser point cloud data can be fused based on the common feature points to obtain the laser point cloud data of the device under test.
[0064] In an optional embodiment, feature points, such as corner points, edge points, etc., are extracted from the point cloud data at each angle using a feature point extraction algorithm (such as SURF, SIFT, etc.). These feature points have the characteristics of being easy to identify and match in data at different angles. For feature points in point cloud data at different angles, the distance or similarity between the feature points is calculated, and matching feature points are found from the extracted feature points based on the distance or similarity. The matching feature points are the common feature points. Based on the common feature points, the transformation matrix that converts the point cloud data at different angles to a unified coordinate system is calculated to ensure that data at different angles can be accurately spliced together. The point cloud data at different angles is converted to a unified coordinate system using a transformation matrix to ensure that the point cloud data at all angles are in the same coordinate system, which provides a basis for subsequent data fusion. In a unified coordinate system, the point cloud data at different angles are fused.
[0065] After obtaining the laser point cloud data of the device under test, it is necessary to identify the outlier data points in the laser point cloud data. Outlier data points refer to those points that are significantly different from the majority of the point cloud data in terms of spatial position, reflection intensity or distribution characteristics. These points may be caused by noise, equipment errors, environmental interference or abnormal characteristics of the device under test itself. By identifying and removing outlier data points, the quality of the point cloud data can be improved. In addition, the presence of outlier data points may affect the visualization of the point cloud data, causing unevenness and fractures on the model surface. By removing outlier data points, the visualization of the point cloud data can be optimized, making the model smoother and more continuous, and improving the readability and aesthetics of the model.
[0066] In an optional embodiment, the identifying outlier data points in the laser point cloud data of the device under test includes:
[0067] For each data point in the laser point cloud data, determining a target neighborhood of the data point;
[0068] Obtaining the average distance between the data point and all data points in the corresponding target neighborhood;
[0069] Comparing the average distance with a preset average distance threshold to obtain a comparison result;
[0070] It is determined whether the corresponding data point is an outlier data point according to the average distance and a preset average distance threshold.
[0071] For each data point P in the laser point cloud data, a target area needs to be determined. The target area is composed of the K nearest neighbor points around the data point P. The value of K can be selected according to the density and noise level of the point cloud data. The purpose of determining the neighborhood is to analyze the relationship between the data point and its surrounding data points, so as to determine whether the data point is an outlier data point.
[0072] After determining the target neighborhood of each data point, the distance between the data point P and all the data points in its target neighborhood is calculated to obtain the average distance d. The average distance reflects the closeness of the data point with its surrounding data points. If the average distance is large, it means that the data point is far away from the data points in its neighborhood and may be an outlier data point.
[0073] After calculating the average distance corresponding to each data point, each average distance needs to be compared with a preset average distance threshold. The average distance threshold is usually determined based on the overall distribution characteristics of the point cloud data. It can be the median of the average distance corresponding to all data points plus or minus a certain standard deviation, or it can be obtained by other methods. The purpose of the comparison is to determine whether the average distance corresponding to the data point exceeds the normal range, so as to determine whether the data point is an outlier data point.
[0074] Finally, based on the comparison results, it can be determined whether each data point is an outlier data point. If the average distance corresponding to a data point exceeds the preset average distance threshold, then the data point is considered to be an outlier data point and needs to be removed from the point cloud data. If the average distance corresponding to a data point is within the preset average distance threshold, then the data point can be considered to be a normal data point and needs to be retained in the point cloud data.
[0075] In an optional embodiment, the median μ and standard deviation σ of the average distance corresponding to all data points can be calculated to determine whether the average distance d corresponding to the data point P satisfies the condition |d-μ|>λ*σ, where λ is a constant (e.g., 2 or 3) for controlling the sensitivity of identifying outlier data points. Using the median μ and standard deviation σ as statistical benchmarks, the characteristics of different data sets can be automatically adapted. Whether it is the density, distribution pattern or noise level of data points, the calculated μ and σ can be adaptively adjusted to ensure the accuracy and robustness of outlier data point identification. By introducing the constant λ, the sensitivity of outlier data point identification can be flexibly controlled. The larger the value of λ, the wider the range of outlier data points identified, and the lower the tolerance for noise and outliers; conversely, the smaller the value of λ, the narrower the range of outlier data points identified, and the higher the tolerance for noise and outliers. This method is based on statistical judgments and does not require complex iterative calculations or optimization processes. It is only necessary to calculate the median μ and standard deviation σ once, and then perform a single comparison of the average distance of each data point.
[0076] The above optional implementation method can accurately identify which data points are outlier data points by determining the target neighborhood for each data point, calculating the average distance between the data points and the neighborhood, and then comparing it with the preset average distance threshold. This judgment based on the spatial relationship between data points can effectively remove noise and abnormal points in point cloud data and improve the accuracy of data processing. By identifying and removing outlier data points in advance, the amount of calculation can be reduced and the processing efficiency can be improved. Especially for large-scale point cloud data, the processing time can be significantly shortened and the overall work efficiency can be improved.
[0077] S12, deleting all outlier data points from the laser point cloud data to obtain target point cloud data.
[0078] After deleting all outlier data points from the laser point cloud data, the target point cloud data is obtained. After deleting outlier data points, the noise and outliers in the point cloud data are effectively removed, and the data quality is improved. The target point cloud data is smoother and more continuous, and can better reflect the true shape and structure of the device under test.
[0079] S13, downsampling the target point cloud data to obtain sampled point cloud data.
[0080] The target point cloud data usually contains a large number of data points, which will lead to huge computational complexity and slow processing speed for subsequent processing (such as dimension measurement, 3D reconstruction, object recognition, path planning, etc.). By downsampling the target point cloud data, the number of data points can be significantly reduced, thereby reducing computational complexity and improving processing efficiency. Reducing the number of data points can also effectively reduce storage requirements and save storage space.
[0081] In an optional implementation, downsampling the target point cloud data to obtain sampled point cloud data includes:
[0082] Initializing a three-dimensional voxel grid, wherein the size of the three-dimensional voxel grid is determined according to a preset downsampling resolution;
[0083] Traverse all data points in the target point cloud data and assign each traversed data point to a corresponding voxel grid:
[0084] For each voxel grid, one representative data point is retained;
[0085] All the retained representative data points are combined into new point cloud data to obtain sampled point cloud data.
[0086] The size of the 3D voxel grid, i.e. the size of each voxel, is determined by the preset downsampling resolution. The downsampling resolution determines the degree of downsampling. A higher resolution means that each voxel is smaller and more point cloud data details are retained; a lower resolution means that the voxels are larger and the point cloud data retained is sparser.
[0087] Map the target point cloud data to a three-dimensional voxel grid. Specifically, traverse all data points of the target point cloud data, and assign the data points to the corresponding three-dimensional voxel grid according to the coordinates of each data point, ensuring that the data points can be aggregated and representative data points can be selected based on the voxel grid.
[0088] For each voxel grid containing data points, select a data point as a representative data point, which is used to represent all the data points in the voxel grid. The representative data point can be the centroid (average) of all the data points in the voxel grid, or the data point closest to the center of the voxel grid. The purpose of selecting representative data points is to preserve the overall shape and key features of the point cloud data as much as possible while reducing the number of data points.
[0089] Collect the representative data points in all voxel grids to form new point cloud data, which is the sampled point cloud data after downsampling.
[0090] In the above optional implementation, a large number of data points in the target point cloud data are effectively compressed into one representative data point in each voxel grid by downsampling the voxel grid, thereby significantly reducing the number of data points. The reduction of data points directly reduces the computational complexity of subsequent processing and improves the processing speed. Although the number of data points is reduced, the overall shape and key feature information of the point cloud can be preserved by reasonably selecting representative data points.
[0091] S14, performing registration processing on the sampled point cloud data to obtain registered point cloud data.
[0092] In the process of fusing multi-angle point cloud data, although the coordinates have been unified, downsampling is performed after fusion. In the process of downsampling, due to factors such as the way to select representative data points and the size of the voxel grid, certain errors or deformations may be introduced. These errors may cause inconsistencies in local areas of the point cloud data that have already unified coordinates. By registering the sampled point cloud data, the consistency of the sampled point cloud data in the global range can be further ensured, the error impact caused by downsampling can be reduced, and the integrity and consistency of the data can be ensured.
[0093] In an optional implementation, the performing registration processing on the sampled point cloud data to obtain the registered point cloud data includes:
[0094] Selecting a data point from the sampled point cloud data as a reference data point, and selecting data points in the sampled point cloud data other than the reference data point as data points to be registered;
[0095] The reference data point and each of the data points to be registered form a data point pair;
[0096] For each data point pair, initialize a transformation matrix;
[0097] Determine a target point pair set from the plurality of data point pairs;
[0098] An error function is calculated according to the target point pair set, wherein the error function represents the deviation between the data point to be registered and the reference data point after being transformed by the transformation matrix;
[0099] Iteratively updating the transformation matrix to minimize the error function;
[0100] When the iteration meets the preset iteration stop condition, the target transformation matrix is obtained;
[0101] The target transformation matrix is used to align the data points to be aligned.
[0102] A data point is selected from the sampled point cloud data as the reference data point (reference point cloud), and all data points in the sampled point cloud data except the reference point cloud are used as the data points to be registered (point cloud to be registered). The reference point cloud will serve as a fixed reference in the subsequent registration process.
[0103] The selected reference data point and each data point to be registered form a data point pair. The number of data point pairs is the same as the number of data points to be registered. For each data point pair, the transformation matrix is initialized to the unit matrix, that is, it is assumed that the point cloud to be registered and the reference point cloud completely overlap at the beginning. In the subsequent iteration process, the transformation matrix will be updated to minimize the error.
[0104] Find the closest point pair between the reference point cloud and the point cloud to be registered to form a target point pair set. In order to speed up the matching process, a data structure such as a KD tree can be used for nearest neighbor search.
[0105] The error function is calculated based on the target point pair set. The error function is usually expressed as the sum of the squares of the distances between the point cloud to be registered and the reference point cloud after transformation.
[0106] The least squares optimization algorithm is used to iteratively update the transformation matrix (including the rotation matrix and the translation vector) to minimize the error function. After each iteration, the point cloud to be registered is transformed according to the new transformation matrix.
[0107] When the error function converges below a preset threshold or reaches a preset number of iterations, the iteration is stopped to obtain the final transformation matrix, that is, the target transformation matrix.
[0108] The final transformation matrix is applied to transform the point cloud to be registered so that it is aligned with the reference point cloud. This process continues until all the point clouds to be registered are registered with the reference point cloud, and complete point cloud data in a unified coordinate system is obtained.
[0109] In the above optional implementation, by selecting a reference data point and taking other data points as data points to be registered, and registering with the reference data points to form data point pairs, the relative position relationship between each data point to be registered and the reference data point can be accurately calculated. By iteratively updating the transformation matrix to minimize the error function, the accuracy of the registration result can be ensured. By determining a set of target point pairs from multiple data point pairs, and calculating the error function based on the target point pairs in the target point pair set, the influence of noise and abnormal points on the registration results can be reduced, thereby improving the robustness of the registration process. And because any data point can be selected as a reference data point, and the iteration stop condition can be adjusted as needed, it has high flexibility and can adapt to point cloud registration tasks of different scenarios and requirements.
[0110] S15, segmenting the registered point cloud data.
[0111] Segmenting the registered point cloud data means cutting the registered point cloud data set as a whole into multiple parts or subsets according to a certain rule or algorithm. The registered point cloud data can be segmented using an automated point cloud segmentation algorithm based on region growing. The automated point cloud segmentation algorithm based on region growing will decide how to cut the point cloud into different parts based on the local geometric features of the point cloud data, such as normal vectors, curvature, etc.
[0112] Different parts of a device may have different geometric features and properties. Segmentation allows for specific feature extraction for each part, which can more accurately describe and represent the various components of the device under test, providing an accurate basis for subsequent feature extraction and size calculations. In addition, for large or complex point cloud data, direct overall processing may be very time-consuming and computationally intensive. Segmentation allows point cloud data to be broken down into smaller, more easily processed parts without having to operate on the entire point cloud data, thereby improving processing efficiency.
[0113] In a specific implementation, segmenting the registered point cloud data includes:
[0114] Selecting an unprocessed data point from the registered point cloud data as an initial seed point;
[0115] Traversing each neighboring point of the initial seed point, and calculating the spatial distance and normal direction difference between the neighboring point and the midpoint in the current region;
[0116] When the spatial distance and normal direction difference of the adjacent points are both less than a preset threshold, the adjacent points are added to the current area and marked as processed;
[0117] The neighboring points of the newly added point are traversed until no new neighboring points are added to the current area, and then the current area is segmented.
[0118] An unprocessed data point can be selected randomly or according to a certain strategy from the registered point cloud data as the initial seed point. Initialize a new empty area to store the points belonging to the area. With the initial seed point as the center, traverse its neighboring points (usually the neighboring relationship is determined based on the spatial distance). For each neighboring point, calculate the spatial distance and normal direction difference between it and the point in the current area. If the spatial distance and normal direction difference of the neighboring point are both less than the preset threshold, the neighboring point is added to the current area to achieve regional growth and marked as processed. Continue to traverse and judge the neighboring points with the newly added point as the center. When there are no new neighboring points that can be added to the current area (that is, all neighboring points do not meet the joining conditions or have been processed), the regional growth process terminates. Mark the current area as an independent device part and store relevant information.
[0119] Find the next unprocessed data point in the registered point cloud data as a new seed point. Repeat the above region growth and termination process until all data points in the registered point cloud data have been processed, that is, each data point belongs to a certain device part.
[0120] The segmented equipment parts are further processed, such as removing noise and smoothing boundaries, to improve the accuracy of segmentation. The segmentation results are visualized or stored in a specific file format as needed. Through the above steps, the registered point cloud data is effectively segmented into multiple regions representing different equipment parts, providing an accurate basis for subsequent feature extraction, geometric dimension calculation, and further measurement and modeling work.
[0121] Existing automated point cloud segmentation algorithms often have difficulty accurately segmenting each device part when facing substation equipment with complex shapes and similar structures, resulting in deviations in subsequent processing. However, the present application proposes that an unprocessed data point can be selected randomly or according to a certain strategy as an initial seed point. This flexibility allows the algorithm to better select the starting point in complex scenes and avoid segmentation deviations caused by improper selection of initial seed points. In the process of regional growth, the present application not only considers the spatial distance between adjacent points, but also introduces the normal direction difference as a basis for judgment. This comprehensive evaluation method can more accurately reflect the local geometric feature similarity between data points, thereby effectively distinguishing different parts in equipment with complex shapes and similar structures. In order to adapt to equipment of different shapes and structures, the thresholds of spatial distance and normal direction difference can be automatically adjusted according to the local features of the point cloud or the segmentation progress to further improve the accuracy of segmentation. The present application emphasizes the traversal and judgment of adjacent points with the newly added point as the center. This meticulous traversal method can ensure that each point is fully considered to avoid omission or incorrect segmentation. By continuously searching for the next unprocessed data point as a new seed point and repeating the region growing and termination process, the present application ensures that each point in the point cloud data is correctly classified into a certain device part, thereby achieving comprehensive segmentation.
[0122] S16, extracting key feature points from the segmented point cloud data.
[0123] Extract the boundary and geometric feature points of the device under test from the segmented point cloud data. The segmented point cloud data can be processed using an edge detection algorithm. The edge detection algorithm can identify the edge contour of the surface of the device under test, that is, the boundary line of the shape of the device under test. The boundary line helps to understand the overall shape and contour of the device under test.
[0124] According to the shape characteristics of the device under test, representative key feature points are identified. Key feature points can include vertices (such as the highest or lowest point of the device under test), inflection points (such as points where the shape of the device under test changes significantly), intersections (such as the intersection of different device parts or components), etc. Geometric feature points can more accurately describe the shape and structure of the device under test.
[0125] By extracting boundaries and geometric feature points, the key shape information of the device under test can be obtained from the segmented point cloud data, providing accurate basic data for subsequent processing and analysis. These feature points not only help to understand the overall structure and shape of the device, but also provide important reference for subsequent dimensional measurement, 3D modeling, motion simulation and other tasks.
[0126] In an optional implementation, extracting key feature points of the device under test from the segmented point cloud data includes:
[0127] The segmented point cloud data is standardized to obtain standardized point cloud data;
[0128] generating a covariance matrix based on the standardized point cloud data;
[0129] Calculating the eigenvalues and corresponding eigenvectors of the covariance matrix;
[0130] Select the first k largest eigenvalues from the eigenvalues;
[0131] Obtain the target eigenvectors corresponding to the first k largest eigenvalues;
[0132] The key feature points of the device under test are obtained according to the preset mapping matrix and the target feature vector.
[0133] The segmented point cloud data is standardized to eliminate the dimensional differences between different dimensions (such as X, Y, Z coordinates, etc.) so that the data are comparable.
[0134] The covariance matrix is a matrix that describes the correlation between the dimensions of the data and reflects the spatial relationship between the data points in the point cloud data.
[0135] The eigenvalues represent the size of the variance of the data in various directions, while the eigenvectors indicate these directions. By calculating the eigenvalues and eigenvectors, the most important directions (i.e., directions with the largest variance) in the data can be identified, which correspond to the main features of the data.
[0136] The most important k features are selected based on the size of the eigenvalue. The larger the eigenvalue, the more dramatic the data change in the direction represented by the corresponding eigenvector, that is, the more information it contains. By selecting the first k largest eigenvalues, the most critical information in the data can be retained, while removing noise and redundant information to achieve data dimensionality reduction.
[0137] Get the eigenvectors corresponding to the selected top k largest eigenvalues. These eigenvectors constitute the basis vectors of the data in the new feature space. The target eigenvector is the basis of the new coordinate system after the data dimension reduction, which defines how the data is represented in the new space.
[0138] The mapping matrix W is usually composed of selected target feature vectors and is used to map the original d-dimensional data into a new k-dimensional feature space. Through the mapping of the mapping matrix, the representation of the device under test in the feature space after dimensionality reduction, namely the key feature points, can be obtained. It not only achieves data dimensionality reduction and retains key feature information, but also helps to reduce the amount of calculation for subsequent processing while improving the accuracy and efficiency of processing. As a representation of data after dimensionality reduction, the key feature points provide a more compact and efficient data representation for subsequent size calculation and model construction.
[0139] The above optional implementation method can eliminate noise and outliers in the data and improve the quality and consistency of the data by standardizing the segmented point cloud data. The covariance matrix generated based on the standardized point cloud data can capture the relationship between different feature points in the data set, which helps to extract key feature points more accurately. By calculating the eigenvalues and corresponding eigenvectors of the covariance matrix and selecting the top k largest eigenvalues, effective screening and optimization of feature points can be achieved, which helps to extract the most representative and discriminative feature points, thereby improving the efficiency and accuracy of feature extraction. The key feature points of the device under test are obtained using the preset mapping matrix and target eigenvectors, which enhances the flexibility and controllability of feature extraction.
[0140] S17, calculating the geometric dimensions of the device under test according to the key feature points.
[0141] After obtaining multiple key feature points, the geometric dimensions of the device under test can be calculated according to the three-dimensional coordinates of the multiple key feature points.
[0142] In an optional implementation, calculating the geometric dimensions of the device under test according to the key feature points includes:
[0143] Obtaining the three-dimensional coordinates of the key feature point, the three-dimensional coordinates including an X coordinate, a Y coordinate, and a Z coordinate;
[0144] Obtaining the maximum X coordinate among the multiple X coordinates;
[0145] Obtaining the maximum Y coordinate among the multiple Y coordinates;
[0146] Obtaining the maximum Z coordinate among the plurality of Z coordinates;
[0147] The geometric size of the device under test is calculated according to the maximum X coordinate, the maximum Y coordinate and the maximum Z coordinate.
[0148] Since the point cloud data includes three-dimensional coordinates, the coordinates of each key feature point in three-dimensional space can be obtained. These coordinates are composed of three components: X, Y, and Z, which represent the horizontal coordinate, vertical coordinate, and vertical coordinate in three-dimensional space respectively.
[0149] After obtaining the X coordinates of all key feature points, you need to find the maximum value among these X coordinates. This maximum X coordinate usually represents the maximum size of the device under test in the X direction (usually the length direction). Similarly, you need to find the maximum value among all Y coordinates, which represents the maximum size of the device under test in the Y direction (usually the width direction). Find the maximum value among all Z coordinates, which represents the maximum size of the device under test in the Z direction (usually the height direction).
[0150] For a device under test with a regular shape (such as a cuboid, cylinder, etc.), the key feature points are usually boundary points or corner points of the device under test, and the volume of the device under test can be directly calculated based on the height, width and length of the device under test.
[0151] For irregularly shaped devices, since the length, width, and height cannot be directly obtained through simple distance calculation, it is necessary to use integration or fitting algorithms to approximate the geometric dimensions of the device under test. The integration method can obtain approximate dimensions by mathematically integrating the surface or volume of the device under test. The fitting algorithm finds a set of parameters that best describe the shape of the device under test (such as the major axis and minor axis of the ellipsoid), and then calculates the dimensions based on these parameters.
[0152] In an optional embodiment, the method further comprises:
[0153] Based on the geometric dimensions and the key feature points, a three-dimensional model of the device under test is generated.
[0154] A three-dimensional model of the device under test can be generated based on the calculated geometric dimensions and key feature points by using modeling techniques such as triangular meshes or (Non-Uniform Rational B-Splines, NURBS).
[0155] In an optional implementation, generating the three-dimensional model of the device under test based on the geometric dimensions and the key feature points includes:
[0156] Creating a basic geometric body in a three-dimensional modeling software according to the geometric dimensions;
[0157] Adjusting the basic geometric body according to the actual size of the device to be tested to obtain a target geometric body;
[0158] Mapping the key feature points to the target geometric body, and adding detail structures to the target geometric body to obtain a basic model;
[0159] Smoothing the surface of the base model;
[0160] The three-dimensional model of the device under test is generated based on the smoothed basic model.
[0161] According to the obtained geometric dimension data of the device to be tested (such as length, width, height, radius, etc.), create corresponding basic geometric shapes such as cuboids, cylinders, cones, etc. in 3D modeling software (such as AutoCAD, SolidWorks, 3ds Max, etc.). Creating basic geometric bodies provides a basic framework for subsequent modeling work, so that model construction has a clear starting point and reference.
[0162] Using matrix transformation algorithms in linear algebra (such as translation, rotation, scaling, etc.), the initially created basic geometric bodies are precisely adjusted to match their size, position, and orientation with the actual size and position of the device under test, providing an accurate benchmark for the subsequent addition of details and complex structures.
[0163] The key feature points (such as edge points, intersection points, extreme points, etc.) of the identified and recorded device surface are mapped to the adjusted target geometry as accurate reference points for adding details and complex structures. Then, based on the position, curvature and direction information of the key feature points, detailed structures such as flanges, protrusions, grooves and cables are added one by one to the target geometry, making the model more refined and realistic, and able to accurately reflect the actual shape and detailed features of the device under test.
[0164] The surface of the basic model with detailed structure added is smoothed to eliminate unnecessary edges and protrusions, making the model surface smoother and more natural. Based on the smoothed basic model, appropriate texture and color information is added to the model according to the actual material and appearance characteristics of the device under test to further enhance the realism of the model. Finally, the constructed equipment components and details are accurately assembled according to the actual structure of the device under test to form a complete three-dimensional model of the device under test, thus completing the final construction of the model.
[0165] In an optional embodiment, the calculated geometric dimensions and the generated three-dimensional model can be output in a standard format. Standard formats may include, but are not limited to: STL (stereolithography file format), OBJ (object file format), PLY (polygonal file format), IGES (initialized graphics exchange specification) and STEP (product model data exchange standard), etc. Users can choose the appropriate format for output and saving according to actual needs. For example, for models that need to be 3D printed, the STL format may be more suitable; for scenarios that require collaborative design in multiple CAD systems, IGES or STEP formats are more advantageous. In the daily operation and maintenance of the power industry, outputting the geometric dimensions of the equipment to be tested not only helps with the maintenance, overhaul and upgrading of the equipment, but also provides strong support for the installation design of new equipment.
[0166] In an optional embodiment, after obtaining the geometric dimensions of the device to be tested, the measured geometric dimensions can be compared with the actual dimensions or design dimensions of the device to be tested one by one in an automated manner to determine whether there is a deviation or error. If the deviation is within an acceptable range, it indicates that the measured geometric dimensions are accurate and reliable, that is, the currently used measurement method is accurate and reliable; if the deviation is large, the currently used measurement method needs to be further optimized and adjusted.
[0167] Figure 2 It is a functional module diagram of the device dimension measurement device based on point cloud provided in an embodiment of the present application.
[0168] In some embodiments, the device size measurement apparatus based on point cloud 20 may include a plurality of functional modules composed of program code segments. The program code of each program segment in the device size measurement apparatus based on point cloud 20 may be stored in a memory of a computer device and executed by at least one processor to perform (see Figure 1 Description) Function of measuring device dimensions based on point cloud.
[0169] In this embodiment, the device size measurement apparatus 20 based on point cloud can be divided into multiple functional modules according to the functions it performs. The functional modules may include: an identification module 201, a deletion module 202, a sampling module 203, a registration module 204, a segmentation module 205, an extraction module 206, a calculation module 207 and a generation module 208. The module referred to in this application refers to a series of computer-readable instruction segments that can be executed by at least one processor and can complete a fixed function, which is stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0170] The identification module 201 is used to identify outlier data points in the laser point cloud data of the device under test.
[0171] The deleting module 202 is used to delete all outlier data points from the laser point cloud data to obtain target point cloud data.
[0172] The sampling module 203 is used to perform downsampling processing on the target point cloud data to obtain sampling point cloud data.
[0173] The registration module 204 is used to perform registration processing on the sampled point cloud data to obtain registered point cloud data.
[0174] The segmentation module 205 is used to segment the registered point cloud data.
[0175] The extraction module 206 is used to extract key feature points from the segmented point cloud data.
[0176] The calculation module 207 is used to calculate the geometric dimensions of the device under test according to the key feature points.
[0177] The generating module 208 is used to generate a three-dimensional model of the device under test based on the geometric dimensions and the key feature points.
[0178] It should be understood that the various variations and specific embodiments of the point cloud-based device dimension measurement method provided in the above-mentioned embodiments are also applicable to the point cloud-based device dimension measurement device in the present embodiment. Through the detailed description of the aforementioned point cloud-based device dimension measurement method, those skilled in the art can clearly understand the implementation process of the point cloud-based device dimension measurement device in the present embodiment. For the sake of brevity of the specification, it will not be described in detail here.
[0179] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, all or part of the steps of the device size measurement method based on point cloud are implemented.
[0180] See also Figure 3 FIG. 2 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. In a preferred embodiment of the present application, the computer device 3 includes a memory 301 , at least one processor 302 , and at least one communication bus 303 .
[0181] Those skilled in the art should understand that Figure 3 The structure of the computer device shown does not constitute a limitation of the embodiments of the present application. The computer device 3 may also include more or less other hardware or software than shown in the figure, or a different arrangement of components.
[0182] In some embodiments, the computer device 3 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits, programmable gate arrays, digital processors, and embedded devices. The computer device 3 may also include client devices, which include but are not limited to any electronic product that can interact with the client through a keyboard, mouse, remote control, touchpad, or voice control device, such as a personal computer, tablet computer, smart phone, digital camera, etc.
[0183] It should be noted that the computer device 3 is only an example, and other existing or future electronic products that are suitable for the present application should also be included in the protection scope of the present application and included here by reference.
[0184] In some embodiments, the memory 301 stores a computer program, and when the computer program is executed by the at least one processor 302, all or part of the steps in the device size measurement method based on point cloud are implemented. The memory 301 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data. Further, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, and the like.
[0185] In some embodiments, the at least one processor 302 is the control core (CrolUnit) of the computer device 3, and uses various interfaces and lines to connect the various components of the entire computer device 3, and executes various functions and processes data of the computer device 3 by running or executing the program or module stored in the memory 301, and calling the data stored in the memory 301. For example, when the at least one processor 302 executes the computer program stored in the memory, it implements all or part of the steps of the device size measurement method based on point cloud described in the embodiment of the present application; or implements all or part of the functions of the device size measurement device based on point cloud. The at least one processor 302 can be composed of an integrated circuit, for example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple integrated circuits with the same function or different functions, including one or more central processing units (CPU), microprocessors, digital processing chips, graphics processors, and various control chips.
[0186] In some embodiments, the at least one communication bus 303 is configured to realize connection and communication between the memory 301 and the at least one processor 302, etc. Although not shown, the computer device 3 may also include a power supply (such as a battery) for powering each component. Preferably, the power supply may be logically connected to the at least one processor 302 through a power management device, so as to realize functions such as management of charging, discharging, and power consumption management through the power management device. The power supply may also include any components such as one or more DC or AC power supplies, recharging power supply fault detection circuits, power converters or inverters, power status indicators, etc. The computer device 3 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0187] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to execute part of the method described in each embodiment of the present application.
[0188] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0189] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Claims
1. A device size measurement method based on point cloud, characterized in that: The device size measurement method based on point cloud includes: Identify outlier data points in the laser point cloud data of the device under test; Deleting all outlier data points from the laser point cloud data to obtain target point cloud data; Downsampling the target point cloud data to obtain sampled point cloud data; Performing registration processing on the sampled point cloud data to obtain registered point cloud data; Segmenting the registered point cloud data; Extract key feature points from the segmented point cloud data; The geometric dimensions of the device under test are calculated according to the key feature points.
2. The device size measurement method based on point cloud according to claim 1, characterized in that: Before identifying outlier data points in the laser point cloud data of the device under test, the method further includes: Acquire multi-angle laser point cloud data of the device to be tested; Acquire common feature points in the multi-angle laser point cloud data; The multi-angle laser point cloud data are fused based on the common feature points to obtain the laser point cloud data of the device to be tested.
3. The device size measurement method based on point cloud according to claim 1, characterized in that: The method of identifying outlier data points in the laser point cloud data of the device under test comprises: For each data point in the laser point cloud data, determining a target neighborhood of the data point; Obtaining the average distance between the data point and all data points in the corresponding target neighborhood; It is determined whether the corresponding data point is an outlier data point according to the average distance and a preset average distance threshold.
4. The device size measurement method based on point cloud according to claim 1, characterized in that: The downsampling of the target point cloud data to obtain the sampled point cloud data comprises: Initializing a three-dimensional voxel grid, wherein the size of the three-dimensional voxel grid is determined according to a preset downsampling resolution; Traverse all data points in the target point cloud data and assign each traversed data point to a corresponding voxel grid: For each voxel grid, one representative data point is retained; All the retained representative data points are combined into new point cloud data to obtain sampled point cloud data.
5. The device size measurement method based on point cloud according to claim 1, characterized in that: The performing registration processing on the sampled point cloud data to obtain the registered point cloud data comprises: Selecting a data point from the sampled point cloud data as a reference data point, and selecting data points in the sampled point cloud data other than the reference data point as data points to be registered; The reference data point and each of the to-be-registered data points form a data point pair; For each data point pair, initialize a transformation matrix; Determine a target point pair set from the plurality of data point pairs; An error function is calculated based on the target point pair set, wherein the error function represents the deviation between the data point to be registered and the reference data point after being transformed by the transformation matrix; Iteratively updating the transformation matrix to minimize the error function; When the iteration meets the preset iteration stop condition, the target transformation matrix is obtained; The target transformation matrix is used to align the data points to be aligned.
6. The device size measurement method based on point cloud according to claim 1, characterized in that: The segmenting of the registered point cloud data comprises: Selecting an unprocessed data point from the registered point cloud data as an initial seed point; Traversing each neighboring point of the initial seed point, and calculating the spatial distance and normal direction difference between the neighboring point and the midpoint in the current region; When the spatial distance and normal direction difference of the adjacent points are both less than a preset threshold, the adjacent points are added to the current area and marked as processed; The neighboring points of the newly added point are traversed until no new neighboring points are added to the current area, and then the current area is segmented.
7. The device size measurement method based on point cloud according to claim 1, characterized in that: The extracting the key feature points from the segmented point cloud data comprises: The segmented point cloud data is standardized to obtain standardized point cloud data; generating a covariance matrix based on the standardized point cloud data; Calculating the eigenvalues and corresponding eigenvectors of the covariance matrix; Select the first k largest eigenvalues from the eigenvalues; Obtain the target eigenvectors corresponding to the first k largest eigenvalues; The key feature points are obtained according to a preset mapping matrix and the target feature vector.
8. The device size measurement method based on point cloud according to claim 1, characterized in that: The method further comprises: Based on the geometric dimensions and the key feature points, a three-dimensional model of the device under test is generated.
9. A computer device, characterized in that: The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the device size measurement method based on point cloud as claimed in any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the device size measurement method based on point cloud as claimed in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Camera-based size measurement method and device, equipment and storage medium
CN113379829A
Object three-dimensional size measurement method based on lidar
CN118274755A
Point cloud matching method and system based on derivative-free optimization
CN118314180A
Automatic detection method of conductor height and pull-out value of overhead line system based on vehicle-mounted mobile laser point cloud
WO2023019709A1