CGAL 4.5.2 - Point Set Processing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
CGAL Namespace Reference

Namespaces

 internal
 

Classes

struct  value_type_traits
 Class providing the value type of an iterator, and in the case of an output iterator, a type of objects that can be put in it. More...
 
struct  value_type_traits< std::back_insert_iterator< Container > >
 
struct  value_type_traits< std::insert_iterator< Container > >
 
struct  value_type_traits< std::front_insert_iterator< Container > >
 

Functions

template<typename InputIterator , typename PointPMap , typename Kernel >
Kernel::FT compute_average_spacing (InputIterator first, InputIterator beyond, PointPMap point_pmap, unsigned int k, const Kernel &)
 Computes average spacing from k nearest neighbors. More...
 
template<typename ForwardIterator , typename PointPMap , typename Kernel >
ForwardIterator grid_simplify_point_set (ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, double epsilon, const Kernel &)
 Merges points which belong to the same cell of a grid of cell size = epsilon. More...
 
template<class Iter >
Index_property_map< Iter > make_index_property_map (Iter first, Iter beyond)
 Free function to create an Index_property_map property map. More...
 
template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool read_off_points_and_normals (std::istream &stream, OutputIterator output, PointPMap point_pmap, NormalPMap normal_pmap, const Kernel &)
 Reads points (positions + normals, if available) from a .off ASCII stream. More...
 
template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename Kernel >
bool read_off_points (std::istream &stream, OutputIterator output, PointPMap point_pmap, const Kernel &kernel)
 Reads points (position only) from a .off ASCII stream. More...
 
template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool read_xyz_points_and_normals (std::istream &stream, OutputIterator output, PointPMap point_pmap, NormalPMap normal_pmap, const Kernel &)
 Reads points (positions + normals, if available) from a .xyz ASCII stream. More...
 
template<typename OutputIteratorValueType , typename OutputIterator , typename PointPMap , typename Kernel >
bool read_xyz_points (std::istream &stream, OutputIterator output, PointPMap point_pmap, const Kernel &kernel)
 Reads points (positions only) from a .xyz ASCII stream. More...
 
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool write_off_points_and_normals (std::ostream &stream, ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, NormalPMap normal_pmap, const Kernel &)
 Saves the [first, beyond) range of points (positions + normals) to a .off ASCII stream. More...
 
template<typename ForwardIterator , typename PointPMap , typename Kernel >
bool write_off_points (std::ostream &stream, ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, const Kernel &)
 Saves the [first, beyond) range of points (positions only) to a .off ASCII stream. More...
 
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
bool write_xyz_points_and_normals (std::ostream &stream, ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, NormalPMap normal_pmap, const Kernel &)
 Saves the [first, beyond) range of points (positions + normals) to a .xyz ASCII stream. More...
 
template<typename ForwardIterator , typename PointPMap , typename Kernel >
bool write_xyz_points (std::ostream &stream, ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, const Kernel &)
 Saves the [first, beyond) range of points (positions only) to a .xyz ASCII stream. More...
 
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel , typename SvdTraits >
void jet_estimate_normals (ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, NormalPMap normal_pmap, unsigned int k, const Kernel &, unsigned int degree_fitting=2)
 Estimates normal directions of the [first, beyond) range of points using jet fitting on the k nearest neighbors. More...
 
template<typename InputIterator , typename PointPMap , typename Kernel , typename SvdTraits >
void jet_smooth_point_set (InputIterator first, InputIterator beyond, PointPMap point_pmap, unsigned int k, const Kernel &, unsigned int degree_fitting=2, unsigned int degree_monge=2)
 Smoothes the [first, beyond) range of points using jet fitting on the k nearest neighbors and reprojection onto the jet. More...
 
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
ForwardIterator mst_orient_normals (ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, NormalPMap normal_pmap, unsigned int k, const Kernel &kernel)
 Orients the normals of the [first, beyond) range of points using the propagation of a seed orientation through a minimum spanning tree of the Riemannian graph [Hoppe92]. More...
 
template<typename ForwardIterator , typename PointPMap , typename NormalPMap , typename Kernel >
void pca_estimate_normals (ForwardIterator first, ForwardIterator beyond, PointPMap point_pmap, NormalPMap normal_pmap, unsigned int k, const Kernel &)
 Estimates normal directions of the [first, beyond) range of points by linear least squares fitting of a plane over the k nearest neighbors. More...
 
template<typename ForwardIterator , typename PointPMap , typename Kernel >
ForwardIterator random_simplify_point_set (ForwardIterator first, ForwardIterator beyond, PointPMap, double removed_percentage, const Kernel &)
 Randomly deletes a user-specified fraction of the input points. More...
 
template<typename InputIterator , typename PointPMap , typename Kernel >
InputIterator remove_outliers (InputIterator first, InputIterator beyond, PointPMap point_pmap, unsigned int k, double threshold_percent, const Kernel &)
 Removes outliers: More...
 
template<typename InputIterator , typename PointPMap , typename Kernel >
InputIterator remove_outliers_wrt_median_knn_sq_distance (InputIterator first, InputIterator beyond, PointPMap point_pmap, unsigned int k, double threshold_percent, const Kernel &kernel)
 Removes outliers: More...
 

Function Documentation

template<class Iter >
Index_property_map<Iter> CGAL::make_index_property_map ( Iter  first,
Iter  beyond 
)

Free function to create an Index_property_map property map.

Template Parameters
Iteriterator over input elements.
Returns
an "index" property map, which associates a 0-based index (unsigned int) to the [first, beyond) range of elements.
Parameters
firstiterator over the first element (index 0)
beyondpast-the-end iterator over the elements
template<typename InputIterator , typename PointPMap , typename Kernel >
InputIterator CGAL::remove_outliers_wrt_median_knn_sq_distance ( InputIterator  first,
InputIterator  beyond,
PointPMap  point_pmap,
unsigned int  k,
double  threshold_percent,
const Kernel &  kernel 
)

Removes outliers:

  • computes median squared distance to the K nearest neighbors,
  • sorts the points in increasing order of computed distance.

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.

Precondition
k >= 2
Template Parameters
InputIteratoriterator over input points.
PointPMapis a model of ReadablePropertyMap with a value_type = Point_3<Kernel>. It can be omitted if InputIterator value_type is convertible to Point_3<Kernel>.
KernelGeometric traits class. It can be omitted and deduced automatically from PointPMap value_type.
Returns
iterator over the first point to remove.
Parameters
firstiterator over the first input point.
beyondpast-the-end iterator over the input points.
point_pmapproperty map: value_type of InputIterator -> Point_3
knumber of neighbors.
threshold_percentpercentage of points to remove.
kernelgeometric traits.