Ilker O. Yaz and Sébastien Loriot
This package provides methods to generate automatic segmentations of triangulated surface mesh.
|
| template<class Polyhedron , class SDFPropertyMap , class GeomTraits = typename Polyhedron::Traits> |
| std::pair< double, double > | CGAL::sdf_values (const Polyhedron &polyhedron, SDFPropertyMap sdf_values_map, double cone_angle=2.0/3.0 *CGAL_PI, std::size_t number_of_rays=25, bool postprocess=true, GeomTraits traits=GeomTraits()) |
| | Function computing the Shape Diameter Function over a surface mesh. More...
|
| |
| template<class Polyhedron , class SDFPropertyMap > |
| std::pair< double, double > | CGAL::sdf_values_postprocessing (const Polyhedron &polyhedron, SDFPropertyMap sdf_values_map) |
| | Function post-processing raw SDF values computed per facet. More...
|
| |
| template<class Polyhedron , class SDFPropertyMap , class SegmentPropertyMap , class GeomTraits = typename Polyhedron::Traits> |
| std::size_t | CGAL::segmentation_from_sdf_values (const Polyhedron &polyhedron, SDFPropertyMap sdf_values_map, SegmentPropertyMap segment_ids, std::size_t number_of_clusters=5, double smoothing_lambda=0.26, bool output_cluster_ids=false, GeomTraits traits=GeomTraits()) |
| | Function computing the segmentation of a surface mesh given an SDF value per facet. More...
|
| |
| template<class Polyhedron , class SegmentPropertyMap , class GeomTraits = typename Polyhedron::Traits> |
| std::size_t | CGAL::segmentation_via_sdf_values (const Polyhedron &polyhedron, SegmentPropertyMap segment_ids, double cone_angle=2.0/3.0 *CGAL_PI, std::size_t number_of_rays=25, std::size_t number_of_clusters=5, double smoothing_lambda=0.26, bool output_cluster_ids=false, GeomTraits traits=GeomTraits()) |
| | Function computing the segmentation of a surface mesh. More...
|
| |
template<class Polyhedron , class SDFPropertyMap , class SegmentPropertyMap , class GeomTraits = typename Polyhedron::Traits>
| std::size_t CGAL::segmentation_from_sdf_values |
( |
const Polyhedron & |
polyhedron, |
|
|
SDFPropertyMap |
sdf_values_map, |
|
|
SegmentPropertyMap |
segment_ids, |
|
|
std::size_t |
number_of_clusters = 5, |
|
|
double |
smoothing_lambda = 0.26, |
|
|
bool |
output_cluster_ids = false, |
|
|
GeomTraits |
traits = GeomTraits() |
|
) |
| |
Function computing the segmentation of a surface mesh given an SDF value per facet.
This function fills a property map which associates a segment-id (in [0, number of segments -1]) or a cluster-id (in [0, number_of_clusters -1]) to each facet. A segment is a set of connected facets which are placed under the same cluster (see Figure 52.5).
- Note
- Log-normalization is applied on
sdf_values_map before segmentation. As described in the original paper [4], this normalization is done to preserve thin parts of the mesh by increasing the distance between smaller SDF values and reducing it between larger ones.
-
There is no direct relation between the parameter
number_of_clusters and the final number of segments after segmentation. However, setting a large number of clusters will result in a detailed segmentation of the mesh with a large number of segments.
- Precondition
- polyhedron.is_pure_triangle()
-
number_of_clusters > 0
- Template Parameters
-
- Parameters
-
| polyhedron | surface mesh corresponding to the SDF values |
| sdf_values_map | the SDF value of each facet between [0-1] |
| [out] | segment_ids | the segment or cluster id of each facet |
| number_of_clusters | number of clusters for the soft clustering |
| smoothing_lambda | factor which indicates the importance of the surface features for the energy minimization. It is recommended to choose a value in the interval [0,1]. See the section Hard clustering for more details. |
| output_cluster_ids | if false fill segment_ids with segment-ids, and with cluster-ids otherwise (see Figure 52.5) |
| traits | traits class |
- Returns
- number of segments if
output_cluster_ids is set to false and number_of_clusters otherwise
- Examples:
- Surface_mesh_segmentation/segmentation_from_sdf_values_example.cpp, and Surface_mesh_segmentation/segmentation_with_facet_ids_example.cpp.