#include <CGAL/Shape_detection/Region_growing/Region_growing.h>
template<typename
NeighborQuery, typename
RegionType, typename RegionMap = typename RegionType::Region_index_map>
class CGAL::Shape_detection::Region_growing< NeighborQuery, RegionType, RegionMap >
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,
- optional
SeedRange
defining the seeding order of items and skipping unnecessary items.
- Template Parameters
-
- Examples
- Shape_detection/region_growing_circles_on_point_set_2.cpp, Shape_detection/region_growing_cylinders_on_point_set_3.cpp, Shape_detection/region_growing_lines_on_point_set_2.cpp, Shape_detection/region_growing_lines_on_segment_set.cpp, Shape_detection/region_growing_planes_on_point_set_3.cpp, Shape_detection/region_growing_planes_on_polygon_mesh.cpp, Shape_detection/region_growing_spheres_on_point_set_3.cpp, and Shape_detection/region_growing_with_custom_classes.cpp.
|
using | Item = typename RegionType::Item |
| Item type.
|
|
using | Region = std::vector< Item > |
|
using | Primitive_and_region = std::pair< typename Region_type::Primitive, Region > |
| Primitive and region type.
|
|
using | Region_map = RegionMap |
| Item to region property map.
|
|
|
template<typename InputRange , typename ItemMap = Default> |
| Region_growing (const InputRange &input_range, NeighborQuery &neighbor_query, RegionType ®ion_type, ItemMap item_map=ItemMap()) |
| initializes the region growing algorithm.
|
|
template<typename InputRange , typename SeedRange , typename ItemMap = Default> |
| Region_growing (const InputRange &input_range, SeedRange &seed_range, NeighborQuery &neighbor_query, RegionType ®ion_type, ItemMap item_map=ItemMap()) |
| initializes the region growing algorithm.
|
|
|
template<typename InputRange , typename ItemMap = Default> |
| Region_growing (const InputRange &input_range, NeighborQuery &neighbor_query, RegionType ®ion_type, Region_map rm, ItemMap item_map=ItemMap()) |
| initializes the region growing algorithm.
|
|
template<typename InputRange , typename SeedRange , typename ItemMap = Default> |
| Region_growing (const InputRange &input_range, SeedRange &seed_range, NeighborQuery &neighbor_query, RegionType ®ion_type, Region_map rm, ItemMap item_map=ItemMap()) |
| initializes the region growing algorithm.
|
|
|
template<typename PrimitiveAndRegionOutputIterator = Emptyset_iterator> |
PrimitiveAndRegionOutputIterator | detect (PrimitiveAndRegionOutputIterator region_out=PrimitiveAndRegionOutputIterator()) |
| runs the region growing algorithm and fills an output iterator with the fitted primitive and their region.
|
|
const Region_map & | region_map () |
| provides a property map that provides the region index (or std::size_t(-1)) for each input element.
|
|
|
template<typename InputRange , typename ItemOutputIterator , typename ItemMap = Default> |
ItemOutputIterator | unassigned_items (const InputRange &input_range, ItemOutputIterator output, ItemMap item_map=ItemMap()) const |
| fills an output iterator with all unassigned items.
|
|
◆ Region_growing() [1/4]
template<typename
NeighborQuery , typename
RegionType , typename RegionMap = typename RegionType::Region_index_map>
template<typename InputRange , typename ItemMap = Default>
initializes the region growing algorithm.
- Template Parameters
-
- 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 |
item_map | an instance of the property map to retrieve items from input values |
- Precondition
input_range.size() > 0
◆ Region_growing() [2/4]
template<typename
NeighborQuery , typename
RegionType , typename RegionMap = typename RegionType::Region_index_map>
template<typename InputRange , typename SeedRange , typename ItemMap = Default>
initializes the region growing algorithm.
- Template Parameters
-
- 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_range | a vector of Item that is used as seeds for the region growing. Defaults to the full input_range. |
item_map | an instance of the property map to retrieve items from input values |
- Precondition
input_range.size() > 0
◆ Region_growing() [3/4]
template<typename
NeighborQuery , typename
RegionType , typename RegionMap = typename RegionType::Region_index_map>
template<typename InputRange , typename ItemMap = Default>
initializes the region growing algorithm.
- Template Parameters
-
- 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 |
item_map | an instance of the property map to retrieve items from input values |
rm | external property map that will be filled when calling detect() |
- Precondition
input_range.size() > 0
◆ Region_growing() [4/4]
template<typename
NeighborQuery , typename
RegionType , typename RegionMap = typename RegionType::Region_index_map>
template<typename InputRange , typename SeedRange , typename ItemMap = Default>
initializes the region growing algorithm.
- Template Parameters
-
- 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_range | a vector of Item that is used as seeds for the region growing. Defaults to the full input_range. |
item_map | an instance of the property map to retrieve items from input values |
rm | external property map that will be filled when calling detect() |
- Precondition
input_range.size() > 0
◆ detect()
template<typename
NeighborQuery , typename
RegionType , typename RegionMap = typename RegionType::Region_index_map>
template<typename PrimitiveAndRegionOutputIterator = Emptyset_iterator>
runs the region growing algorithm and fills an output iterator with the fitted primitive and their region.
- Template Parameters
-
PrimitiveAndRegionOutputIterator | a model of OutputIterator whose value type is Primitive_and_region |
- Parameters
-
region_out | an output iterator of type PrimitiveAndRegionOutputIterator . |
- Returns
- past-the-end position in the output sequence
◆ region_map()
template<typename
NeighborQuery , typename
RegionType , typename RegionMap = typename RegionType::Region_index_map>
provides a property map that provides the region index (or std::size_t(-1)) for each input element.
- Returns
- Property map that maps each iterator of the input range to a region index.
◆ unassigned_items()
template<typename
NeighborQuery , typename
RegionType , typename RegionMap = typename RegionType::Region_index_map>
template<typename InputRange , typename ItemOutputIterator , typename ItemMap = Default>
fills an output iterator with all unassigned items.
- Template Parameters
-
- Parameters
-
input_range | a range of input items for region growing |
output | an iterator of type PrimitiveAndRegionOutputIterator . |
item_map | an instance of the property map to retrieve items from input values |
- Returns
- past-the-end position in the output sequence