ReUseX  0.0.1
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
segment_planes.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Povl Filip Sonne-Frederiksen
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6#include <pcl/planar_region_growing.hpp>
7
8#include <ReUseX/types.hpp>
10#include <spdmon/spdmon.hpp>
11
12#include <fmt/format.h>
13
14#include <spdlog/sinks/stdout_color_sinks.h>
15#include <spdlog/spdlog.h>
16#include <spdlog/stopwatch.h>
17
18#include <pcl/common/colors.h>
19#include <pcl/filters/filter.h>
20#include <pcl/io/auto_io.h>
21#include <pcl/io/pcd_io.h>
22#include <pcl/visualization/pcl_visualizer.h>
23
24#include <boost/parameter.hpp>
25#include <boost/parameter/keyword.hpp>
26#include <boost/parameter/name.hpp>
27
28#include <ReUseX/io/reusex.hpp>
29
30namespace parameter = boost::parameter;
31
32namespace ReUseX::geometry {
33
35 const float angle_threshold,
36 const float plane_dist_threshold,
37 const int min_inliers, const float radius,
38 const float interval_0, const float interval_factor,
39 const bool visualize)
40 -> std::tuple<CloudLPtr, CloudLocPtr, CloudNPtr>;
41
42BOOST_PARAMETER_NAME(cloud)
43BOOST_PARAMETER_NAME(normals)
44BOOST_PARAMETER_NAME(angle_threshold)
45BOOST_PARAMETER_NAME(plane_dist_threshold)
46BOOST_PARAMETER_NAME(min_inliers)
47BOOST_PARAMETER_NAME(radius)
48BOOST_PARAMETER_NAME(interval_0)
49BOOST_PARAMETER_NAME(interval_factor)
50BOOST_PARAMETER_NAME(visualize)
51
53 (std::tuple<CloudLPtr, CloudLocPtr, CloudNPtr>), // 1. parenthesized return
54 // type
55 segment_planes, // 2. name of the function template
56 tag, // 3. namespace of tag types
57 (required //
58 (cloud, (CloudConstPtr)) //
59 (normals, (CloudNConstPtr)) //
60 ) //
61 (optional //
62 (angle_threshold, (float), 25.0) //
63 (plane_dist_threshold, (float), 0.07) //
64 (min_inliers, (int), 1000) //
65 (radius, (float), 0.5) //
66 (interval_0, (int), 16) //
67 (interval_factor, (float), 1.5) //
68 (visualize, (bool), false) //
69 )) {
70 return segment_planes_impl(cloud, normals, angle_threshold,
71 plane_dist_threshold, min_inliers, radius,
72 interval_0, interval_factor, visualize);
73}
74
75} // namespace ReUseX::geometry
BOOST_PARAMETER_FUNCTION((std::tuple< CloudLPtr, CloudLocPtr, CloudNPtr >), segment_planes, tag,(required(cloud,(CloudConstPtr))(normals,(CloudNConstPtr)))(optional(angle_threshold,(float), 25.0)(plane_dist_threshold,(float), 0.07)(min_inliers,(int), 1000)(radius,(float), 0.5)(interval_0,(int), 16)(interval_factor,(float), 1.5)(visualize,(bool), false)))
auto segment_planes_impl(CloudConstPtr cloud, CloudNConstPtr normals, const float angle_threshold, const float plane_dist_threshold, const int min_inliers, const float radius, const float interval_0, const float interval_factor, const bool visualize) -> std::tuple< CloudLPtr, CloudLocPtr, CloudNPtr >
typename CloudN::Ptr CloudNPtr
Definition types.hpp:26
typename CloudN::ConstPtr CloudNConstPtr
Definition types.hpp:27
typename CloudLoc::Ptr CloudLocPtr
Definition types.hpp:34
typename CloudL::Ptr CloudLPtr
Definition types.hpp:30
typename Cloud::ConstPtr CloudConstPtr
Definition types.hpp:23