|
CGAL 5.4 - Shape Detection
|
#include <CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_cylinder_fit_region.h>
Region type based on the quality of the least squares cylinder fit applied to 3D points.
This class fits an infinite cylinder to chunks of points in a 3D point set and controls the quality of this fit. If all quality conditions are satisfied, the chunk is accepted as a valid region, otherwise rejected.
| GeomTraits | must be a model of Kernel. |
| InputRange | must be a model of ConstRange whose iterator type is RandomAccessIterator. |
| PointMap | must be an LvaluePropertyMap whose key type is the value type of the input range and value type is Kernel::Point_3. |
| NormalMap | must be an LvaluePropertyMap whose key type is the value type of the input range and value type is Kernel::Vector_3. |
Types | |
| typedef GeomTraits::FT | FT |
| Number type. | |
Initialization | |
| Least_squares_cylinder_fit_region (const InputRange &input_range, const FT distance_threshold=FT(1), const FT angle_threshold=FT(25), const std::size_t min_region_size=3, const FT minimum_radius=FT(0), const FT maximum_radius=std::numeric_limits< FT >::infinity(), const PointMap point_map=PointMap(), const NormalMap normal_map=NormalMap(), const GeomTraits traits=GeomTraits()) | |
| initializes all internal data structures. More... | |
Access | |
| bool | is_part_of_region (const std::size_t, const std::size_t query_index, const std::vector< std::size_t > &indices) const |
implements RegionType::is_part_of_region(). More... | |
| bool | is_valid_region (const std::vector< std::size_t > ®ion) const |
implements RegionType::is_valid_region(). More... | |
| void | update (const std::vector< std::size_t > ®ion) |
implements RegionType::update(). More... | |
| CGAL::Shape_detection::Point_set::Least_squares_cylinder_fit_region< GeomTraits, InputRange, PointMap, NormalMap >::Least_squares_cylinder_fit_region | ( | const InputRange & | input_range, |
| const FT | distance_threshold = FT(1), |
||
| const FT | angle_threshold = FT(25), |
||
| const std::size_t | min_region_size = 3, |
||
| const FT | minimum_radius = FT(0), |
||
| const FT | maximum_radius = std::numeric_limits<FT>::infinity(), |
||
| const PointMap | point_map = PointMap(), |
||
| const NormalMap | normal_map = NormalMap(), |
||
| const GeomTraits | traits = GeomTraits() |
||
| ) |
initializes all internal data structures.
| input_range | an instance of InputRange with 3D points and corresponding 3D normal vectors |
| distance_threshold | the maximum distance from a point to a cylinder. Default is 1. |
| angle_threshold | the maximum accepted angle in degrees between the normal of a point and the radius of a cylinder. Default is 25 degrees. |
| min_region_size | the minimum number of 3D points a region must have. Default is 3. |
| minimum_radius | the radius below which an estimated cylinder is considered as invalid and discarded. Default is 0 (no limit). |
| maximum_radius | the radius above which an estimated cylinder is considered as invalid and discarded. Default is infinity (no limit). |
| point_map | an instance of PointMap that maps an item from input_range to Kernel::Point_3 |
| normal_map | an instance of NormalMap that maps an item from input_range to Kernel::Vector_3 |
| traits | an instance of GeomTraits. |
input_range.size() > 0 distance_threshold >= 0 angle_threshold >= 0 && angle_threshold <= 90 min_region_size > 0 | bool CGAL::Shape_detection::Point_set::Least_squares_cylinder_fit_region< GeomTraits, InputRange, PointMap, NormalMap >::is_part_of_region | ( | const std::size_t | , |
| const std::size_t | query_index, | ||
| const std::vector< std::size_t > & | indices | ||
| ) | const |
implements RegionType::is_part_of_region().
This function controls if a point with the index query_index is within the distance_threshold from the corresponding cylinder and if the angle between its normal and the cylinder radius is within the angle_threshold. If both conditions are satisfied, it returns true, otherwise false.
| query_index | index of the query point |
| indices | indices of the inliers of the region |
The first parameter is not used in this implementation.
true or falsequery_index >= 0 && query_index < input_range.size() | bool CGAL::Shape_detection::Point_set::Least_squares_cylinder_fit_region< GeomTraits, InputRange, PointMap, NormalMap >::is_valid_region | ( | const std::vector< std::size_t > & | region | ) | const |
implements RegionType::is_valid_region().
This function controls if the estimated radius is between minimum_radius and maximum_radius and if the region contains at least min_region_size points.
| region | indices of points included in the region |
true or false | void CGAL::Shape_detection::Point_set::Least_squares_cylinder_fit_region< GeomTraits, InputRange, PointMap, NormalMap >::update | ( | const std::vector< std::size_t > & | region | ) |
implements RegionType::update().
This function fits the least squares cylinder to all points from the region.
| region | indices of points included in the region |
region.size() > 0