cgal/Principal_component_analysis/doc_tex/Principal_component_analysis/intro.tex

33 lines
2.8 KiB
TeX

This \cgal\ package provides functions to compute global information on the shape of a set of 2D or 3D objects such as points. It provides the computation of axis-aligned bounding boxes for point sets, and barycenters of weighted point sets. The set of kernel primitive elements are assumed to be stored into an iterator range of a container.\\
In addition, it computes centroids as well as linear least squares fitting for sets of points, circles, rectangles, segments and triangles in 2D and in points, segments, triangles, cuboids, spheres and tetrahedra in 3D. For each object type in 2D and 3D, it allows the user to specify the dimension of the object fitted. For example, it is possible to fit a set of balls by providing an iterator range of spheres and specifying dimension 3. It is also possible to fit only the edges of a set of tetrahedra by specifying dimension 1, etc.
\section{Definitions}
A \emph{bounding box} for a set of objects is a cuboid that completely contains the set. An \emph{axis-aligned bounding box} is a bounding box aligned with the axes of the coordinate system.\\
A \emph{centroid} is defined as average of position. A \emph{barycenter} of weighted point sets is defined as weighted
average of position. When all weights are equal the barycenter coincides with the centroid.\\
Given a point set, \emph{linear least squares fitting} amounts to find the linear sub-space which minimizes the sum of squared distances from the points to their projection onto this linear sub-space. This problem is equivalent to search for the linear sub-space which maximizes the variance of projected points, the latter being obtained by eigen decomposition of the covariance matrix of the point set. Eigenvectors corresponding to large eigenvalues are the
directions in which the data has strong component, or equivalently large variance. If eigenvalues are the same there is no preferable sub-space.\\
Given an object set, \emph{linear least squares fitting} amounts to find the linear sub-space which minimizes the sum of squared distances from all points in the set to their projection onto this linear sub-space. This problem is equivalent to the one of fitting a linear sub-space to a point set, except that the covariance matrix is now derived (closed form formula) from a continuous integral over the objects instead of a discrete sum over the points.
\begin{center}
\label{fit}
% Image
\begin{ccTexOnly}
\includegraphics[width=1.0\textwidth]{Principal_component_analysis/fit}
\end{ccTexOnly}
\begin{ccHtmlOnly}
<img width="100%" border=0 src="./fit.png"><P>
\end{ccHtmlOnly}
% Title
\begin{figure}[h]
\caption{Left: fitting a line to a 2D point set.
Right: fitting a line and a plane to a 3D point set.}
\end{figure}
\end{center}