#include <CGAL/Shape_detection/Region_growing/Region_growing_on_point_set/Least_squares_plane_fit_region.h>
Region type based on the quality of the least squares plane fit applied to 3D points.
This class fits a plane 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.
- Template Parameters
-
- Is Model Of:
RegionType
- Examples:
- Shape_detection/region_growing_on_point_set_3.cpp.
|
typedef GeomTraits::FT | FT |
| Number type.
|
|
|
| Least_squares_plane_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 PointMap point_map=PointMap(), const NormalMap normal_map=NormalMap(), const GeomTraits traits=GeomTraits()) |
| initializes all internal data structures. More...
|
|
◆ Least_squares_plane_fit_region()
template<typename GeomTraits , typename InputRange , typename PointMap , typename NormalMap >
initializes all internal data structures.
- Parameters
-
input_range | an instance of InputRange with 3D points and corresponding 3D normal vectors |
distance_threshold | the maximum distance from a point to a plane. Default is 1. |
angle_threshold | the maximum accepted angle in degrees between the normal of a point and the normal of a plane. Default is 25 degrees. |
min_region_size | the minimum number of 3D points a region must have. Default is 3. |
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 . |
- Precondition
input_range.size() > 0
-
distance_threshold >= 0
-
angle_threshold >= 0 && angle_threshold <= 90
-
min_region_size > 0
◆ is_part_of_region()
template<typename GeomTraits , typename InputRange , typename PointMap , typename NormalMap >
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 plane and if the angle between its normal and the plane's normal is within the angle_threshold
. If both conditions are satisfied, it returns true
, otherwise false
.
- Parameters
-
query_index | index of the query point |
The first and third parameters are not used in this implementation.
- Returns
- Boolean
true
or false
- Precondition
query_index >= 0 && query_index < input_range.size()
◆ is_valid_region()
template<typename GeomTraits , typename InputRange , typename PointMap , typename NormalMap >
implements RegionType::is_valid_region()
.
This function controls if the region
contains at least min_region_size
points.
- Parameters
-
region | indices of points included in the region |
- Returns
- Boolean
true
or false
◆ update()
template<typename GeomTraits , typename InputRange , typename PointMap , typename NormalMap >
implements RegionType::update()
.
This function fits the least squares plane to all points from the region
.
- Parameters
-
region | indices of points included in the region |
- Precondition
region.size() > 0