Three-dimensional boundary extraction method and system for parts based on feature interval segmentation projection
Patent Information
- Application Number
- CN202610962505.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-09-25
AI Technical Summary
[0005]本发明提出了基于特征区间分割投影的零部件三维边界提取方法及系统,旨在解决现有技术中存在的针对复杂零部件因特征强度渐变与结构自遮挡导致的三维边界提取不完整的技术问题
(1)通过曲率引导的轻量级多层感知机自适应分割特征高度区间,有效克服了特征强度渐变和结构自遮挡造成的边界断裂问题,显著提升了边界提取的完整性。
Smart Images

Figure CN122820754A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D point cloud processing and reverse engineering technology, and in particular to a method and system for extracting 3D boundaries of components based on feature interval segmentation projection. Background Technology
[0002] 3D boundary extraction of complex components is a key technology for reverse engineering and part repair. The integrity of the boundary directly affects the quality of surface reconstruction and the accuracy of toolpath planning. Point clouds, as discrete samples of the 3D spatial structure of an object's surface, can accurately describe the geometry of components and serve as the foundational data for boundary extraction. However, in industrial practice, due to the self-occlusion of component structures and gradual changes in feature intensity, traditional extraction methods are prone to feature line breaks or missing lines, making it difficult to meet the requirements for high-integrity extraction of complex surfaces.
[0003] Existing 3D boundary extraction methods can be mainly divided into three categories: geometric feature-driven methods, deep learning-driven methods, and geometry-image fusion methods. Geometric methods based on local differential properties such as curvature and normal vectors have high computational efficiency, but they struggle to balance sensitivity and stability in environments with gradual feature changes and industrial noise. While deep learning methods improve the continuity and noise resistance of edge detection, their high parameter cost limits their real-time deployment in lightweight industrial settings. Geometry-image fusion methods improve extraction efficiency in structured scenes through spatial projection of 2D manifolds; however, projection distortion and mapping loss still limit their adaptability when dealing with complex free-form surfaces and gradually changing features.
[0004] Therefore, how to overcome the problem of incomplete boundary extraction caused by feature intensity gradient and structural self-occlusion, while maintaining low computational resource consumption, is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0005] This invention proposes a method and system for extracting the three-dimensional boundaries of components based on feature interval segmentation projection, aiming to solve the technical problem of incomplete three-dimensional boundary extraction of complex components caused by gradual changes in feature intensity and structural self-occlusion in the prior art.
[0006] In a first aspect, the present invention provides a method for extracting the three-dimensional boundaries of components based on feature interval segmentation projection, comprising the following steps: S1, acquire the 3D point cloud data of the parts, calculate the curvature of each point and perform normalization processing; S2, using the three-dimensional coordinates and normalized curvature of the points as input features, uses a pre-trained lightweight multilayer perceptron model to predict the change curve of the number of feature points in the entire point cloud along the projection axis direction coordinate, and determines at least one feature height interval based on the change curve, wherein the feature height interval refers to the height range of the point cloud corresponding to the geometric feature aggregation area of the component. S3, the original point cloud is segmented according to each of the feature height intervals, and a subset of the point cloud in each feature height interval is extracted; S4, each subset of point clouds is orthogonally projected onto a two-dimensional plane along the projection axis direction, and a corresponding binary image is generated; S5, an improved Canny edge detection algorithm is used to extract the two-dimensional boundary in the binary image. The improvement includes: after the Canny algorithm initially extracts the edge contours, the contour area and the aspect ratio of the minimum bounding rectangle of each contour are calculated, and the contours are filtered using a preset area threshold and aspect ratio threshold range. Contours that satisfy the condition that the area is greater than the area threshold and the aspect ratio falls within the aspect ratio threshold range are retained, while non-target contours are filtered out. S6. The extracted two-dimensional boundary points are mapped back to three-dimensional space through inverse coordinate transformation, and the nearest neighbor search is performed in the point cloud subset corresponding to each feature height interval using KD tree to obtain the three-dimensional boundary point set and reconstruct the complete three-dimensional boundary.
[0007] Furthermore, the calculation of curvature in S1 specifically includes: For any point in the point cloud Search The nearest neighbors form a neighborhood point set. Calculate the geometric center of this neighborhood point set and construct the covariance matrix: ; in For the first The coordinate vector of the neighboring points Let be the geometric center vector of the neighborhood point set; perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues. , , And satisfy Then point The curvature is defined as Then the curvature values of all points are linearly normalized to the interval [0,1].
[0008] Furthermore, the lightweight multilayer perceptron model has the following structure: a three-layer fully connected feedforward network, consisting of an input layer, a hidden layer, and an output layer; the input layer receives a four-dimensional feature vector composed of the x, y, z coordinates of a point and its normalized curvature; the hidden layer contains 32 neurons and uses the ReLU activation function; the output layer contains one neuron and uses the Sigmoid activation function, outputting the predicted probability that the point belongs to the feature region; the training process of the model is as follows: a training dataset is constructed, where the label of each sample is set according to whether the point falls within the pre-labeled true feature height range; if it falls within the range, it is marked as 1, otherwise as 0; a binary classification cross-entropy loss value is used. Conduct supervised training, among which For the sample size, For the first The true label of each sample The model outputs the predicted probability; the learning rate is adjusted using the Adam optimizer, and the pre-trained lightweight multilayer perceptron model is obtained after 80 rounds of iterative training.
[0009] Furthermore, determining at least one characteristic height range based on the change curve in step S2 specifically includes: The projection axis direction coordinate values are discretized into multiple continuous, equally spaced sub-intervals. For each sub-interval, the number of points predicted as feature points by the lightweight multilayer perceptron model within that sub-interval is counted, forming a curve showing the change in the number of feature points with the projection axis direction coordinates. The sub-interval containing the local peak in the curve is selected as a candidate feature interval. Adjacent candidate feature intervals with a spacing less than a preset merging threshold are merged into a feature height interval, ultimately obtaining at least one feature height interval.
[0010] Furthermore, the generation of the binary image specifically includes: Calculate the bounding box of the point cloud after projecting the point cloud subset, set the pixel size of the binary image to M×N, and reserve pixel margins. ; Calculate the scaling ratio based on the bounding box and pixel margins. ; Pixel offset in the X direction Pixel offset in the Y direction ; Set the coordinates of the j-th projection point Mapped to pixel coordinates satisfy , ,in This indicates rounding down; the pixel corresponding to the pixel coordinate is set to black, and the remaining background pixels are set to white to obtain an initial binary image; then, Gaussian blur operation is performed on the initial binary image in sequence to eliminate jagged edges, and dilation operation is performed to enhance the connectivity of the point cloud to obtain the final binary image; Where M and N are the number of rows and columns of pixels in the binary image, respectively, and δ is the reserved pixel margin. , These represent the maximum and minimum values of the projected point cloud in the X-coordinate, respectively. , These represent the maximum and minimum values of the projected point cloud in the Y coordinate, respectively.
[0011] Furthermore, the contour area in S5 ; in( , () represents the pixel coordinates of the i-th contour point. Let be the total number of points on the contour, and define . ; Minimum bounding rectangle aspect ratio ; in The width of the minimum bounding rectangle. The height of the minimum bounding rectangle; The preset area threshold is the minimum area value. The aspect ratio threshold range is Only if the contour simultaneously satisfies Area≥ and ≤Aspect≤ When this happens, the contour is retained as a valid two-dimensional boundary.
[0012] Furthermore, in step S6, mapping the two-dimensional boundary points back to three-dimensional space through inverse coordinate transformation specifically involves: For any pixel coordinate (u,v) on the extracted 2D boundary, first, based on the scaling factor s during projection and the pixel offset in the X direction... Pixel offset in the Y direction Calculate the coordinates on the real space plane: ; ; in , The spatial coordinates corresponding to the projection plane are defined by the normal direction of the projection plane, which is the direction of the projection axis. Then, based on the characteristic height range to which the boundary point belongs. Take the midpoint of the interval Constructing a three-dimensional query point Finally, in the KD tree constructed from the point cloud subsets corresponding to the feature height intervals, using... Search for the nearest neighbor for the query point, and use the 3D coordinates of the nearest neighbor as the reconstructed 3D boundary point.
[0013] Furthermore, the projection axis direction is determined by principal component analysis: the three-dimensional covariance matrix of the entire point cloud data is calculated, the covariance matrix is decomposed into eigenvalues to obtain three eigenvectors, the eigendirection corresponding to the largest eigenvalue is taken as the projection axis direction, and a local Cartesian coordinate system is established with this direction as the Z-axis.
[0014] Furthermore, the component is an automobile wheel hub, a multi-layered stepped frustum, or a sealing frame, and the three-dimensional point cloud data is acquired by a three-dimensional scanner.
[0015] Secondly, the present invention provides a three-dimensional boundary extraction system for components based on feature interval segmentation projection, the system being used to execute the method, including: Curvature Calculation and Normalization Module: This module receives input 3D point cloud data, calculates the curvature of each point, and outputs the normalized data. Feature interval prediction module: Embedded with a pre-trained lightweight multilayer perceptron model, used to output the curve of the change in the number of feature points along the projection axis based on the coordinates of the points and the normalized curvature, and to determine the feature height interval based on the curve of change. Point cloud segmentation and projection module: used to segment the original point cloud according to the feature height range, and orthogonally project each point cloud subset onto a two-dimensional plane along the projection axis to generate a corresponding binary image; Two-dimensional boundary extraction module: used to perform Canny edge detection on the binary image, and filter the preliminary contour based on a dual feature filter of contour area and minimum bounding rectangle aspect ratio, and output a two-dimensional boundary point set; Inverse mapping and reconstruction module: used to map the two-dimensional boundary point set back to three-dimensional space through coordinate inverse transformation and KD tree nearest neighbor search, and reconstruct the complete three-dimensional boundary.
[0016] The technical effects of this invention are: (1) By using a curvature-guided lightweight multilayer perceptron to adaptively segment the feature height range, the boundary breakage problem caused by feature intensity gradient and structural self-occlusion is effectively overcome, and the integrity of boundary extraction is significantly improved.
[0017] (2) A dual-feature filter based on the contour area and the aspect ratio of the minimum bounding rectangle is designed, which can accurately filter out noise fragments introduced by projection, retain effective contours with complete geometric features, and improve the robustness of two-dimensional boundary extraction.
[0018] (3) The entire method has only 2.4k parameters and a training time of about 3 minutes. Its computational efficiency is far superior to that of mainstream deep learning methods, significantly reducing the dependence on hardware resources and making it suitable for resource-constrained scenarios in industrial settings.
[0019] (4) By using the “projection-filtering-inverse mapping” process, the three-dimensional boundary extraction problem is transformed into a two-dimensional boundary extraction problem within multiple intervals. This not only utilizes mature algorithms for two-dimensional image processing but also avoids the distortion problem of global projection. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating the method for extracting the three-dimensional boundaries of components based on feature interval segmentation projection proposed in an embodiment of the present invention. Figure 2 This is a schematic diagram of the extraction structure provided in an embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] This embodiment uses a complex automotive wheel hub as the extraction object. The wheel hub model has the characteristics of small-diameter and deep-grooved holes, and the surface includes various geometric shapes such as swept surfaces and chamfered surfaces. The spoke boundaries are composed of complex curves, exhibiting significant feature intensity gradients and structural self-shading phenomena, which can fully represent the typical characteristics of complex parts.
[0023] I. Point cloud data acquisition.
[0024] The original point cloud set was obtained by using a 3D scanner to acquire 3D point cloud data of the car wheel hub. ,in Let be the three-dimensional coordinates of the i-th point, and n be the total number of point clouds.
[0025] II. Curvature Calculation.
[0026] Curvature reflects the intensity of changes in the geometric features of a point cloud surface; regions with high curvature correspond to feature areas with significant geometric deformation. This embodiment first calculates the curvature of each point as a priori guide for subsequent feature interval segmentation.
[0027] For any point p in the point cloud, the K-nearest neighbor algorithm is used to find its K nearest neighbors in 3D space. In this embodiment, K=20 is used to form the neighborhood point set. Calculate the geometric center vector of the neighborhood point set. .
[0028] Construct the covariance matrix: ; in, It is a 3×3 covariance matrix, and the superscript T indicates matrix transpose.
[0029] For matrix Eigenvalue decomposition yields three eigenvalues. , , And satisfy The curvature of point p is then defined as: ; in, Let represent the curvature value of point p, ranging from [0, 1 / 3]. Under this definition, flat regions (where the three eigenvalues are similar) have smaller curvature, while sharp edges (…)… The curvature is relatively large.
[0030] Since curvature serves only as a guiding parameter for interval partitioning, its core function is to reflect the relative strength of feature changes. To simplify data representation and optimize the input distribution of the subsequent multilayer perceptron model, the curvature of all points is linearly normalized to the [0,1] interval: ; in, Let be the normalized curvature value of the i-th point. Let i be the original curvature value at the i-th point. and These are the minimum and maximum values of the curvature at all points, respectively.
[0031] In this embodiment, the normalized curvature value of each point is obtained through the above calculation. The high curvature region corresponds to the feature parts with significant geometric deformation, such as the hub edge and the groove boundary. The technical effect of this step is that curvature, as a local differential attribute, can effectively capture geometric abrupt changes, and the normalization process optimizes the input distribution of the subsequent neural network, improving the model training stability and prediction accuracy.
[0032] III. Determining the projection axis direction.
[0033] To establish a unified projection coordinate system and facilitate subsequent interval segmentation along the height direction, principal component analysis is first used to determine the projection axis direction. This direction represents the main distribution direction of the point cloud and serves as the subsequent Z-axis.
[0034] Calculate the global geometric center and global covariance matrix of the entire point cloud data, then perform eigenvalue decomposition to obtain three eigenvalues (arranged in descending order) and their corresponding eigenvectors. Use the eigenvector corresponding to the largest eigenvalue as the projection axis direction, and establish a local Cartesian coordinate system with this direction as the Z-axis. Subsequent feature height intervals refer to the height range along this Z-axis direction.
[0035] For parts of different shapes, the projection axis direction can be adaptively determined based on the principal direction of the point cloud, eliminating the need for manual setting and enhancing the method's versatility. For example, for a vertically placed wheel hub, the direction of maximum feature is vertical; for a horizontally placed sealing frame, the direction of maximum feature is horizontal. This difference has been absorbed by the coordinate system transformation and does not affect the subsequent boundary extraction results.
[0036] IV. Lightweight Multilayer Perceptron Model Construction and Training.
[0037] This embodiment constructs a lightweight multilayer perceptron to predict whether each point belongs to a feature region. The network structure is a three-layer fully connected feedforward network, as follows: Input layer: Receives 4-dimensional feature vectors Where x, y, z are the coordinates of the point in the aforementioned local Cartesian coordinate system. For normalized curvature.
[0038] Hidden layer: Contains 32 neurons, using the ReLU activation function f=max(0,z). The output of this layer is h.
[0039] Output layer: Contains one neuron, using the sigmoid activation function. The output of this layer is... , ∈(0,1) is the predicted probability that the point belongs to the feature region.
[0040] To train the network, a labeled dataset needs to be constructed. In this embodiment, a set of real feature height intervals, such as multiple intervals along the Z-axis, are manually extracted from the point cloud. Point cloud patches located within these real intervals are labeled as 1 (positive samples, indicating they belong to the feature region), and the remaining points are labeled as 0 (negative samples). The training dataset is divided into a training set and a validation set in an 8:2 ratio.
[0041] Using binary classification cross-entropy loss function Conduct supervised training, among which For the sample size, For the first The true label of each sample The model outputs the predicted probability; the learning rate is adjusted using the Adam optimizer, and the pre-trained lightweight multilayer perceptron model is obtained after 80 rounds of iterative training.
[0042] V. Prediction of Feature Height Ranges.
[0043] The entire point cloud is predicted using a trained lightweight multilayer perceptron model to obtain the predicted probability that each point belongs to a feature region. Define the range of coordinate values for the projection axis direction (Z-axis) as follows: ,in , Discretize the range into multiple continuous and equally spaced subintervals, each with a length of ΔZ. The number of subintervals Q satisfies... The k-th subinterval is defined as: .
[0044] In this embodiment, ΔZ = 0.5 mm (adjusted according to point cloud density).
[0045] For each sub-interval Count the number of points within the sub-interval that are predicted as feature points by the model. The criterion for determining feature points is the prediction probability. >0.5. Record this quantity as... The curve showing the change in the number of feature points with the Z-coordinate was obtained.
[0046] Select local peak points from the curve. Specifically, if the number of feature points in a sub-interval is... The number of feature points is greater than the number of feature points in its preceding and following subintervals (i.e. and ),but This represents the sub-interval where the local peaks are located. These local peak intervals are then used as candidate feature intervals.
[0047] By analyzing the local peaks of the statistical feature point distribution curves, regions where geometric features cluster can be automatically located. The merging operation avoids generating too many small fragmented intervals due to data noise, thus obtaining meaningful feature intervals corresponding to different structural levels of the part.
[0048] VI. Point cloud segmentation and projection image generation: This involves segmenting each point cloud subset... Orthogonally project along the Z-axis onto the XY plane. After projection, each point p = (x, y, z) ∈ The image is transformed into a two-dimensional point (X,Y)=(x,y), with the Z coordinate information temporarily lost. To generate a binary image, perform the following steps: Step 6.1: Calculate the bounding box of the projected point cloud: ; ; ; ; in, It is a two-dimensional point set projected from a subset of the point cloud.
[0049] Step 6.2: Set the size and margins of the binary image.
[0050] The number of rows and columns of the binary image are set to M and N respectively (in this embodiment, M=N=1024), and the reserved pixel margin is δ (in this embodiment, δ=20 pixels). The margin is used to avoid the loss of edge information due to the projection points touching the edge.
[0051] Step 6.3: Calculate the scaling ratio.
[0052] The scaling factor 's' should ensure that the projected point set fills the effective area of the image as much as possible, while maintaining the original aspect ratio. The calculation formula is: ; Where 's' is the scaling ratio (unit: pixels / mm), and the denominator contains... and These represent the extents of the projected point cloud in the X and Y directions (unit: millimeters), respectively. Dimensional analysis: Molecules ( Since s is in pixels and the denominator is in millimeters, the dimension of s is pixels / millimeter, which is correct.
[0053] Step 6.4: Calculate the offset and pixel coordinate mapping.
[0054] The offset is used to translate the coordinates of the projected point into the image coordinate system, ensuring that margins are reserved: Pixel offset in the X direction Pixel offset in the Y direction ; Set the coordinates of the j-th projection point Mapped to pixel coordinates satisfy , ,in This indicates rounding down; the pixel corresponding to the pixel coordinate is set to black, and the remaining background pixels are set to white to obtain an initial binary image; then, Gaussian blur operation is performed on the initial binary image in sequence to eliminate jagged edges, and dilation operation is performed to enhance the connectivity of the point cloud to obtain the final binary image; Where M and N are the number of rows and columns of pixels in the binary image, respectively, and δ is the reserved pixel margin. , These represent the maximum and minimum values of the projected point cloud in the X-coordinate, respectively. , These represent the maximum and minimum values of the projected point cloud in the Y coordinate, respectively.
[0055] Through coordinate mapping and image processing operations, the sparse and gapped 3D point cloud is projected into a dense 2D binary image. Gaussian blur and dilation operations effectively fill the small gaps between the projected points, ensuring the continuity of subsequent edge detection.
[0056] VII. Improved Canny Edge Detection and Dual Feature Filtering For each generated binary image, the standard Canny algorithm is first used to initially extract the two-dimensional edge contours. The Canny algorithm includes the following steps: Gaussian smoothing, calculating gradient magnitude and direction, non-maximum suppression, double threshold detection, and edge connection. After the Canny algorithm, a preliminary contour set C={ , ,…, }, where m is the initial number of extracted contours, and each contour It is a closed or open curve composed of a series of consecutive pixels.
[0057] Because noise (such as scanning noise and discrete sampling noise) may be introduced during point cloud projection, as well as the subtle unevenness of the part surface, the initially extracted contour often contains many invalid tiny fragment contours, which are not the true boundaries of the parts. To filter out this noise, this embodiment designs a dual-feature filter based on the contour area and the aspect ratio of the minimum bounding rectangle.
[0058] Step 7.1: Calculate the contour area.
[0059] For each contour The area of the outline is calculated using the polygon area formula (shoelace formula): ; in( , () represents the pixel coordinates of the i-th contour point. Let be the total number of points on the contour, and define . ; Minimum bounding rectangle aspect ratio ; in The width of the minimum bounding rectangle. The height of the minimum bounding rectangle; The preset area threshold is the minimum area value. The aspect ratio threshold range is Only if the contour simultaneously satisfies Area≥ and ≤Aspect≤ When this happens, the contour is retained as a valid two-dimensional boundary.
[0060] By leveraging prior knowledge that the target contour has a large area and its aspect ratio reflects its geometric regularity, a simple yet efficient filtering method is implemented. This filtering operator avoids complex machine learning classification for each contour, further controlling computational overhead, while accurately filtering out noise debris.
[0061] 8. Inverse mapping and 3D boundary reconstruction.
[0062] For each pixel (u,v) on each valid 2D contour, it needs to be mapped back to 3D space to reconstruct the 3D boundary point.
[0063] First, the coordinates of the pixel in the real space plane are recovered through an inverse transformation. The inverse transformation is the inverse operation of coordinate mapping during projection: ; ; in , The spatial coordinates corresponding to the projection plane are defined by the normal direction of the projection plane, which is the direction of the projection axis. Then, based on the characteristic height range to which the boundary point belongs. Take the midpoint of the interval Constructing a three-dimensional query point Finally, in the KD tree constructed from the point cloud subsets corresponding to the feature height intervals, using... Search for the nearest neighbor for the query point, and use the 3D coordinates of the nearest neighbor as the reconstructed 3D boundary point.
[0064] Since Z-coordinate information is lost during projection, a simple inverse transformation can only recover planar coordinates. However, by using a KD-tree to search for nearest neighbors in the original point cloud, the true Z-coordinates of each point can be accurately retrieved, thus precisely reconstructing the 3D boundary. Furthermore, because the search range is limited to the corresponding feature height interval, a global search is avoided, significantly improving computational efficiency (the average search time for each query point is in milliseconds).
[0065] To verify the adaptability of the proposed method to parts with different shapes, boundary extraction experiments were conducted on two parts with significant geometric differences: a multi-layered stepped frustum and a sealing frame, selected from the publicly available ABC dataset. The results are as follows: Figure 2As shown in the figure. Experimental data shows that the proposed method achieves good extraction results on both parts: the precision, recall, and F1 score for the multi-layer stepped frustum are 0.83, 0.92, and 0.87, respectively, and for the sealed frame, they are 0.89, 0.81, and 0.85, respectively. It should be noted that although the projection axis directions obtained by PCA calculation for parts of different shapes are different, this paper uses this projection axis as the Z-axis to establish a local coordinate system. This difference has been absorbed by the coordinate system transformation and does not affect the subsequent boundary extraction effect. In addition, the number of point clouds varies for different parts, and the determination of the feature interval in this paper is based on the trend of the number of point clouds along the height direction, not the absolute value of the number of point clouds. Therefore, the difference in the number of point clouds has little impact on the interval division result. The above results show that the proposed method has good adaptability and robustness to parts of different shapes.
[0066] Based on the same inventive concept, this embodiment also provides a three-dimensional boundary extraction system for components based on feature interval segmentation projection. The system is used to execute the method, including: Curvature Calculation and Normalization Module: This module receives input 3D point cloud data, calculates the curvature of each point, and outputs the normalized data. Feature interval prediction module: Embedded with a pre-trained lightweight multilayer perceptron model, used to output the curve of the change in the number of feature points along the projection axis based on the coordinates of the points and the normalized curvature, and to determine the feature height interval based on the curve of change. Point cloud segmentation and projection module: used to segment the original point cloud according to the feature height range, and orthogonally project each point cloud subset onto a two-dimensional plane along the projection axis to generate a corresponding binary image; Two-dimensional boundary extraction module: used to perform Canny edge detection on the binary image, and filter the preliminary contour based on a dual feature filter of contour area and minimum bounding rectangle aspect ratio, and output a two-dimensional boundary point set; Inverse mapping and reconstruction module: used to map the two-dimensional boundary point set back to three-dimensional space through coordinate inverse transformation and KD tree nearest neighbor search, and reconstruct the complete three-dimensional boundary.
[0067] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.
Claims
1. A method for extracting the 3D boundaries of components based on feature interval segmentation projection, characterized in that, Includes the following steps: S1, acquire the 3D point cloud data of the parts, calculate the curvature of each point and perform normalization processing; S2, using the three-dimensional coordinates and normalized curvature of the points as input features, uses a pre-trained lightweight multilayer perceptron model to predict the change curve of the number of feature points in the entire point cloud along the projection axis direction coordinate, and determines at least one feature height interval based on the change curve, wherein the feature height interval refers to the height range of the point cloud corresponding to the geometric feature aggregation area of the component. S3, the original point cloud is segmented according to each of the feature height intervals, and a subset of the point cloud in each feature height interval is extracted; S4, each subset of point clouds is orthogonally projected onto a two-dimensional plane along the projection axis direction, and a corresponding binary image is generated; S5, an improved Canny edge detection algorithm is used to extract the two-dimensional boundary in the binary image. The improvement includes: after the Canny algorithm initially extracts the edge contours, the contour area and the aspect ratio of the minimum bounding rectangle of each contour are calculated, and the contours are filtered using a preset area threshold and aspect ratio threshold range. Contours that satisfy the condition that the area is greater than the area threshold and the aspect ratio falls within the aspect ratio threshold range are retained, while non-target contours are filtered out. S6. The extracted two-dimensional boundary points are mapped back to three-dimensional space through inverse coordinate transformation, and the nearest neighbor search is performed in the point cloud subset corresponding to each feature height interval using KD tree to obtain the three-dimensional boundary point set and reconstruct the complete three-dimensional boundary.
2. The method according to claim 1, characterized in that, The calculation of curvature in S1 specifically includes: For any point in the point cloud Search The nearest neighbors form a neighborhood point set. Calculate the geometric center of this neighborhood point set and construct the covariance matrix: ; in For the first The coordinate vector of the neighboring points Let be the geometric center vector of the neighborhood point set; perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues. , , And satisfy Then point The curvature is defined as Then the curvature values of all points are linearly normalized to the interval [0,1].
3. The method according to claim 1, characterized in that, The lightweight multilayer perceptron model has the following structure: a three-layer fully connected feedforward network, consisting of an input layer, a hidden layer, and an output layer. The input layer receives a four-dimensional feature vector composed of the x, y, and z coordinates of a point and its normalized curvature. The hidden layer contains 32 neurons and uses the ReLU activation function. The output layer contains one neuron and uses the Sigmoid activation function, outputting the predicted probability that the point belongs to the feature region. The training process of the model is as follows: a training dataset is constructed, where the label of each sample is set according to whether the point falls within the pre-labeled true feature height range; if it falls within the range, it is labeled 1, otherwise 0. A binary classification cross-entropy loss value is used. Conduct supervised training, among which For the sample size, For the first The true label of each sample The model outputs the predicted probability; the learning rate is adjusted using the Adam optimizer, and the pre-trained lightweight multilayer perceptron model is obtained after 80 rounds of iterative training.
4. The method according to claim 1, characterized in that, Specifically, determining at least one characteristic height range based on the change curve in step S2 includes: The projection axis direction coordinate values are discretized into multiple continuous, equally spaced sub-intervals. For each sub-interval, the number of points predicted as feature points by the lightweight multilayer perceptron model within that sub-interval is counted, forming a curve showing the change in the number of feature points with the projection axis direction coordinates. The sub-interval containing the local peak in the curve is selected as a candidate feature interval. Adjacent candidate feature intervals with a spacing less than a preset merging threshold are merged into a feature height interval, ultimately obtaining at least one feature height interval.
5. The method according to claim 1, characterized in that, The generation of the binary image specifically includes: Calculate the bounding box of the point cloud after projecting the point cloud subset, set the pixel size of the binary image to M×N, and reserve pixel margins. ; Calculate the scaling ratio based on the bounding box and pixel margins. ; Pixel offset in the X direction Pixel offset in the Y direction ; Set the coordinates of the j-th projection point Mapped to pixel coordinates satisfy , ,in This indicates rounding down; the pixel corresponding to the pixel coordinate is set to black, and the remaining background pixels are set to white to obtain an initial binary image; then, Gaussian blur operation is performed on the initial binary image in sequence to eliminate jagged edges, and dilation operation is performed to enhance the connectivity of the point cloud to obtain the final binary image; Where M and N are the number of rows and columns of pixels in the binary image, respectively, and δ is the reserved pixel margin. , These represent the maximum and minimum values of the projected point cloud in the X-coordinate, respectively. , These represent the maximum and minimum values of the projected point cloud in the Y coordinate, respectively.
6. The method according to claim 1, characterized in that, The contour area in S5 ; in( , () represents the pixel coordinates of the i-th contour point. Let be the total number of points on the contour, and define . ; Minimum bounding rectangle aspect ratio ; in The width of the minimum bounding rectangle. The height of the minimum bounding rectangle; The preset area threshold is the minimum area value. The aspect ratio threshold range is Only if the contour simultaneously satisfies Area≥ and ≤Aspect≤ When this happens, the contour is retained as a valid two-dimensional boundary.
7. The method according to claim 1, characterized in that, Specifically, in S6, mapping the two-dimensional boundary points back to three-dimensional space through inverse coordinate transformation is as follows: For any pixel coordinate (u,v) on the extracted 2D boundary, first, based on the scaling factor s during projection and the pixel offset in the X direction... Pixel offset in the Y direction Calculate the coordinates on the real space plane: ; ; in , The spatial coordinates corresponding to the projection plane are defined by the normal direction of the projection plane, which is the direction of the projection axis. Then, based on the characteristic height range to which the boundary point belongs. Take the midpoint of the interval Constructing a three-dimensional query point Finally, in the KD tree constructed from the point cloud subsets corresponding to the feature height intervals, using... Search for the nearest neighbor for the query point, and use the 3D coordinates of the nearest neighbor as the reconstructed 3D boundary point.
8. The method according to claim 1, characterized in that, The projection axis direction is determined by principal component analysis: calculate the three-dimensional covariance matrix of the entire point cloud data, perform eigenvalue decomposition on the covariance matrix to obtain three eigenvectors, take the eigendirection corresponding to the largest eigenvalue as the projection axis direction, and establish a local Cartesian coordinate system with this direction as the Z-axis.
9. The method according to claim 1, characterized in that, The components are automotive wheel hubs, multi-layered stepped truncated cones, or sealing frames, and the three-dimensional point cloud data is acquired by a three-dimensional scanner.
10. A system for extracting the three-dimensional boundaries of components based on feature interval segmentation projection, characterized in that, The system is used to perform the method according to any one of claims 1-9, comprising: Curvature Calculation and Normalization Module: This module receives input 3D point cloud data, calculates the curvature of each point, and outputs the normalized data. Feature interval prediction module: Embedded with a pre-trained lightweight multilayer perceptron model, used to output the curve of the change in the number of feature points along the projection axis based on the coordinates of the points and the normalized curvature, and to determine the feature height interval based on the curve of change. Point cloud segmentation and projection module: used to segment the original point cloud according to the feature height range, and orthogonally project each point cloud subset onto a two-dimensional plane along the projection axis to generate a corresponding binary image; Two-dimensional boundary extraction module: used to perform Canny edge detection on the binary image, and filter the preliminary contour based on a dual feature filter of contour area and minimum bounding rectangle aspect ratio, and output a two-dimensional boundary point set; Inverse mapping and reconstruction module: used to map the two-dimensional boundary point set back to three-dimensional space through coordinate inverse transformation and KD tree nearest neighbor search, and reconstruct the complete three-dimensional boundary.