Free-form surface fitting method adopting micro-calculation for point cloud

By using differentiable computing and stochastic gradient descent algorithms in the free surface fitting method, the problems of complex operation and insufficient accuracy in the prior art are solved, and high-precision fitting of the surface shape of any object is achieved.

CN119672258APending Publication Date: 2025-03-21HEFEI JIUSHAO INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411738859.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The existing free surface parameterization methods, especially manual manual creation and heuristic solution methods, have problems such as complex operation, high time cost and insufficient accuracy, making it difficult to effectively fit the surface shape of any object.

Method used

The free surface fitting method is adopted with differentiable calculation and stochastic gradient descent algorithm. By performing differentiable calculations on the sample points on the free surface, the distance error between point clouds is calculated using the L2-Chamfer Distance function, and the free surface parameters are adjusted through the optimization algorithm to achieve the best fit of point clouds.

Benefits of technology

This method can better adapt and fit the surface shape of any object, achieve high-precision fitting results, and quickly optimize the best-fitted free surface parameters without human intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672258A_ABST
    Figure CN119672258A_ABST
Patent Text Reader

Abstract

The invention discloses a microcomputable free-form surface fitting method for point clouds, and relates to the technical field of three-dimensional modeling, and the method comprises the steps: carrying out the microcomputation of sampling points on a free-form surface according to a calculation formula of the sampling points on the free-form surface with respect to the parameters of the free-form surface, and obtaining the derivatives of the sampling points on the free-form surface with respect to the parameters of the free-form surface; defining a sampling point set on the free-form surface as a fitting point cloud; and calculating a distance error between the fitting point cloud and the given point cloud, transmitting optimization of the fitting point cloud to optimization of the free-form surface parameters by minimizing the distance error, obtaining the free-form surface parameters of the optimal fitting given point cloud through a stochastic gradient descent algorithm, and fitting based on the optimized free-form surface parameters to obtain the free-form surface. Compared with an existing free-form surface fitting method based on manual creation or heuristic solution, the free-form surface fitting method based on micro-calculation and stochastic gradient descent can better adapt to and fit any object surface shape.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of three-dimensional modeling, and in particular to a free-form surface fitting method using differentiable computing for point clouds. Background Art

[0002] In the fields of computer graphics and computer-aided geometric design, the representation of three-dimensional shapes is one of the core issues, which is crucial for applications such as virtual reality, games, advanced manufacturing and scientific visualization. Among them, different free-form surface representations such as B-spline surfaces and NURBS surfaces are widely used in the fields of industrial parts design, manufacturing and production based on CAD, CAE and CAM due to their good geometric properties and accurate expression of the surface of objects. As point clouds are one of the easiest data to collect from the real world, many works are devoted to exploring feasible solutions to convert point clouds into various different expressions and convert them into free-form surfaces efficiently and accurately.

[0003] There are two main methods for parameterizing free-form surfaces: manual creation and heuristic solution. Manual creation refers to the creation and editing of free-form surfaces by professional operators in dedicated design software by placing and dragging control points in three-dimensional space until the task requirements are met; heuristic solution is mainly based on an initial surface data structure, and iteratively optimizes the parameters of the free-form surface by defining specific objective functions, constraints and optimization algorithms. The former requires the operator to have rich design experience and experience in operating dedicated design software, and it takes a lot of time; the latter, due to the lack of robustness of the heuristic algorithm, has problems such as a significant decrease in accuracy or even incorrect parameterization in many cases. Summary of the invention

[0004] In order to overcome the above-mentioned defects in the prior art, the present invention provides a free surface fitting method using differentiable computing for point clouds, which can better adapt to and fit the surface shape of any object.

[0005] To achieve the above object, the present invention adopts the following technical solutions, including:

[0006] A free-form surface fitting method using differentiable computing for point clouds is used to fit the input point clouds to obtain a free-form surface. The specific process is as follows:

[0007] According to the calculation formula of the sampling points on the free-form surface with respect to the free-form surface parameter V, the sampling points on the free-form surface are subjected to differentiable calculation to obtain the derivative of the sampling points on the free-form surface with respect to the free-form surface parameter V;

[0008] The set of sampling points on the free surface is defined as the fitting point cloud P fit ;

[0009] Take the input point cloud as the given point cloud P init , calculate the fitting point cloud P fit With a given point cloud P init The distance error between them is minimized to achieve the fitting point cloud P fit According to the derivative of the sampling points on the free surface with respect to the free surface parameter V, the fitting point cloud P fit The optimization is transferred to the optimization of the free surface parameter V;

[0010] Based on the optimized free-form surface parameter V, the free-form surface is fitted.

[0011] Preferably, the L2-Chamfer Distance function is used to calculate the fitting point cloud P fit With a given point cloud P init The distance error between L2CD(P init ,P fit ), calculated as:

[0012]

[0013] Where p is the given point cloud P init Points in, q is the fitted point cloud P fit Point in; |P init |、|P fit | respectively fit the point cloud P fit , given point cloud P init The number of points in;||pq|| 2 is the square of the distance from point p to point q, ||pq|| 2 =(p x -q x ) 2 +(p y -q y ) 2 +(p z -q x ) 2 , (p x ,p y ,p z ) is the coordinate of point p, (q x ,q y ,q z ) are the coordinates of point q.

[0014] Preferably, the expression of the sampling point P'(u,v) on the free surface under any (u,v) parameters is:

[0015]

[0016] Among them, P ij is the control point of the free-form surface, i and j represent the row and column numbers in the control point matrix, i = 0, 1, ..., m, j = 0, 1, ..., n; m and n are the number of control points along two different directions; u and v are parameterized coordinates on the free-form surface along two different directions, namely, U and V directions, and u and v are variables between 0 and 1; P′(u, v) is the sampling point on the free-form surface; k and l are the orders of the basis functions of the free-form surface along two different directions; N i,k (u) is the function value of the k-order free-form surface basis function at the ith control point along the u direction, N j,l (v) is the function value of the jth control point of the l-order free-form surface along the v direction;

[0017] The definition of free-form surface basis function is as follows:

[0018]

[0019]

[0020] Among them, t is a variable between 0 and 1, and the real number sequence {t z} is the endpoint of a monotonically increasing interval; t z ,t z+1 Represents the two endpoints of the zth region; N z,0 (t) represents the 0th order free surface basis function of the zth region; N z,k (t) represents the k-th order free-form surface basis function of the z-th region;

[0021] The expression of the sampling point P' on the free surface is abstracted as:

[0022] P'=F(t z ,P ij )| u,v,k,l,m,n

[0023] Among them, the free surface parameter V = {t z ,P ij}, F is the calculation function of the sampling point P' on the free surface with respect to the free surface parameter V.

[0024] The present application also provides a computer program product, which includes a computer program / instruction, which, when executed by a processor, implements the above-mentioned free-form surface fitting method using differentiable computing for point clouds.

[0025] The present application also provides a readable storage medium having a computer program stored thereon, and when the computer program is executed, the free surface fitting method using differentiable computing for point clouds is implemented.

[0026] The present application also provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the free surface fitting method using differentiable computing for point clouds is implemented.

[0027] The advantages of the present invention are:

[0028] (1) Since three-dimensional point cloud is the data structure that is easiest to collect and describe the geometric information of objects in the real world, the present invention provides a simple and effective free-form surface fitting method. The algorithm directly uses a given point cloud as the geometric description of the object surface, performs differentiable calculations on the sampling points on the free-form surface, and uses the minimization of the distance to the given point cloud as the loss term. The parameters corresponding to the free-form surface that best fits the given point cloud are obtained through a stochastic gradient descent algorithm.

[0029] (2) Compared with the existing free-form surface fitting methods that are manually created or based on heuristic solutions, the free-form surface fitting method based on differentiable computing and stochastic gradient descent proposed in the present invention can better adapt to and fit the surface shape of any object.

[0030] (3) The method of the present invention only needs to use point clouds as input data and does not require any human intervention to obtain high-precision fitting results.

[0031] (4) The calculation process of the present invention can achieve rapid optimization of the best-fitting remaining parameters of the free-form surface for any given point cloud and the corresponding order of the free-form surface, the number of control points, etc.

[0032] (5) The present invention realizes the calculation of free-form surface sampling points and the gradient calculation of corresponding variables by dividing the free-form surface parameters into constants and variables in a specific manner.

[0033] (6) Based on point cloud representation and stochastic gradient descent, the present invention designs a universal free-form surface parameter optimization algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 This is a flow chart of a free surface fitting method using differentiable computing for point clouds according to Example 1.

[0035] Figure 2 A visualization diagram of the B-spline surface and its control points.

[0036] Figure 3 A visualization diagram of the B-spline surface basis function. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] Example 1

[0039] Depend on Figure 1 As shown, a free-form surface fitting method using differentiable computing for point clouds is used to fit a free-form surface according to the input point cloud. The specific process is as follows:

[0040] According to the calculation formula of the sampling points on the free-form surface with respect to the free-form surface parameter V, the sampling points on the free-form surface are subjected to differentiable calculation to obtain the derivative of the sampling points on the free-form surface with respect to the free-form surface parameter V;

[0041] The set of sampling points on the free surface is defined as the fitting point cloud P fit ;

[0042] Take the input point cloud as the given point cloud P init , calculate the fitting point cloud P fit With a given point cloud P init The distance error between them is minimized to achieve the fitting point cloud P fit According to the derivative of the sampling points on the free surface with respect to the free surface parameter V, the fitting point cloud P fit The optimization is transferred to the optimization of the free surface parameter V;

[0043] Based on the optimized free-form surface parameter V, the free-form surface is fitted.

[0044] Since NURBS surfaces, B-spline surfaces, etc. have explicit conversion formulas, for the convenience of description, this embodiment takes the B-spline surface among free-form surfaces as an example to describe the method proposed by the present invention. It should be noted that, in essence, the method proposed by the present invention is suitable for any free-form surface whose surface sampling points can be obtained by explicit calculation.

[0045] like Figure 2 As shown in the figure, the orange part is the distribution of the surface of the B-spline surface in three-dimensional space, and the black points are the control points of the B-spline surface. Below, the calculation process of the sampling points at any position on the B-spline surface is given. First, the definition of the B-spline surface basis function is as follows:

[0046]

[0047] Among them, t is a variable between 0 and 1, and the real number sequence {tz} is the endpoint of a monotonically increasing interval; t z ,t z+1 Represents the two endpoints of the zth region; N z,0 (t) represents the 0th order free surface basis function of the zth region; N z,k (t) represents the k-order free-form surface basis function of the z-th region. z} In the case of uniform increase, the B-spline surface basis function is as follows Figure 3 shown.

[0048] Therefore, the sampling points on the B-spline surface with arbitrary (u, v) parameters can be quickly calculated by combining the B-spline surface basis function with the control points:

[0049]

[0050] Among them, P ij are the control points of the B-spline surface, that is Figure 3 The black dots shown in the figure, i and j represent the row and column numbers in the control point matrix, i = 0, 1, ..., m, j = 0, 1, ..., n; m and n are the number of control points along two different directions; u and v are the parameterized coordinates along two different directions (i.e., U and V directions) on the B-spline surface; P'(u, v) is the sampling point on the B-spline surface; k and l are the orders of the B-spline surface basis functions along two different directions; N i,k (u) is the function value of the k-order B-spline surface basis function at the ith control point along the u direction, N j,l (v) is the function value of the j-th control point of the l-order B-spline surface basis function along the v direction, which is equivalent to point P ij The weight of .

[0051] Since all the above calculation formulas are explicit addition, subtraction, multiplication and division quaternion operations, the three coordinate components (x, y, z) of the sampling point P'(u, v) can be obtained by deriving the expression of the sampling point P'(u, v) during the calculation process. ij The three coordinate components (x c ,y c ,z c ), thereby realizing differentiable calculation from control point P to any sampling point P' on the B-spline surface. It should be noted that in order to realize the derivation, it is necessary to regard the variables {u, v, k, l, m, n} as constants during the calculation. Specifically, this embodiment uses an open source automatic differentiation library. Based on this automatic differentiation library, only all the above calculation processes can be defined to realize the automatic calculation of the derivative between any two variables.

[0052] After obtaining the derivative, we can know how to adjust the coordinates of the control point P to make the sampling point P' closer to the input point cloud. The derivative is equivalent to providing a relationship between the moving direction of the control point P and the sampling point P'.

[0053] Through the above calculation formula, any sampling point P' on the B-spline surface can be defined as the following abstract function:

[0054] P'=F(t z ,P ij )| u,v,k,l,m,n

[0055] Where F is the calculation function of the sampling point obtained by the calculation formula described above, {u, v, k, l, m, n} is regarded as a constant, and the interval endpoints {t z} and control point {P ij} as the independent variable to calculate the unique corresponding sampling point P' on the B-spline surface. In this way, the three coordinate components of the sampling point P' can be explicitly calculated about the interval endpoint {t z} and control point {P ij}, thus allowing the subsequent optimization algorithm to be further implemented. For the convenience of description, the set of B-spline surface parameters to be optimized is expressed as

[0056] Next, by sampling different (u, v) combinations, we can obtain a set of sampling points evenly tiled on the surface of the B-spline surface. This set of sampling points is called the fitting point cloud P. fit Specifically, u and v are uniformly sampled M and N times from 0 to 1, respectively, so as to obtain a fitting point cloud P containing M×N sampling points. fit .

[0057] Then, calculate the fitting point cloud P fit To a given point cloud P init Specifically, the L2-ChamferDistance function is used to calculate the fitting point cloud P fit With a given point cloud P init The distance error between L2CD(P init , P fit ), calculated as:

[0058] Among them, p is the fitting point cloud P fit Points in, q is a given point cloud P init Point in; |P init |、|P fit | respectively fit the point cloud P fit , given point cloud P init The number of points in;||pq||2 is the square of the distance from point p to point q, that is, the sum of the squares of the three components xyz, ||pq|| 2 =(p x -q x ) 2 +(p y -q y ) 2 +(p z -q z ) 2 , (p x ,p y ,p z ) is the coordinate of point p, (q x ,q y ,q z ) are the coordinates of point q.

[0059] Since this formula also has an explicit calculation process, the gradient can be obtained from the error term L2CD(P init ,P fit ) is passed to each parameter in the target optimization parameter set V. Finally, we use the stochastic gradient descent algorithm to convert the error term L2CD(P init ,P fit ) is minimized to optimize the B-spline surface parameter V.

[0060] Through the calculation method of the above embodiment, it can be achieved that for any given point cloud and the order of the free-form surface, the number of control points, etc., the remaining parameters of the free-form surface with the best fit can be quickly optimized.

[0061] Example 2

[0062] An electronic device comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a free surface fitting method for point clouds using differentiable computing according to the first embodiment is implemented.

[0063] The electronic device of the embodiment of the present application can be the mobile device itself, or a stand-alone device independent of the mobile device, which can communicate with the mobile device to receive the collected input signals from them and send the selected target decision behavior to them.

[0064] The electronic device includes one or more processors and memory. The processor may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. The memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may run the program instructions to implement the decision behavior decision method and / or other desired functions of the various embodiments of the present application described above.

[0065] Electronic devices may also include input devices and output devices.

[0066] Example 3

[0067] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the decision-making behavior decision method according to various embodiments of the present application described in the above-mentioned embodiment 1 of this specification.

[0068] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0069] Example 4

[0070] An embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the decision-making behavior decision method according to various embodiments of the present application described in the above-mentioned embodiment 1.

[0071] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0072] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A free-form surface fitting method using differentiable computing for point clouds, characterized in that: It is used to fit the input point cloud to obtain a free-form surface. The specific process is as follows: According to the calculation formula of the sampling points on the free-form surface with respect to the free-form surface parameter V, the sampling points on the free-form surface are subjected to differentiable calculation to obtain the derivative of the sampling points on the free-form surface with respect to the free-form surface parameter V; The set of sampling points on the free surface is defined as the fitting point cloud P fit ; Take the input point cloud as the given point cloud P init , calculate the fitting point cloud P fit With a given point cloud P init The distance error between them is minimized to achieve the fitting point cloud P fit According to the derivative of the sampling points on the free surface with respect to the free surface parameter V, the fitting point cloud P fit The optimization is transferred to the optimization of the free surface parameter V; Based on the optimized free-form surface parameter V, the free-form surface is fitted.

2. The free-form surface fitting method using differentiable computing for point cloud according to claim 1, characterized in that: Use L2 = Chamfer Distance function to calculate the fitting point cloud P fit With a given point cloud P init The distance error between L2CD(P init , P fit ), calculated as: Where p is the given point cloud P init Points in, q is the fitted point cloud P fit Point in; |P init |、|P fit | respectively fit the point cloud P fit , given point cloud P init The number of points in;||pq|| 2 is the square of the distance from point p to point q, ||pq|| 2 =(p x -q x ) 2 +(p y -q y ) 2 +(p z -q z ) 2 , (p x , p y , p z ) is the coordinate of point p, (q x ,q y ,q z ) are the coordinates of point q.

3. The free-form surface fitting method using differentiable computing for point cloud according to claim 1, characterized in that: The expression of the sampling point P′(u, v) on the free surface under arbitrary (u, v) parameters is: Among them, P ij is the control point of the free-form surface, i and j represent the row and column numbers in the control point matrix, i = 0, 1, ..., m, j = 0, 1, ..., n; m and n are the number of control points along two different directions; u and v are parameterized coordinates along two different directions, namely, U and V directions, on the free-form surface, and u and v are variables between 0 and 1; P′(u, v) is the sampling point on the free-form surface; k and l are the orders of the basis functions of the free-form surface along two different directions; N i,k (u) is the function value of the k-order free-form surface basis function at the ith control point along the u direction, N j,l (v) is the function value of the jth control point of the l-order free-form surface along the v direction; The definition of free-form surface basis function is as follows: Among them, t is a variable between 0 and 1, and the real number sequence {t z } is the endpoint of a monotonically increasing interval; t z ,t z+1 Represents the two endpoints of the zth region; N z,0 (t) represents the 0th order free surface basis function of the zth region; N z,k (t) represents the k-th order free-form surface basis function of the z-th region; The expression of the sampling point P′ on the free surface is abstracted as: P′=F(t z ,P ij )| u,v,k,l,m,n Among them, the free surface parameter V = {t z , P ij }, F is the calculation function of the sampling point P′ on the free surface with respect to the free surface parameter V.

4. A computer program product, characterized in that It includes a computer program / instruction, which, when executed by a processor, implements a free-form surface fitting method using differentiable computing for point clouds as described in any one of claims 1 to 3.

5. A readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the free surface fitting method using differentiable computing for point clouds as described in any one of claims 1 to 3 is implemented.

6. An electronic device, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a free surface fitting method for point cloud using differentiable computing as described in any one of claims 1 to 3.