3#include "_cexports/c_core_3d.h"
8#include "sparse_point_cloud.hpp"
9#include "dense_point_cloud.hpp"
10#include "calibrator_3d.hpp"
11#include "sensor_settings.hpp"
35 auto pointCloud = std::dynamic_pointer_cast<T>(
Load(fileName, flags));
50 return Internal::DoResCallShareOut<PointCloud>([&](
void* & handle)
52 return CVB_CALL_CAPI(CVC3DLoadFileTyped(fileName.c_str(),
static_cast<CExports::cvbval_t
>(flags), handle));
89 return Internal::DoResCallShareOut<PointCloud>([&](
void* & handle)
91 return CVB_CALL_CAPI(CVC3DCreateCalibratedPointCloudFromRangeMap(rangeMap.
Map()->Handle(), calibrator.
Handle(),
static_cast<CExports::cvbval_t
>(flags), handle));
113 auto pointCloud =
Create(rangeMap, calibrator, flags);
114 auto typedPointCloud = std::dynamic_pointer_cast<T>(pointCloud);
115 if (!typedPointCloud)
116 typedPointCloud = TypeConvert<T>::Convert(*pointCloud);
117 return typedPointCloud;
159 return Internal::DoResCallShareOut<PointCloud>([&](
void*& handle)
161 return CVB_CALL_CAPI(CVC3DCreateCalibratedPointCloudFromRangeMapWithSettings(
162 rangeMap.
Map()->Handle(),
164 *
reinterpret_cast<const CExports::CVC3DSensorSettings*
>(&settings),
166 static_cast<CExports::cvbval_t
>(flags), handle));
188 auto pointCloud =
CreateWithSettings(rangeMap, calibrator, flags, settings, encoderStep);
189 auto typedPointCloud = std::dynamic_pointer_cast<T>(pointCloud);
190 if (!typedPointCloud)
191 typedPointCloud = TypeConvert<T>::Convert(*pointCloud);
192 return typedPointCloud;
211 return std::dynamic_pointer_cast<SparsePointCloud>(Internal::DoResCallShareOut<PointCloud>([&](
void * & handle)
213 return CVB_CALL_CAPI(CVC3DCreateSparsePointCloud(
214 static_cast<CExports::cvbint64_t
>(numPoints),
215 static_cast<CExports::cvbval_t
>(flags),
234 return std::dynamic_pointer_cast<SparsePointCloud>(Internal::DoResCallShareOut<PointCloud>([&](
void * & handle)
237 std::copy(planeIncs.begin(), planeIncs.end(), std::begin(tmpPlaneIncs));
238 return CVB_CALL_CAPI(CVC3DCreateSparsePointCloudFromPointer(
239 const_cast<void**
>(planeBasePtrs.data()),
240 static_cast<CExports::cvbdim_t
>(numPlanes),
244 [](
void *,
void *) {},
266 return std::dynamic_pointer_cast<DensePointCloud>(Internal::DoResCallShareOut<PointCloud>([&](
void * & handle)
268 return CVB_CALL_CAPI(CVC3DCreateDensePointCloud(size.
Width(), size.
Height(),
static_cast<CExports::cvbval_t
>(flags), handle));
289 return std::dynamic_pointer_cast<DensePointCloud>(Internal::DoResCallShareOut<PointCloud>([&](
void* & handle)
291 return CVB_CALL_CAPI(CVC3DCreateDensePointCloudFromRangeMap(rangeMap.
Map()->Handle(),
292 *
reinterpret_cast<CExports::CVC3DFactors*
>(&factors),
static_cast<CExports::cvbval_t
>(flags),
301 struct TypeConvert{};
306struct PointCloudFactory::TypeConvert<DensePointCloud>
310 const auto& sparse =
dynamic_cast<const SparsePointCloud&
>(pointCloud);
311 return sparse.ToDensePointCloud();
316struct PointCloudFactory::TypeConvert<SparsePointCloud>
320 const auto& dense =
dynamic_cast<const DensePointCloud&
>(pointCloud);
321 return dense.ToSparsePointCloud();
Base calibration class to apply 3D calibration to point clouds.
Definition: decl_calibrator_3d.hpp:67
void * Handle() const noexcept
Returns C-API style handle to Node Object.
Definition: decl_calibrator_3d.hpp:180
Data type description for an image plane.
Definition: data_type.hpp:28
int NativeDescriptor() const noexcept
Native data type descriptor.
Definition: data_type.hpp:322
Image plane information container.
Definition: decl_image_plane.hpp:33
std::unique_ptr< Image > Map() const
Create a map from a single image plane that shares its memory with the original plane.
Definition: detail_image_plane.hpp:100
Factory object for creating point cloud objects.
Definition: point_cloud_factory.hpp:21
static SparsePointCloudPtr CreateSparse(const std::vector< void * > &planeBasePtrs, int numPlanes, Cvb::DataType dataType, std::size_t numPoints, const std::vector< std::intptr_t > &planeIncs)
Creates a point cloud from the given memory without copying the data.
Definition: point_cloud_factory.hpp:232
static PointCloudPtr Load(const String &fileName, PointCloudFlags flags)
Loads a 3D point, polygon or mesh file.
Definition: point_cloud_factory.hpp:48
static SparsePointCloudPtr CreateSparse(std::size_t numPoints, PointCloudFlags flags)
Creates a new sparse Cartesian 3D point cloud.
Definition: point_cloud_factory.hpp:209
static std::shared_ptr< T > Load(const String &fileName, PointCloudFlags flags)
Loads a 3D point, polygon or mesh file (typed).
Definition: point_cloud_factory.hpp:32
static std::shared_ptr< T > Create(const ImagePlane &rangeMap, const Calibrator3D &calibrator, PointCloudFlags flags)
Creates a new Cartesian 3D point cloud from the given 2.5D range map image (typed).
Definition: point_cloud_factory.hpp:110
static DensePointCloudPtr CreateDense(const Cvb::ImagePlane &rangeMap, Factors3D factors, PointCloudFlags flags)
Creates a new Cartesian 3D point cloud from the given 2.5D range map image.
Definition: point_cloud_factory.hpp:287
static DensePointCloudPtr CreateDense(Size2D< int > size, PointCloudFlags flags)
Creates a new dense Cartesian 3D point cloud.
Definition: point_cloud_factory.hpp:264
static PointCloudPtr CreateWithSettings(const ImagePlane &rangeMap, const Calibrator3D &calibrator, PointCloudFlags flags, const SensorSettings &settings, double encoderStep)
Creates a new Cartesian 3D point cloud from the given 2.5D range map image with modified camera setti...
Definition: point_cloud_factory.hpp:157
static std::shared_ptr< T > CreateWithSettings(const ImagePlane &rangeMap, const Calibrator3D &calibrator, PointCloudFlags flags, const SensorSettings &settings, double encoderStep)
Creates a new Cartesian 3D point cloud from the given 2.5D range map image with modified camera setti...
Definition: point_cloud_factory.hpp:185
static PointCloudPtr Create(const ImagePlane &rangeMap, const Calibrator3D &calibrator, PointCloudFlags flags)
Creates a new Cartesian 3D point cloud from the given 2.5D range map image.
Definition: point_cloud_factory.hpp:87
Class to store camera sensor settings.
Definition: sensor_settings.hpp:26
T Height() const noexcept
Gets the vertical component of the size.
Definition: size_2d.hpp:79
T Width() const noexcept
Gets the horizontal component of the size.
Definition: size_2d.hpp:59
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24
PointCloudFlags
Flags for creating point clouds.
Definition: core_3d.hpp:90
std::shared_ptr< SparsePointCloud > SparsePointCloudPtr
Convenience shared pointer for SparsePointCloud.
Definition: core_3d.hpp:48
std::shared_ptr< DensePointCloud > DensePointCloudPtr
Convenience shared pointer for DensePointCloud.
Definition: core_3d.hpp:44
Factor components to be applied in the 3D domain.
Definition: core_3d.hpp:17