CVB++ 15.0
decl_metric_segmentor_dense_point_cloud.hpp
1#pragma once
2
3namespace Cvb
4{
5 CVB_BEGIN_INLINE_NS
6
7 namespace Foundation
8 {
9 namespace Metric
10 {
12 }
13 } // namespace Foundation
14
15 template <>
16 inline HandleGuard<Foundation::Metric::DensePointCloudSegmentor>::HandleGuard(void *handle) noexcept
17 : HandleGuard<Foundation::Metric::DensePointCloudSegmentor>(
18 handle, [](void *handle) { CVB_CALL_CAPI(ReleaseObject(handle)); })
19 {
20 }
21
22 namespace Foundation
23 {
24 namespace Metric
25 {
26 enum class CalibrationPiece;
27 enum class SegmentationMethod;
28
34 class DensePointCloudSegmentor
35 {
36 protected:
37 struct PrivateTag
38 {
39 };
40
41 explicit DensePointCloudSegmentor(HandleGuard<DensePointCloudSegmentor> &&guard) noexcept
42 : handle_(std::move(guard))
43 {
44 }
45
46 public:
47 using GuardType = HandleGuard<DensePointCloudSegmentor>;
48
49 DensePointCloudSegmentor(const DensePointCloudSegmentor &other) = delete;
50 DensePointCloudSegmentor &operator=(const DensePointCloudSegmentor &other) = delete;
51 DensePointCloudSegmentor(DensePointCloudSegmentor &&other) = delete;
52 DensePointCloudSegmentor &operator=(DensePointCloudSegmentor &&other) = delete;
53 virtual ~DensePointCloudSegmentor() = default;
54
57
69 int WindowSize() const
70 {
71 return static_cast<int>(Internal::DoResCallValueOut<CExports::cvbdim_t>([&](CExports::cvbdim_t &value) {
72 return CVB_CALL_CAPI(CVMAQS12SegmentorDensePointCloudGetWindowSize(Handle(), value));
73 }));
74 }
75
78
90 void SetWindowSize(int windowSize) const
91 {
92 CVB_CALL_CAPI_CHECKED(
93 CVMAQS12SegmentorDensePointCloudSetWindowSize(Handle(), static_cast<CExports::cvbdim_t>(windowSize)));
94 }
95
96 virtual std::unique_ptr<Image> FaceSegmentationFromPiece(const DensePointCloud &cloud) = 0;
97 virtual std::unique_ptr<Image> FaceSegmentationFromPiece(const DensePointCloud &cloud, Rect<int> aoi) = 0;
98
99 virtual std::vector<Point3D<double>> ExtractProjectedPointsFromPiece(const DensePointCloud &cloud) = 0;
100 virtual std::vector<Point3D<double>> ExtractProjectedPointsFromPiece(const DensePointCloud &cloud,
101 Rect<int> aoi) = 0;
102
104
111 static std::shared_ptr<DensePointCloudSegmentor> FromHandle(HandleGuard<DensePointCloudSegmentor> &&guard);
112
113 template <class T>
114 static std::shared_ptr<DensePointCloudSegmentor> FromHandle(HandleGuard<DensePointCloudSegmentor> &&guard)
115 {
116 return FromHandle(std::move(guard));
117 }
118
120
123 void *Handle() const noexcept
124 {
125 return handle_.Handle();
126 }
127
128 private:
129 HandleGuard<DensePointCloudSegmentor> handle_;
130 };
131
132 } // namespace Metric
133 } // namespace Foundation
134
135 CVB_END_INLINE_NS
136} // namespace Cvb
An organized dense Cartesian 3D point cloud object.
Definition decl_dense_point_cloud.hpp:35
Base class for segmentor object to configure and compute segmentation on dense point clouds.
Definition decl_metric_segmentor_dense_point_cloud.hpp:35
int WindowSize() const
Gets window size for calculation of normals (used for the classification of the target faces).
Definition decl_metric_segmentor_dense_point_cloud.hpp:69
static std::shared_ptr< DensePointCloudSegmentor > FromHandle(HandleGuard< DensePointCloudSegmentor > &&guard)
Creates a segmentor from a classic API handle.
Definition detail_metric_segmentor.hpp:23
void * Handle() const noexcept
Returns C-API style handle to Node Object.
Definition decl_metric_segmentor_dense_point_cloud.hpp:123
void SetWindowSize(int windowSize) const
Sets window size for the calculation of normals (used for the classification of the target faces).
Definition decl_metric_segmentor_dense_point_cloud.hpp:90
Rectangle object.
Definition rect.hpp:24
cvbbool_t ReleaseObject(OBJ &Object)
T move(T... args)
Namespace for metric calibration.
Definition decl_metric_aqs12_calibration_piece.hpp:13
CalibrationPiece
Defines the calibration piece to use for face segmentation.
Definition metric.hpp:24
SegmentationMethod
Defines the segmentation method for labeling the faces of the calibration piece.
Definition metric.hpp:31
Namespace for the Foundation package.
Definition decl_metric_aqs12_calibration_piece.hpp:11
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17