mirror of https://github.com/CGAL/cgal
Updated Documentation
M Principal_component_analysis_ref/main.tex M Principal_component_analysis_ref/centroid.tex M Principal_component_analysis_ref/linear_least_squares_fitting_2.tex A Principal_component_analysis_ref/tag_0.tex M Principal_component_analysis_ref/intro.tex M Principal_component_analysis_ref/linear_least_squares_fitting_3.tex A Principal_component_analysis_ref/tag_1.tex A Principal_component_analysis_ref/tag_2.tex A Principal_component_analysis_ref/tag_3.tex
This commit is contained in:
parent
ce7b960958
commit
5f829c9e3a
|
|
@ -2047,6 +2047,10 @@ Principal_component_analysis/demo/Principal_component_analysis/windows/3d/res/id
|
|||
Principal_component_analysis/doc_tex/Principal_component_analysis/fit.eps -text svneol=unset#application/postscript
|
||||
Principal_component_analysis/doc_tex/Principal_component_analysis/fit.png -text svneol=unset#image/png
|
||||
Principal_component_analysis/doc_tex/Principal_component_analysis/teaserLeastSquaresFitting.png -text
|
||||
Principal_component_analysis/doc_tex/Principal_component_analysis_ref/tag_0.tex -text
|
||||
Principal_component_analysis/doc_tex/Principal_component_analysis_ref/tag_1.tex -text
|
||||
Principal_component_analysis/doc_tex/Principal_component_analysis_ref/tag_2.tex -text
|
||||
Principal_component_analysis/doc_tex/Principal_component_analysis_ref/tag_3.tex -text
|
||||
Principal_component_analysis/examples/Principal_component_analysis/linear_least_squares_fitting_ankit.cpp -text
|
||||
Principal_component_analysis/examples/Principal_component_analysis/linear_least_squares_fitting_circles_2.cpp -text
|
||||
Principal_component_analysis/examples/Principal_component_analysis/linear_least_squares_fitting_cuboids_3.cpp -text
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
% | Reference manual page: centroid.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% |
|
||||
% | March 2005 Pierre Alliez and Sylvain Pion
|
||||
% | March 2005 Pierre Alliez and Sylvain Pion and Ankit Gupta
|
||||
% | Package: Principal Component Analysis
|
||||
% |
|
||||
% +------------------------------------------------------------------------+
|
||||
|
|
@ -13,41 +13,42 @@
|
|||
\ccDefinition
|
||||
|
||||
The function \ccRefName\ computes the centroid (center of mass) of a set
|
||||
of 2D or 3D objects. These include Points, Segments, Triangles, Rectangles and Circles.
|
||||
of 2D or 3D objects. These include Points, Segments, Triangles, Rectangles and Circles in 2D and in addition, Cuboids, Spheres and Tetrahedrons in 3D.
|
||||
|
||||
\ccInclude{CGAL/centroid.h}
|
||||
|
||||
There is a set of overloaded \ccc{centroid} functions for 2D and 3D objects.
|
||||
The user can also optionally pass an explicit kernel, in case the default,
|
||||
based on \ccc{Kernel_traits} is not sufficient.
|
||||
The dimension is also deduced automatically.
|
||||
The dimension is also deduced automatically. The user also has to pass a \ccc{tag}
|
||||
specifying the type of manifold of the objects.
|
||||
|
||||
\ccFunction{template < typename InputIterator >
|
||||
\ccFunction{template < typename InputIterator, typename Tag >
|
||||
K::Point_2
|
||||
centroid(InputIterator first, InputIterator beyond);}
|
||||
{ computes the centroid of a non-empty set of 2D objects.
|
||||
centroid(InputIterator first, InputIterator beyond, const Tag& t);}
|
||||
{ computes the centroid of a non-empty set of 2D objects having a manifold described by t.
|
||||
\ccc{K} is \ccc{Kernel_traits<std::iterator_traits<InputIterator>::value_type>::Kernel}. The value type must be \ccc{K::Point_2}.
|
||||
\ccPrecond{first != beyond.} }
|
||||
|
||||
\ccFunction{template < typename InputIterator, typename K >
|
||||
\ccFunction{template < typename InputIterator, typename K, typename Tag >
|
||||
K::Point_2
|
||||
centroid(InputIterator first, InputIterator beyond, const K & k);}
|
||||
{ computes the centroid of a non-empty set of 2D objects.
|
||||
centroid(InputIterator first, InputIterator beyond, const K & k, const Tag& t);}
|
||||
{ computes the centroid of a non-empty set of 2D objects having a manifold described by t.
|
||||
The value type must be \ccc{K::Point_2}.
|
||||
\ccPrecond{first != beyond.} }
|
||||
|
||||
\ccFunction{template < typename InputIterator >
|
||||
\ccFunction{template < typename InputIterator, typename Tag >
|
||||
K::Point_3
|
||||
centroid(InputIterator first, InputIterator beyond);}
|
||||
{ computes the centroid of a non-empty set of 3D points.
|
||||
centroid(InputIterator first, InputIterator beyond, const Tag& t);}
|
||||
{ computes the centroid of a non-empty set of 3D points having a manifold described by t.
|
||||
\ccc{K} is \ccc{Kernel_traits<std::iterator_traits<InputIterator>::value_type>::Kernel}.
|
||||
The value type must be \ccc{K::Point_3}.
|
||||
\ccPrecond{first != beyond.} }
|
||||
|
||||
\ccFunction{template < typename InputIterator, typename K >
|
||||
\ccFunction{template < typename InputIterator, typename K, typename Tag >
|
||||
K::Point_3
|
||||
centroid(InputIterator first, InputIterator beyond, const K & k);}
|
||||
{ computes the centroid of a non-empty set of 3D points.
|
||||
centroid(InputIterator first, InputIterator beyond, const K & k, const Tag& t);}
|
||||
{ computes the centroid of a non-empty set of 3D points having a manifold described by t.
|
||||
The value type must be \ccc{K::Point_3}.
|
||||
\ccPrecond{first != beyond.} }
|
||||
|
||||
|
|
|
|||
|
|
@ -9,23 +9,28 @@
|
|||
|
||||
\ccRefChapter{Principal Component Analysis\label{ref_chapter_pca}}
|
||||
|
||||
\ccChapterAuthor{Pierre Alliez and Sylvain Pion}
|
||||
\ccChapterAuthor{Pierre Alliez and Sylvain Pion and Ankit Gupta}
|
||||
|
||||
|
||||
|
||||
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, centroids of point sets and triangle sets in 2D and 3D, barycenters of weighted point sets, as well as linear least squares fitting for point sets in 2D, and point sets and triangle sets in 3D. It assumes the set of kernel primitive elements to be stored into an iterator range of a container.
|
||||
|
||||
|
||||
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, barycenters of weighted point sets and centroids as well as linear least squares fitting for sets of points, circles, rectangles, segments and triangles in 2D and in addition to these, cuboids, spheres and tetrahedrons in 3D. It also provides the computation of centroids and linear least squares fitting for all $n-1$ manifolds of these $n$ dimensional geometries ($n = 2$ or $3$). It assumes the set of kernel primitive elements to be stored into an iterator range of a container.
|
||||
|
||||
|
||||
\section{Classified Reference Pages}
|
||||
|
||||
\ccHeading{Tags}
|
||||
|
||||
\ccRefIdfierPage{CGAL::PCA_dimension_0_tag}\\
|
||||
\ccRefIdfierPage{CGAL::PCA_dimension_1_tag}\\
|
||||
\ccRefIdfierPage{CGAL::PCA_dimension_2_tag}\\
|
||||
\ccRefIdfierPage{CGAL::PCA_dimension_3_tag}\\
|
||||
|
||||
\ccHeading{Functions}
|
||||
|
||||
\ccRefIdfierPage{CGAL::barycenter}\\
|
||||
\ccRefIdfierPage{CGAL::bounding_box}\\
|
||||
\ccRefIdfierPage{CGAL::centroid}\\
|
||||
\ccRefIdfierPage{CGAL::linear_least_squares_fitting_2}\\
|
||||
\ccRefIdfierPage{CGAL::linear_least_squares_fitting_3}
|
||||
\ccRefIdfierPage{CGAL::linear_least_squares_fitting_3}\\
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
% | Reference manual page: linear_least_squares_fitting_2.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% |
|
||||
% | March 2005 Pierre Alliez and Sylvain Pion
|
||||
% | March 2005 Pierre Alliez and Sylvain Pion and Ankit Gupta
|
||||
% | Package: Principal Component Analysis
|
||||
% |
|
||||
% |
|
||||
|
|
@ -14,19 +14,19 @@
|
|||
\ccDefinition
|
||||
|
||||
The function \ccRefName\ computes the best fitting 2D line of a 2D
|
||||
object of Points, Segments, Triangles (filled or hollow), Rectangles(filled or hollow), Circles and Disks. The best fit line minimizes the sum of squared distances
|
||||
object set of Points, Segments, Triangles, Rectangles and Circles. The best fit line minimizes the sum of squared distances
|
||||
from the points comprising these objects to their projections onto the line.
|
||||
|
||||
\ccInclude{CGAL/linear_least_squares_fitting_2.h}
|
||||
|
||||
\ccFunction{template < typename InputIterator, typename K>
|
||||
\ccFunction{template < typename InputIterator, typename K, typename Tag >
|
||||
typename K::FT
|
||||
linear_least_squares_fitting_2(InputIterator first,
|
||||
InputIterator beyond,
|
||||
typename K::Line_2 & line,
|
||||
typename K::Point_2 & centroid,
|
||||
const K & k,
|
||||
const bool non_standard_geometry);}
|
||||
const Tag& t);}
|
||||
{ computes the best fitting 2D line of a 2D object set in the range
|
||||
[\ccc{first},\ccc{beyond}). The value returned is a fitting quality
|
||||
between $0$ and $1$, where $0$ means that the variance is the same
|
||||
|
|
@ -40,7 +40,7 @@ The class \ccc{K} is the kernel in which the type
|
|||
\ccc{InputIterator::value_type} is defined. It can be omitted and
|
||||
deduced automatically from the value type.
|
||||
|
||||
The boolean \ccc{non_standard_geometry} differentiates between filled and hollow objects in the object set. Triangles and Rectangles are considered hollow if its value is set to true, otherwise filled. Circles are considered as disks if its value is set to true, otherwise hollow. It is irrelevant for Points and Segments. It can be omitted and is assumed to be false is that case.
|
||||
The tag \ccc{t} identifies the type of manifold of the objects in the object set.
|
||||
|
||||
\ccHeading{Requirements}
|
||||
|
||||
|
|
@ -49,6 +49,7 @@ The boolean \ccc{non_standard_geometry} differentiates between filled and hollow
|
|||
\item \ccc{line} is the best fitting line computed.
|
||||
\item \ccc{centroid} is the centroid computed. This parameter can be
|
||||
omitted.
|
||||
\item \ccc{t} is the tag identifying the type of manifold of the objects in the object set. It should be one of \ccc{PCA_dimension_0_tag}, \ccc{PCA_dimension_1_tag} or \ccc{PCA_dimension_2_tag}. Also, it shouldn't be of a greater dimension than the geometry of the object. For example, a \ccc{Segment} can't have a \ccc{PCA_dimension_2_tag} tag.
|
||||
\end{enumerate}
|
||||
|
||||
\end{ccRefFunction}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
% | Reference manual page: linear_least_squares_fitting_3.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% |
|
||||
% | March 2005 Pierre Alliez and Sylvain Pion
|
||||
% | March 2005 Pierre Alliez and Sylvain Pion and Ankit Gupta
|
||||
% | Package: Principal Component Analysis
|
||||
% |
|
||||
% |
|
||||
|
|
@ -14,19 +14,20 @@
|
|||
\ccDefinition
|
||||
|
||||
The function \ccRefName\ computes the best fitting 3D line or plane of 3D
|
||||
point sets or triangle sets. The best fit linear sub-space minimizes
|
||||
sets of Points, Segments, Triangles, Rectangles, Circles, Spheres, Cuboids and Tetrahedrons. The best fit linear sub-space minimizes
|
||||
the sum of squared distances from the points to their projections onto the
|
||||
sub-space.
|
||||
|
||||
\ccInclude{CGAL/linear_least_squares_fitting_3.h}
|
||||
|
||||
\ccFunction{template < typename InputIterator, typename K>
|
||||
\ccFunction{template < typename InputIterator, typename K, typename Tag >
|
||||
typename K::FT
|
||||
linear_least_squares_fitting_3(InputIterator first,
|
||||
InputIterator beyond,
|
||||
typename K::Line_3 & line,
|
||||
typename K::Point_3 & centroid,
|
||||
const K & k);}
|
||||
const K & k,
|
||||
const Tag& t);}
|
||||
{ computes the best fitting 3D line of a 3D point set or triangle set in the range
|
||||
[\ccc{first},\ccc{beyond}). The value returned is a fitting quality
|
||||
between $0$ and $1$, where $0$ means that the variance is the same
|
||||
|
|
@ -38,6 +39,8 @@ The class \ccc{K} is the kernel in which the type
|
|||
\ccc{InputIterator::value_type} is defined. It can be omitted and
|
||||
deduced automatically from the value type.
|
||||
|
||||
The tag \ccc{t} identifies the type of manifold of the objects in the object set.
|
||||
|
||||
\ccHeading{Requirements}
|
||||
|
||||
\begin{enumerate}
|
||||
|
|
@ -45,16 +48,18 @@ deduced automatically from the value type.
|
|||
\item \ccc{line} is the best fitting line computed.
|
||||
\item \ccc{centroid} is the centroid computed. This parameter can be
|
||||
omitted.
|
||||
\item \ccc{t} is the tag identifying the type of manifold of the objects in the object set. It should be one of \ccc{PCA_dimension_0_tag}, \ccc{PCA_dimension_1_tag}, \ccc{PCA_dimension_2_tag} or \ccc{PCA_dimension_3_tag}. Also, it shouldn't be of a greater dimension than the geometry of the object. For example, a \ccc{Circle} can't have a \ccc{PCA_dimension_3_tag} tag.
|
||||
\end{enumerate}
|
||||
|
||||
|
||||
\ccFunction{template < typename InputIterator, typename K>
|
||||
\ccFunction{template < typename InputIterator, typename K, typename Tag >
|
||||
typename K::FT
|
||||
linear_least_squares_fitting_3(InputIterator first,
|
||||
InputIterator beyond,
|
||||
typename K::Plane_3 & plane,
|
||||
typename K::Point_3 & centroid,
|
||||
const K & k);}
|
||||
const K & k,
|
||||
const Tag& t);}
|
||||
{ computes the best fitting 3D plane of a 3D point set or triangle set in the range
|
||||
[\ccc{first},\ccc{beyond}). The value returned is a fitting quality
|
||||
between $0$ and $1$, where $0$ means that the variance is the same
|
||||
|
|
@ -66,6 +71,8 @@ The class \ccc{K} is the kernel in which the type
|
|||
\ccc{InputIterator::value_type} is defined. It can be omitted and
|
||||
deduced automatically from the value type.
|
||||
|
||||
The tag \ccc{t} identifies the type of manifold of the objects in the object set.
|
||||
|
||||
\ccHeading{Requirements}
|
||||
|
||||
\begin{enumerate}
|
||||
|
|
@ -73,6 +80,7 @@ deduced automatically from the value type.
|
|||
\item \ccc{plane} is the best fitting plane computed.
|
||||
\item \ccc{centroid} is the centroid computed. This parameter can be
|
||||
omitted.
|
||||
\item \ccc{t} is the tag identifying the type of manifold of the objects in the object set. It should be one of \ccc{PCA_dimension_0_tag}, \ccc{PCA_dimension_1_tag}, \ccc{PCA_dimension_2_tag} or \ccc{PCA_dimension_3_tag}. Also, it shouldn't be of a greater dimension than the geometry of the object. For example, a \ccc{Circle} can't have a \ccc{PCA_dimension_3_tag} tag.
|
||||
\end{enumerate}
|
||||
|
||||
\end{ccRefFunction}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
\input{Principal_component_analysis_ref/intro}
|
||||
\input{Principal_component_analysis_ref/tag_0}
|
||||
\input{Principal_component_analysis_ref/tag_1}
|
||||
\input{Principal_component_analysis_ref/tag_2}
|
||||
\input{Principal_component_analysis_ref/tag_3}
|
||||
\input{Principal_component_analysis_ref/barycenter}
|
||||
\input{Principal_component_analysis_ref/bounding_box}
|
||||
\input{Principal_component_analysis_ref/centroid}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
% +------------------------------------------------------------------------+
|
||||
% | Reference manual page: tag_0.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% |
|
||||
% | June 2007 Pierre Alliez and Sylvain Pion and Ankit Gupta
|
||||
% | Package: Principal Component Analysis
|
||||
% |
|
||||
% |
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
\begin{ccRefClass}{PCA_dimension_0_tag}
|
||||
%% add template arg's if necessary
|
||||
\ccDefinition
|
||||
The class \ccRefName\ is used to indicate that the \textit{0 manifold} of the objects must be used for any computation.
|
||||
|
||||
\ccInclude{CGAL/PCA_tags.h}
|
||||
|
||||
|
||||
\end{ccRefClass}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
% +------------------------------------------------------------------------+
|
||||
% | Reference manual page: tag_1.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% |
|
||||
% | June 2007 Pierre Alliez and Sylvain Pion and Ankit Gupta
|
||||
% | Package: Principal Component Analysis
|
||||
% |
|
||||
% |
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
\begin{ccRefClass}{PCA_dimension_1_tag}
|
||||
%% add template arg's if necessary
|
||||
\ccDefinition
|
||||
The class \ccRefName\ is used to indicate that the \textit{1 manifold} of the objects must be used for any computation.
|
||||
|
||||
\ccInclude{CGAL/PCA_tags.h}
|
||||
|
||||
|
||||
\end{ccRefClass}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
% +------------------------------------------------------------------------+
|
||||
% | Reference manual page: tag_2.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% |
|
||||
% | June 2007 Pierre Alliez and Sylvain Pion and Ankit Gupta
|
||||
% | Package: Principal Component Analysis
|
||||
% |
|
||||
% |
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
\begin{ccRefClass}{PCA_dimension_2_tag}
|
||||
%% add template arg's if necessary
|
||||
\ccDefinition
|
||||
The class \ccRefName\ is used to indicate that the \textit{2 manifold} of the objects must be used for any computation.
|
||||
|
||||
\ccInclude{CGAL/PCA_tags.h}
|
||||
|
||||
|
||||
\end{ccRefClass}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
% +------------------------------------------------------------------------+
|
||||
% | Reference manual page: tag_3.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% |
|
||||
% | June 2007 Pierre Alliez and Sylvain Pion and Ankit Gupta
|
||||
% | Package: Principal Component Analysis
|
||||
% |
|
||||
% |
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
\begin{ccRefClass}{PCA_dimension_3_tag}
|
||||
%% add template arg's if necessary
|
||||
\ccDefinition
|
||||
The class \ccRefName\ is used to indicate that the \textit{3 manifold} of the objects must be used for any computation.
|
||||
|
||||
\ccInclude{CGAL/PCA_tags.h}
|
||||
|
||||
|
||||
\end{ccRefClass}
|
||||
Loading…
Reference in New Issue