CVB++ 14.1
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
167 const CalibrationConfiguration& config, Rect<int> aoi)
168{
170 Internal::DoResCall([&]() {
171 return CVB_CALL_CAPI(
172 CVMAQS12CalculateCorrectionOfLaserPlaneInclinationFromPieceRect(
173 cloud.Handle(),
174 aoi.Left(),
175 aoi.Top(),
176 aoi.Right(),
177 aoi.Bottom(),
178 segmentor.Handle(),
179 config.Handle(),
180 *reinterpret_cast<CExports::CVC3DTransformation*>(&result.first),
181 reinterpret_cast<CExports::CVC3DPointD*>(result.second.data())));
182 });
183
184 return result;
185}
186
189
198 const AQS12Piece& aqs12)
199{
201 Internal::DoResCall([&]() {
202 return CVB_CALL_CAPI(
203 CVMAQS12CalculateRigidBodyTransformationFromPiece(
204 cloud.Handle(),
205 segmentor.Handle(),
206 reinterpret_cast<const CExports::CVC3DPointD*>(aqs12.Points().data()),
207 aqs12.TopBasePlaneDistance(),
208 *reinterpret_cast<CExports::CVC3DTransformation*>(&result.first),
209 reinterpret_cast<CExports::CVC3DPointD*>(result.second.data())));
210 });
211
212 return result;
213}
214
217
231 const AQS12Piece& aqs12, Cvb::Rect<int> aoi)
232{
234 Internal::DoResCall([&]() {
235 return CVB_CALL_CAPI(
236 CVMAQS12CalculateRigidBodyTransformationFromPieceRect(
237 cloud.Handle(),
238 aoi.Left(),
239 aoi.Top(),
240 aoi.Right(),
241 aoi.Bottom(),
242 segmentor.Handle(),
243 reinterpret_cast<const CExports::CVC3DPointD*>(aqs12.Points().data()),
244 aqs12.TopBasePlaneDistance(),
245 *reinterpret_cast<CExports::CVC3DTransformation*>(&result.first),
246 reinterpret_cast<CExports::CVC3DPointD*>(result.second.data())));
247 });
248
249 return result;
250}
251}
252}
253CVB_END_INLINE_NS
254}
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:113
void * Handle() const noexcept
Returns C-API style handle to Node Object.
Definition: decl_metric_segmentor_range_map.hpp:121
Image plane information container.
Definition: decl_image_plane.hpp:33
void * Handle() const noexcept override
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:768
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:197
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24