Skip to content
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c7fe36a
Feature graph initial commit
ange-clement Apr 10, 2026
f3c299e
Initial API for Feature graph
ange-clement Apr 16, 2026
dee6f63
Updated API for Feature graph
ange-clement Apr 17, 2026
6953ea2
API Changes
ange-clement Apr 22, 2026
b85a0b7
Regularization parameters
ange-clement Apr 27, 2026
bf7c751
Fix missing quote + Use stars for doc
ange-clement May 6, 2026
43701aa
Changed "// @" to "/// @"
ange-clement May 6, 2026
106d1bb
Temporarily moved doc folder
ange-clement May 7, 2026
b175e0a
Moved measures to namespace Feature_graph
ange-clement May 7, 2026
a5a7b7a
Fixed missing link
ange-clement May 7, 2026
c0d790f
Add GPL License
ange-clement May 7, 2026
cc3669a
Moved the documentation and created minimum files
ange-clement May 7, 2026
a104997
Added package dependencies
ange-clement May 19, 2026
62b468a
Added package to list + dependencies
ange-clement May 20, 2026
e3af8ba
Revert "Added package to list + dependencies"
ange-clement May 20, 2026
df86aa4
Added package to list + dependencies
ange-clement May 20, 2026
38866d9
Added dummy manual page
ange-clement Jun 3, 2026
f059139
Fix empty example
ange-clement Jun 3, 2026
d83a764
First simple fixes
ange-clement Jun 9, 2026
0ee5861
First fix of the rest of the first review
ange-clement Jun 10, 2026
7cd79d4
Removed wrong model
ange-clement Jun 11, 2026
d619c87
Fix second pass
ange-clement Jun 17, 2026
4279785
Detect_features: unwrap of the parameters.
ange-clement Jun 19, 2026
2da740b
Removed concept FeatureImage_3
ange-clement Jun 19, 2026
49a34d3
Merge branch 'main' of https://github.com/CGAL/cgal into Feature_grap…
ange-clement Jun 25, 2026
d58ce24
Merge branch 'main' of https://github.com/CGAL/cgal into Feature_grap…
ange-clement Jun 29, 2026
f2d550f
Added an example
ange-clement Jul 3, 2026
7c64c5e
Made the example compiles
ange-clement Jul 3, 2026
2de78f0
Removed whitespace
ange-clement Jul 3, 2026
140b954
Removed whitespace 2 : electric boogaloo
ange-clement Jul 3, 2026
0526708
Feature_graph : Include Named_function_parameters for example
ange-clement Jul 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions Feature_graph/doc/Feature_graph/CGAL/AmbrosioTortorelli_on_image.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
namespace CGAL {

/*!
* \ingroup PkgFeatureGraphRef
*
* \brief Class that evaluates the Ambriosio-Tortorelli normals and sharpness measure from an image.
* Two functors can then be retrieved to access the estimations.
*
* \tparam Vector_3 the type of the normal vector model of `Kernel::Vector_3`.
*
* \cgalModels{NormalEstimator}
*/
template <typename Vector_3>
struct AmbrosioTortorelli_on_image
{
public:
/// \name Types
/// @{

/*!
* The type of the normal vector.
*/
typedef Vector_3 Normal_type;

/*!
* The type of the functor that allows to retrieve the sharpness values.
* \cgalModels{SharpnessEstimator}
*/
typedef unspecified_type Sharpness_functor;
/*!
* The type of the functor that allows to retrieve the normals.
* \cgalModels{NormalEstimator}
*/
typedef unspecified_type Normal_functor;

///@}

/// \name Constructor
/// @{

/*!
* evaluates the normal and sharpness values using the Ambrosio-Tortorelli energy optimization.
*
* \tparam Image the image type model of `FeatureImage_3`
* \tparam FT a model of `RealEmbeddable`
*
* \param image the image.
* \param selection_threshold a threshold on the sharpness value.
* Elements with a sharpness value lower than this threshold are considered flat
* and will be given a negative value.
*/
template <typename Image, typename FT = Sharpness_functor::Sharpness_value_type>
AmbrosioTortorelli_on_image(const Image& image, const FT& selection_threshold = FT(0.25));

// @}

/// \name Functor Accessors
/// @{

/*!
* returns the functor that allows to retrieve the sharpness values.
*/
Sharpness_functor get_sharpness_functor() const;
/*!
* returns the functor that allows to retrieve the normals.
*/
Normal_functor get_normal_functor() const;

///@}
};

} /* namespace CGAL */
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
namespace CGAL {

namespace Normal_estimator
{

/*!
* \ingroup PkgFeatureGraphNormalEstimator
*
* \brief Functor that assign a normal on elements of a surface.
*
* \tparam Vector_3 the type of the normal vector model of `Kernel::Vector_3`.
*
* \cgalModels{NormalEstimator}
*/
template <typename Vector_3>
struct Normal_estimator_on_surface
{
public:
/// \name Types
/// @{

/*!
* The type of the normal vector.
*/
typedef Vector_3 Normal_type;

///@}

/// \name Constructor
/// @{

/*!
* Constructor that pre-computes the normals on the surface.
*
* \tparam Surface a model of `FaceListGraph` that represents a surface mesh.
*
* \param surface the surface where the normals are evaluated.
*/
template <typename Surface>
Normal_estimator_on_surface(const Surface& surface);

// @}

/// \name Functor
/// @{

/*!
* returns the normal vector of the surface element described by a type and an index.
*
* \tparam DimensionTag a tag that represent the element type.
* Can be `CGAL::Dimension_tag<0>`, `CGAL::Dimension_tag<1>` or `CGAL::Dimension_tag<2>`
* \tparam Index the type of index of the element to evaluate.
*
* \param element_index the index of the element to evaluate.
*/
template <typename DimensionTag, typename Index>
Normal_type operator()(const Index& element_index) const;

/// @}
};

} /* namespace Normal_estimator */

} /* namespace CGAL */
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
namespace CGAL {

namespace Sharpness_estimator
{

/*!
* \ingroup PkgFeatureGraphSharpnessEstimator
*
* \brief Functor that assign a sharpness value on elements of a surface.
*
* \cgalModels{SharpnessEstimator}
*/
struct Sharpness_estimator_on_surface
{
public:
/// \name Types
/// @{

/*!
* The type of of the sharpness value.
*/
typedef double Sharpness_value_type;

///@}

/// \name Constructor
/// @{

/*!
* Constructor that pre-computes the normals on the surface.
*
* \tparam Surface a model of `FaceListGraph` that represents a surface mesh.
* \tparam FT a model of `RealEmbeddable`
*
* \param surface the surface where the normals are evaluated.
* \param selection_threshold a threshold on the sharpness value.
* Elements with a sharpness value lower than this threshold are considered flat
* and will be given a negative value.
*/
template <typename Surface, typename FT = Sharpness_value_type>
Sharpness_estimator_on_surface(const Surface& surface, const FT& selection_threshold);

// @}

/// \name Functor
/// @{

/*!
* returns the sharpness value of the surface element described by a type and an index.
*
* \tparam DimensionTag a tag that represent the element type.
* Can be `CGAL::Dimension_tag<0>`, `CGAL::Dimension_tag<1>` or `CGAL::Dimension_tag<2>`
* \tparam Index the type of index of the element to evaluate.
*
* \param element_index the index of the element to evaluate.
*/
template <typename DimensionTag, typename Index>
Sharpness_value_type operator()(const Index& element_index) const;

/// @}
};

} /* namespace Sharpness_estimator */

} /* namespace CGAL */
131 changes: 131 additions & 0 deletions Feature_graph/doc/Feature_graph/CGAL/detect_sharp_features.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
namespace CGAL {

/*!
* \ingroup PkgFeatureGraphDetector
*
* Functor for sharp feature detection in labeled images.
*/
struct Detect_sharp_features_on_labeled_image
{
/*!
* \brief detects and constructs the feature graph from a labeled image
*
* The feature graph has polylines that lie on the
* sharp features of the surface defined by the image's subdomains.
* Each subdomain inside the bounding box
* of the input labeled image is defined as the set of voxels
* with the same value. The outside of the bounding box
* of the image is considered as a subdomain with voxel value `value_outside`.
*
* \tparam Point_3 class model of `Kernel::Point_3`.
* It defines the feature graph point type.
*
* \tparam Image class model of `FeatureImage_3`.
* It represent a labeled image.
*
* \tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
*
* \param image the input image
*
* \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below:
* \cgalNamedParamsBegin
* \cgalParamSectionBegin{sharpness_estimator}
* \cgalParamDescription{a functor model of `SharpnessEstimator`.
* See \ref PkgFeatureGraphSharpnessEstimator for available functors.}
* \cgalParamDefault{`CGAL::AmbrosioTortorelli_on_image(image).get_sharpness_functor()`}
* \cgalParamSectionEnd
* \cgalParamSectionBegin{regularization_parameters}
* \cgalParamDescription{an instance of `CGAL::Regularization_parameters`.
* It describes the parameters for the regularization step.}
* \cgalParamDefault{`CGAL::Regularization_parameters_on_image()`}
* \cgalParamSectionEnd
* \cgalParamSectionBegin{do_optimize}
* \cgalParamDescription{a boolean indicating if the optimization step is called.}
* \cgalParamDefault{`true`}
* \cgalParamSectionEnd
* \cgalParamSectionBegin{optimization_parameters}
* \cgalParamDescription{an instance of `CGAL::Optimization_parameters`.
* It describe the parameters for the optimization step.}
* \cgalParamDefault{`CGAL::Optimization_parameters_on_image<>()`}
* \cgalParamSectionEnd
* \cgalParamSectionBegin{point_to_element_output_map}
* \cgalParamDescription{an output property map that will be filled if supplied.
* It allows to retrieve the surface element where a feature graph point is embedded.
* It must be a model of `WritablePropertyMap`,
* so it must implement `put(output_pmap, point_index, element_index)`
* where the key type is the point index type and the value type the element index type.
* The element index correspond to surface element with the tag `CGAL::DimensionTag<2>`}
* \cgalParamDefault{`parameters::default()`}
* \cgalParamSectionEnd
* \cgalNamedParamsEnd
*
* \returns a graph model of `VertexAndEdgeListGraph`
* containing the constructed features.
*
* \sa `Detect_sharp_features_on_surface::oprator()()`
*/
template<typename Point_3, typename Image, typename CGAL_NP_TEMPLATE_PARAMETERS>
unspecified_type operator()(const Image& image, const CGAL_NP_CLASS& np = parameters::default_values()) const;
};

/*!
* \ingroup PkgFeatureGraphDetector
*
* Functor for sharp feature detection in surfaces.
*/
struct Detect_sharp_features_on_surface
{
/*!
* \brief detects and constructs the feature graph from a surface
*
* The feature graph has polylines that lie on the
* sharp features of the surface.
*
* \tparam Point_3 a model of `Kernel::Point_3`.
* It defines the feature graph point type.
*
* \tparam Surface a model of `FaceListGraph` that represents a surface mesh.
*
* \param surface the input surface
*
* \param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below:
* \cgalNamedParamsBegin
* \cgalParamSectionBegin{sharpness_estimator}
* \cgalParamDescription{a functor model of `SharpnessEstimator`.
* See \ref PkgFeatureGraphSharpnessEstimator for available functors.}
* \cgalParamDefault{`CGAL::Sharpness_estimator::Sharpness_estimator_on_surface(surface)`}
* \cgalParamSectionEnd
* \cgalParamSectionBegin{regularization_parameters}
* \cgalParamDescription{an instance of `CGAL::Regularization_parameters`.
* It describes the parameters for the regularization step.}
* \cgalParamDefault{`CGAL::Regularization_parameters_on_surface()`}
Comment thread
ange-clement marked this conversation as resolved.
Outdated
* \cgalParamSectionEnd
* \cgalParamSectionBegin{do_optimize}
* \cgalParamDescription{a boolean indicating if the optimization step is called.}
* \cgalParamDefault{`true`}
* \cgalParamSectionEnd
* \cgalParamSectionBegin{optimization_parameters}
* \cgalParamDescription{an instance of `Optimization_parameters`.
* It describe the parameters for the optimization step.}
* \cgalParamDefault{`CGAL::Optimization_parameters_on_surface<>()`}
* \cgalParamSectionEnd
* \cgalParamSectionBegin{point_to_element_output_map}
* \cgalParamDescription{an output property map that will be filled if supplied.
* It allows to retrieve the surface element where a feature graph point is embedded.
* It must be a model of `WritablePropertyMap`,
* so it must implement `put(output_pmap, point_index, element_index)`
* where the key type is the point index type and the value type the element index type.
* The element index correspond to surface element with the tag `CGAL::DimensionTag<2>`}
* \cgalParamDefault{`parameters::default()`}
* \cgalParamSectionEnd
* \cgalNamedParamsEnd
*
* \returns a graph model of `VertexAndEdgeListGraph`
* containing the constructed features.
*/
template<typename Point_3, typename Surface, typename CGAL_NP_TEMPLATE_PARAMETERS>
unspecified_type operator()(const Surface& surface, const CGAL_NP_CLASS& np = parameters::default_values()) const;
};


} /* namespace CGAL */
Loading
Loading