Fitting C2-continuous or superior surfaces to a set S of points sampled on a 2-manifold is central to reverse engineering, computer aided geometric modeling, entertaining, modeling of art heritage, etc. This article addresses the fitting of analytic (ellipsoid, cones, cylinders) surfaces in general position in . Currently, the state of the art presents limitations in 1) automatically finding an initial guess for the analytic surface F sought, and 2) economically estimating the geometric distance between a point of S and the analytic surface F. These issues are central in estimating an analytic surface which minimizes its accumulated distances to the point set. In response to this situation, this article presents and tests novel user-independent strategies for addressing aspects 1) and 2) above, for cylinders, cones and ellipsoids. A conjecture for the calculation of the distance point-ellipsoid is also proposed. Our strategies produce good initial guesses for F and fast fitting error estimation for F, leading to an agile and robust optimization algorithm. Ongoing work addresses the fitting of free-form parametric surfaces to S.
Surface reconstruction is a widely studied field because of its importance in CAD-CAM applications, virtual reality, medical imaging and movie industry. Particularly, the reconstruction of analytic surfaces is important since they are frequently used in mechanical parts [
The optimization problem of fitting F to S is described by the objective function shown in Equation (1).
where the residual represents the minimum distance between the i-th point of and its corresponding point on F and indicates the order of the residual. Then is given by:
where is the norm-degree to calculate the distance.
To minimize and find the best surface fit, some variables are tunned. These variables are specific for each situation.
The number of decision variables and the number of equality constrains in a optimization problem, allow to know the degrees of freedom with the equiation.
The Gauss-Newton iterative method for solving non-linear optimization problems uses the Hessian approximation to calculate the next iteration, as is shown in Equation (3).
where is the decision variables vector and is residuals vector.
Notice that in the case in which is not strictly convex, can be singular at some iteration possibly causing the algorithm to diverge. This problem can be overcome by using the Levenberg-Marquardt (LM) Method ([4,5]):
where is the LM parameter and is the identity matrix.
The convexity condition of an objective function and its feasible region determines if a local extrema corresponds to a global extrema or not. In order to evaluate this condition in, it is required to examine the eigenvalues of its Hessian matrix by solving Equation (5)
If all eigenvalues of are positive, then is strictly-convex, but if at least one eigenvalue is equal to zero, is convex [
Some authors have researched the calculation of the distance between a point and an analytic surface. Sappa and Rouhani [
Just like Zhou and Salvado [
Yan, Liu and Wang [
Jiang and Cheng [
Li and Griffiths [
References [8,13] report the use of LM method to fit analytic surfaces without mentioning the selection of the LM parameter and its influence on the optimization process.
Numerical optimization strategies are sensitive to the initial guess. The closer to the ideal solution is the initial guess, the less number of iterations in the optimization process. On the other hand, a bad initial guess could make the algorithm to diverge.
Just like Ruiz and Cadavid [
Simari and Singh [
References [13,18] report the implementation of an algebraic method based on a least squares solution of the general quadric equation to find an initial guess of the parameters of analytic surfaces.
As was shown in the taxonomy conducted in the literature review, there are several issues that remain open in optimized analytic surfaces fitting which are studied in this work: 1) Estimation of the real geometric distance between a point and an ellipsoid, 2) Identification of the effect of the parameters such as the norm k in the distance measurement, 3) Analysis of the optimality conditions effect on the convergence of the algorithm.
A circular cylinder is defined by a radius, an axis vector and its pivot point and respectively. For purposes of this research, no assumption is made on the orientation or position in space of the cylinder from which the data set belongs.
The initial guess of the cylinder’s parameters is obtained with a statistical and geometrical procedure as explained below and shown in
1) Random seed points are selected from and a local neighborhood found for each seed. See
2) Crossing each other the line segments defined by a seed point and the normal vector of the best plane fit to, a set of points passing near are found. See
3) A PCA is executed over for finding an initial approximation of the cylinder axis and its pivot point, and respectively. See
4) An approximation to the cylinder radius is calculated as the average of the minimum distances between and.
This method allows processing both complete cylindrical surfaces and cylindrical caps.
The minimum distance between the point and a circular cylindrical surface is calculated as:
where is the radius of the cylinder and is the orthogonal projection of onto as is shown in
A circular right cone can be defined by an axis vector, an apex and a semi-opening angle.
The initial approximation of a circular conical surface to a point cloud is obtained by an statistical and geometrical procedure as is depicted in
1) A set of seed points and local neighborhoods are taken from. See
2) The minimum curvature direction of,
being collinear with a generatrix of the cone, is found by fitting a paraboloid and calculating the eigenvectors of it Hessian matrix
. See
3) being the first approximation to, is obtained by averaging the crossing points of all lines defined by a seed point and its corresponding. Notice that represents an statistical apex. See
4) By finding the center of gravity of the center of the circumferences passing trough the points, and, where and are unitary vectors in direction of minimum curvatures, the initial guess of the axis vector is
calculated. See
5) The initial estimation of is taken as the average of the angles between the vectors and. See
The distance from a point and a cone is calculated by solving the Equation (7) for and.
where is a rotation of around an angle,
and as is shown in the
As is shown in
The first approximation to the parameters of the ellipsoid can be obtained with the following procedure:
1) A general quadric surface is defined by Equation (8).
Rearranging Equation (8) appropriately [
In compact form, the above equation is:
If the points of are taken into account, is a matrix where its row -th is:
is a vector with row -th:. is the coefficients vector and it can be obtained by solving the linear system of Equation (9). As the system is overspecified, a least squares solution is calculated the with the pseudo-inverse matrix of:
2) The initial approximation of the center coordinates, the semi axes and the Euler angles, are obtained from the subdiscriminant in the matrix notation of a general oriented quadric:
where
The eigenvectors of represent the axes of the ellipsoid, then and can be calculated. The eigenvalues of are proportional to and [
.
We present the following conjecture (
Conjecture. Let be an ellipsoid centered in i with Euler angles and semi axes. Let be a point in. Then, an ellipsoid exists with the same center and orientation to, but with semi axes
, that contain.
If and are translated to the origin and aligned with the principal axes by a rigid transformation, the following equation can be posed:
Rearranging (11):
where with.
The minimum absolute real root of the polynomial in Equation (12) corresponds to the minimum signed distance from to.
In order to test our fitting routines two study cases were proposed as follows.
In order to prove the algorithm for fitting ellipsoids, a subset of the frog shown in
A good initial guess found by an algebraic approach, let to a fast convergence of the algorithm. In
To test the cylinder and cone fitting algorithms some parts of the fan shown in
This article presents the fitting of analytic surfaces (such as cylinders, cones and ellipsoids) in the sense of mathematical optimization. The objective function for each surface was implemented in terms of the real geometric distance. In the case of cylinder and conical surfaces this metric is formulated and calculated easily. However, in the ellipsoid case the measurement of the distance between a point and the surface is not trivial. In response to this situation this work presented a novel methodology to calculate this distance. The addressed results allow to check that the proposed distance calculation works fine.
The routines for the initial guess of the surfaces were implemented using geometrical and statistical procedures. The study cases allow to prove that the iterative optimization algorithms converge fast with a good initial guess.
Future work includes the extension of the optimization strategies to other analytic and to free form parametric surfaces.
S: Noisy point sample F: Best fit surface to S PCA: Principal Component Analysis LM: Lenvenberg-Marquardt k: Norm degree f: Objective function di: Minimum distance between the i-th point of and its corresponding point on F