- the maximum distance from the furthest vertex of a segment to a line
-
Type:
GeomTraits::FT - Default: 1
|
CGAL 6.0 - Shape Detection
|
#include <CGAL/Shape_detection/Region_growing/Segment_set/Least_squares_line_fit_region.h>
Region type based on the quality of the least squares line fit applied to a segment set.
This class fits a line, using PCA, to chunks of 2D or 3D segments and controls the quality of this fit. If all quality conditions are satisfied, the chunk is accepted as a valid region, otherwise rejected.
| GeomTraits | a model of Kernel |
| Item_ | a descriptor representing a given segment. Must be a model of Hashable. |
| SegmentMap | a model of ReadablePropertyMap whose key type is Item and value type is Kernel::Segment_2 or Kernel::Segment_3 |
RegionType Types | |
| typedef GeomTraits::FT | FT |
| Number type. | |
| using | Item = Item_ |
| Item type. | |
| using | Region = std::vector< Item > |
| using | Primitive = typename GeomTraits::Line_2 or typename GeomTraits::Line_3 using Region_unordered_map=std::unordered_map< Item, std::size_t, internal::hash_item< Item > > |
| Primitive type depends on the dimension of the input data. | |
| using | Region_index_map = boost::associative_property_map< Region_unordered_map > |
Initialization | |
| template<typename NamedParameters = parameters::Default_named_parameters> | |
| Least_squares_line_fit_region (const NamedParameters &np=parameters::default_values()) | |
| initializes all internal data structures. | |
Access | |
| Region_index_map | region_index_map () |
implements RegionType::region_index_map(). | |
| Primitive | primitive () const |
implements RegionType::primitive(). | |
| bool | is_part_of_region (const Item query, const Region &) const |
implements RegionType::is_part_of_region(). | |
| bool | is_valid_region (const Region ®ion) const |
implements RegionType::is_valid_region(). | |
| bool | update (const Region ®ion) |
implements RegionType::update(). | |
| CGAL::Shape_detection::Segment_set::Least_squares_line_fit_region< GeomTraits, Item_, SegmentMap >::Least_squares_line_fit_region | ( | const NamedParameters & | np = parameters::default_values() | ) |
initializes all internal data structures.
| NamedParameters | a sequence of Named Parameters |
| np | a sequence of Named Parameters among the ones listed below |
| InputRange | a model of ConstRange whose iterator type is RandomAccessIterator |
| |
| |
| |
| |
| |
|
maximum_distance >= 0 maximum_angle >= 0 && maximum_angle <= 90 cosine_of_maximum_angle >= 0 && cosine_of_maximum_angle <= 1 minimum_region_size > 0 | bool CGAL::Shape_detection::Segment_set::Least_squares_line_fit_region< GeomTraits, Item_, SegmentMap >::is_part_of_region | ( | const Item | query, |
| const Region & | |||
| ) | const |
implements RegionType::is_part_of_region().
This function controls if a segment with the index query is within the maximum_distance from the corresponding line and if the angle between the direction of this segment and the line's direction is within the maximum_angle. If both conditions are satisfied, it returns true, otherwise false.
| query | Item of the query segment |
The last parameter is not used in this implementation.
true or false | bool CGAL::Shape_detection::Segment_set::Least_squares_line_fit_region< GeomTraits, Item_, SegmentMap >::is_valid_region | ( | const Region & | region | ) | const |
implements RegionType::is_valid_region().
This function controls if the region contains at least minimum_region_size segments.
| region | Segments of the region represented as Items. |
true or false | Primitive CGAL::Shape_detection::Segment_set::Least_squares_line_fit_region< GeomTraits, Item_, SegmentMap >::primitive | ( | ) | const |
implements RegionType::primitive().
This function provides the last primitive that has been fitted with the region.
successful fitted primitive via successful call of update(region) with a sufficient large region | Region_index_map CGAL::Shape_detection::Segment_set::Least_squares_line_fit_region< GeomTraits, Item_, SegmentMap >::region_index_map | ( | ) |
implements RegionType::region_index_map().
This function creates an empty property map that maps iterators on the input range Item to std::size_t.
| bool CGAL::Shape_detection::Segment_set::Least_squares_line_fit_region< GeomTraits, Item_, SegmentMap >::update | ( | const Region & | region | ) |
implements RegionType::update().
This function fits the least squares line to all segments from the region.
| region | Segments of the region represented as Items. |
true if the line fitting succeeded and false otherwiseregion.size() > 0