Defect discarding and curved surface fitting method and system based on point cloud data and medium

By performing region segmentation, defect detection and NURBS surface fitting on point cloud data, the problems of noise, redundancy and defective areas in point cloud data are solved, and high-precision surface fitting effect is achieved.

CN120655839APending Publication Date: 2025-09-16SHENZHEN KAIPULE TECHNOLOGY CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510981828.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-16
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

The existing point cloud data processing technology has problems such as noise and redundant point interference, uneven data density, and insufficient defect detection capabilities, resulting in insufficient surface fitting accuracy and poor ability to capture local details.

Method used

The point cloud data is divided into several rectangular areas for flatness check. The area with the smallest flatness is selected as the benchmark. The defective areas are eliminated by combining voxel filtering, curvature calculation, normal vector consistency detection and NURBS surface fitting. The Levenberg-Marquardt optimization algorithm is used for overall surface fitting.

Benefits of technology

Effectively remove noise and redundant points, ensure the balance of point cloud quantity in the region, accurately identify and eliminate defective areas, improve surface fitting accuracy and global optimization, and achieve high-precision surface fitting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120655839A_ABST
    Figure CN120655839A_ABST
Patent Text Reader

Abstract

The invention discloses a defect abandoning and curved surface fitting method and system based on point cloud data and a medium. The method comprises the following steps: preprocessing the point cloud data; segmenting the preprocessed point cloud data into a plurality of rectangular regions; based on a geometric shape defect detection method, whether defects exist in the rectangular areas or not is judged, and the areas with the defects are removed; carrying out effective sampling based on region features on the reserved region; in the reference area, performing curved surface fitting by using a non-uniform rational B spline to obtain a fitting curved surface of the reference area; and taking the fitting curved surface of the reference region as an initial curved surface, constructing an overall fitting objective function, introducing a smoothness penalty term of a curved surface second derivative to make the curved surface complexity, and completing overall curved surface fitting. According to the method, high-precision curved surface fitting can be realized, and the problems of insufficient fitting precision and poor local detail capturing capability in the prior art are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of point cloud data processing, and in particular to a defect rejection and surface fitting method, system and medium based on point cloud data. Background Art

[0002] Point cloud data typically comes from devices like 3D scanners and laser scanners, and is used to capture the 3D geometry of objects. However, noise, redundant points, and incomplete data often contribute to inaccurate surface fitting results during point cloud data acquisition.

[0003] Existing point cloud processing technologies often have the following defects:

[0004] 1. Interference from noise and redundant points: Unprocessed point cloud data may contain a lot of noise and redundant data, which will affect the fitting results.

[0005] 2. Uneven data density: The density of point cloud data may vary greatly in different areas, and traditional segmentation methods cannot effectively handle it.

[0006] 3. Insufficient defect detection capabilities: In existing technologies, there is a lack of effective methods for detecting and eliminating geometric defects (such as cracks, dents, etc.) in point cloud data. Summary of the Invention

[0007] The main purpose of the present invention is to propose a defect rejection and surface fitting method, system and medium based on point cloud data. The method aims to divide the point cloud data into several rectangular areas, check the flatness of each area, and select the area with the smallest flatness deviation as the benchmark, thereby achieving high-precision surface fitting, effectively solving the problems of insufficient fitting accuracy and poor local detail capture ability in the existing technology.

[0008] To achieve the above object, the present invention provides a defect rejection and surface fitting method based on point cloud data, the method comprising the following steps:

[0009] Step S10, point cloud data preprocessing;

[0010] Step S20, spatial range division: dividing the pre-processed point cloud data into several rectangular areas according to point density and spatial range;

[0011] Step S30, geometric shape-based defect detection and region rejection: A geometric shape-based defect detection method is used, combining curvature calculation and normal vector consistency detection to determine whether there are defects within the plurality of rectangular regions, and defective regions are discarded, retaining defect-free regions for subsequent fitting;

[0012] Step S40, regional sampling based on regional features: for the retained regions, effective sampling based on regional features is performed;

[0013] Step S50, reference area surface fitting: using non-uniform rational B-splines to perform surface fitting in the reference area to obtain a fitting surface of the reference area;

[0014] Step S60, overall surface fitting: using the reference region fitting surface as the initial surface, constructing an overall fitting objective function, introducing a smoothness penalty term of the second-order derivative of the surface to control the surface complexity, and completing the overall surface fitting.

[0015] A further technical solution of the present invention is that step S10 includes:

[0016] Step S101: Get the original point cloud data Denoising, filtering and downsampling are performed, and voxel filtering method is used to remove outliers and redundant points.

[0017] A further technical solution of the present invention is that step S101 includes:

[0018] Step S1011, definition of voxel grid: set the size of voxel to V size =(V x ,V y ,V z ) and creates a voxel grid in three-dimensional space, where each voxel is represented as a cubic area, and the size of the voxel is determined by the user-defined size (V x ,V y ,V z )Decide;

[0019] Step S1012, voxel grid construction: point cloud data Divided into voxel grids, each point p i is mapped into a voxel:

[0020]

[0021] Among them, p i =(x i ,y i ,z i ) represents the i-th point in the point cloud, whose coordinates are the position vector in three-dimensional space; (V x ,V y ,V z ) represent the side lengths of the voxel grid in the x, y, and z directions respectively; Represents a rounding-down operation, which is used to map continuous spatial coordinates to discrete voxel indices; Voxel index represents the point p iThe voxel number that is fallen into;

[0022] Step S1013, voxel representative point calculation: for each voxel (V i,j,k ), calculate the centroid of all points within the voxel as the representative point of the voxel:

[0023]

[0024] Among them, p centroid Represents the geometric center (center of mass) of all points in the voxel, which serves as the representative point of the voxel; N ijk represents the total number of points located within the (i, j, k)th voxel;

[0025] Step S1014: Output the downsampled point cloud: The final downsampled point cloud is a set of centroid points of all voxels:

[0026]

[0027] in, represents the downsampled point cloud set after voxel filtering; p centroid It is the representative point calculated in each voxel; "forallbodyvoxels" represents the voxel unit that contains at least one original point; this set serves as a simplified input for subsequent surface processing to improve computational efficiency.

[0028] A further technical solution of the present invention is that step S20 includes:

[0029] Step S201: Calculate the number of point clouds N in the neighborhood of each point neigh (p i ), the calculation formula is:

[0030]

[0031] Among them, p j ∈P represents the point cloud dataset Any point in (||p i -p j ||) is point p i With point p j The Euclidean distance between neigh is the neighborhood radius. neigh is the neighborhood radius, which is used to limit the neighborhood range; N neigh (p i ) means falling into p i The number of points in the neighborhood, used to measure the local density of points;

[0032] Step S202: Divide the rectangular area according to the density of the points Ensure that each area Rj The number of points N j Number of points close to the target N target :

[0033]

[0034] During the division process, ensure that the error of the number of points in each area meets the following conditions:

[0035] |N j -N target |≤∈;

[0036] Among them, ∈ is the allowable error range.

[0037] A further technical solution of the present invention is that step S30 includes:

[0038] Step S301, curvature calculation: Identify the location where the surface mutation occurs through curvature calculation, where curvature describes the degree of curvature of the surface at a point in the point cloud data. The curvature calculation formula is:

[0039] K = k1·k2;

[0040] Among them, k1 and k2 represent the principal curvatures of the surface at the point, and K is the total curvature of the point;

[0041] Step S302, normal vector consistency detection: determine whether the surface is smooth by normal vector consistency detection, where the normal vector n i It's point p i The normal of the surface is calculated by calculating the angle θ between the normal vectors of adjacent points ij , to determine whether there is a sudden change in surface direction, the normal vector angle calculation formula is:

[0042]

[0043] If the angle θ ij Greater than a set threshold τ angle , it means that there may be surface mutations in the area, which may be a defective area;

[0044] Step S303, defect area judgment: judge each area by combining the curvature and normal vector consistency analysis results. j The curvature value K is greater than the preset threshold τ curvature , or the normal vector angle max(θ ij ) is greater than the preset threshold τ angle , then the area is considered to contain defects; the judgment formula is:

[0045]

[0046] If Defect(R j )=1, it means that the area R j It is a defective area and needs to be removed; if Defect(R j )=0, it means that there is no defect in the area and the area is retained for subsequent fitting.

[0047] A further technical solution of the present invention is that step S40 includes:

[0048] Step S401, point cloud feature calculation: calculate the local density ρ of each point i and geometric characteristic curvature κ i , and determine the sampling weight of each point based on these features; the calculation formula for local density is:

[0049]

[0050] Among them, N neigh (p i ) represents point p i The number of points in the neighborhood, V neigh is the neighborhood volume;

[0051] Step S402, calculate sampling weight: calculate the sampling weight w of each point based on density and geometric features i , the weight formula is:

[0052]

[0053] Among them, N j Indicates region R j The total number of points in κ i For point p i Curvature characteristics;

[0054] Step S403, weighted random sampling: according to the calculated weight w i , perform weighted random sampling; first, calculate the total weight of all samples and generate a cumulative weight list; then, by generating a random number, select the first sample point whose cumulative weight is greater than or equal to the random number; in this way, it can ensure that points with larger weights are more likely to be selected, and select M points in the area that can represent the geometry and characteristics of the entire area. j points, which can effectively capture the surface structure in the region and are therefore preferred points for subsequent surface fitting. The probability of each point being selected is:

[0055] P(p i )=w i ;

[0056] Step S404: Ensure uniform distribution: j Divide the grid into several uniformly sized grids and select a sampling weight w in each grid i The highest point is used as the representative point of the grid:

[0057] Step S405, sampling result: the representative point set obtained by sampling is expressed as:

[0058]

[0059] The sampling point set is used as the reference area for subsequent surface fitting processing.

[0060] A further technical solution of the present invention is that the surface expression in step S50 is:

[0061]

[0062] Among them, N i,p (u) and M j,q (v) is the B-spline basis function, P ij is the control point, w ij is the weight, (u,v) is the parameter space.

[0063] A further technical solution of the present invention is that step S60 includes:

[0064] Step S601: The reference fitting surface S in step S50 is b The control point, weight and node vector fitting parameters of (u, v) are used as the initial fitting parameters p of the overall surface fitting, and the fitting objective function E(p) is expressed as:

[0065]

[0066] Among them, x i is the coordinate of the i-th point, y i is the actual measured coordinate of the i-th point, f(x i ,p) is the fitting surface at x i Predicted value of position; |y i -f(x i ,p)| 2 is the data point p i To the fitting surface f(x i ,p) is used to measure the fitting accuracy; R(p)) is the penalty term, which is used to control the complexity of the fitting surface and prevent overfitting; λ is the regularization coefficient, which is used to balance the trade-off between the fitting error and the penalty term;

[0067] In step S601, the smoothness penalty term R(p) of the second-order derivative of the surface is expressed as:

[0068]

[0069] in, is the second derivative of the surface, and dA is the area element. This penalty term helps ensure a smooth surface during surface fitting and avoids excessive curvature;

[0070] Step S602, Levenberg-Marquardt optimization: The Levenberg-Marquardt optimization algorithm is used to fit the entire surface, and the parameter p is optimized to minimize the fitting error. The parameter update formula is as follows:

[0071] p k+1 =p k -[J(p k ) T J(p k )+λ k I] -1 J(p k ) T r k ;

[0072] Through continuous iterative optimization, the globally optimal surface fitting parameters are finally obtained to complete the overall surface fitting.

[0073] To achieve the above-mentioned objectives, the present invention also proposes a defect rejection and surface fitting system based on point cloud data, characterized in that the system includes a memory, a processor, and a defect rejection and surface fitting program based on point cloud data stored on the processor, and the defect rejection and surface fitting program based on point cloud data executes the steps of the above-mentioned method when run by the processor.

[0074] To achieve the above objectives, the present invention also proposes a computer-readable storage medium, which stores a defect rejection and surface fitting program based on point cloud data, and the defect rejection and surface fitting program based on point cloud data executes the steps of the method described above when run by a processor.

[0075] The beneficial effects of the defect rejection and surface fitting method, system and medium based on point cloud data of the present invention are:

[0076] This invention effectively addresses existing issues such as noise, redundancy, defective areas, and uneven distribution of point cloud data. By combining multiple technologies, including voxel filtering and denoising, adaptive region segmentation, geometry-based defect detection, sampling based on regional features, NURBS surface fitting, and the Levenberg-Marquardt optimization algorithm, the invention achieves significant technical results in surface fitting of three-dimensional point cloud data. Specifically, this includes the following aspects:

[0077] 1. Denoising and redundant data elimination effects:

[0078] Point cloud data usually contains a lot of noise and redundant points, which will affect the subsequent fitting accuracy. The present invention can effectively remove noise and redundant points by adopting voxel filtering method.

[0079] 2. Adaptive region division effect:

[0080] The present invention adopts an adaptive area division method based on point cloud data density, which can ensure the balance of point cloud quantity in each divided area and avoid the problem of point cloud being too sparse or too dense that may occur in traditional fixed division methods.

[0081] 3. Defect area removal and surface fitting effect:

[0082] During point cloud data processing, some areas may contain geometric defects, such as cracks, depressions, or sudden changes in surface orientation. These defects can affect subsequent surface fitting results. This paper proposes a geometric shape-based defect detection method, combined with curvature calculation and normal vector consistency detection, to accurately identify and remove defective areas, reducing the computational effort.

[0083] 4. Regional sampling and representative point selection effects:

[0084] This paper proposes an effective sampling method based on regional characteristics, ensuring uniform distribution of sampling points while retaining representative points within the region. Combining weighted random sampling with grid sampling allows the sampling points to retain surface characteristics to the greatest extent possible, ensuring accuracy.

[0085] 5. High-precision surface fitting effect:

[0086] This method combines NURBS surface fitting with the Levenberg-Marquardt optimization algorithm to ensure the accuracy and global optimality of the fitted surface. NURBS surface fitting can handle complex three-dimensional surfaces and fully consider the distribution characteristics of point cloud data during the fitting process. The Levenberg-Marquardt optimization algorithm can avoid local minima during the optimization process, ensuring that the fitting error is minimized. BRIEF DESCRIPTION OF THE DRAWINGS

[0087] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

[0088] Figure 1 It is a flow chart of a preferred embodiment of the defect rejection and surface fitting method based on point cloud data of the present invention;

[0089] Figure 2 is a detailed flow chart of step S101;

[0090] Figure 3 is a detailed flow chart of step S20;

[0091] Figure 4 is a detailed flow chart of step S30;

[0092] Figure 5 is a detailed flow chart of step S40;

[0093] Figure 6 is a detailed flow chart of step S60;

[0094] Figure 7 This is a hardware architecture diagram of the defect rejection and surface fitting system based on point cloud data of the present invention.

[0095] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0096] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0097] The present invention proposes a defect rejection and surface fitting method based on point cloud data. The technical solution adopted by the present invention is mainly to divide the point cloud data into several rectangular areas, check the flatness of each area, and select the area with the smallest flatness deviation as the benchmark, thereby achieving high-precision surface fitting, effectively solving the problems of insufficient fitting accuracy and poor local detail capture ability in the existing technology.

[0098] The present invention can be widely used in the fields of 3D reconstruction, reverse engineering, 3D scanning, etc. It can efficiently process point clouds with noise and redundant data and accurately fit curved surfaces.

[0099] like Figure 1 As shown, a preferred embodiment of the defect rejection and surface fitting method based on point cloud data of the present invention includes the following steps:

[0100] Step S10: point cloud data preprocessing.

[0101] The step S10 includes: step S101, obtaining the original point cloud data Denoising, filtering and downsampling are performed, and voxel filtering method is used to remove outliers and redundant points.

[0102] like Figure 2 As shown, the step S101 specifically includes:

[0103] Step S1011, definition of voxel grid: set the size of voxel to V size =(V x ,V y ,V z ) and creates a voxel grid in three-dimensional space, where each voxel is represented as a cubic area, and the size of the voxel is determined by the user-defined size (V x ,V y ,V z )Decide;

[0104] Step S1012, voxel grid construction: point cloud data Divided into voxel grids, each point p i is mapped into a voxel:

[0105]

[0106] Among them, p i =(x i ,y i ,z i ) represents the i-th point in the point cloud, whose coordinates are the position vector in three-dimensional space; (V x ,V y ,V z ) represent the side lengths of the voxel grid in the x, y, and z directions respectively; Represents a rounding-down operation, which is used to map continuous spatial coordinates to discrete voxel indices; Voxel index represents the point p i The voxel number that is fallen into;

[0107] Step S1013, voxel representative point calculation: for each voxel (V i,j,k ), calculate the centroid of all points within the voxel as the representative point of the voxel:

[0108]

[0109] Among them, p centroid Represents the geometric center (center of mass) of all points in the voxel, which serves as the representative point of the voxel; N ijkrepresents the total number of points within the (i, j, k)th voxel; this formula averages all points within the voxel to achieve downsampling and denoising purposes;

[0110] Step S1014: Output the downsampled point cloud: The final downsampled point cloud is a set of centroid points of all voxels:

[0111]

[0112] in, represents the downsampled point cloud set after voxel filtering; p centroid It is the representative point calculated in each voxel; "for allbodyvoxels" indicates a voxel unit containing at least one original point; this set serves as a simplified input for subsequent surface processing to improve computational efficiency.

[0113] Step S20, spatial range division: divide the pre-processed point cloud data into several rectangular areas according to the point density and spatial range Ensure that the number of points in each area is close to the target number. The specific division method is adaptive division according to point density.

[0114] like Figure 3 As shown, S20 specifically includes the following steps:

[0115] Step S201: Calculate the number of point clouds N in the neighborhood of each point neigh (p i ), where the calculation formula is:

[0116]

[0117] Among them, p j ∈P represents the point cloud dataset Any point in (||p i -p j ||) is point p i With point p j The Euclidean distance between neigh is the neighborhood radius. neigh is the neighborhood radius, which is used to limit the neighborhood range; N neigh (p i ) means falling into p i The number of points in a neighborhood, used to measure the local density of points.

[0118] Step S202: Divide the rectangular area according to the density of the points Ensure that each area R j The number of points N j Number of points close to the target N target :

[0119]

[0120] During the division process, ensure that the error of the number of points in each area meets the following conditions:

[0121] |N j -N target |≤∈;

[0122] Where ∈ is the allowable error range. The adaptive partitioning algorithm dynamically adjusts the region size according to the local density of the point cloud data to ensure that each region contains an appropriate number of points.

[0123] Step S30, defect detection and area rejection based on geometric shapes: Based on the defect detection method of geometric shapes, curvature calculation and normal vector consistency detection are combined to determine whether there are defects in the plurality of rectangular areas, and defective areas are discarded, and areas without defects are retained for subsequent fitting.

[0124] During point cloud data processing, some areas may contain defects that do not conform to the expected geometry, such as cracks, dents, and sudden changes in surface orientation. These defects can affect subsequent surface fitting. This embodiment proposes a geometry-based defect detection method that combines curvature calculation and normal vector consistency detection to determine whether an area contains defects.

[0125] like Figure 4 As shown, the step S30 specifically includes the following steps:

[0126] Step S301, curvature calculation: Identify locations where surface mutations occur, such as cracks, depressions, and other areas, through curvature calculation. Curvature describes the degree of curvature of the surface at a point in the point cloud data. The curvature calculation formula is:

[0127] K = k1·k2;

[0128] Among them, k1 and k2 represent the principal curvatures of the surface at the point, and K is the total curvature of the point.

[0129] Step S302, normal vector consistency detection: Normal vector consistency is an important indicator of whether the surface is smooth. In this embodiment, the surface is smooth by normal vector consistency detection, where the normal vector n i It's point p i The normal of the surface is calculated by calculating the angle θ between the normal vectors of adjacent points ij , to determine whether there is a sudden change in surface direction, the normal vector angle calculation formula is:

[0130]

[0131] If the angle θ ijGreater than a set threshold τ angle , it means that there may be surface mutations in the area, which may be a defective area.

[0132] Step S303, defect area judgment: judge each area by combining the curvature and normal vector consistency analysis results. j The curvature value K is greater than the preset threshold τ curvature , or the normal vector angle max(θ ij ) is greater than the preset threshold τ angle , then the area is considered to contain defects. The judgment formula is:

[0133]

[0134] If Defect(R j )=1, it means that the area R j It is a defective area and needs to be removed; if Defect(R j )=0, it means that there is no defect in the area and the area is retained for subsequent fitting.

[0135] Step S40, regional sampling based on regional features: for the retained regions, effective sampling based on regional features is performed to reduce the amount of calculation and retain representative points in the region to ensure the accuracy of fitting.

[0136] The step S40 is to calculate the sampling weight of each point according to the local density and geometric features of the point cloud, and select representative points through weighted random sampling and grid sampling.

[0137] like Figure 5 As shown, the step S40 specifically includes the following steps:

[0138] Step S401, point cloud feature calculation: calculate the local density ρ of each point i and geometric characteristic curvature κ i , and determine the sampling weight of each point based on these features; the calculation formula for local density is:

[0139]

[0140] Among them, N neigh (p i ) represents point p i The number of points in the neighborhood, V neigh is the neighborhood volume.

[0141] Step S402, calculate sampling weight: calculate the sampling weight w of each point based on density and geometric features i , the weight formula is:

[0142]

[0143] Among them, N j Indicates region R j The total number of points in κ i For point p i curvature characteristics.

[0144] Step S403, weighted random sampling: according to the calculated weight w i , perform weighted random sampling; first, calculate the total weight of all samples and generate a cumulative weight list; then, by generating a random number, select the first sample point whose cumulative weight is greater than or equal to the random number; in this way, it can ensure that important sample points (points with larger weights) are more likely to be selected, and select M points in the area that can represent the geometry and characteristics of the entire area. j points, which can effectively capture the surface structure in the region and are therefore preferred points for subsequent surface fitting. The probability of each point being selected is:

[0145] P(p i )=w i .

[0146] Step S404, uniform distribution guarantee (grid sampling):

[0147] In order to ensure uniform spatial distribution of sampling points, this embodiment adopts a grid sampling method. j Divide into several cubic grids of uniform size and select a sampling weight w in each grid i The highest point is used as the representative point of the grid.

[0148] Step S405: Get the sampling result: The representative point set obtained by sampling is expressed as:

[0149]

[0150] This sampling point set is used as a reference area for subsequent surface fitting processing and has good representativeness and spatial uniformity.

[0151] Step S50, reference region surface fitting: using non-uniform rational B-splines (NURBS) to perform surface fitting in the reference region to obtain a fitting surface of the reference region.

[0152] The NURBS surface expression in step S50 is:

[0153]

[0154] Among them, N i,p (u) and M j,q(v) is the B-spline basis function, P ij is the control point, w ij is the weight, (u,v) is the parameter space.

[0155] Step S60, overall surface fitting: using the reference region fitting surface as the initial surface, constructing an overall fitting objective function, introducing a smoothness penalty term of the second-order derivative of the surface to control the surface complexity, and completing the overall surface fitting.

[0156] Specifically, the fitting surface of the reference area is used as the initial surface, and the Levenberg-Marquardt optimization algorithm is used to perform overall surface fitting. The parameters are optimized to minimize the fitting error, and finally the globally optimal fitting result is obtained.

[0157] This example uses the reference region fitting surface as the initial surface and proposes and constructs an overall fitting objective function. To further improve the accuracy of the overall surface fitting and avoid overfitting, a penalty term can be introduced to control surface complexity. The following is a method for constructing the overall fitting objective function, including the fitting error and penalty term.

[0158] Specifically, if Figure 6 As shown, the step S60 specifically includes:

[0159] Step S601: The reference fitting surface S in step S50 is b The control point, weight and node vector fitting parameters of (u, v) are used as the initial fitting parameters p of the overall surface fitting, and the fitting objective function E(p) is used.

[0160] The reference fitting surface S in step S50 b (u, v) contains the fitting parameters such as the control points, weights and node vectors of the reference area, which constitute the initial fitting parameters p of the overall surface fitting.

[0161] The fitting objective function E(p) is expressed as:

[0162]

[0163] Among them, x i is the coordinate of the i-th point (the point position of the input data), y i is the actual measured coordinate of the i-th point (the true value in the point cloud data), f(x i ,p) is the fitting surface at x i The predicted value of the position (determined by the fitting parameter p); |y i -f(x i ,p)| 2 is the data point p i To the fitting surface f(x i,p) is used to measure the fitting accuracy; R(p)) is the penalty term used to control the complexity of the fitted surface and prevent overfitting; common penalty terms include regularization terms, such as surface smoothness metrics. λ is the regularization coefficient, which is used to balance the trade-off between fitting error and penalty terms.

[0164] In order to make the fitting surface smoother, a smoothness penalty term of the second-order derivative of the surface can be introduced. In this embodiment, in step S601, the smoothness penalty term R(p) of the second-order derivative of the surface is expressed as:

[0165]

[0166] in, is the second derivative of the surface, and dA is the area element. This penalty term helps ensure a smooth surface during surface fitting and avoids excessive curvature.

[0167] Step S602, Levenberg-Marquardt optimization: The Levenberg-Marquardt optimization algorithm is used to fit the entire surface, and the parameter p is optimized to minimize the fitting error. The parameter update formula is as follows:

[0168] p k+1 =p k -[J(p k ) T J(p k )+λ k I] -1 J(p k ) T r k ;

[0169] Through continuous iterative optimization, the globally optimal surface fitting parameters are finally obtained to complete the overall surface fitting.

[0170] The beneficial effects of the defect rejection and surface fitting method based on point cloud data of the present invention are:

[0171] This invention effectively addresses existing issues such as noise, redundancy, defective areas, and uneven distribution of point cloud data. By combining multiple technologies, including voxel filtering and denoising, adaptive region segmentation, geometry-based defect detection, sampling based on regional features, NURBS surface fitting, and the Levenberg-Marquardt optimization algorithm, the invention achieves significant technical results in surface fitting of three-dimensional point cloud data. Specifically, this includes the following aspects:

[0172] 1. Denoising and redundant data elimination effects:

[0173] Point cloud data usually contains a lot of noise and redundant points, which will affect the subsequent fitting accuracy. The present invention can effectively remove noise and redundant points by adopting voxel filtering method.

[0174] 2. Adaptive region division effect:

[0175] The present invention adopts an adaptive area division method based on point cloud data density, which can ensure the balance of point cloud quantity in each divided area and avoid the problem of point cloud being too sparse or too dense that may occur in traditional fixed division methods.

[0176] 3. Defect area removal and surface fitting effect:

[0177] During point cloud data processing, some areas may contain geometric defects, such as cracks, depressions, or sudden changes in surface orientation. These defects can affect subsequent surface fitting results. This paper proposes a geometric shape-based defect detection method, combined with curvature calculation and normal vector consistency detection, to accurately identify and remove defective areas, reducing the computational effort.

[0178] 4. Regional sampling and representative point selection effects:

[0179] This paper proposes an effective sampling method based on regional characteristics, ensuring uniform distribution of sampling points while retaining representative points within the region. Combining weighted random sampling with grid sampling allows the sampling points to retain surface characteristics to the greatest extent possible, ensuring accuracy.

[0180] 5. High-precision surface fitting effect:

[0181] This method combines NURBS surface fitting with the Levenberg-Marquardt optimization algorithm to ensure the accuracy and global optimality of the fitted surface. NURBS surface fitting can handle complex three-dimensional surfaces and fully consider the distribution characteristics of point cloud data during the fitting process. The Levenberg-Marquardt optimization algorithm can avoid local minima during the optimization process, ensuring that the fitting error is minimized.

[0182] To achieve the above objectives, the present invention also proposes a defect rejection and surface fitting system based on point cloud data, such as Figure 7As shown, the system includes a processor 1001, a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002, and a defect rejection and surface fitting program based on point cloud data stored on the processor, wherein the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0183] Those skilled in the art will understand that Figure 7 The system structure shown in the figure does not constitute a limitation of the system, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0184] like Figure 7 As shown, the memory 1005 as a computer storage medium may include an operating device, a network communication module, a user interface module, and a defect rejection and surface fitting program based on point cloud data.

[0185] exist Figure 7 In the system shown, the network interface 1004 is mainly used to connect to the network server and communicate data with the network server; the user interface 1003 is mainly used to interact with the user terminal and receive instructions input by the user; and the processor 1001 can be used to call the defect rejection and surface fitting program based on point cloud data stored in the memory 1005.

[0186] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. All equivalent structural transformations made by using the contents of the present invention description and drawings under the concept of the present invention, or direct / indirect application in other related technical fields are included in the patent protection scope of the present invention.

Claims

1. A defect rejection and surface fitting method based on point cloud data, characterized in that: The method comprises the following steps: Step S10, point cloud data preprocessing; Step S20, spatial range division: dividing the pre-processed point cloud data into several rectangular areas according to point density and spatial range; Step S30, geometric shape-based defect detection and region rejection: A geometric shape-based defect detection method is used, combining curvature calculation and normal vector consistency detection to determine whether there are defects within the plurality of rectangular regions, and defective regions are discarded, retaining defect-free regions for subsequent fitting; Step S40, regional sampling based on regional features: for the retained regions, effective sampling based on regional features is performed; Step S50, reference area surface fitting: using non-uniform rational B-splines to perform surface fitting in the reference area to obtain a fitting surface of the reference area; Step S60, overall surface fitting: using the reference region fitting surface as the initial surface, constructing an overall fitting objective function, introducing a smoothness penalty term of the second-order derivative of the surface to control the surface complexity, and completing the overall surface fitting.

2. The defect rejection and surface fitting method based on point cloud data according to claim 1, characterized in that: The step S10 includes: Step S101: Get the original point cloud data Denoising, filtering and downsampling are performed, and voxel filtering method is used to remove outliers and redundant points.

3. The defect rejection and surface fitting method based on point cloud data according to claim 2, characterized in that: The step S101 includes: Step S1011, definition of voxel grid: set the size of voxel to V size =(V x ,V y ,V z ) and creates a voxel grid in three-dimensional space, where each voxel is represented as a cubic area, and the size of the voxel is determined by the user-defined size (V x ,V y ,V z )Decide; Step S1012, voxel grid construction: point cloud data Divided into voxel grids, each point p i is mapped into a voxel: Among them, p i =(x i ,y i ,z i ) represents the i-th point in the point cloud, whose coordinates are the position vector in three-dimensional space; (V x ,V y ,V z ) represent the side lengths of the voxel grid in the x, y, and z directions respectively; Represents a rounding-down operation, which is used to map continuous spatial coordinates to discrete voxel indices; Voxel index represents the point p i The voxel number that is fallen into; Step S1013, voxel representative point calculation: for each voxel (V i,j,k ), calculate the centroid of all points within the voxel as the representative point of the voxel: Among them, p centroid Represents the geometric center (center of mass) of all points in the voxel, which serves as the representative point of the voxel; N ijk represents the total number of points located within the (i, j, k)th voxel; Step S1014: Output the downsampled point cloud: The final downsampled point cloud is a set of centroid points of all voxels: in, represents the downsampled point cloud set after voxel filtering; p centroid It is the representative point calculated in each voxel; "for all body voxels" means the voxel unit contains at least one original point; this set is used as a simplified input for subsequent surface processing to improve computational efficiency.

4. The defect rejection and surface fitting method based on point cloud data according to claim 3, characterized in that: The step S20 includes: Step S201: Calculate the number of point clouds N in the neighborhood of each point neigh (p i ), the calculation formula is: Among them, p j ∈P represents the point cloud dataset Any point in (||p i -p j ||) is point p i With point p j The Euclidean distance between neigh is the neighborhood radius. neigh is the neighborhood radius, which is used to limit the neighborhood range; N neigh (p i ) means falling into p i The number of points in the neighborhood, used to measure the local density of points; Step S202: Divide the rectangular area according to the density of the points Ensure that each area R j The number of points N j Number of points close to the target N target : During the division process, ensure that the error of the number of points in each area meets the following conditions: |N j -N target |≤∈; Among them, ∈ is the allowable error range.

5. The defect rejection and surface fitting method based on point cloud data according to claim 4, characterized in that: The step S30 includes: Step S301, curvature calculation: Identify the location where the surface mutation occurs through curvature calculation, where curvature describes the degree of curvature of the surface at a point in the point cloud data. The curvature calculation formula is: K = k1·k2; Among them, k1 and k2 represent the principal curvatures of the surface at the point, and K is the total curvature of the point; Step S302, normal vector consistency detection: determine whether the surface is smooth by normal vector consistency detection, where the normal vector n i It's point p i The normal of the surface is calculated by calculating the angle θ between the normal vectors of adjacent points ij , to determine whether there is a sudden change in surface direction, the normal vector angle calculation formula is: If the angle θ ij Greater than a set threshold τ angle , it means that there may be surface mutations in the area, which may be a defective area; Step S303, defect area judgment: judge each area by combining the curvature and normal vector consistency analysis results. j The curvature value K is greater than the preset threshold τ curvature , or the normal vector angle max(θ ij ) is greater than the preset threshold τ angle , then the area is considered to contain defects; the judgment formula is: If Defect(R j )=1, it means that the area R j It is a defective area and needs to be removed; if Defect(R j )=0, it means that there is no defect in the area and the area is retained for subsequent fitting.

6. The defect rejection and surface fitting method based on point cloud data according to claim 5, characterized in that: The step S40 includes: Step S401, point cloud feature calculation: calculate the local density ρ of each point i and geometric characteristic curvature κ i , and determine the sampling weight of each point based on these features; the calculation formula for local density is: Among them, N neigh (p i ) represents point p i The number of points in the neighborhood, V neigh is the neighborhood volume; Step S402, calculate sampling weight: calculate the sampling weight w of each point based on density and geometric features i , the weight formula is: Among them, N j Indicates region R j The total number of points in κ i For point p i Curvature characteristics; Step S403, weighted random sampling: according to the calculated weight w i , perform weighted random sampling; first, calculate the total weight of all samples and generate a cumulative weight list; then, by generating a random number, select the first sample point whose cumulative weight is greater than or equal to the random number; in this way, it can ensure that points with larger weights are more likely to be selected, and select M points in the area that can represent the geometry and characteristics of the entire area. j points, which can effectively capture the surface structure in the region and are therefore preferred points for subsequent surface fitting. The probability of each point being selected is: P(p i )=w i ; Step S404: Ensure uniform distribution: j Divide the grid into several uniformly sized grids and select a sampling weight w in each grid i The highest point is used as the representative point of the grid: Step S405, sampling result: the representative point set obtained by sampling is expressed as: The sampling point set is used as the reference area for subsequent surface fitting processing.

7. The defect rejection and surface fitting method based on point cloud data according to claim 6, characterized in that: The surface expression in step S50 is: Among them, N i,p (u) and M j,q (v) is the B-spline basis function, P ij is the control point, w ij is the weight, (u,v) is the parameter space.

8. The defect rejection and surface fitting method based on point cloud data according to claim 7, characterized in that: The step S60 includes: Step S601: The reference fitting surface S in step S50 is b The control point, weight and node vector fitting parameters of (u, v) are used as the initial fitting parameters p of the overall surface fitting, and the fitting objective function E(p) is expressed as: Among them, x i is the coordinate of the i-th point, y i is the actual measured coordinate of the i-th point, f(x i ,p) is the fitting surface at x i Predicted value of position; |y i -f(x i ,p)| 2 is the data point p i To the fitting surface f(x i ,p) is used to measure the fitting accuracy; R(p)) is the penalty term, which is used to control the complexity of the fitting surface and prevent overfitting; λ is the regularization coefficient, which is used to balance the trade-off between the fitting error and the penalty term; In step S601, the smoothness penalty term R(p) of the second-order derivative of the surface is expressed as: in, is the second derivative of the surface, and dA is the area element. This penalty term helps ensure a smooth surface during surface fitting and avoids excessive curvature; Step S602, Levenberg-Marquardt optimization: The Levenberg-Marquardt optimization algorithm is used to fit the entire surface, and the parameter p is optimized to minimize the fitting error. The parameter update formula is as follows: p k+1 =p k -[J(p k ) T J(p k )+λ k I] -1 J(p k ) T r k ; Through continuous iterative optimization, the globally optimal surface fitting parameters are finally obtained to complete the overall surface fitting.

9. A defect rejection and surface fitting system based on point cloud data, characterized in that: The system includes a memory, a processor, and a point cloud data-based defect rejection and surface fitting program stored on the processor. When the point cloud data-based defect rejection and surface fitting program is run by the processor, the steps of the method according to any one of claims 1 to 8 are executed.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a defect rejection and surface fitting program based on point cloud data, and the defect rejection and surface fitting program based on point cloud data is executed by a processor to perform the steps of the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • BIM-based curtain wall simulation design method and system

    CN120910972A

  • Flaw detection method and system for large mold production based on machine vision

    CN121724935A

  • Circle center deviation determination method and semiconductor process equipment

    CN121881598A