Skip to main content
Log in

Efficient computation of the Gauss-Newton direction when fitting NURBS using ODR

  • Published:
BIT Numerical Mathematics Aims and scope Submit manuscript

Abstract

We consider a subproblem in parameter estimation using the Gauss-Newton algorithm with regularization for NURBS curve fitting. The NURBS curve is fitted to a set of data points in least-squares sense, where the sum of squared orthogonal distances is minimized. Control-points and weights are estimated. The knot-vector and the degree of the NURBS curve are kept constant. In the Gauss-Newton algorithm, a search direction is obtained from a linear overdetermined system with a Jacobian and a residual vector. Because of the properties of our problem, the Jacobian has a particular sparse structure which is suitable for performing a splitting of variables. We are handling the computational problems and report the obtained accuracy using different methods, and the elapsed real computational time. The splitting of variables is a two times faster method than using plain normal equations.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4

Similar content being viewed by others

References

  1. Ahn, S.J.: Geometric fitting of parametric curves and surfaces. JIPS 4(4), 153–158 (2008)

    Google Scholar 

  2. Atieg, A., Watson, G.A.: A class of methods for fitting a curve or surface to data by minimizing the sum of squares of orthogonal distances. J. Comput. Appl. Math. 158(2), 277–296 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  3. Björck, Å.: Numerical Methods for Least Squares Problems. SIAM, Philadelphia (1996)

    Book  MATH  Google Scholar 

  4. Boggs, P.T., Donaldson, J.R., Byrd, R.h., Schnabel, R.B.: Algorithm 676: Odrpack: software for weighted orthogonal distance regression. ACM Trans. Math. Softw. 15, 348–364 (1989)

    Article  MATH  Google Scholar 

  5. Borges, C.F.: A full-Newton approach to separable nonlinear least squares. Electron. Trans. Numer. Anal. 35, 57–68 (2009)

    MathSciNet  MATH  Google Scholar 

  6. Borges, C.F., Pastva, T.: Total least squares fitting of Bézier and B-spline curves to ordered data. Comput. Aided Geom. Des. 19(4), 275–289 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  7. Carlson, N., Gulliksson, M.: Surface fitting with NURBS: a Gauss-Newton with trust region approach. In: MATH’08: Proceedings of the 13th WSEAS International Conference on Applied Mathematics, pp. 169–174. World Scientific and Engineering Academy and Society (WSEAS), Stevens Point, (2008)

    Google Scholar 

  8. Cox, M.: The least-squares solution of linear equations with block-angular observation matrix. In: Cox, M., Hammarling, S. (eds.) Reliable Numerical Computation. Oxford University Press, Oxford (1990)

    Google Scholar 

  9. Dan, J., Lancheng, W.: An algorithm of NURBS surface fitting for reverse engineering. Int. J. Adv. Manuf. Technol. 31, 92–97 (2006)

    Article  Google Scholar 

  10. Gilbert, J.R., Moler, C., Schreiber, R.: Sparse matrices in Matlab: design and implementation. SIAM J. Matrix Anal. Appl. 13, 333–356 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  11. Householder, A.S.: Unitary triangularization of a nonsymmetric matrix. J. ACM 5, 339–342 (1958)

    MathSciNet  MATH  Google Scholar 

  12. Laurent-Gengoux, P., Mekhilef, M.: Optimization of a NURBS representation. Comput. Aided Des. 25(11), 699–710 (1993)

    Article  MATH  Google Scholar 

  13. Ma, W., Kruth, J.P.: Parameterization of randomly measured points for least squares fitting of B-spline curves and surfaces. Comput. Aided Des. 27(9), 663–675 (1995)

    Article  MATH  Google Scholar 

  14. Ma, W., Kruth, J.P.: NURBS curve and surface fitting for reverse engineering. Int. J. Adv. Manuf. Technol. 14(12), 918–927 (1998)

    Article  Google Scholar 

  15. Mizutani, E., Demmel, J.W.: On structure-exploiting trust-region regularized nonlinear least squares algorithms for neural-network learning. Neural Netw. 16(5–6), 745–753 (2003)

    Article  Google Scholar 

  16. Piegl, L., Tiller, W.: The NURBS Book, 2nd edn. Springer, New York (1997)

    Book  Google Scholar 

  17. Piegl, L.A., Tiller, W.: Parametrization for surface fitting in reverse engineering. Comput. Aided Des. 33(8), 593–603 (2001)

    Article  Google Scholar 

  18. Sourlier, D.M.: Three dimensional feature independent bestfit in coordinate metrology. Ph.D. thesis, ETH, Zürich (1995). doi:10.3929/ethz-a-001516147

  19. Speer, T., Kuppe, M., Hoschek, J.: Global reparametrization for curve approximation. Comput. Aided Geom. Des. 15(9), 869–877 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  20. Turner, D., Anderson, I., Mason, J., Cox, M., Forbes, A.: An efficient separation-of-variables approach to parametric orthogonal distance regression. In: Ciarlini, P., Forbes, A., Pavese, F., Richter, D. (eds.) Advanced Mathematical and Computational Tools in Metrology IV. Series on Advances in Mathematics for Applied Sciences, vol. 53, pp. 246–255. World Scientific, Singapore (2000)

    Chapter  Google Scholar 

  21. Wang, W., Pottmann, H., Liu, Y.: Fitting B-spline curves to point clouds by curvature-based squared distance minimization. ACM Trans. Graph. 25(2), 214–238 (2006)

    Article  Google Scholar 

  22. Yang, L., Wenping, W.: A revisit to least squares orthogonal distance fitting of parametric curves and surfaces. Adv. Geom. Modeling Process. 4975(5), 384–397 (2008)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Per Bergström.

Additional information

Communicated by Tom Lyche.

Appendix

Appendix

In this appendix we are giving some details about the origin of G, g and (3.9). The rows in \(\tilde{\mathbf{J}}\) consisting of \(\lambda_{u_{k}}\) and c k is here denoted \([\bar{\boldsymbol{\mathcal{L}}}_{k} \ \bar{\boldsymbol{\mathcal{S}}}_{k}]\), and the corresponding rows in \(\tilde{\mathbf{r}}\) is denoted \(\bar{\mathbf{r}}_{k}\). The parameter \(\lambda_{u_{k}}\) is in the first row of \(\bar{\boldsymbol{\mathcal{L}}}_{k}\). Explicitly written, we have

and from these quantities we form the matrices

$$\bar{\mathbf{J}}=\left[\begin{array}{c@{\quad }c}\bar{\boldsymbol{\mathcal{L}}}_0 & \bar{\boldsymbol{\mathcal{S}}}_0 \\\bar{\boldsymbol{\mathcal{L}}}_1 & \bar{\boldsymbol{\mathcal{S}}}_1 \\\vdots & \vdots\\\bar{\boldsymbol{\mathcal{L}}}_m & \bar{\boldsymbol{\mathcal{S}}}_m \\\mathbf{0} & \boldsymbol{\Lambda}_{\mathrm{s}}\\\end{array}\right],\qquad \bar{\mathbf{r}}=\left[\begin{array}{c}\bar{\mathbf{r}}_0\\\bar{\mathbf{r}}_1\\\vdots\\\bar{\mathbf{r}}_m\\\mathbf{0}\\\end{array}\right],$$

which are same as \(\tilde{\mathbf{J}}\) and \(\tilde{\mathbf{r}}\), but with interchanged rows.

We use an orthogonal matrix similar to a Householder transformation [11],

$$\boldsymbol{\Phi}_{k}=\frac{2}{\| \mathbf{v}_{k}\| _2^2}\mathbf{v}_{k}\mathbf{v}_{k}^{\mathrm{T}}-\mathbf{I}_{d+1},$$

where

$$\mathbf{v}_{k}=\left[\begin{array}{c}\lambda_{u_k}+\sqrt{\sigma_k}\\{\mathbf{c}'}_k\\\end{array}\right].$$

It gives that \(\| \mathbf{v}_{k} \| _{2}^{2}=2(\sigma_{k}+\lambda _{u_{k}}\sqrt{\sigma_{k}})\). Usually the opposite sign of Φ k is used, making it to a reflection matrix. We could have done that but our way makes subsequent expressions simpler without minus signs. We multiply \(\bar{\boldsymbol{\mathcal{L}}}_{k}\), \(\bar{\boldsymbol{\mathcal{S}}}_{k}\) and \(\bar{\mathbf{r}}_{k}\) with Φ k . That results in

$$ \everymath{\displaystyle}\begin{array}{rcl}\boldsymbol{\Phi}_{k}\bar{\boldsymbol{\mathcal{L}}}_k&= &\left[\begin{array}{c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c}0 & \ldots& 0 & \sqrt{\sigma_k} & 0 & \ldots& 0 \\\mathbf{0} & \ldots& \mathbf{0} & \mathbf{0} & \mathbf{0} & \ldots&\mathbf{0} \\\end{array}\right],\\[14pt]\boldsymbol{\Phi}_{k}\bar{\boldsymbol{\mathcal{S}}}_k&=&\bigg( \frac{2}{\| \mathbf{v}_{k} \| _2^2}\mathbf {v}_{k}\mathbf{v}_{k}^{\mathrm{T}}-\mathbf{I}_{d+1} \bigg)\left[\begin{array}{c@{\quad }c@{\quad }c@{\quad }c}\mathbf{0} & \mathbf{0} & \ldots& \mathbf{0}\\\boldsymbol{\mathcal{S}}_{k,1} & \boldsymbol{\mathcal{S}}_{k,2}& \ldots& \boldsymbol{\mathcal{S}}_{k,n-1}\\\end{array}\right]\\[14pt]&=&\left[\begin{array}{c@{\quad }c@{\quad }c@{\quad }c}\frac{1}{\sqrt{\sigma_k}} \boldsymbol{\mathcal{H}}_{k,1}&\frac{1}{\sqrt{\sigma_k}}\boldsymbol{\mathcal{H}}_{k,2}&\ldots &\frac{1}{\sqrt{\sigma_k}}\boldsymbol{\mathcal{H}}_{k,n-1}\\[9pt]\boldsymbol{\mathcal{G}}_{k,1}&\boldsymbol{\mathcal{G}}_{k,2}& \ldots &\boldsymbol{\mathcal{G}}_{k,n-1}\end{array} \right],\\[21pt]\boldsymbol{\Phi}_{k}\bar{\mathbf{r}}_k&=&2\frac{\mathbf{r}_k \cdot {\mathbf{c}'}_k}{\|\mathbf{v}_{k} \| _2^2}\left[\begin{array}{c}\lambda_{u_k}+\sqrt{\sigma_k}\\{\mathbf{c}'}_k\end{array}\right]-\left[\begin{array}{c}0\\{\mathbf{r}}_k\end{array}\right]=\left[\begin{array}{c}\frac{1}{\sqrt{\sigma_k}} \mathbf{r}_k ^{\mathrm{T}} {\mathbf{c}'}_k\\\mathbf{g}_{k}\\\end{array}\right],\end{array}$$
(8.1)

where

Let

$$\mathbf{Z} =\operatorname{diag}(\sqrt{\sigma_0},\sqrt{\sigma_1},\ldots,\sqrt{\sigma_m}),$$

be a diagonal matrix, and let

$$\mathbf{B}=\operatorname{diag}(\boldsymbol{\Phi}_{0},\ldots,\boldsymbol{\Phi}_{m},\mathbf{I}_{(n-1)(d+1)}), $$

be a block diagonal matrix. Note that Z 2=D. The matrix B is an orthogonal matrix since all of its diagonal blocks are orthogonal. The vector \(\bar{\mathbf{J}}\boldsymbol{\delta}+ \bar{\mathbf{r}}\) is a row interchanged version of the vector \(\tilde{\mathbf{J}}\boldsymbol{\delta} + \tilde {\mathbf{r}}\), and B is an orthogonal matrix, so

$$\| \tilde{\mathbf{J}}\boldsymbol{\delta} + \tilde{\mathbf {r}} \| _2^2=\| \bar{\mathbf{J}}\boldsymbol{\delta} + \bar{\mathbf{r}}\| _2^2=\| \mathbf{B}\bar{\mathbf{J}}\boldsymbol{\delta} + \mathbf {B}\bar{\mathbf{r}} \| _2^2.$$

Using (8.1) and doing relevant row interchanges in the last expression, which does not affect the norm, we get

$$\| \mathbf{B}\bar{\mathbf{J}}\boldsymbol{\delta} + \mathbf{B}\bar{\mathbf{r}} \| _2^2=\left\| \left[\begin{array}{c@{\quad}c}\mathbf{Z} & \mathbf{Z}^{-1} \mathbf{H}\\\mathbf{0} & \mathbf{G}\\\end{array}\right]\left[\begin{array}{c}\boldsymbol{\delta}_{\mathrm{l}}\\\boldsymbol{\delta}_{\mathrm{s}}\\\end{array}\right]+\left[\begin{array}{c}\mathbf{Z}^{-1} \mathbf{h}\\\mathbf{g}\\\end{array}\right]\right\| _2^2,$$

where

$$\mathbf{G}=\left[\begin{array}{c@{\quad }c@{\quad }c@{\quad }c}\boldsymbol{\mathcal{G}}_{0,1} & \boldsymbol{\mathcal{G}}_{0,2}& \ldots& \boldsymbol{\mathcal{G}}_{0,n-1}\\\boldsymbol{\mathcal{G}}_{1,1} & \boldsymbol{\mathcal{G}}_{1,2}& \ldots& \boldsymbol{\mathcal{G}}_{1,n-1}\\\vdots & \vdots &\ddots & \vdots \\\boldsymbol{\mathcal{G}}_{m,1} & \boldsymbol{\mathcal{G}}_{m,2}& \ldots& \boldsymbol{\mathcal{G}}_{m,n-1}\\\boldsymbol{\Lambda}_{\mathrm{s},1} &\mathbf{0} & \ldots& \mathbf{0}\\\mathbf{0}& \boldsymbol{\Lambda}_{\mathrm{s},2}& \ldots& \mathbf{0}\\\vdots & \vdots & \ddots& \vdots \\\mathbf{0} & \mathbf{0}& \ldots& \boldsymbol{\Lambda}_{\mathrm{s},n-1}\\\end{array}\right],\qquad \mathbf{g}=\left[\begin{array}{c}\mathbf{g}_0 \\\mathbf{g}_1 \\\vdots \\\mathbf{g}_m \\\mathbf{0}\\\mathbf{0}\\\vdots \\\mathbf{0}\end{array}\right],$$

and where Λ s,i is the regularization parameters for (p i ,w i ). Finding the least-squares solution is done by solving (3.9). By forming the normal equations, we get the same expression as in (3.5) and (3.6), since A=G T G and b=−G T g.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Bergström, P., Edlund, O. & Söderkvist, I. Efficient computation of the Gauss-Newton direction when fitting NURBS using ODR. Bit Numer Math 52, 571–588 (2012). https://doi.org/10.1007/s10543-012-0371-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10543-012-0371-7

Keywords

Mathematics Subject Classification (2010)

Navigation