<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">AJCM</journal-id><journal-title-group><journal-title>American Journal of Computational Mathematics</journal-title></journal-title-group><issn pub-type="epub">2161-1203</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/ajcm.2013.31A004</article-id><article-id pub-id-type="publisher-id">AJCM-30864</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Fitting of Analytic Surfaces to Noisy Point Clouds
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>scar</surname><given-names>Ruiz</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Santiago</surname><given-names>Arroyave</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Diego</surname><given-names>Acosta</given-names></name><xref ref-type="aff" rid="aff2"><sup>2</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Laboratory of CAD/CAM/CAE, Medellin, Colombia</addr-line></aff><aff id="aff2"><addr-line>Design and Development of Processes (DDP) Group, Universidad EAFIT, Medellin, Colombia</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>oruiz@eafit.edu.co(SR)</email>;</corresp></author-notes><pub-date pub-type="epub"><day>30</day><month>04</month><year>2013</year></pub-date><volume>03</volume><issue>01</issue><fpage>18</fpage><lpage>26</lpage><history><date date-type="received"><day>February</day>	<month>5,</month>	<year>2013</year></date><date date-type="rev-recd"><day>March</day>	<month>9,</month>	<year>2013</year>	</date><date date-type="accepted"><day>March</day>	<month>25,</month>	<year>2013</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p><html>
 <head></head>
 
   Fitting C<sup>2</sup>-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 <img style="width:22px;height:16px;" alt="" src="Edit_b2abe863-f587-46ec-b8c8-3a78f6ce567c.bmp" width="24" height="17" />. 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. 
 
</html></p></abstract><kwd-group><kwd>Surface Fitting; Optimization; Analytic Surfaces</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>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 [<xref ref-type="bibr" rid="scirp.30864-ref1">1</xref>]. Surface reconstruction process consists in obtaining a surface that minimizes the distance between each point <img src="4-1100244\94fa426c-dbf3-49e0-800f-9e924d12bdc4.jpg" /> of a point sample <img src="4-1100244\76a59281-354a-4ee5-a006-9631b86a0245.jpg" /> and its corresponding point on surface<img src="4-1100244\23c953a2-b9b8-487e-956f-37bff6faf898.jpg" />. It is assumed that S fulfills the Nyquist-Shannon criteria [2,3].</p><sec id="s1_1"><title>1.1. Optimization Approach</title><p>The optimization problem of fitting F to S is described by the objective function <img src="4-1100244\bffe3232-cb92-46ae-9aac-908d3437adff.jpg" /> shown in Equation (1).</p><disp-formula id="scirp.30864-formula89902"><label>(1)</label><graphic position="anchor" xlink:href="4-1100244\40f7cc83-cf7b-4464-bbb2-d4567ebe1c8c.jpg"  xlink:type="simple"/></disp-formula><p>where the residual <img src="4-1100244\8c5c8fcf-b31e-411e-961d-ff2ef316040c.jpg" /> represents the minimum distance between the i-th point of <img src="4-1100244\6aa85d73-25f4-463d-8063-c0461bba00b0.jpg" /> and its corresponding point on F and <img src="4-1100244\33ba47b8-5556-4759-82e2-6a8bce3e96cf.jpg" /> indicates the order of the residual. Then <img src="4-1100244\f2dab42c-d0e6-4563-bebb-4a41a133878d.jpg" /> is given by:</p><disp-formula id="scirp.30864-formula89903"><label>(2)</label><graphic position="anchor" xlink:href="4-1100244\79757915-b40c-45c0-836f-aa25d11e03a3.jpg"  xlink:type="simple"/></disp-formula><p>where <img src="4-1100244\cf8b017c-2cac-4c6b-b9b1-0a4ca24c37d1.jpg" /> is the norm-degree to calculate the distance.</p><p>To minimize <img src="4-1100244\5262b9c2-ee7a-43cf-ae94-2f006ce65864.jpg" /> and find the best surface fit, some variables are tunned. These variables are specific for each situation. <xref ref-type="table" rid="table1">Table 1</xref> shows the decision variables for each surface addressed in this paper. On the other hand, norm <img src="4-1100244\ff894fdc-bfff-43e4-a1d4-3c410df25638.jpg" /> remains constant in the optimization process and is considered as a parameter of the problem.</p><p><xref ref-type="table" rid="table1">Table 1</xref>. Decision variables in analytic surfaces fitting.</p><p><img src="4-1100244\7be570db-cc5e-4d57-ba36-c65ef7fc575d.jpg" /></p><p>The number of decision variables <img src="4-1100244\aeb4ac56-40d4-49d9-a656-b791409d6133.jpg" /> and the number of equality constrains <img src="4-1100244\2c20326a-d69e-4906-bdca-5d3f9b0ef16e.jpg" /> in a optimization problem, allow to know the degrees of freedom with the equiation<img src="4-1100244\4d44e68c-784f-4783-b166-1ee462b4f334.jpg" />. <xref ref-type="table" rid="table1">Table 1</xref> presents the degrees of freedom for each analytic surface addressed in this paper. Notice that <img src="4-1100244\56aa9ee0-a9fd-4349-be48-66279a818a0e.jpg" /> corresponds to <img src="4-1100244\caf16e10-49ad-463e-9b31-f0b653f1b41d.jpg" /> because the problem is unconstrained.</p></sec><sec id="s1_2"><title>1.2. Optimization Method</title><p>The Gauss-Newton iterative method for solving non-linear optimization problems uses the Hessian approximation <img src="4-1100244\ba7981fe-13da-4652-ba9b-ecae34a63e7e.jpg" /> to calculate the next iteration, as is shown in Equation (3).</p><disp-formula id="scirp.30864-formula89904"><label>(3)</label><graphic position="anchor" xlink:href="4-1100244\53a15bc9-8114-41ef-a701-cd790f0cabf1.jpg"  xlink:type="simple"/></disp-formula><p>where <img src="4-1100244\40c31a4c-d3ae-47d5-97e8-2061fed0a50d.jpg" /> is the decision variables vector and <img src="4-1100244\3f65cd5c-1a4b-4b61-985b-22876e542d4e.jpg" /> is residuals vector.</p><p>Notice that in the case in which <img src="4-1100244\9b849daa-3b31-417e-b562-22b5b838e6d7.jpg" /> is not strictly convex, <img src="4-1100244\04b2933d-bc13-4b4e-812f-efa4ef4ef044.jpg" />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]):</p><disp-formula id="scirp.30864-formula89905"><label>(4)</label><graphic position="anchor" xlink:href="4-1100244\559a994a-cf32-4242-8de5-e9a203944e11.jpg"  xlink:type="simple"/></disp-formula><p>where <img src="4-1100244\e7eb46e1-99f7-493e-a2ed-f3836a737775.jpg" /> is the LM parameter and <img src="4-1100244\8e5da5d3-2ec0-483d-a72f-dbd71932c03c.jpg" /> is the identity matrix.</p></sec><sec id="s1_3"><title>1.3. Function and Region Convexity</title><p>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<img src="4-1100244\db5b525e-bcb1-4f5f-9501-6cecdf44f925.jpg" />, it is required to examine the eigenvalues <img src="4-1100244\ca557f33-02cb-4c32-a7a6-8b3e9e3d4bb0.jpg" /> of its Hessian matrix <img src="4-1100244\eb918549-763c-427e-8f12-5e7c121eae0d.jpg" /> by solving Equation (5)</p><disp-formula id="scirp.30864-formula89906"><label>(5)</label><graphic position="anchor" xlink:href="4-1100244\5447edff-e3b8-430b-9082-321d3b36e086.jpg"  xlink:type="simple"/></disp-formula><p>If all eigenvalues of <img src="4-1100244\2221014f-e600-4450-8a81-703361216252.jpg" /> are positive, then <img src="4-1100244\5f8f3152-5728-46f8-a718-56c72fbab0ee.jpg" /> is strictly-convex, but if at least one eigenvalue is equal to zero, <img src="4-1100244\47f86300-3fa2-43a1-bb1a-ffa0cbf18b0f.jpg" />is convex [<xref ref-type="bibr" rid="scirp.30864-ref6">6</xref>]. In the case studies on this research, an exact calculation of <img src="4-1100244\d9185b00-19d2-493f-9608-8649070a1741.jpg" /> is not possible. Thus, a numerical calculation is required by approximating partial derivatives numerically.</p></sec></sec><sec id="s2"><title>2. Literature Review</title><sec id="s2_1"><title>2.1. Objective Function and Distance Measurement</title><p>Some authors have researched the calculation of the distance between a point and an analytic surface. Sappa and Rouhani [<xref ref-type="bibr" rid="scirp.30864-ref7">7</xref>] present a new technique for the estimation a pseudo geometric distance by calculating the height of a small tetrahedron intersecting the surface. This technique is prone to yield accuracy loss in the distance metric when applied to surfaces with high curvatures. Wang and Yu [<xref ref-type="bibr" rid="scirp.30864-ref1">1</xref>] present a comparison of the fitting processes implementing the algebraic, Euclidean, tangent or squared distance for fitting quadric surfaces. Zhou and Salvado [<xref ref-type="bibr" rid="scirp.30864-ref8">8</xref>] compare the geometric and algebraic distances in fitting ellipsoids. The authors estimate the geometric distance as the difference between the length of the ray connecting the point to ellipsoid center and the radius in the intersection of the ray and the surface. This estimation being a fast solution, only works well in cases of quasi-spherical ellipsoids.</p></sec><sec id="s2_2"><title>2.2. Optimality Conditions</title><p>Just like Zhou and Salvado [<xref ref-type="bibr" rid="scirp.30864-ref8">8</xref>], Jiang and Cheng [<xref ref-type="bibr" rid="scirp.30864-ref9">9</xref>] classify the surface fitting problem as a non-convex one. The authors do not discuss the convexity analysis neither for the objective function nor for the optimization region. Other references reviewed do not report any classification of the surface fitting problem in terms of the convexity.</p></sec><sec id="s2_3"><title>2.3. Optimization Methods</title><p>Yan, Liu and Wang [<xref ref-type="bibr" rid="scirp.30864-ref10">10</xref>] use Lloyd iterations to reconstruct quadric surfaces from a 3D point cloud. Ying, Yang and Zha [<xref ref-type="bibr" rid="scirp.30864-ref11">11</xref>] fit ellipsoids to data using semidefinite programming obtaining low runtime.</p><p>Jiang and Cheng [<xref ref-type="bibr" rid="scirp.30864-ref9">9</xref>] apply a decomposition technique to reduce the dimensions of the optimization space. This implies that the possibilities of dropping into local minima decrease. However, as the approach is out of the geometrical field, coming up with an initial guess of the parameters is not an easy task.</p><p>Li and Griffiths [<xref ref-type="bibr" rid="scirp.30864-ref12">12</xref>] fit ellipsoids by a least squares method using quadrics. This method does not require an initial estimation but, as it is not based on real geometrical distances, the results do not provide the best geometric fitting ellipsoid.</p><p>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.</p></sec><sec id="s2_4"><title>2.4. Initial Guess</title><p>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.</p><p>Just like Ruiz and Cadavid [<xref ref-type="bibr" rid="scirp.30864-ref14">14</xref>], Kwon et al. [<xref ref-type="bibr" rid="scirp.30864-ref15">15</xref>] use PCA for finding an approximation to axis orientation, center coordinates and radius of point clouds belonging to circular cylindrical surfaces. Because this technique reduces the dimensionality of the data giving the direction of largest dispersion [<xref ref-type="bibr" rid="scirp.30864-ref16">16</xref>], it is limited to cylinders with aspect ratio lower than 5.0 [<xref ref-type="bibr" rid="scirp.30864-ref14">14</xref>] and to cylindrical caps. Similarly, Zhou and Salvado [<xref ref-type="bibr" rid="scirp.30864-ref8">8</xref>] use the eigenvectors of the covariance matrix of the whole data as the axes of the ellipsoid coordinate system. As noted, this technique gives axes that probably will not correspond to the ellipsoid coordinate system in the case of ellipsoidal caps.</p><p>Simari and Singh [<xref ref-type="bibr" rid="scirp.30864-ref17">17</xref>] estimate the ellipsoid’s center as the geometric centroid of the data set. This proposal works in the cases of ellipsoids completely sampled but it loses validity when the cloud is only a subsample of the whole ellipsoid.</p><p>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.</p></sec><sec id="s2_5"><title>2.5. Literature Review Conclusions and Contribution of This Paper</title><p>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.</p></sec></sec><sec id="s3"><title>3. Methodology</title><sec id="s4_0_1"><title>3.1. Circular Cylinder Fitting</title><p>A circular cylinder is defined by a radius<img src="4-1100244\b798742c-f7b2-4086-998d-1967de505131.jpg" />, an axis vector and its pivot point <img src="4-1100244\f7acfeb9-b39f-4ca3-ab5b-cc952e85cbe6.jpg" /> and <img src="4-1100244\93831708-c2fa-49b5-8537-64c01490f6d7.jpg" /> 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.</p></sec><sec id="s4_0_2"><title>3.1.1. Initial Guess for Circular Cylinder</title><p>The initial guess of the cylinder’s parameters is obtained with a statistical and geometrical procedure as explained below and shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>:</p><p>1) Random seed points are selected from <img src="4-1100244\b966afaf-7bc7-4a39-8a5f-45b3fa3063c6.jpg" /> and a local neighborhood <img src="4-1100244\0d164c4c-1575-496c-a5c9-0331f615dcc4.jpg" /> found for each seed. See <xref ref-type="fig" rid="fig1">Figure 1</xref>(a).</p><p>2) Crossing each other the line segments defined by a seed point and the normal vector <img src="4-1100244\c9d878fc-6dc5-4777-83cf-9f7c80f54b0c.jpg" /> of the best plane fit to<img src="4-1100244\50c9fde7-49a7-4c7c-8ec2-7ca8661e0c6d.jpg" />, a set of points <img src="4-1100244\8c4cbed3-b812-47ed-b320-aaaec29c488d.jpg" /> passing near <img src="4-1100244\bc6d7962-d258-4104-a861-cd54233dde8b.jpg" /> are found. See <xref ref-type="fig" rid="fig1">Figure 1</xref>(b).</p><p>3) A PCA is executed over <img src="4-1100244\4b7b4e34-7f7b-4bcd-a925-ddc9db8f0eb9.jpg" /> for finding an initial approximation of the cylinder axis and its pivot point, <img src="4-1100244\bcb23a85-8060-4fce-8331-cf6f7fa1cfed.jpg" />and <img src="4-1100244\55d21399-f2ae-4505-9fdb-17b4f0c7011f.jpg" /> respectively. See <xref ref-type="fig" rid="fig1">Figure 1</xref>(c).</p><p>4) An approximation to the cylinder radius is calculated as the average of the minimum distances between <img src="4-1100244\733888b9-68de-429f-be50-64fbb5c3f0cb.jpg" /> and<img src="4-1100244\5f8b9d8c-ba48-49a3-83ea-5c9ddc561fe8.jpg" />.</p><p>This method allows processing both complete cylindrical surfaces and cylindrical caps.</p></sec><sec id="s4_0_3"><title>3.1.2. Estimation of Point-Cylinder Distance</title><p>The minimum distance <img src="4-1100244\a6ff0a28-a372-4a21-a3ee-ebc9f2cd20e7.jpg" /> between the point <img src="4-1100244\d08f4f3c-20f3-4309-8c29-b4f6695dcdf8.jpg" /> and a circular cylindrical surface is calculated as:</p><disp-formula id="scirp.30864-formula89907"><label>(6)</label><graphic position="anchor" xlink:href="4-1100244\150b6010-50c0-4541-9c33-77d7924d56ca.jpg"  xlink:type="simple"/></disp-formula><p>where <img src="4-1100244\9032647b-37e5-400c-a203-4fdc99675d2e.jpg" /> is the radius of the cylinder and <img src="4-1100244\16e804c0-6a26-4e79-8953-33328b4842a7.jpg" /> is the orthogonal projection of <img src="4-1100244\3edb57d4-14ba-4058-a702-b39610ddfcf9.jpg" /> onto <img src="4-1100244\c22c7eaa-ee9b-495c-a64e-892d7949c534.jpg" /> as is shown in <xref ref-type="fig" rid="fig2">Figure 2</xref>.</p></sec><sec id="s4_1"><title>3.2. Circular Cone Fitting</title><p>A circular right cone can be defined by an axis vector<img src="4-1100244\78cd221a-75cd-4ead-a3b5-05c57026cdca.jpg" />, an apex <img src="4-1100244\15ce2977-8192-4eb3-8057-9ac6b37affd0.jpg" /> and a semi-opening angle<img src="4-1100244\8284ee65-9c58-46c2-b20e-5406f665d5d3.jpg" />.</p><sec id="s4_1_1"><title>3.2.1. Initial Guess for Circular Cone</title><p>The initial approximation of a circular conical surface to a point cloud is obtained by an statistical and geometrical procedure as is depicted in <xref ref-type="fig" rid="fig3">Figure 3</xref> and explained as follows:</p><p>1) A set of seed points and local neighborhoods <img src="4-1100244\7c44134a-ff9d-4718-918b-42c77dfcb1a9.jpg" /> are taken from<img src="4-1100244\df68fadb-3ba4-42b8-8d4f-41dc8f199f12.jpg" />. See <xref ref-type="fig" rid="fig4">Figure 4</xref>(a).</p><p>2) The minimum curvature direction <img src="4-1100244\d8aff515-a3d3-4e5b-808e-01c3c2c77851.jpg" /> of<img src="4-1100244\37616ba4-136e-4958-8ecc-54e58a9399cf.jpg" />,</p><p>being collinear with a generatrix of the cone, is found by fitting a paraboloid <img src="4-1100244\d6459ec8-ddfd-458e-8717-f4eb95108bf6.jpg" /> and calculating the eigenvectors of it Hessian matrix</p><p><img src="4-1100244\46f0f178-e9ee-4dae-b717-2b501d98a3ba.jpg" />. See <xref ref-type="fig" rid="fig4">Figure 4</xref>(b).</p><p>3) <img src="4-1100244\61f4c16f-6307-4cdd-8bec-0aaec9a590b3.jpg" />being the first approximation to<img src="4-1100244\85f09320-9c72-4182-962a-cef7cc3c28f8.jpg" />, is obtained by averaging the crossing points of all lines defined by a seed point and its corresponding<img src="4-1100244\b25a9d2e-8424-4674-87f0-559b1893e6b0.jpg" />. Notice that <img src="4-1100244\ff30ccda-ccc5-4f33-87bf-31c2a624cd2d.jpg" /> represents an statistical apex. See <xref ref-type="fig" rid="fig4">Figure 4</xref>(c).</p><p>4) By finding the center of gravity of the center of the circumferences passing trough the points<img src="4-1100244\3c5f90dd-ec83-4bdb-b8b0-1a01616ebd6e.jpg" />, <img src="4-1100244\ffb15fd3-42ca-4786-93c3-d852cd08c056.jpg" />and<img src="4-1100244\e4267184-5203-4a3a-b8cf-f6795597f9bc.jpg" />, where <img src="4-1100244\b76f1e71-33fa-4656-b2ad-40df80f017e3.jpg" /> and <img src="4-1100244\bd2accfc-8b8f-42e6-91e8-953fced070a4.jpg" />are unitary vectors in direction of minimum curvatures, the initial guess of the axis vector <img src="4-1100244\56a9a3c8-3697-47ce-929c-64b44487ad2f.jpg" /> is</p><p>calculated. See <xref ref-type="fig" rid="fig4">Figure 4</xref>(d).</p><p>5) The initial estimation of <img src="4-1100244\586c146a-7755-4c2c-a2d2-a8a7437e097d.jpg" /> is taken as the average of the angles between the vectors <img src="4-1100244\999b47c0-c16f-46a1-9b51-d268be2a1ea9.jpg" /> and<img src="4-1100244\c5124341-f026-4fb1-8788-9454e5d85fbe.jpg" />. See <xref ref-type="fig" rid="fig4">Figure 4</xref>(e).</p></sec><sec id="s4_1_2"><title>3.2.2. Point-Cone Distance Estimation</title><p>The distance <img src="4-1100244\4f257fbc-8aa2-4ebc-9738-66fb3213011e.jpg" /> from a point <img src="4-1100244\93c9bcd3-cca7-4b2f-b6b2-639a16097155.jpg" /> and a cone is calculated by solving the Equation (7) for <img src="4-1100244\a5a1029a-fbe1-4d58-a67a-7364baa94b8d.jpg" /> and<img src="4-1100244\cbf8754d-3508-4c44-8ae0-a61e322d634a.jpg" />.</p><disp-formula id="scirp.30864-formula89908"><label>(7)</label><graphic position="anchor" xlink:href="4-1100244\81814814-27af-48a0-ae21-8cd191406552.jpg"  xlink:type="simple"/></disp-formula><p>where <img src="4-1100244\eb2640da-2122-4c87-a1d1-458e399d41f3.jpg" /> is a rotation of <img src="4-1100244\530def7b-7b90-488f-b424-ff750008cad3.jpg" /> around <img src="4-1100244\14460207-8212-43e8-b099-5a3c1d0b5197.jpg" /> an angle<img src="4-1100244\08d5407d-6ebd-4c5b-8ba7-3ae09b815808.jpg" />,</p><p><img src="4-1100244\bf0ccdaf-4339-4916-b605-47fff09c33f6.jpg" />and <img src="4-1100244\05ab0414-96c2-45c3-adba-44c75a6d4d21.jpg" /> as is shown in the <xref ref-type="fig" rid="fig5">Figure 5</xref>. Finally <img src="4-1100244\d0e2fc34-ba06-44f8-ad5d-b492be4ae864.jpg" /> is the signed distance between <img src="4-1100244\33c32515-c4f9-4c2a-ada8-ae8834d0946a.jpg" /> and the cone.</p></sec></sec><sec id="s4_2"><title>3.3. Ellipsoid Fitting</title><p>As is shown in <xref ref-type="table" rid="table1">Table 1</xref>, an ellipsoid in general position is defined by the center coordinates<img src="4-1100244\9279222e-1054-4c6b-a8e8-b386a6723de2.jpg" />, the semi axes <img src="4-1100244\26cfa843-3076-48f7-ae29-2311c56b2778.jpg" /> and the Euler angles<img src="4-1100244\529159be-9115-4a2c-a929-00e6a5e7d8cf.jpg" />.</p><sec id="s4_2_1"><title>3.3.1. Initial Guess for Ellipsoid</title><p>The first approximation to the parameters of the ellipsoid can be obtained with the following procedure:</p><p>1) A general quadric surface is defined by Equation (8).</p><disp-formula id="scirp.30864-formula89909"><label>(8)</label><graphic position="anchor" xlink:href="4-1100244\836645ad-e46d-45e4-8dd3-a5549d21c542.jpg"  xlink:type="simple"/></disp-formula><p>Rearranging Equation (8) appropriately [<xref ref-type="bibr" rid="scirp.30864-ref18">18</xref>], it can be written as:</p><p><img src="4-1100244\98deccee-33ee-45ef-bab4-4919aab07120.jpg" /></p><p>In compact form, the above equation is:</p><disp-formula id="scirp.30864-formula89910"><label>(9)</label><graphic position="anchor" xlink:href="4-1100244\7848ab17-ff95-4d1e-8cdd-401832bb2c11.jpg"  xlink:type="simple"/></disp-formula><p>If the <img src="4-1100244\61e1ca11-4278-4f36-96d6-a147991357c2.jpg" /> points of <img src="4-1100244\30bb4810-81a2-4700-a0f4-d20763136988.jpg" /> are taken into account, <img src="4-1100244\90fdf733-d250-4792-857e-b3dfe7794106.jpg" />is a <img src="4-1100244\b0ad6eda-d633-4f94-889e-c36343c541bf.jpg" /> matrix where its row <img src="4-1100244\ebc1308f-1f61-4ca8-8d57-be680074e999.jpg" />-th is:</p><p><img src="4-1100244\00fede21-b92e-49cf-a8fc-6d3fd4e2f471.jpg" /></p><p><img src="4-1100244\66bef0a1-da2b-402a-8f02-531453df039b.jpg" />is a <img src="4-1100244\2e7460dc-1beb-43f7-bf73-1ff0500cba1c.jpg" /> vector with row <img src="4-1100244\7b01f997-d035-4a7b-9617-666c006dea44.jpg" />-th:<img src="4-1100244\3c13ed80-6871-4522-980c-e0d843fd161d.jpg" />. <img src="4-1100244\88674bdc-6b6e-4c6b-84c0-ede334a57f4a.jpg" />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<img src="4-1100244\0d1c907f-3ada-4677-8525-26815cde8835.jpg" />:</p><p><img src="4-1100244\93099bb3-5496-4a78-bcba-3943e4310038.jpg" /></p><p>2) The initial approximation of the center coordinates<img src="4-1100244\ed2f9e44-c374-4b03-a7c5-7cf722244892.jpg" />, the semi axes <img src="4-1100244\c01222d4-1043-4f99-be2b-76d40fec0ba8.jpg" /> and the Euler angles<img src="4-1100244\c2e84261-aee6-46f2-b609-8e96a17b19c2.jpg" />, are obtained from the subdiscriminant <img src="4-1100244\67928ad1-889e-4c0e-b802-228c5f4006b8.jpg" /> in the matrix notation of a general oriented quadric:</p><disp-formula id="scirp.30864-formula89911"><label>(10)</label><graphic position="anchor" xlink:href="4-1100244\e939d969-9ec3-4bb7-aaa9-9c8ea626f748.jpg"  xlink:type="simple"/></disp-formula><p>where</p><p><img src="4-1100244\db42cfe2-2a21-4899-8228-a4305795cc53.jpg" /></p><p>The eigenvectors of <img src="4-1100244\c6e12388-bb7a-4649-9f42-84ddeceef985.jpg" /> represent the axes of the ellipsoid, then <img src="4-1100244\1b655560-a63e-4274-a531-e261bc2f2b9e.jpg" /> and <img src="4-1100244\b66d2398-f1f1-4a5c-ad4a-912a5cdf1d4f.jpg" /> can be calculated. The eigenvalues of <img src="4-1100244\ac67e552-8997-4f34-865d-704846598895.jpg" /> are proportional to<img src="4-1100244\d15a5bf9-7a53-465b-a56b-9d4e6c6737c5.jpg" /> and <img src="4-1100244\e2765258-8e03-4d5d-b1bd-d55fb75638af.jpg" /> [<xref ref-type="bibr" rid="scirp.30864-ref19">19</xref>], then <img src="4-1100244\81045565-fce7-419b-a99d-db72719204fa.jpg" /> and <img src="4-1100244\49c9560e-012d-461b-8a86-83519ca33578.jpg" /> can be obtained. The initial guess of the ellipsoid center can be obtained as</p><p><img src="4-1100244\32e0ef3b-71af-4a5b-91c4-8e4b455170aa.jpg" />.</p></sec><sec id="s4_2_2"><title>3.3.2. Point-Ellipsoid Distance Estimation</title><p>We present the following conjecture (<xref ref-type="fig" rid="fig6">Figure 6</xref>).</p><p>Conjecture. Let <img src="4-1100244\f316f18f-f781-4bd6-bbd6-5b91dcdcee69.jpg" /> be an ellipsoid centered in <img src="4-1100244\4b5ef4ec-1d22-4a14-9751-ddbc55cd7e54.jpg" />i with Euler angles <img src="4-1100244\4c40bb52-670c-4665-bf62-2d1ed884f5ad.jpg" /> and semi axes<img src="4-1100244\30c509de-f247-44e2-b6e6-84d8d4624e86.jpg" />. Let <img src="4-1100244\73bc05fe-90cb-4f64-b56f-1039720b39e4.jpg" /> be a point in<img src="4-1100244\672edae6-9a41-447f-80b2-accf87feab92.jpg" />. Then, an ellipsoid <img src="4-1100244\5b18081d-c389-4630-88d3-8a8445482d8e.jpg" /> exists with the same center and orientation to<img src="4-1100244\0e5e2f36-7f11-43d7-bda9-f249d12d252e.jpg" />, but with semi axes</p><p><img src="4-1100244\6a505b93-c0f9-4b56-89ae-7483d49f55a0.jpg" />, that contain<img src="4-1100244\b30e27d8-f0a7-42f2-92eb-f6c4f68033c9.jpg" />.</p><p>If <img src="4-1100244\f106eee6-7c5f-48a8-a0ca-75cb7f34fb7f.jpg" /> and <img src="4-1100244\7a255382-2983-4445-bd10-e27ea6bce369.jpg" /> are translated to the origin and aligned with the principal axes by a rigid transformation, the following equation can be posed:</p><disp-formula id="scirp.30864-formula89912"><label>(11)</label><graphic position="anchor" xlink:href="4-1100244\dd2675cc-d099-4045-8d39-3e3f6d3d6854.jpg"  xlink:type="simple"/></disp-formula><p>Rearranging (11):</p><disp-formula id="scirp.30864-formula89913"><label>(12)</label><graphic position="anchor" xlink:href="4-1100244\54cfe795-6e84-4a6c-b9b6-76e421fd975d.jpg"  xlink:type="simple"/></disp-formula><p>where <img src="4-1100244\5a3094ef-aef5-4399-ad51-56c5ad0b92e4.jpg" /> with<img src="4-1100244\c63c82a1-c694-4fcd-ac64-f06fa0dcd669.jpg" />.</p><p>The minimum absolute real root of the polynomial in Equation (12) corresponds to the minimum signed distance from <img src="4-1100244\6ad2c83c-0583-44dc-870a-559aa9f95586.jpg" /> to<img src="4-1100244\8be35ca4-4a6b-4592-90ea-f4fd2db0d87d.jpg" />.</p></sec></sec></sec><sec id="s5"><title>4. Results and Discussion</title><p>In order to test our fitting routines two study cases were proposed as follows.</p><sec id="s5_1"><title>4.1. Data Set 1. Frog</title><p>In order to prove the algorithm for fitting ellipsoids, a subset of the frog shown in <xref ref-type="fig" rid="fig7">Figure 7</xref>(a) was taken. In <xref ref-type="fig" rid="fig7">Figure 7</xref>(b) the highlighted points to which the ellipsoids were fitted can be seen. The result of the fitting process is presented in Figures 7(c) and (d).</p><p>A good initial guess found by an algebraic approach, let to a fast convergence of the algorithm. In <xref ref-type="fig" rid="fig8">Figure 8</xref> it may be seen that the longest fitting process required of 12 iterations for finding the optimum according to the termination criteria. In <xref ref-type="fig" rid="fig9">Figure 9</xref> the initial estimation ellipsoid and the best geometrical ellipsoid fit are shown. Notice that the initial surface wraps most of the points, giving a good starting point for the LM algorithm. <xref ref-type="table" rid="table2">Table 2</xref> presents a comparison between the the initial ellipsoids and the optimized ones.</p><p><xref ref-type="table" rid="table2">Table 2</xref>. Fitting results in frog’s study case.</p><p><img src="4-1100244\b7f56c57-df9e-4459-83bc-99b1c83b9c0b.jpg" /></p></sec><sec id="s5_2"><title>4.2. Data Set 2. Fan</title><p>To test the cylinder and cone fitting algorithms some parts of the fan shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>0(a) were processed with the algorithms. <xref ref-type="fig" rid="fig1">Figure 1</xref>0 displays the results of the optimization process of two conical surfaces and one cylinder. As in the case of ellipsoids, the algorithm found the optimal surface after a few iterations. The history of the optimized function for the Fan Data Set is shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>1. The cones (<xref ref-type="fig" rid="fig1">Figure 1</xref>2) required 4 iterations while the cylinders (<xref ref-type="fig" rid="fig1">Figure 1</xref>3) required 6 iterations. The good initial estimation of the surfaces allows the convergence of the algorithm and to reduce the number of iterations, therefore saving computing resources. Geometrical statistics for the Fan Data Set appear in <xref ref-type="table" rid="table3">Table 3</xref>.</p><p><xref ref-type="table" rid="table3">Table 3</xref>. Fitting results in fan’s study case.</p><p><img src="4-1100244\4a2962aa-d884-44e3-ae77-0852de22a58c.jpg" /></p></sec></sec><sec id="s6"><title>5. Conclusions and Future Work</title><p>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.</p><p>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.</p><p>Future work includes the extension of the optimization strategies to other analytic and to free form parametric surfaces.</p></sec><sec id="s7"><title>REFERENCES</title></sec><sec id="s8"><title>Nomenclature</title><p>S: <img src="4-1100244\36c3b7fd-4dcd-4cd7-9cea-d405967d04ae.jpg" />Noisy point sample F: Best fit surface to S PCA: Principal Component Analysis LM: Lenvenberg-Marquardt k: Norm degree f: Objective function d<sub>i</sub>: Minimum distance between the i-th point of <img src="4-1100244\876c83f1-86f3-4c51-89cc-ee1b0676b0fb.jpg" /> and its corresponding point on F</p></sec></body><back><ref-list><title>References</title><ref id="scirp.30864-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">H. Nyquist, “Certain Topics in Telegraph Transmission Theory,” Transactions of the American Institute of Electrical Engineers, Vol. 47, No. 2, 1928, pp. 617-644.  
doi:10.1109/T-AIEE.1928.5055024</mixed-citation></ref><ref id="scirp.30864-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">C. E. Shannon, “Communication in the Presence of Noise,” Proceedings of the IRE, Vol. 37, No. 1, 1949, pp. 10-21. doi:10.1109/JRPROC.1949.232969</mixed-citation></ref><ref id="scirp.30864-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">K. Levenberg, “A Method for the Solution of Certain Non-Linear Problems in Least Squares,” Quarterly Journal of Applied Mathmatics, Vol. II, No. 2, 1944, pp. 164-168.</mixed-citation></ref><ref id="scirp.30864-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">D. W. Marquardt, “An Algorithm for Least-Squares Estimation of Nonlinear Parameters,” Journal of the Society for Industrial and Applied Mathematics, Vol. 11, No. 2, 1963, pp. 431-441. doi:10.1137/0111030</mixed-citation></ref><ref id="scirp.30864-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">E. K. P. Chong and S. H. Zak, “An Introduction to Optimization,” 2nd Edition, Wiley India Pvt. Ltd., New Delhi, 2010.</mixed-citation></ref><ref id="scirp.30864-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">J. Wang and Z. Yu, “Quadratic Curve and Surface Fitting Via Squared Distance Minimization,” Computers and Graphics, Vol. 35, No. 6, 2011, pp. 1035-1050.  
doi:10.1016/j.cag.2011.09.001</mixed-citation></ref><ref id="scirp.30864-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">A. D. Sappa and M. Rouhani, “Efficient Distance Estimation for Fitting Implicit Quadric Surfaces,” 16th IEEE International Conference on Image Processing ICIP, Cairo, 7-12 November 2009, pp. 3521-3524.</mixed-citation></ref><ref id="scirp.30864-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">D. M. Yan, Y. Liu and W. Wang, “Quadric Surface Extraction by Variational Shape Approximation,” Geometric Modeling and Processing—GMP, Pittsburgh, 26-28 July 2006, pp. 73-86.</mixed-citation></ref><ref id="scirp.30864-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">X. Jiang and D. C. Cheng, “A Novel Parameter Decomposition Approach to Faithful Fitting of Quadric Surfaces,” Pattern Recognition, Vol. 3663, 2005, pp. 168-175. doi:10.1007/11550518_21</mixed-citation></ref><ref id="scirp.30864-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">X. Ying, L. Yang and H. Zha, “A Fast Algorithm for Multidimensional Ellipsoid-Specific Fitting by Minimizing a New Defined Vector Norm of Residuals Using Semidefinite Programming,” IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol.:1856-1863, 2012. doi:10.1109/TPAMI.2012.109</mixed-citation></ref><ref id="scirp.30864-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Q. Li and J. G. Griffiths, “Least Squares Ellipsoid Specific Fitting,” Proceedings of Geometric Modeling and Processing, 2004, pp. 335-340.  
doi:10.1109/GMAP.2004.1290055</mixed-citation></ref><ref id="scirp.30864-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">S. W. Kwon, F. Bosche, C. Kim, C. T. Haas and K. A. Liapi, “Fitting Range Data to Primitives for Rapid Local 3D Modeling Using Sparse Range Point Clouds,” Automation in Construction, Vol. 13, No. 1, 2004, pp. 67-81.  
doi:10.1016/j.autcon.2003.08.007</mixed-citation></ref><ref id="scirp.30864-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">O. Ruiz and C. Vanegas, “Statistical Assessment of Global and Local Cylinder Wear,” 5th IEEE International Conference on Industrial Informatics, Vienna, 23-26 July 2007, pp. 387-392.</mixed-citation></ref><ref id="scirp.30864-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">R. A. Calvo, M. Partridge and M. Jabri, “A Comparative Study of Principal Component Analysis Techniques,” Proceedings of Ninth Australian Conference on Neural Networks, Brisbane, 11-13 February 1998, pp. 276-281.</mixed-citation></ref><ref id="scirp.30864-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">L. Zhou and O. Salvado, “A Comparison Study of Ellipsoid Fitting for Pose Normalization of Hippocampal Shapes,” International Conference on Digital Image Computing Techniques and Applications (DICTA), Noosa, 6-8 December 2011. pp. 285-290.</mixed-citation></ref><ref id="scirp.30864-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">P. D. Simari and K. Singh, “Extraction and Remeshing of Ellipsoidal Representations from Mesh Data,” Proceedings of Graphics Interface, 9-11 May 2005, Canadian Human-Computer Communications Society, pp. 161-168.</mixed-citation></ref><ref id="scirp.30864-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">D. Marshall, G. Lukacs and R. Martin, “Robust Segmentation of Primitives from Range Data in the Presence of Geometric Degeneracy,” IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 23, No. 3, 2001, pp. 304-314. doi:10.1109/34.910883</mixed-citation></ref><ref id="scirp.30864-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">D. A. Turner, I. J. Anderson, J. C. Mason and M. G. Cox, “An Algorithm for Fitting an Ellipsoid to Data,” National Physical Laboratory, Teddington, 1999.</mixed-citation></ref><ref id="scirp.30864-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">J. Wallner, “On the Semiaxes of Touching Quadrics,” Resultate der Mathematik, Vol. 36, No. 3-4, 1999, pp. 373-383. doi:10.1007/BF03322124</mixed-citation></ref><ref id="scirp.30864-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">P. Morena at Thingiverse, “Treefrog STL Model,” 2012.  
http://www.thingiverse.com/download:61236</mixed-citation></ref><ref id="scirp.30864-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">E. Carlos at GrabCAD, “Fan STL Model,” 2012.  
http://grabcad.com/library/carcasa-de-un-ventilador-paraensayos/files/carca.stl</mixed-citation></ref></ref-list></back></article>