-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New package: Feature graph #9465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ange-clement
wants to merge
31
commits into
CGAL:main
Choose a base branch
from
ange-clement:Feature_graph-aclement
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,205
−0
Draft
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 f3c299e
Initial API for Feature graph
ange-clement dee6f63
Updated API for Feature graph
ange-clement 6953ea2
API Changes
ange-clement b85a0b7
Regularization parameters
ange-clement bf7c751
Fix missing quote + Use stars for doc
ange-clement 43701aa
Changed "// @" to "/// @"
ange-clement 106d1bb
Temporarily moved doc folder
ange-clement b175e0a
Moved measures to namespace Feature_graph
ange-clement a5a7b7a
Fixed missing link
ange-clement c0d790f
Add GPL License
ange-clement cc3669a
Moved the documentation and created minimum files
ange-clement a104997
Added package dependencies
ange-clement 62b468a
Added package to list + dependencies
ange-clement e3af8ba
Revert "Added package to list + dependencies"
ange-clement df86aa4
Added package to list + dependencies
ange-clement 38866d9
Added dummy manual page
ange-clement f059139
Fix empty example
ange-clement d83a764
First simple fixes
ange-clement 0ee5861
First fix of the rest of the first review
ange-clement 7cd79d4
Removed wrong model
ange-clement d619c87
Fix second pass
ange-clement 4279785
Detect_features: unwrap of the parameters.
ange-clement 2da740b
Removed concept FeatureImage_3
ange-clement 49a34d3
Merge branch 'main' of https://github.com/CGAL/cgal into Feature_grap…
ange-clement d58ce24
Merge branch 'main' of https://github.com/CGAL/cgal into Feature_grap…
ange-clement f2d550f
Added an example
ange-clement 7c64c5e
Made the example compiles
ange-clement 2de78f0
Removed whitespace
ange-clement 140b954
Removed whitespace 2 : electric boogaloo
ange-clement 0526708
Feature_graph : Include Named_function_parameters for example
ange-clement File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
Feature_graph/doc/Feature_graph/CGAL/AmbrosioTortorelli_on_image.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 */ |
64 changes: 64 additions & 0 deletions
64
Feature_graph/doc/Feature_graph/CGAL/Normal_estimator/Normal_estimator_on_surface.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 */ |
65 changes: 65 additions & 0 deletions
65
Feature_graph/doc/Feature_graph/CGAL/Sharpness_estimator/Sharpness_estimator_on_surface.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
131
Feature_graph/doc/Feature_graph/CGAL/detect_sharp_features.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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()`} | ||
| * \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 */ | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.