CGAL 5.0.1 - Point Set Processing
|
Collection of algorithms of point set processing (smoothing, simplification, etc.).
Classes | |
class | CGAL::Point_set_with_structure< Kernel > |
A 3D point set with structure information based on a set of detected planes. More... | |
Functions | |
template<typename ConcurrencyTag , typename PointRange , typename NamedParameters > | |
double | CGAL::bilateral_smooth_point_set (PointRange &points, unsigned int k, const NamedParameters &np) |
This function smooths an input point set by iteratively projecting each point onto the implicit surface patch fitted over its nearest neighbors. More... | |
template<typename ConcurrencyTag , typename PointRange , typename CGAL_BGL_NP_TEMPLATE_PARAMETERS > | |
FT | CGAL::compute_average_spacing (const PointRange &points, unsigned int k, const CGAL_BGL_NP_CLASS &np) |
Computes average spacing from k nearest neighbors. More... | |
template<typename ConcurrencyTag , typename PointRange , typename OutputIterator , typename NamedParameters > | |
OutputIterator | CGAL::edge_aware_upsample_point_set (const PointRange &points, OutputIterator output, const NamedParameters &np) |
This method progressively upsamples the point set while approaching the edge singularities (detected by normal variation), which generates a denser point set from an input point set. More... | |
template<typename PointRange , typename QueryPointRange , typename OutputIterator , typename NamedParameters > | |
OutputIterator | CGAL::estimate_local_k_neighbor_scales (const PointRange &points, const QueryPointRange &queries, OutputIterator output, const NamedParameters &np) |
Estimates the local scale in a K nearest neighbors sense on a set of user-defined query points. More... | |
template<typename PointRange , typename NamedParameters > | |
std::size_t | CGAL::estimate_global_k_neighbor_scale (const PointRange &points, const NamedParameters &np) |
Estimates the global scale in a K nearest neighbors sense. More... | |
template<typename PointRange , typename QueryPointRange , typename OutputIterator , typename NamedParameters > | |
OutputIterator | CGAL::estimate_local_range_scales (const PointRange &points, const QueryPointRange &queries, OutputIterator output, const NamedParameters &np) |
Estimates the local scale in a range sense on a set of user-defined query points. More... | |
template<typename PointRange , typename NamedParameters > | |
FT | CGAL::estimate_global_range_scale (const PointRange &points, const NamedParameters &np) |
Estimates the global scale in a range sense. More... | |
template<typename PointRange , typename NamedParameters > | |
PointRange::iterator | CGAL::grid_simplify_point_set (PointRange &points, double epsilon, const NamedParameters &np) |
Merges points which belong to the same cell of a grid of cell size = epsilon . More... | |
template<typename PointRange , typename NamedParameters > | |
PointRange::iterator | CGAL::hierarchy_simplify_point_set (PointRange &points, const NamedParameters &np) |
Recursively split the point set in smaller clusters until the clusters have less than size elements or until their variation factor is below var_max . More... | |
template<typename ConcurrencyTag , typename PointRange , typename NamedParameters > | |
void | CGAL::jet_estimate_normals (PointRange &points, unsigned int k, const NamedParameters &np) |
Estimates normal directions of the range of points using jet fitting on the nearest neighbors. More... | |
template<typename ConcurrencyTag , typename PointRange , typename NamedParameters > | |
void | CGAL::jet_smooth_point_set (PointRange &points, unsigned int k, const NamedParameters &np) |
Smoothes the range of points using jet fitting on the nearest neighbors and reprojection onto the jet. More... | |
template<typename PointRange , typename NamedParameters > | |
PointRange::iterator | CGAL::mst_orient_normals (PointRange &points, unsigned int k, const NamedParameters &np) |
Orients the normals of the range of points using the propagation of a seed orientation through a minimum spanning tree of the Riemannian graph. More... | |
template<typename ConcurrencyTag , typename PointRange , typename NamedParameters > | |
void | CGAL::pca_estimate_normals (PointRange &points, unsigned int k, const NamedParameters &np) |
Estimates normal directions of the range of points by linear least squares fitting of a plane over the nearest neighbors. More... | |
template<typename PointRange > | |
PointRange::iterator | CGAL::random_simplify_point_set (PointRange &points, double removed_percentage) |
Randomly deletes a user-specified fraction of the input points. More... | |
template<typename PointRange , typename NamedParameters > | |
PointRange::iterator | CGAL::remove_outliers (PointRange &points, unsigned int k, const NamedParameters &np) |
Removes outliers: More... | |
template<typename PointRange , typename PlaneRange , typename OutputIterator , typename NamedParameters > | |
OutputIterator | CGAL::structure_point_set (const PointRange &points, const PlaneRange &planes, OutputIterator output, double epsilon, const NamedParameters &np) |
This is an implementation of the Point Set Structuring algorithm. More... | |
template<class FT , class VCMTraits > | |
bool | CGAL::vcm_is_on_feature_edge (std::array< FT, 6 > &cov, double threshold, VCMTraits) |
determines if a point is on a sharp feature edge from a point set for which the Voronoi covariance Measures have been computed. More... | |
template<typename PointRange , typename NamedParameters > | |
void | CGAL::compute_vcm (const PointRange &points, std::vector< std::array< double, 6 > > &ccov, double offset_radius, double convolution_radius, const NamedParameters &np) |
computes the Voronoi Covariance Measure (VCM) of a point cloud, a construction that can be used for normal estimation and sharp feature detection. More... | |
template<typename PointRange , typename NamedParameters > | |
void | CGAL::vcm_estimate_normals (PointRange &points, double offset_radius, double convolution_radius, const NamedParameters &np) |
Estimates normal directions of the range of points using the Voronoi Covariance Measure with a radius for the convolution. More... | |
template<typename PointRange , typename NamedParameters > | |
void | CGAL::vcm_estimate_normals (PointRange &points, double offset_radius, unsigned int k, const NamedParameters &np) |
Estimates normal directions of the range of points using the Voronoi Covariance Measure with a number of neighbors for the convolution. More... | |
template<typename ConcurrencyTag , typename PointRange , typename OutputIterator , typename NamedParameters > | |
OutputIterator | CGAL::wlop_simplify_and_regularize_point_set (PointRange &points, OutputIterator output, const NamedParameters &np) |
This is an implementation of the Weighted Locally Optimal Projection (WLOP) simplification algorithm. More... | |
double CGAL::bilateral_smooth_point_set | ( | PointRange & | points, |
unsigned int | k, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/bilateral_smooth_point_set.h>
This function smooths an input point set by iteratively projecting each point onto the implicit surface patch fitted over its nearest neighbors.
Bilateral projection preserves sharp features according to the normal (gradient) information. Both point positions and normals will be modified. For more details, please see section 4 in [5].
A parallel version of this function is provided and requires the executable to be linked against the Intel TBB library. To control the number of threads used, the user may use the tbb::task_scheduler_init class. See the TBB documentation for more details.
ConcurrencyTag | enables sequential versus parallel algorithm. Possible values are Sequential_tag And Parallel_tag . |
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
k | size of the neighborhood for the implicit surface patch fitting. The larger the value is, the smoother the result will be. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadWritePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
normal_map | a model of ReadWritePropertyMap with value type geom_traits::Vector_3 . |
neighbor_radius | spherical neighborhood radius. If provided, the neighborhood of a query point is computed with a fixed spherical radius instead of a fixed number of neighbors. In that case, the parameter k is used as a limit on the number of points returned by each spherical query (to avoid overly large number of points in high density areas). If no limit is wanted, use k=0 . |
sharpness_angle | controls the sharpness of the result. |
callback | an instance of std::function<bool(double)> . It is called regularly when the algorithm is running: the current advancement (between 0. and 1.) is passed as parameter. If it returns true , then the algorithm continues its execution normally; if it returns false , the algorithm is stopped, all points are left unchanged and the function return NaN . |
geom_traits | an instance of a geometric traits class, model of Kernel |
FT CGAL::compute_average_spacing | ( | const PointRange & | points, |
unsigned int | k, | ||
const CGAL_BGL_NP_CLASS & | np | ||
) |
#include <CGAL/compute_average_spacing.h>
Computes average spacing from k nearest neighbors.
k >= 2.
ConcurrencyTag | enables sequential versus parallel algorithm. Possible values are Sequential_tag and Parallel_tag . |
PointRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
k | number of neighbors. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
callback | an instance of std::function<bool(double)> . It is called regularly when the algorithm is running: the current advancement (between 0. and 1.) is passed as parameter. If it returns true , then the algorithm continues its execution normally; if it returns false , the algorithm is stopped and the average spacing value estimated on the processed subset is returned. |
geom_traits | an instance of a geometric traits class, model of Kernel |
FT
is a number type. It is either deduced from the geom_traits
Named Parameters if provided, or the geometric traits class deduced from the point property map of points
. void CGAL::compute_vcm | ( | const PointRange & | points, |
std::vector< std::array< double, 6 > > & | ccov, | ||
double | offset_radius, | ||
double | convolution_radius, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/vcm_estimate_normals.h>
computes the Voronoi Covariance Measure (VCM) of a point cloud, a construction that can be used for normal estimation and sharp feature detection.
The VCM associates to each point the covariance matrix of its Voronoi cell intersected with the ball of radius offset_radius
. In addition, if the second radius convolution_radius
is positive, the covariance matrices are smoothed via a convolution process. More specifically, each covariance matrix is replaced by the average of the matrices of the points located at a distance at most convolution_radius
. The choice for parameter offset_radius
should refer to the geometry of the underlying surface while the choice for parameter convolution_radius
should refer to the noise level in the point cloud. For example, if the point cloud is a uniform and noise-free sampling of a smooth surface, offset_radius
should be set to the minimum local feature size of the surface, while convolution_radius
can be set to zero.
The Voronoi covariance matrix of each vertex is stored in an array a
of length 6 and is as follow:
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
ccov | output range of covariance matrices. |
offset_radius | offset_radius. |
convolution_radius | convolution_radius. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
geom_traits | an instance of a geometric traits class, model of Kernel |
OutputIterator CGAL::edge_aware_upsample_point_set | ( | const PointRange & | points, |
OutputIterator | output, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/edge_aware_upsample_point_set.h>
This method progressively upsamples the point set while approaching the edge singularities (detected by normal variation), which generates a denser point set from an input point set.
This has applications in point-based rendering, hole filling, and sparse surface reconstruction. Normals of points are required as input. For more details, please refer to [5].
ConcurrencyTag | enables sequential versus parallel versions of compute_average_spacing() (called internally). Possible values are Sequential_tag and Parallel_tag . |
PointRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter point_map . |
OutputIterator | Type of the output iterator. The type of the objects put in it is std::pair<geom_traits::Point_3, geom_traits::Vector_3> . Note that the user may use a function_output_iterator to match specific needs. |
points | input point range. |
output | iterator where output points and normals are put. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
normal_map | a model of ReadablePropertyMap with value type geom_traits::Vector_3 . |
sharpness_angle | controls the sharpness of the result. |
edge_sensitivity | controls the priority of points inserted along sharp features. See section Parameter: edge_sensitivity for an example. |
neighbor_radius | spherical neighborhood radius. |
number_of_output_points | is the number of output points to generate. |
geom_traits | an instance of a geometric traits class, model of Kernel |
std::size_t CGAL::estimate_global_k_neighbor_scale | ( | const PointRange & | points, |
const NamedParameters & | np | ||
) |
#include <CGAL/estimate_scale.h>
Estimates the global scale in a K nearest neighbors sense.
The computed scale corresponds to the smallest scale such that the K subsets of points have the appearance of a surface in 3D or the appearance of a curve in 2D (see Automatic Scale Estimation).
PointRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 (or geom_traits::Point_2 ). If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> (or CGAL::Identity_property_map<geom_traits::Point_2> ) is used. |
geom_traits | an instance of a geometric traits class, model of Kernel |
FT CGAL::estimate_global_range_scale | ( | const PointRange & | points, |
const NamedParameters & | np | ||
) |
#include <CGAL/estimate_scale.h>
Estimates the global scale in a range sense.
The computed scale corresponds to the smallest scale such that the subsets of points inside the sphere range have the appearance of a surface in 3D or the appearance of a curve in 2D (see Automatic Scale Estimation).
PointRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 (or geom_traits::Point_2 ). If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> (or CGAL::Identity_property_map<geom_traits::Point_2> ) is used. |
geom_traits | an instance of a geometric traits class, model of Kernel |
FT
is a number type. It is either deduced from the geom_traits
Named Parameters if provided, or the geometric traits class deduced from the point property map of points
. OutputIterator CGAL::estimate_local_k_neighbor_scales | ( | const PointRange & | points, |
const QueryPointRange & | queries, | ||
OutputIterator | output, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/estimate_scale.h>
Estimates the local scale in a K nearest neighbors sense on a set of user-defined query points.
The computed scales correspond to the smallest scales such that the K subsets of points have the appearance of a surface in 3D or the appearance of a curve in 2D (see Automatic Scale Estimation).
PointRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter point_map . |
QueryPointRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter query_point_map . |
OutputIterator | is used to store the computed scales. It accepts values of type std::size_t . |
points | input point range. |
queries | range of locations where scale must be estimated |
output | iterator to store the computed scales |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 (or geom_traits::Point_2 ). If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> (or CGAL::Identity_property_map<geom_traits::Point_2> ) is used. |
query_point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 (or geom_traits::Point_2 ). If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> (or CGAL::Identity_property_map<geom_traits::Point_2> ) is used. |
geom_traits | an instance of a geometric traits class, model of Kernel |
OutputIterator CGAL::estimate_local_range_scales | ( | const PointRange & | points, |
const QueryPointRange & | queries, | ||
OutputIterator | output, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/estimate_scale.h>
Estimates the local scale in a range sense on a set of user-defined query points.
The computed scales correspond to the smallest scales such that the subsets of points included in the sphere range have the appearance of a surface in 3D or the appearance of a curve in 2D (see Automatic Scale Estimation).
PointRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter point_map . |
QueryPointRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter query_point_map . |
OutputIterator | is used to store the computed scales. It accepts values of type geom_traits::FT . |
points | input point range. |
queries | range of locations where scale must be estimated |
output | iterator to store the computed scales |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 (or geom_traits::Point_2 ). If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> (or CGAL::Identity_property_map<geom_traits::Point_2> ) is used. |
query_point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 (or geom_traits::Point_2 ). If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> (or CGAL::Identity_property_map<geom_traits::Point_2> ) is used. |
geom_traits | an instance of a geometric traits class, model of Kernel |
PointRange::iterator CGAL::grid_simplify_point_set | ( | PointRange & | points, |
double | epsilon, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/grid_simplify_point_set.h>
Merges points which belong to the same cell of a grid of cell size = epsilon
.
This method modifies the order of input points so as to pack all remaining points first, and returns an iterator over the first point to remove (see erase-remove idiom). For this reason it should not be called on sorted containers.
epsilon > 0
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
epsilon | tolerance value when merging 3D points. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadWritePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
callback | an instance of std::function<bool(double)> . It is called regularly when the algorithm is running: the current advancement (between 0. and 1.) is passed as parameter. If it returns true , then the algorithm continues its execution normally; if it returns false , the algorithm is stopped and simplification stops with no guarantee on the output. |
geom_traits | an instance of a geometric traits class, model of Kernel |
PointRange::iterator CGAL::hierarchy_simplify_point_set | ( | PointRange & | points, |
const NamedParameters & | np | ||
) |
#include <CGAL/hierarchy_simplify_point_set.h>
Recursively split the point set in smaller clusters until the clusters have less than size
elements or until their variation factor is below var_max
.
This method modifies the order of input points so as to pack all remaining points first, and returns an iterator over the first point to remove (see erase-remove idiom). For this reason it should not be called on sorted containers.
0 < maximum_variation < 1/3
size > 0
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadWritePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
size | maximum cluster size. |
maximum_variation | maximum cluster variation value. |
diagonalize_traits | a model of DiagonalizeTraits . It can be omitted: if Eigen 3 (or greater) is available and CGAL_EIGEN3_ENABLED is defined then an overload using Eigen_diagonalize_traits is provided. Otherwise, the internal implementation CGAL::Diagonalize_traits is used. |
callback | an instance of std::function<bool(double)> . It is called regularly when the algorithm is running: the current advancement (between 0. and 1.) is passed as parameter. If it returns true , then the algorithm continues its execution normally; if it returns false , the algorithm is stopped and simplification stops with no guarantee on the output. |
geom_traits | an instance of a geometric traits class, model of Kernel |
void CGAL::jet_estimate_normals | ( | PointRange & | points, |
unsigned int | k, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/jet_estimate_normals.h>
Estimates normal directions of the range of points
using jet fitting on the nearest neighbors.
The output normals are randomly oriented.
k >= 2
ConcurrencyTag | enables sequential versus parallel algorithm. Possible values are Sequential_tag and Parallel_tag . |
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
k | number of neighbors |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
normal_map | a model of ReadWritePropertyMap with value type geom_traits::Vector_3 . |
neighbor_radius | spherical neighborhood radius. If provided, the neighborhood of a query point is computed with a fixed spherical radius instead of a fixed number of neighbors. In that case, the parameter k is used as a limit on the number of points returned by each spherical query (to avoid overly large number of points in high density areas). If no limit is wanted, use k=0 . |
degree_fitting | degree of jet fitting. |
svd_traits | template parameter for the class Monge_via_jet_fitting . If Eigen 3.2 (or greater) is available and CGAL_EIGEN3_ENABLED is defined, then CGAL::Eigen_svd is used. |
callback | an instance of std::function<bool(double)> . It is called regularly when the algorithm is running: the current advancement (between 0. and 1.) is passed as parameter. If it returns true , then the algorithm continues its execution normally; if it returns false , the algorithm is stopped and the remaining normals are left unchanged. |
geom_traits | an instance of a geometric traits class, model of Kernel |
void CGAL::jet_smooth_point_set | ( | PointRange & | points, |
unsigned int | k, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/jet_smooth_point_set.h>
Smoothes the range of points
using jet fitting on the nearest neighbors and reprojection onto the jet.
As this method relocates the points, it should not be called on containers sorted w.r.t. point locations.
k >= 2
ConcurrencyTag | enables sequential versus parallel algorithm. Possible values are Sequential_tag and Parallel_tag . |
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
k | number of neighbors |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
neighbor_radius | spherical neighborhood radius. If provided, the neighborhood of a query point is computed with a fixed spherical radius instead of a fixed number of neighbors. In that case, the parameter k is used as a limit on the number of points returned by each spherical query (to avoid overly large number of points in high density areas). If no limit is wanted, use k=0 . |
degree_fitting | degree of jet fitting. |
degree_monge | Monge degree. |
svd_traits | template parameter for the class Monge_via_jet_fitting . If Eigen 3.2 (or greater) is available and CGAL_EIGEN3_ENABLED is defined, then CGAL::Eigen_svd is used. |
callback | an instance of std::function<bool(double)> . It is called regularly when the algorithm is running: the current advancement (between 0. and 1.) is passed as parameter. If it returns true , then the algorithm continues its execution normally; if it returns false , the algorithm is stopped and the remaining points are left unchanged. |
geom_traits | an instance of a geometric traits class, model of Kernel |
PointRange::iterator CGAL::mst_orient_normals | ( | PointRange & | points, |
unsigned int | k, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/mst_orient_normals.h>
Orients the normals of the range of points
using the propagation of a seed orientation through a minimum spanning tree of the Riemannian graph.
This method modifies the order of input points so as to pack all sucessfully oriented points first, and returns an iterator over the first point with an unoriented normal (see erase-remove idiom). For this reason it should not be called on sorted containers. It is based on [3].
k >= 2
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
k | number of neighbors. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
normal_map | a model of ReadWritePropertyMap with value type geom_traits::Vector_3 . |
neighbor_radius | spherical neighborhood radius. If provided, the neighborhood of a query point is computed with a fixed spherical radius instead of a fixed number of neighbors. In that case, the parameter k is used as a limit on the number of points returned by each spherical query (to avoid overly large number of points in high density areas). If no limit is wanted, use k=0 . |
point_is_constrained_map | a model of ReadablePropertyMap with value type bool . Points with a true value will be used as seed points: their normal will be considered as already oriented, it won't be altered and it will be propagated to its neighbors. If this parameter is omitted, the highest point (highest Z coordinate) will be used as the unique seed with an upward oriented normal |
geom_traits | an instance of a geometric traits class, model of Kernel |
void CGAL::pca_estimate_normals | ( | PointRange & | points, |
unsigned int | k, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/pca_estimate_normals.h>
Estimates normal directions of the range of points
by linear least squares fitting of a plane over the nearest neighbors.
The output normals are randomly oriented.
k >= 2
ConcurrencyTag | enables sequential versus parallel algorithm. Possible values are Sequential_tag and Parallel_tag . |
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
k | number of neighbors |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
normal_map | a model of WritablePropertyMap with value type geom_traits::Vector_3 . |
neighbor_radius | spherical neighborhood radius. If provided, the neighborhood of a query point is computed with a fixed spherical radius instead of a fixed number of neighbors. In that case, the parameter k is used as a limit on the number of points returned by each spherical query (to avoid overly large number of points in high density areas). If no limit is wanted, use k=0 . |
callback | an instance of std::function<bool(double)> . It is called regularly when the algorithm is running: the current advancement (between 0. and 1.) is passed as parameter. If it returns true , then the algorithm continues its execution normally; if it returns false , the algorithm is stopped and the remaining normals are left unchanged. |
geom_traits | an instance of a geometric traits class, model of Kernel |
PointRange::iterator CGAL::random_simplify_point_set | ( | PointRange & | points, |
double | removed_percentage | ||
) |
#include <CGAL/random_simplify_point_set.h>
Randomly deletes a user-specified fraction of the input points.
This method modifies the order of input points so as to pack all remaining points first, and returns an iterator over the first point to remove (see erase-remove idiom). For this reason it should not be called on sorted containers.
PointRange | is a model of Range . |
points | input point range. |
removed_percentage | percentage of points to remove. |
PointRange::iterator CGAL::remove_outliers | ( | PointRange & | points, |
unsigned int | k, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/remove_outliers.h>
Removes outliers:
This method modifies the order of input points so as to pack all remaining points first, and returns an iterator over the first point to remove (see erase-remove idiom). For this reason it should not be called on sorted containers.
k >= 2
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
k | number of neighbors |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
neighbor_radius | spherical neighborhood radius. If provided, the neighborhood of a query point is computed with a fixed spherical radius instead of a fixed number of neighbors. In that case, the parameter k is used as a limit on the number of points returned by each spherical query (to avoid overly large number of points in high density areas). If no limit is wanted, use k=0 . |
threshold_percent | maximum percentage of points to remove. |
threshold_distance | minimum distance for a point to be considered as outlier (distance here is the square root of the average squared distance to K nearest neighbors). |
callback | an instance of std::function<bool(double)> . It is called regularly when the algorithm is running: the current advancement (between 0. and 1.) is passed as parameter. If it returns true , then the algorithm continues its execution normally; if it returns false , the algorithm is stopped, all points are left unchanged and the function return points.end() . |
geom_traits | an instance of a geometric traits class, model of Kernel |
threshold_percent
and threshold_distance
. This function returns the smallest number of outliers such that at least one of these threshold is fulfilled. This means that if threshold_percent=100
, only threshold_distance
is taken into account; if threshold_distance=0
only threshold_percent
is taken into account. OutputIterator CGAL::structure_point_set | ( | const PointRange & | points, |
const PlaneRange & | planes, | ||
OutputIterator | output, | ||
double | epsilon, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/structure_point_set.h>
This is an implementation of the Point Set Structuring algorithm.
This algorithm takes advantage of a set of detected planes: it detects adjacency relationships between planes and resamples the detected planes, edges and corners to produce a structured point set.
The size parameter epsilon
is used both for detecting adjacencies and for setting the sampling density of the structured point set.
For more details, please refer to [6].
PointRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter point_map . |
PlaneRange | is a model of ConstRange . The value type of its iterator is the key type of the named parameter plane_map . |
OutputIterator | Type of the output iterator. The type of the objects put in it is std::pair<Kernel::Point_3, Kernel::Vector_3> . Note that the user may use a function_output_iterator to match specific needs. |
points | input point range. |
planes | input plane range. |
output | output iterator where output points are written |
epsilon | size parameter. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
normal_map | a model of ReadablePropertyMap with value type geom_traits::Vector_3 . |
plane_index_map | a model of ReadablePropertyMap with value type int . Associates the index of a point in the input range to the index of plane (-1 if point does is not assigned to a plane). |
plane_map | a model of ReadablePropertyMap with value type geom_traits::Plane_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Plane_3> is used. |
attraction_factor | multiple of epsilon used to connect simplices. |
geom_traits | an instance of a geometric traits class, model of Kernel |
void CGAL::vcm_estimate_normals | ( | PointRange & | points, |
double | offset_radius, | ||
double | convolution_radius, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/vcm_estimate_normals.h>
Estimates normal directions of the range of points
using the Voronoi Covariance Measure with a radius for the convolution.
The output normals are randomly oriented.
See compute_vcm()
for a detailed description of the parameters offset_radius
and convolution_radius
and of the Voronoi Covariance Measure.
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
offset_radius | offset_radius. |
convolution_radius | convolution_radius. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
normal_map | a model of WritablePropertyMap with value type geom_traits::Vector_3 . |
diagonalize_traits | a model of DiagonalizeTraits . It can be omitted: if Eigen 3 (or greater) is available and CGAL_EIGEN3_ENABLED is defined then an overload using Eigen_diagonalize_traits is provided. Otherwise, the internal implementation CGAL::Diagonalize_traits is used. |
geom_traits | an instance of a geometric traits class, model of Kernel |
void CGAL::vcm_estimate_normals | ( | PointRange & | points, |
double | offset_radius, | ||
unsigned int | k, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/vcm_estimate_normals.h>
Estimates normal directions of the range of points
using the Voronoi Covariance Measure with a number of neighbors for the convolution.
The output normals are randomly oriented.
See compute_vcm()
for a detailed description of the parameter offset_radius
and of the Voronoi Covariance Measure.
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
points | input point range. |
offset_radius | offset_radius. |
k | number of neighbor points used for convolution. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadablePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
normal_map | a model of WritablePropertyMap with value type geom_traits::Vector_3 . |
diagonalize_traits | a model of DiagonalizeTraits . It can be omitted: if Eigen 3 (or greater) is available and CGAL_EIGEN3_ENABLED is defined then an overload using Eigen_diagonalize_traits is provided. Otherwise, the internal implementation CGAL::Diagonalize_traits is used. |
geom_traits | an instance of a geometric traits class, model of Kernel |
bool CGAL::vcm_is_on_feature_edge | ( | std::array< FT, 6 > & | cov, |
double | threshold, | ||
VCMTraits | |||
) |
#include <CGAL/vcm_estimate_edges.h>
determines if a point is on a sharp feature edge from a point set for which the Voronoi covariance Measures have been computed.
The sharpness of the edge, specified by 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 if the input contains sharp features with different external angles, the one with the smallest external angle should be considered, which however would result in selecting more points on sharper regions. More details are provided in [7].
VCMTraits | is a model of DiagonalizeTraits . It can be omitted: if Eigen 3 (or greater) is available and CGAL_EIGEN3_ENABLED is defined then an overload using Eigen_diagonalize_traits is provided. Otherwise, the internal implementation Diagonalize_traits is used. |
OutputIterator CGAL::wlop_simplify_and_regularize_point_set | ( | PointRange & | points, |
OutputIterator | output, | ||
const NamedParameters & | np | ||
) |
#include <CGAL/wlop_simplify_and_regularize_point_set.h>
This is an implementation of the Weighted Locally Optimal Projection (WLOP) simplification algorithm.
The WLOP simplification algorithm can produce a set of denoised, outlier-free and evenly distributed particles over the original dense point cloud. The core of the algorithm is a Weighted Locally Optimal Projection operator with a density uniformization term. For more details, please refer to [4].
A parallel version of WLOP is provided and requires the executable to be linked against the Intel TBB library. To control the number of threads used, the user may use the tbb::task_scheduler_init class. See the TBB documentation for more details.
ConcurrencyTag | enables sequential versus parallel algorithm. Possible values are Sequential_tag and Parallel_tag . |
PointRange | is a model of Range . The value type of its iterator is the key type of the named parameter point_map . |
OutputIterator | Type of the output iterator. It must accept objects of type geom_traits::Point_3 . |
points | input point range. |
output | iterator where output points are put. |
np | optional sequence of Named Parameters among the ones listed below. |
point_map | a model of ReadWritePropertyMap with value type geom_traits::Point_3 . If this parameter is omitted, CGAL::Identity_property_map<geom_traits::Point_3> is used. |
normal_map | a model of ReadWritePropertyMap with value type geom_traits::Vector_3 . |
select_percentage | percentage of points to retain. The default value is set to 5 (%). |
neighbor_radius | spherical neighborhood radius. This is a key parameter that needs to be finely tuned. The result will be irregular if too small, but a larger value will impact the runtime. In practice, choosing a radius such that the neighborhood of each sample point includes at least two rings of neighboring sample points gives satisfactory result. If this parameter is not provided, it is automatically set to 8 times the average spacing of the point set. |
number_of_iterations | number of iterations to solve the optimsation problem. The default value is 35. More iterations give a more regular result but increase the runtime. |
require_uniform_sampling | an optional preprocessing, which will give better result if the distribution of the input points is highly non-uniform. The default value is false . |
callback | an instance of std::function<bool(double)> . It is called regularly when the algorithm is running: the current advancement (between 0. and 1.) is passed as parameter. If it returns true , then the algorithm continues its execution normally; if it returns false , the algorithm is stopped, no output points are generated. |
geom_traits | an instance of a geometric traits class, model of Kernel |