diff --git a/Jet_fitting_3/doc_tex/Jet_fitting_3/Jet_fitting_3_user.tex b/Jet_fitting_3/doc_tex/Jet_fitting_3/Jet_fitting_3_user.tex index 81ce69389f7..c49db17cc68 100644 --- a/Jet_fitting_3/doc_tex/Jet_fitting_3/Jet_fitting_3_user.tex +++ b/Jet_fitting_3/doc_tex/Jet_fitting_3/Jet_fitting_3_user.tex @@ -2,8 +2,9 @@ %WARNING: amsmath not available -This chapter describes the \cgal's package for the estimation of local -differential quantities on sampled surfaces. +This chapter describes the \cgal's package geared towards the +estimation of local differential quantities on sampled surfaces, known +either as a mesh or a point cloud. %%%%%%%%%%%%%%%%%%%%%%% \section{Introduction} @@ -15,38 +16,68 @@ differential quantities on sampled surfaces. Consider a sampled smooth surface, and assume we are given a collection of points $P$ about a given sample $p$. We aim at -estimating the differential properties up to order $d'$ of the surface -at point $p$ from the point set $P^+ = P\cup \{ p\}$ --we note $N=\mid -P^+\mid$. More precisely, first order properties correspond to the -normal or the tangent plane; second order properties provide the -principal curvatures and directions, third order properties provide -the directional derivatives of the principal curvatures along the -curvature lines, etc. Most of the time, estimating first and second -order differential quantities is sufficient. However, some -applications involving shape analysis require estimating third and -fourth order differential quantities. +estimating the differential properties up to any fixed order of the +surface at point $p$ from the point set $P^+ = P\cup \{ p\}$ ---we +denote $N=\mid P^+\mid$. More precisely, first order properties +correspond to the normal or the tangent plane; second order properties +provide the principal curvatures and directions, third order +properties provide the directional derivatives of the principal +curvatures along the curvature lines, etc. Most of the time, +estimating first and second order differential quantities is +sufficient. However, some applications involving shape analysis +require estimating third and fourth order differential quantities. %% Many different estimators have been proposed in the vast literature of -applied geometry \cite{cgal:p-smrqt-01}. They all need to define a -neighborhood around the point at which the estimation is computed and -use at different level the geometry of the mesh. On one hand, methods -relying on {\em discrete differential geometry} only use the -information provided by the mesh -\cite{cgal:pp-cdmsc-93,cgal:mdsb-ddgot-02,cgal:csm-rdtnc-03}. On the -other hand, fitting methods rely on smooth differential geometry and -approximation, and hence are able to process point clouds directly. +applied geometry \cite{cgal:p-smrqt-01}, and all of them need to +define a neighborhood around the point at which the estimation is +computed. These methods may be classified into two groups. The first +one features methods geared towards meshes +\cite{cgal:pp-cdmsc-93,cgal:mdsb-ddgot-02,cgal:csm-rdtnc-03}. +Such methods exploit the geometry and the topology of the mesh, and +are sometimes referred to as methods from {\em discrete differential +geometry}. +%% +The second one comprises methods relying on smooth differential +geometry calculations, carried out on smooth objects {\em fitted} from +the sample points provided. Such naturally accommodate meshes, but also +point clouds. -By now, there are two methods to extract local differential properties -coming with theoretical analysis of their convergence rates. On one -hand, the normal cycle theory is used in -\cite{cgal:csm-rdtnc-03} to provide an estimate of the integral of the -Weingarten map of surface discretized by a mesh. On the other hand, +%On the other hand, fitting methods rely on smooth differential +%geometry and approximation, and hence are able to process point clouds +%directly. + +%and use at different level the geometry of the mesh. On one hand, +%methods relying on {\em discrete differential geometry} only use the +%information provided by the mesh + +%By now, there are two methods to extract local differential properties +%coming with theoretical analysis of their convergence rates. + + +Estimating differential quantities naturally subsumes (i)\ a smooth +surface exists (ii)\ one wishes to recover its differential +properties. This two observations call for the convergence analysis of +the methods developed, and by now, two estimation methods come with +approximation guarantees measuring the convergence rate of the +discrepancy between the estimates and the true (unknown) values. + +On one hand, the normal cycle theory is used in +\cite{cgal:csm-rdtnc-03} to provide an estimate of the integral of the +$3D$ embedding \footnote{Recall that the Weingarten map is a bilinear +form of the tangent space, so that integrating it requires embedding +it in $3D$ since the tangent plane rotates.} of the Weingarten map of +surface discretized by a mesh. On the other hand, \cite{cgal:cp-edqpf-05} uses polynomial fitting to extract the coefficients of the local representation of the surface as a height -function. This method has three advantages~: first, differential -properties of any order can be retrieved; second, the coefficients -estimated feature the best error bounds known so far; third, it -process point samples (and does not need a mesh). +function. The former method provides spatial averages, and is +particularly well suited to meshes. Yet, it is limited to second order +differential properties. +%% +The later one carries three advantages~: first, differential +properties of any order can be retrieved; second, the convergence +rates provided are the best ones known so far ---they are actually +optimal; third, point clouds can be directly handled ---no topological +information is required. \subsection{Jets, Monge form and polynomial fitting} @@ -56,10 +87,10 @@ process point samples (and does not need a mesh). % To present the method, we shall need the following notions. Consider a smooth surface. About one of its points, consider a coordinate system -whose $z$-axis is not aligned with the normal of the surface. In such -a frame, the surface can locally be written as the graph of a -bivariate function. Denoting h $\hot$ standing for {\em -higher order terms}, one has~: +whose $z$-axis does not belong to the tangent space. In such a frame, +the surface can locally be written as the graph of a bivariate +function. Denoting h $\hot$ standing for {\em higher order terms}, one +has~: % %Assume the surface is given, locally and in a suitable , as a height %function ---with $\hot$ standing for {\em higher order terms}~: @@ -69,17 +100,19 @@ J_{B,d}(x,y)=\sum_{k=0}^{k=d}(\sum_{i=0}^{i=k} \frac{B_{k-i,i}x^{k-i}y^{i}}{i!(k-i)!}). \end{equation} The degree $d$ polynomial $J_{B,d}$ is the Taylor expansion of the -function $z$, we call it its $d$-jet. Notice that a $d$-jet contains +function $z$, an is called its $d$-jet. Notice that a $d$-jet contains $N_d=(d+1)(d+2)/2$ coefficients. -At any point of the surface which is not an umbilic, principal -directions $d_1, d_2$ are well defined, and these (non oriented) -directions together with the normal vector $n$ define two direct -orthonormal frames. If $v_1$ is a unit vector of direction $d_1$ then -there exists a unique unit vector $v_2$ so that $(v_1,v_2,n)$ is -direct; and the other possible frame is $(-v_1,-v_2,n)$. In one of -these Monge coordinate systems, the surface is said to be given in the -Monge form and its jet has the following canonical form~: +Recall that an umbilical point of a surface ---or umbilic for short, +is a point where both principal curvatures are identical. At any +point of the surface which is not an umbilic, principal directions +$d_1, d_2$ are well defined, and these (non oriented) directions +together with the normal vector $n$ define two direct orthonormal +frames. If $v_1$ is a unit vector of direction $d_1$ then there exists +a unique unit vector $v_2$ so that $(v_1,v_2,n)$ is direct; and the +other possible frame is $(-v_1,-v_2,n)$. In one of these Monge +coordinate systems, the surface is said to be given in the Monge form +and its jet has the following canonical form~: \begin{eqnarray} \label{eq:monge} @@ -94,20 +127,23 @@ respective curvature lines, while $b_1,b_2$ are the directional derivatives of $k_1,k_2$ along the other curvature lines. The Monge coordinate system can be computed from any $d$-jet ($d\geq -2$), and so are the Monge coefficients. These data, characterizing the -geometry of the surface in a canonical way, will naturally be the -output of the algorithm. +2$), and so are the Monge coefficients. These informations +characterize the local geometry of the surface in a canonical way, and +are the quantities returned by our algorithm. \paragraph{Interpolating or approximating the $d$-jet.} % -The idea is to fit the $d$-jet, in a well chosen coordinate system, -using bivariate polynomial interpolation or approximation on the point -set $P^+$. +In a well chosen coordinate system, the idea is to fit the $d$-jet of +the surface using bivariate polynomial interpolation or approximation +on the point set $P^+$. % More precisely, the fitting consists of finding the coefficients -$A_{i,j}$ of the degree $d$ polynomial $J_{A,d}= -\sum_{k=0}^{k=d}(\sum_{i=0}^{i=k} -\frac{A_{k-i,i}x^{k-i}y^{i}}{i!(k-i)!})$. +$A_{i,j}$ of the degree $d$ polynomial +\begin{equation} +\label{eq-answer} +J_{A,d}= \sum_{k=0}^{k=d}(\sum_{i=0}^{i=k} +\frac{A_{k-i,i}x^{k-i}y^{i}}{i!(k-i)!}). +\end{equation} Denote $p_i=(x_i,y_i,z_i), \ i=1,\ldots , N$ the coordinates of the @@ -118,21 +154,24 @@ i=1,\ldots,N$, and for approximation one has to minimize $\sum_{i=1}^N (A(x_i,y_i)-z_i)^2$. The linear algebra formulation of the problem is given by % -\begin{eqnarray*} +\begin{eqnarray} +\label{eq:fit-linalg} A = & (A_{0,0}, A_{1,0},A_{0,1}, \ldots , A_{0,d})^T \\ Z= &(z_1, z_2,\ldots , z_N)^T \\ M= &(1,x_i,\ y_i,\ \frac{x_i^2}{2},\ldots , \ \frac{x_iy_i^{d-1}}{(d-1)!},\ \frac{y_i^d}{d!})_{i=1,...,N}\\ -\end{eqnarray*} +\end{eqnarray} % -The equations for interpolation become $MA=Z$ and for approximation -$\min ||MA-Z||_2$. +The equations for interpolation become $MA=Z$. For approximation, one +seeks the matrix $A$ such that $A = \arg \min_A ||MA-Z||_2$. - -The following theorem precisely states the order of convergence of the -polynomial fitting method. Given a parameter $h$ measuring the -sampling step, the following theorem, provising the best asymptotic -estimates known to date, is proved in \cite{cgal:cp-edqpf-05}~: +To assess the convergence guarantees, assume the sampling step is +given by a parameter $h$, which means all samples are at distance +$O(h)$ of the point where the calculation is carried out. +%% +The following theorem, proved in \cite{cgal:cp-edqpf-05}, provides the +asymptotic error estimates ---which are the best known to date: +%% \begin{theorem} A polynomial fitting of degree $d$ estimates any $k^{th}$-order differential quantity to accuracy $O(h^{d-k+1})$~: @@ -160,11 +199,11 @@ Based on the above concepts, the algorithm consists of 4 steps. % \begin{enumerate} \item -We perform a PCA on $P^+$. This analysis outputs three orthonormal -eigenvectors and the associated eigenevalues. If the -surface is well sampled, we expect the PCA to provide one small and -two large eigenvalues, the eigenvector associated to the small one -approximating the normal vector. +We perform a Principal Component Analysis (PCA) on $P^+$. This +analysis outputs three orthonormal eigenvectors and the associated +eigenvalues. If the surface is well sampled, we expect the PCA to +provide one small and two large eigenvalues, the eigenvector +associated to the small one approximating the normal vector. \item We perform a change of coordinates to move the samples into the coordinate system defined by the PCA eigenvectors. We then resort to @@ -179,17 +218,22 @@ Finally, we compute the Monge coefficients. \end{enumerate} -For the fitting, we do not assume the z-axis of the fitting to -be the normal of the surface. Hence we keep the first order -coefficients of the polynomial $J_{A,d}$. It is prooved that such a choice -improves the estimations \cite{cgal:cp-edqpf-05}. +For the fitting, we do not assume the $z$-axis of the fitting to be +the normal of the surface. +As proved in \cite{cgal:cp-edqpf-05}, two stages methods estimating +the tangent plane first incur of higher order quantities the error +made on first order quantities. +%% +Thus, we keep the first order coefficients of the polynomial +$J_{A,d}$, which provide the estimate for the tangent plane. -Note that we do not aim at identifying exactly special points such as -umbilics where both principal curvatures are equal. This would only be -possible if the original surface and the fitted surface coincide. This -implying that the original surface is a graph of a bivariate -polynomial of a lower degree than the fitted polynomial and that the -coordinate system used for the fitting has the same height direction. +Finally, notice that we do not aim at identifying exactly special +points such as umbilics where both principal curvatures are +equal. This would only be possible if the original surface and the +fitted surface coincide. This implying that the original surface is a +graph of a bivariate polynomial of a lower degree than the fitted +polynomial and that the coordinate system used for the fitting has the +same height direction. %For the sake of clarity and wlog, we assume the study point is at the %origin. @@ -198,15 +242,23 @@ coordinate system used for the fitting has the same height direction. \label{sec:deg-cases} %%%%%%%%%%%%%%%%%%%%% +As usual, the fitting procedure may run into (almost) degenerate +cases: +%% \begin{itemize} \item -The PCA used to determine a rough normal vector does not yield an -eigenvalue significantly smaller then the two remaining ones. -\item -When solving the linear system, the condition number is too large. -\end{itemize} +Due to poor sampling, the PCA used to determine a rough normal vector +may not yield an eigenvalue significantly smaller than the two +remaining ones. -In these cases, the estimation may not be relevant. To inform the user +\item +As observed in \cite{cgal:cp-edqpf-05}, the interpolating problem is +not {\em poised} if the points used project, into the fitting frame, +onto an algebraic curve of degree $d$. More generally, the problem is +ill poised if the condition number is too large. +\end{itemize} +%% +In these cases, the estimation may not be relevant. To inform the user of these issues, we provide the PCA results and the condition number of the fitting in the class \ccc{Monge_info}. @@ -216,10 +268,10 @@ of the fitting in the class \ccc{Monge_info}. In this section, we detail the mathematics involved, in order to justify the design choices made. - -Note that there are 3 relevant direct orthonormal basis: world-basis -$(w_x,w_y,w_z)$, fitting-basis $(f_x,f_y,f_z)$, monge-basis -$(d_1,d_2,n)$. +%% +To do so, observe that there are three relevant direct orthonormal +basis: the world-basis $(w_x,w_y,w_z)$, the fitting-basis +$(f_x,f_y,f_z)$, the monge-basis $(d_1,d_2,n)$. \begin{figure}[h!] \begin{ccTexOnly} @@ -228,7 +280,7 @@ $(d_1,d_2,n)$. \end{ccTexOnly} \label{fig:jet_fitting_basis} -\caption{The three basis envolved in the estimation.} +\caption{The three basis involved in the estimation.} \begin{ccHtmlOnly}