CVB++ 14.0
metric_aqs12.hpp
1#pragma once
2
3#include "../calibrator_3d.hpp"
4
5#include "metric.hpp"
6#include "_decl/decl_metric_calibration_configuration.hpp"
7#include "_decl/decl_metric_segmentor_dense_point_cloud_aqs12.hpp"
8#include "_decl/decl_metric_segmentor_range_map_aqs12.hpp"
9#include "_detail/detail_metric_segmentor.hpp"
10
11namespace Cvb
12{
13CVB_BEGIN_INLINE_NS
14
15namespace Foundation
16{
17
19
23namespace Metric
24{
25using AQS12DensePointCloudSegmentorPtr = std::shared_ptr<AQS12DensePointCloudSegmentor>;
26using AQS12RangeMapSegmentorPtr = std::shared_ptr<AQS12RangeMapSegmentor>;
27
29
34
36
41}
42}
43
44
45namespace Foundation
46{
48
52namespace Metric
53{
56
69 const CalibrationConfiguration& config)
70 {
72 result.first = std::dynamic_pointer_cast<LaserPlaneHomographyCalibrator3D>(Internal::DoResCallShareOut<Calibrator3D>([&](void*& handle) {
73 return CVB_CALL_CAPI(
74 CVMAQS12CreateIntrinsicCalibratorFromPiece(
75 imagePlane.Handle(),
76 0,
77 segmentor.Handle(),
78 config.Handle(),
79 handle,
80 reinterpret_cast<CExports::CVC3DPointD*>(result.second.data())));
81 }));
82
83 return result;
84 }
85
88
102 const CalibrationConfiguration& config, Rect<int> aoi)
103{
104
106result.first = std::dynamic_pointer_cast<LaserPlaneHomographyCalibrator3D>(Internal::DoResCallShareOut<Calibrator3D>([&](void*& handle) {
107 return CVB_CALL_CAPI(
108 CVMAQS12CreateIntrinsicCalibratorFromPieceRect(
109 imagePlane.Handle(),
110 0,
111 aoi.Left(),
112 aoi.Top(),
113 aoi.Right(),
114 aoi.Bottom(),
115 segmentor.Handle(),
116 config.Handle(),
117 handle,
118 reinterpret_cast<CExports::CVC3DPointD*>(result.second.data())));
119 }));
120
121return result;
122}
123
126
135 const CalibrationConfiguration& config)
136{
138 Internal::DoResCall([&]() {
139 return CVB_CALL_CAPI(
140 CVMAQS12CalculateCorrectionOfLaserPlaneInclinationFromPiece(
141 cloud.Handle(),
142 segmentor.Handle(),
143 config.Handle(),
144 *reinterpret_cast<CExports::CVC3DTransformation*>(&result.first),
145 reinterpret_cast<CExports::CVC3DPointD*>(result.second.data())));
146 });
147
148 return result;
149}
150
153
163 const CalibrationConfiguration& config, Rect<int> aoi)
164{
166 Internal::DoResCall([&]() {
167 return CVB_CALL_CAPI(
168 CVMAQS12CalculateCorrectionOfLaserPlaneInclinationFromPieceRect(
169 cloud.Handle(),
170 aoi.Left(),
171 aoi.Top(),
172 aoi.Right(),
173 aoi.Bottom(),
174 segmentor.Handle(),
175 config.Handle(),
176 *reinterpret_cast<CExports::CVC3DTransformation*>(&result.first),
177 reinterpret_cast<CExports::CVC3DPointD*>(result.second.data())));
178 });
179
180 return result;
181}
182
185
194 const AQS12Piece& aqs12)
195{
197 Internal::DoResCall([&]() {
198 return CVB_CALL_CAPI(
199 CVMAQS12CalculateRigidBodyTransformationFromPiece(
200 cloud.Handle(),
201 segmentor.Handle(),
202 reinterpret_cast<const CExports::CVC3DPointD*>(aqs12.Points().data()),
203 aqs12.TopBasePlaneDistance(),
204 *reinterpret_cast<CExports::CVC3DTransformation*>(&result.first),
205 reinterpret_cast<CExports::CVC3DPointD*>(result.second.data())));
206 });
207
208 return result;
209}
210
213
223 const AQS12Piece& aqs12, Cvb::Rect<int> aoi)
224{
226 Internal::DoResCall([&]() {
227 return CVB_CALL_CAPI(
228 CVMAQS12CalculateRigidBodyTransformationFromPieceRect(
229 cloud.Handle(),
230 aoi.Left(),
231 aoi.Top(),
232 aoi.Right(),
233 aoi.Bottom(),
234 segmentor.Handle(),
235 reinterpret_cast<const CExports::CVC3DPointD*>(aqs12.Points().data()),
236 aqs12.TopBasePlaneDistance(),
237 *reinterpret_cast<CExports::CVC3DTransformation*>(&result.first),
238 reinterpret_cast<CExports::CVC3DPointD*>(result.second.data())));
239 });
240
241 return result;
242}
243}
244}
245CVB_END_INLINE_NS
246}
A dense Cartesian 3D point cloud object.
Definition: decl_dense_point_cloud.hpp:31
Object to collect all input parameters for the AQS12 calibration piece.
Definition: decl_metric_aqs12_calibration_piece.hpp:28
double TopBasePlaneDistance() const noexcept
Gets the distance between the top and base plane.
Definition: decl_metric_aqs12_calibration_piece.hpp:52
const std::array< Point3D< double >, 12 > & Points() const noexcept
Gets array with AQS12 points.
Definition: decl_metric_aqs12_calibration_piece.hpp:42
Segmentor object to configure face segmentation of AQS12 calibration piece on dense point clouds.
Definition: decl_metric_segmentor_dense_point_cloud_aqs12.hpp:20
Segmentor object to configure face segmentation of AQS12 calibration piece on range maps.
Definition: decl_metric_segmentor_range_map_aqs12.hpp:20
Calibration configuration object.
Definition: decl_metric_calibration_configuration.hpp:38
void * Handle() const noexcept
Returns C-API style handle to Node Object.
Definition: decl_metric_segmentor_dense_point_cloud.hpp:109
void * Handle() const noexcept
Returns C-API style handle to Node Object.
Definition: decl_metric_segmentor_range_map.hpp:117
Image plane information container.
Definition: decl_image_plane.hpp:33
void * Handle() const noexcept
Classic API image handle.
Definition: detail_image_plane.hpp:36
void * Handle() const noexcept
Returns C-API style handle to Node Object.
Definition: decl_point_cloud.hpp:767
std::pair< LaserPlaneHomographyCalibrator3DPtr, std::array< Point3D< double >, 12 > > AQS12CalibratorResult
Result for calculating the calibrator based on the AQS12 calibration piece.
Definition: metric_aqs12.hpp:33
AQS12TransformationResult CalculateCorrectionOfLaserPlaneInclinationFromAqs12Piece(const DensePointCloud &cloud, const AQS12DensePointCloudSegmentor &segmentor, const CalibrationConfiguration &config)
Calculates the correction of the laser plane inclination (affine transformation) from the given dense...
Definition: metric_aqs12.hpp:134
AQS12CalibratorResult CreateCalibratorFromAqs12Piece(const ImagePlane &imagePlane, const AQS12RangeMapSegmentor &segmentor, const CalibrationConfiguration &config)
Calculates intrinsic calibration parameters from the given range map image of an AQS12 calibration pi...
Definition: metric_aqs12.hpp:68
AQS12TransformationResult CalculateRigidBodyTransformationFromAqs12Piece(const DensePointCloud &cloud, const AQS12DensePointCloudSegmentor &segmentor, const AQS12Piece &aqs12)
Calculates the rigid body transformation from the given dense point cloud of an AQS12 calibration pie...
Definition: metric_aqs12.hpp:193
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24