update of is_edge and vcm_estimate_normals

This commit is contained in:
Sébastien Loriot 2015-04-20 17:27:39 +02:00
parent d7e6b7dfa8
commit e553310940
5 changed files with 33 additions and 19 deletions

View File

@ -32,7 +32,7 @@
- `CGAL::jet_smooth_point_set()`
- `CGAL::jet_estimate_normals()`
- `CGAL::pca_estimate_normals()`
- `CGAL::vcm_compute()`
- `CGAL::compute_vcm()`
- `CGAL::vcm_estimate_normals()`
- `CGAL::is_on_edge()`
- `CGAL::write_off_points()`

View File

@ -223,7 +223,7 @@ Function `is_on_edge()` indicates if a points belong to a feature edges of the
point set using its Voronoi Covariance Measure.
It is based on the article \cgalCite{cgal:mog-vbcfe-11}.
It first computes the VCM of the points set using `vcm_compute()`. Then, it estimates
It first computes the VCM of the points set using `compute_vcm()`. Then, it estimates
which points belong to a sharp edge by testing if a ratio of eigenvalues
is greater than a given threshold.

View File

@ -39,7 +39,7 @@ int main (int , char**) {
std::vector<Covariance> cov;
CGAL::First_of_pair_property_map<PointVectorPair> point_pmap;
CGAL::vcm_compute(points.begin(), points.end(), point_pmap, cov, R, r, Kernel());
CGAL::compute_vcm(points.begin(), points.end(), point_pmap, cov, R, r, Kernel());
// Find the points on the edges.
// Note that this step is not expensive and can be done several time to get better results

View File

@ -42,9 +42,21 @@
namespace CGAL {
/// Determine if a point is on an edge using the VCM of the point.
/// A point will be considered as an edge point iff it satisfies a criteria
/// relating the eigenvalues of its VCM.
/// determines if a point is on a sharp feature edge from point set
/// for which the Voronoi covariance Measures have been computed.
///
/// The sharpness of the edge is defined by the parameter `threshold`.
/// is used to filtered points according to the external angle around a sharp feature.
///
/// A point is considered to be on a sharp feature if the external angle `alpha` at the edge is such that
/// `alpha >> 2 / sqrt(3) * sqrt(threshold)`.
/// In particular this means that is the input contains sharp features
/// with different external angles, the one with the smallest external angle should be considered
/// which however will result in selecting more points in sharper regions.
/// More details are given in \cgalCite{cgal:mog-vbcfe-11}.
///
/// \sa CGAL::compute_vcm()`
///
template <class Covariance>
bool
is_on_edge (Covariance &cov,
@ -228,11 +240,11 @@ compute_delaunay_graph (Undirected_Graph& g, ///< constructed graph.
/// Estimates the feature edges of the `[first, beyond)` range of points
/// using the Voronoi Covariance Measure.
/// It returns a vector of all the points that have been estimated as edge points.
/// It mainly consists in computing the VCM using `vcm_compute` and then
/// It mainly consists in computing the VCM using `compute_vcm` and then
/// determining which point must be considered as an edge one or not (using a criterion
/// based on the eigenvalues of the covariance matrices).
///
/// See `vcm_compute()` for more details on the VCM.
/// See `compute_vcm()` for more details on the VCM.
///
/// @tparam ForwardIterator iterator over input points.
/// @tparam PointPMap is a model of `ReadablePropertyMap` with a value_type = `Kernel::Point_3`.
@ -260,7 +272,7 @@ vcm_estimate_edges (ForwardIterator first, ///< iterator over the first input po
// Compute the VCM and convolve it
std::vector<Covariance> cov;
vcm_compute(first, beyond,
compute_vcm(first, beyond,
point_pmap,
cov,
R,

View File

@ -230,7 +230,7 @@ template < class ForwardIterator,
class Covariance
>
void
vcm_compute (ForwardIterator first,
compute_vcm (ForwardIterator first,
ForwardIterator beyond,
PointPMap point_pmap,
std::vector<Covariance> &ccov,
@ -263,7 +263,7 @@ vcm_compute (ForwardIterator first,
/// @cond SKIP_IN_MANUAL
/// Estimates normal directions of the `[first, beyond)` range of points
/// using the Voronoi Covariance Measure (see `vcm_compute` for more details on the VCM).
/// using the Voronoi Covariance Measure (see `compute_vcm` for more details on the VCM).
/// The output normals are randomly oriented.
///
/// @tparam ForwardIterator iterator over input points.
@ -297,7 +297,7 @@ vcm_estimate_normals (ForwardIterator first, ///< iterator over the first input
// Compute the VCM and convolve it
std::vector<Covariance> cov;
if (nb_neighbors_convolve == -1) {
vcm_compute(first, beyond,
compute_vcm(first, beyond,
point_pmap,
cov,
R,
@ -340,11 +340,12 @@ vcm_estimate_normals (ForwardIterator first, ///< iterator over the first input
/// @endcond
/// \ingroup PkgPointSetProcessing
/// Estimates normal directions of the `[first, beyond)` range of points
/// Estimates normal directions of the points in the range `[first, beyond)`
/// using the Voronoi Covariance Measure with a radius for the convolution.
/// The output normals are randomly oriented.
///
/// See `vcm_compute()` for more details on the VCM.
/// See `compute_vcm()` for a detailed description of the parameters `R` and `r`
/// and of the Voronoi Covariance Measure.
///
/// @tparam ForwardIterator iterator over input points.
/// @tparam PointPMap is a model of `ReadablePropertyMap` with a value_type = `Kernel::Point_3`.
@ -361,8 +362,8 @@ vcm_estimate_normals (ForwardIterator first, ///< iterator over the first input
ForwardIterator beyond, ///< past-the-end iterator over the input points.
PointPMap point_pmap, ///< property map: value_type of ForwardIterator -> Point_3.
NormalPMap normal_pmap, ///< property map: value_type of ForwardIterator -> Vector_3.
double R, ///< offset radius: radius of the sphere to intersect the Voronoi cell with.
double r ///< convolution radius: all points in a sphere with this radius will be convolved.
double R, ///< offset radius.
double r ///< convolution radius.
)
{
typedef typename boost::property_traits<PointPMap>::value_type Point;
@ -378,11 +379,12 @@ vcm_estimate_normals (ForwardIterator first, ///< iterator over the first input
}
/// \ingroup PkgPointSetProcessing
/// Estimates normal directions of the `[first, beyond)` range of points
/// Estimates normal directions of the points in the range `[first, beyond)`
/// using the Voronoi Covariance Measure with a number of neighbors for the convolution.
/// The output normals are randomly oriented.
///
/// See `vcm_compute()` for more details on the VCM.
/// See `compute_vcm()` for a detailed description of the parameter `R`
/// and of the Voronoi Covariance Measure.
///
/// @tparam ForwardIterator iterator over input points.
/// @tparam PointPMap is a model of `ReadablePropertyMap` with a value_type = `Kernel::Point_3`.
@ -399,7 +401,7 @@ vcm_estimate_normals (ForwardIterator first, ///< iterator over the first input
ForwardIterator beyond, ///< past-the-end iterator over the input points.
PointPMap point_pmap, ///< property map: value_type of ForwardIterator -> Point_3.
NormalPMap normal_pmap, ///< property map: value_type of ForwardIterator -> Vector_3.
double R, ///< offset radius: radius of the sphere to intersect the Voronoi cell with.
double R, ///< offset radius.
unsigned int nb_neighbors_convolve ///< number of neighbor points used for the convolution.
)
{