#include <CGAL/Shape_detection/Region_growing/Region_growing.h>
template<typename InputRange, typename NeighborQuery, typename RegionType, typename SeedMap = CGAL::Identity_property_map<std::size_t>>
class CGAL::Shape_detection::Region_growing< InputRange, NeighborQuery, RegionType, SeedMap >
Main class/entry point for running the region growing algorithm.
This version of the region growing algorithm enables to detect regions in a set of user-defined items
- given a way to access neighbors of each item via the
NeighborQuery
parameter class and
- control if items form a valid region type via the
RegionType
parameter class,
- the
SeedMap
property map enables to define the seeding order of items and skip unnecessary items.
- Template Parameters
-
- Examples:
- Shape_detection/region_growing_on_point_set_2.cpp, Shape_detection/region_growing_on_point_set_3.cpp, Shape_detection/region_growing_on_polygon_mesh.cpp, and Shape_detection/region_growing_with_custom_classes.cpp.
◆ Region_growing()
template<typename InputRange , typename NeighborQuery , typename RegionType , typename SeedMap = CGAL::Identity_property_map<std::size_t>>
initializes the region growing algorithm.
- Parameters
-
input_range | a range of input items for region growing |
neighbor_query | an instance of NeighborQuery that is used internally to access item's neighbors |
region_type | an instance of RegionType that is used internally to control if items form a valid region type |
seed_map | an instance of SeedMap property map that is used internally to set the order of items in the region growing processing queue. If it maps to std::size_t(-1) , the corresponding item is skipped. |
- Precondition
input_range.size() > 0
◆ detect()
template<typename InputRange , typename NeighborQuery , typename RegionType , typename SeedMap = CGAL::Identity_property_map<std::size_t>>
template<typename OutputIterator >
runs the region growing algorithm and fills an output iterator with the found regions.
- Template Parameters
-
OutputIterator | must be an output iterator whose value type is std::vector<std::size_t> . |
- Parameters
-
regions | an output iterator that stores regions, where each region is returned as a vector of indices of the items, which belong to this region |
- Returns
- past-the-end position in the output sequence
◆ unassigned_items()
template<typename InputRange , typename NeighborQuery , typename RegionType , typename SeedMap = CGAL::Identity_property_map<std::size_t>>
template<typename OutputIterator >
fills an output iterator with indices of all unassigned items.
- Template Parameters
-
OutputIterator | must be an output iterator whose value type is std::size_t . |
- Parameters
-
output | an output iterator that stores indices of all items, which are not assigned to any region |
- Returns
- past-the-end position in the output sequence