added empty segment set classes + updated several docs

This commit is contained in:
Dmitry Anisimov 2021-03-25 17:16:27 +01:00
parent 462817c48e
commit c502a39ea9
16 changed files with 116 additions and 32 deletions

View File

@ -6,9 +6,10 @@ A concept that describes the set of methods used by the `CGAL::Shape_detection::
to access neighbors of an item.
\cgalHasModel
- `CGAL::Shape_detection::Point_set::K_neighbor_query`,
- `CGAL::Shape_detection::Point_set::Sphere_neighbor_query`,
- `CGAL::Shape_detection::Point_set::K_neighbor_query`
- `CGAL::Shape_detection::Point_set::Sphere_neighbor_query`
- `CGAL::Shape_detection::Polygon_mesh::One_ring_neighbor_query`
- `CGAL::Shape_detection::Polyline::One_ring_neighbor_query`
*/
class NeighborQuery {

View File

@ -9,9 +9,11 @@ A region is represented by a set of `indices` of the items, which are included i
this region.
\cgalHasModel
- `CGAL::Shape_detection::Point_set::Least_squares_line_fit_region`,
- `CGAL::Shape_detection::Point_set::Least_squares_plane_fit_region`,
- `CGAL::Shape_detection::Point_set::Least_squares_line_fit_region`
- `CGAL::Shape_detection::Point_set::Least_squares_plane_fit_region`
- `CGAL::Shape_detection::Segment_set::Least_squares_line_fit_region`
- `CGAL::Shape_detection::Polygon_mesh::Least_squares_plane_fit_region`
- `CGAL::Shape_detection::Polyline::Least_squares_line_fit_region`
*/
class RegionType {
@ -50,8 +52,10 @@ public:
represented by `indices`.
`CGAL::Shape_detection::Region_growing` calls this function each time when a
new seed item is selected. In this case, `indices.size() = 1`. This function
is also called periodically when enlarging the region. In this case, `indices.size() > 1`.
new seed item is selected. This case can be identified by checking the
condition `indices.size() == 1`. This function is also called periodically
when enlarging the region. This case can be identified by checking the
condition `indices.size() > 1`.
*/
void update(
const std::vector<std::size_t>& indices) {

View File

@ -5,3 +5,7 @@ EXTRACT_ALL = NO
HIDE_UNDOC_CLASSES = YES
WARN_IF_UNDOCUMENTED = NO
PREDEFINED = DOXYGEN_NS
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
EXPAND_AS_DEFINED = CGAL_BGL_NP_TEMPLATE_PARAMETERS \
CGAL_BGL_NP_CLASS

View File

@ -17,12 +17,24 @@ Concepts used for the parameters of the `CGAL::Shape_detection::Region_growing`.
Models that can be used with the `CGAL::Shape_detection::Region_growing`
for shape detection in a point set.
\defgroup PkgShapeDetectionRGOnSegments Segment Set
\ingroup PkgShapeDetectionRG
Models that can be used with the `CGAL::Shape_detection::Region_growing`
for shape detection in a segment set.
\defgroup PkgShapeDetectionRGOnMesh Polygon Mesh
\ingroup PkgShapeDetectionRG
Models that can be used with the `CGAL::Shape_detection::Region_growing`
for shape detection on a polygon mesh.
\defgroup PkgShapeDetectionRGOnPolyline Polyline
\ingroup PkgShapeDetectionRG
Models that can be used with the `CGAL::Shape_detection::Region_growing`
for shape detection on a polyline.
\addtogroup PkgShapeDetectionRG
\defgroup PkgShapeDetectionRANSAC Efficient RANSAC
@ -121,15 +133,26 @@ on a polygon mesh.}
- `CGAL::Shape_detection::Point_set::Least_squares_line_fit_sorting<GeomTraits, InputRange, NeighborQuery, PointMap>`
- `CGAL::Shape_detection::Point_set::Least_squares_plane_fit_sorting<GeomTraits, InputRange, NeighborQuery, PointMap>`
### Segment Set ###
- `CGAL::Shape_detection::Segment_set::Least_squares_line_fit_region<GeomTraits, InputRange, SegmentMap>`
- `CGAL::Shape_detection::Segment_set::Least_squares_line_fit_sorting<GeomTraits, InputRange, NeighborQuery, SegmentMap>`
### Polygon Mesh ###
- `CGAL::Shape_detection::Polygon_mesh::One_ring_neighbor_query<PolygonMesh, FaceRange>`
- `CGAL::Shape_detection::Polygon_mesh::Least_squares_plane_fit_region<GeomTraits, PolygonMesh, FaceRange, VertexToPointMap>`
- `CGAL::Shape_detection::Polygon_mesh::Least_squares_plane_fit_sorting<GeomTraits, PolygonMesh, NeighborQuery, FaceRange, VertexToPointMap>`
### Polyline ###
- `CGAL::Shape_detection::Polyline::One_ring_neighbor_query<GeomTraits, InputRange>`
- `CGAL::Shape_detection::Polyline::Least_squares_line_fit_region<GeomTraits, InputRange, PointMap>`
- `CGAL::Shape_detection::Polyline::Least_squares_line_fit_sorting<GeomTraits, InputRange, NeighborQuery, PointMap>`
## Deprecated Components ##
- `CGAL::Shape_detection::deprecated::Shape_detection_traits<GeomTraits, InputRange, PointMap, NormalMap>`
- `CGAL::Shape_detection::deprecated::Region_growing_depr<Traits>`
## Functions ##
- `CGAL::regularize_planes()`
- `CGAL::region_growing_lines()`
- `CGAL::region_growing_planes()`
*/

View File

@ -6,9 +6,12 @@
\example Shape_detection/include/efficient_RANSAC_with_custom_shape.h
\example Shape_detection/efficient_RANSAC_with_custom_shape.cpp
\example Shape_detection/efficient_RANSAC_and_plane_regularization.cpp
\example Shape_detection/region_growing_basic.cpp
\example Shape_detection/region_growing_on_point_set_2.cpp
\example Shape_detection/region_growing_on_point_set_3.cpp
\example Shape_detection/region_growing_on_segment_set.cpp
\example Shape_detection/region_growing_on_polygon_mesh.cpp
\example Shape_detection/region_growing_on_polyline.cpp
\example Shape_detection/region_growing_with_custom_classes.cpp
\example Shape_detection/shape_detection_basic_deprecated.cpp
*/

View File

@ -116,18 +116,30 @@ namespace Point_set {
/*!
\brief initializes a Kd-tree with input points.
\tparam NamedParameters
a sequence of \ref bgl_namedparameters "Named Parameters"
\param input_range
an instance of `InputRange` with 2D or 3D points
\param k
the number of returned neighbors per each query point. %Default is 12.
\param np
a sequence of \ref bgl_namedparameters "Named Parameters"
among the ones listed below
\param point_map
an instance of `PointMap` that maps an item from `input_range`
to `Kernel::Point_2` or to `Kernel::Point_3`
\cgalNamedParamsBegin
\cgalParamNBegin{neighbor_radius}
\cgalParamDescription{the number of returned neighbors per each query point}
\cgalParamType{`std::size_t`}
\cgalParamDefault{12}
\cgalParamNEnd
\cgalNamedParamsEnd
\pre `input_range.size() > 0`
\pre `k > 0`
\pre `K > 0`
*/
template<typename NamedParameters>
K_neighbor_query(
@ -160,7 +172,7 @@ namespace Point_set {
/*!
\brief implements `NeighborQuery::operator()()`.
This operator finds indices of the `k` closest points to the point with
This operator finds indices of the `K` closest points to the point with
the index `query_index` using a Kd-tree. These indices are returned in `neighbors`.
\param query_index
@ -169,7 +181,7 @@ namespace Point_set {
\param neighbors
indices of points, which are neighbors of the query point
\pre `query_index >= 0 && query_index < input_range.size()`
\pre `query_index < input_range.size()`
*/
void operator()(
const std::size_t query_index,

View File

@ -93,19 +93,16 @@ namespace Point_set {
/*!
\brief initializes all internal data structures.
\tparam NamedParameters
a sequence of \ref bgl_namedparameters "Named Parameters"
\param input_range
an instance of `InputRange` with 2D points and
corresponding 2D normal vectors
\param distance_threshold
the maximum distance from a point to a line. %Default is 1.
\param angle_threshold
the maximum accepted angle in degrees between the normal of a point and
the normal of a line. %Default is 25 degrees.
\param min_region_size
the minimum number of 2D points a region must have. %Default is 2.
\param np
a sequence of \ref bgl_namedparameters "Named Parameters"
among the ones listed below
\param point_map
an instance of `PointMap` that maps an item from `input_range`
@ -118,9 +115,35 @@ namespace Point_set {
\param traits
an instance of `GeomTraits`
\cgalNamedParamsBegin
\cgalParamNBegin{distance_threshold}
\cgalParamDescription{the maximum distance from a point to a line}
\cgalParamType{`GeomTraits::FT`}
\cgalParamDefault{1}
\cgalParamNEnd
\cgalParamNBegin{angle_deg_threshold}
\cgalParamDescription{the maximum accepted angle in degrees between
the normal of a point and the normal of a line}
\cgalParamType{`GeomTraits::FT`}
\cgalParamDefault{25 degrees}
\cgalParamNEnd
\cgalParamNBegin{cos_value_threshold}
\cgalParamDescription{the cos value computed as cos(angle_deg_threshold * PI / 180),
this value can be used instead of the angle_deg_threshold}
\cgalParamType{`GeomTraits::FT`}
\cgalParamDefault{cos(25 * PI / 180)}
\cgalParamNEnd
\cgalParamNBegin{min_region_size}
\cgalParamDescription{the minimum number of 2D points a region must have}
\cgalParamType{`std::size_t`}
\cgalParamDefault{2}
\cgalParamNEnd
\cgalNamedParamsEnd
\pre `input_range.size() > 0`
\pre `distance_threshold >= 0`
\pre `angle_threshold >= 0 && angle_threshold <= 90`
\pre `angle_deg_threshold >= 0 && angle_deg_threshold <= 90`
\pre `cos_value_threshold >= 0 && cos_value_threshold <= 1`
\pre `min_region_size > 0`
*/
template<typename NamedParameters>
@ -167,7 +190,7 @@ namespace Point_set {
This function controls if a point with the index `query_index` is within
the `distance_threshold` from the corresponding line and if the angle
between its normal and the line's normal is within the `angle_threshold`.
between its normal and the line's normal is within the `angle_deg_threshold`.
If both conditions are satisfied, it returns `true`, otherwise `false`.
\param query_index
@ -177,7 +200,7 @@ namespace Point_set {
\return Boolean `true` or `false`
\pre `query_index >= 0 && query_index < input_range.size()`
\pre `query_index < input_range.size()`
*/
bool is_part_of_region(
const std::size_t,

View File

@ -30,7 +30,7 @@ namespace Point_set {
\brief Sorting of 2D points with respect to the local line fit quality.
Indices of 2D input points are sorted with respect to the quality of the
least squares line fit applied to the neighboring points of each point.
least squares line fit applied to the neighbor points of each point.
\tparam GeomTraits
a model of `Kernel`

View File

@ -30,7 +30,7 @@ namespace Point_set {
\brief Sorting of 3D points with respect to the local plane fit quality.
Indices of 3D input points are sorted with respect to the quality of the
least squares plane fit applied to the neighboring points of each point.
least squares plane fit applied to the neighbor points of each point.
\tparam GeomTraits
a model of `Kernel`

View File

@ -30,7 +30,7 @@ namespace Polygon_mesh {
\brief Sorting of polygon mesh faces with respect to the local plane fit quality.
Indices of faces in a polygon mesh are sorted with respect to the quality of the
least squares plane fit applied to the vertices of neighboring faces of each face.
least squares plane fit applied to the vertices of neighbor faces of each face.
\tparam GeomTraits
a model of `Kernel`

View File

@ -102,7 +102,7 @@ namespace Polygon_mesh {
\param neighbors
indices of faces, which are neighbors of the query face
\pre `query_index >= 0 && query_index < faces(pmesh).size()`
\pre `query_index < faces(pmesh).size()`
*/
void operator()(
const std::size_t query_index,

View File

@ -1,3 +1,7 @@
- add region growing on segments
- move all free functions to the same file
- overload the line functions
- do we need free functions here
- update the docs
- ---- submission ----
- update the polyhedron demo
@ -30,3 +34,13 @@
- move each face vertex to the position of the intersection point between all neighbor region planes
- triangulate each face and tag exterior triangles beyond its boundaries, which are constraints in CDT
- that gives the new simplified surface mesh
- add region type for segments
- the input graph can be split into polylines based on corners
- regularize_face_selection_borders() or better apply graph cut on the computed regions to close holes
- error in the graph cut can be controlled by the size to the ideal position of the corners
- detect planes
- regularize regions
- decimate mesh
- update corner positions