11 #pragma warning(disable : 4996)
12 #pragma warning(disable : 4290)
13 #pragma warning(disable : 4819)
29 #include <pcl/ModelCoefficients.h>
30 #include <pcl/Vertices.h>
31 #include <pcl/common/common.h>
32 #include <pcl/common/io.h>
33 #include <pcl/common/transforms.h>
34 #include <pcl/correspondence.h>
35 #include <pcl/point_types.h>
38 #include <pcl/keypoints/harris_3d.h>
39 #include <pcl/keypoints/sift_keypoint.h>
43 #include <pcl/filters/conditional_removal.h>
44 #include <pcl/filters/crop_hull.h>
45 #include <pcl/filters/extract_indices.h>
46 #include <pcl/filters/passthrough.h>
47 #include <pcl/filters/project_inliers.h>
48 #include <pcl/filters/statistical_outlier_removal.h>
49 #include <pcl/filters/uniform_sampling.h>
50 #include <pcl/filters/voxel_grid.h>
53 #include <pcl/recognition/cg/geometric_consistency.h>
54 #include <pcl/recognition/cg/hough_3d.h>
57 #include <pcl/registration/ia_ransac.h>
58 #include <pcl/registration/icp.h>
61 #include <pcl/kdtree/kdtree_flann.h>
62 #include <pcl/search/kdtree.h>
65 #include <pcl/surface/concave_hull.h>
66 #include <pcl/surface/convex_hull.h>
67 #include <pcl/surface/marching_cubes.h>
68 #include <pcl/surface/marching_cubes_hoppe.h>
69 #include <pcl/surface/marching_cubes_rbf.h>
70 #include <pcl/surface/mls.h>
71 #if defined(WITH_PCL_NURBS)
72 #include <pcl/surface/on_nurbs/fitting_curve_2d.h>
73 #include <pcl/surface/on_nurbs/fitting_curve_2d_apdm.h>
74 #include <pcl/surface/on_nurbs/fitting_curve_2d_asdm.h>
75 #include <pcl/surface/on_nurbs/fitting_curve_2d_atdm.h>
76 #include <pcl/surface/on_nurbs/fitting_curve_2d_pdm.h>
77 #include <pcl/surface/on_nurbs/fitting_curve_2d_sdm.h>
78 #include <pcl/surface/on_nurbs/fitting_curve_2d_tdm.h>
79 #include <pcl/surface/on_nurbs/fitting_curve_pdm.h>
80 #include <pcl/surface/on_nurbs/fitting_surface_tdm.h>
81 #include <pcl/surface/on_nurbs/triangulation.h>
85 #include <pcl/features/board.h>
86 #include <pcl/features/boundary.h>
87 #include <pcl/features/don.h>
88 #include <pcl/features/normal_3d_omp.h>
89 #include <pcl/features/shot_omp.h>
92 #include <pcl/segmentation/extract_clusters.h>
93 #include <pcl/segmentation/min_cut_segmentation.h>
94 #include <pcl/segmentation/progressive_morphological_filter.h>
96 #include <pcl/segmentation/impl/extract_clusters.hpp>
102 #include <Eigen/Core>
110 GridProjection(
const PointCloudNormal::ConstPtr &cloudWithNormals,
112 float resolution = 0.2f,
114 int maxSearchLevel = 8);
122 int isoDivideDepth = 8,
123 int solverDivideDepth = 8,
125 float samplesPerNode = 3.0f,
126 bool useConfidence =
true,
127 bool useManifold =
true,
128 bool outputPolygons =
false);
134 int trigulationSearchRadius = 25,
135 float weightingFactor = 2.5f,
136 int maxNearestNeighbors = 100,
137 int maxSurfaceAngle = 45,
140 bool normalConsistency =
false);
143 const PointCloudT::ConstPtr &originCloud,
144 PointCloudT::Ptr &projectedCloud,
145 const pcl::ModelCoefficients::ConstPtr coefficients,
146 const int &modelType = 0
151 const PointCloudT::ConstPtr &originCloud,
152 PointCloudT::Ptr &projectedCloud,
153 float coefficientA = 0.0f,
154 float coefficientB = 0.0f,
155 float coefficientC = 1.0f,
156 float coefficientD = 0.0f,
157 const int &modelType = 0
173 std::vector<pcl::PointIndices> &clusters,
174 PointCloudRGB::Ptr cloud_segmented,
176 int min_cluster_size,
177 int max_cluster_size,
178 unsigned int neighbour_number,
179 float smoothness_theta,
193 std::vector<pcl::PointIndices> &clusters,
194 PointCloudRGB::Ptr cloud_segmented,
195 int min_cluster_size,
196 float neighbors_distance,
197 float point_color_diff,
198 float region_color_diff);
202 pcl::PointIndices::Ptr inliers,
203 pcl::ModelCoefficients::Ptr coefficients =
nullptr,
204 const int &methodType = 0 ,
205 const int &modelType = 0 ,
206 float distanceThreshold = 0.02f,
207 float probability = 0.95f,
208 int maxIterations = 100,
209 float minRadiusLimits = -10000.0f,
210 float maxRadiusLimits = 10000.0f,
211 float normalDisWeight = 0.1f);
217 template <
typename Po
intInT>
221 float epsilon = 0.01f,
222 float isoLevel = 0.0f,
223 float gridResolution = 50,
224 float percentageExtendGrid = 0.0f) {
226 typename pcl::search::Search<PointInT>::Ptr tree;
227 if (inCloud->isOrganized()) {
228 tree.reset(
new pcl::search::OrganizedNeighbor<PointInT>());
230 tree.reset(
new pcl::search::KdTree<PointInT>());
232 tree->setInputCloud(inCloud);
234 typename pcl::MarchingCubes<PointInT>::Ptr mc;
235 switch (marchingMethod) {
237 mc.reset(
new pcl::MarchingCubesHoppe<PointInT>());
241 typename pcl::MarchingCubesRBF<PointInT>::Ptr rbf(
242 new pcl::MarchingCubesRBF<PointInT>());
243 rbf->setOffSurfaceDisplacement(epsilon);
251 mc->setIsoLevel(isoLevel);
252 mc->setGridResolution(gridResolution, gridResolution, gridResolution);
253 mc->setPercentageExtendGrid(percentageExtendGrid);
254 mc->setInputCloud(inCloud);
255 mc->reconstruct(outMesh);
262 template <
typename Po
intInOutT>
263 int SwapAxis(
const typename pcl::PointCloud<PointInOutT>::ConstPtr inCloud,
264 typename pcl::PointCloud<PointInOutT>::Ptr outcloud,
265 const std::string &flag) {
266 pcl::copyPointCloud<PointInOutT, PointInOutT>(*inCloud, *outcloud);
267 typename pcl::PointCloud<PointInOutT>::iterator it;
268 for (it = outcloud->begin(); it != outcloud->end();) {
277 }
else if (
"zyx" == flag) {
280 }
else if (
"xzy" == flag) {
283 }
else if (
"yxz" == flag) {
286 }
else if (
"yzx" == flag) {
296 template <
typename Po
intInT>
297 int RemoveNaN(
const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
298 typename pcl::PointCloud<PointInT>::Ptr outcloud,
299 std::vector<int> &index) {
300 pcl::removeNaNFromPointCloud(*inCloud, *outcloud, index);
304 #if defined(WITH_PCL_NURBS)
312 meshResolution_(128) {}
318 unsigned curveResolution_;
319 unsigned meshResolution_;
320 pcl::on_nurbs::FittingSurface::Parameter fittingParams_;
322 template <
typename Po
intInT>
323 int NurbsSurfaceFitting(
324 const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
325 const NurbsParameters &nurbsParams,
327 PointCloudRGB::Ptr outCurve =
nullptr) {
329 pcl::on_nurbs::NurbsDataSurface
data;
330 for (
unsigned i = 0; i < inCloud->size(); i++) {
331 const PointInT &p = inCloud->at(i);
332 if (!std::isnan(p.x) && !std::isnan(p.y) && !std::isnan(p.z))
333 data.interior.push_back(Eigen::Vector3d(p.x, p.y, p.z));
337 ON_NurbsSurface nurbs =
338 pcl::on_nurbs::FittingSurface::initNurbsPCABoundingBox(
339 nurbsParams.order_, &
data);
340 pcl::on_nurbs::FittingSurface fit(&
data, nurbs);
344 for (
int i = 0; i < nurbsParams.refinements_; i++) {
346 if (nurbsParams.twoDim_) fit.refine(1);
347 fit.assemble(nurbsParams.fittingParams_);
352 for (
int i = 0; i < nurbsParams.iterations_; i++) {
353 fit.assemble(nurbsParams.fittingParams_);
359 pcl::on_nurbs::FittingCurve2dAPDM::FitParameter curve_params;
361 curve_params.addCPsAccuracy = 5
e-2;
362 curve_params.addCPsIteration = 3;
363 curve_params.maxCPs = 200;
364 curve_params.accuracy = 1
e-3;
365 curve_params.iterations = 100;
367 curve_params.param.closest_point_resolution = 0;
368 curve_params.param.closest_point_weight = 1.0;
369 curve_params.param.closest_point_sigma2 = 0.1;
370 curve_params.param.interior_sigma2 = 0.00001;
371 curve_params.param.smooth_concavity = 1.0;
372 curve_params.param.smoothness = 1.0;
376 "[PCLModules::NurbsSurfaceReconstruction] Start curve fitting "
378 pcl::on_nurbs::NurbsDataCurve2d curve_data;
379 curve_data.interior =
data.interior_param;
380 curve_data.interior_weight_function.push_back(
true);
381 ON_NurbsCurve curve_nurbs =
382 pcl::on_nurbs::FittingCurve2dAPDM::initNurbsCurve2D(
383 nurbsParams.order_, curve_data.interior);
385 pcl::on_nurbs::FittingCurve2dASDM curve_fit(&curve_data, curve_nurbs);
387 curve_fit.fitting(curve_params);
389 pcl::on_nurbs::Triangulation::convertCurve2PointCloud(
390 curve_fit.m_nurbs, fit.m_nurbs, outCurve,
391 nurbsParams.curveResolution_);
393 "[PCLModules::NurbsSurfaceReconstruction] Triangulate trimmed "
395 pcl::on_nurbs::Triangulation::convertTrimmedSurface2PolygonMesh(
396 fit.m_nurbs, curve_fit.m_nurbs, outMesh,
397 nurbsParams.meshResolution_);
399 pcl::on_nurbs::Triangulation::convertSurface2PolygonMesh(
400 fit.m_nurbs, outMesh, nurbsParams.meshResolution_);
403 CVLog::Print(QString(
"[PCLModules::NurbsSurfaceReconstruction] Refines: "
404 "%1, Iterations: %2")
405 .arg(nurbsParams.refinements_)
406 .arg(nurbsParams.iterations_));
410 enum CurveFittingMethod { PD, SD, APD,
TD, ASD };
411 template <
typename Po
intInT>
412 int BSplineCurveFitting2D(
413 const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
414 const CurveFittingMethod &fittingMethod,
415 PointCloudRGB::Ptr outCurve,
417 int controlPointsNum = 10,
418 unsigned curveResolution = 8,
419 double smoothness = 0.000001,
421 bool closed =
false) {
428 pcl::on_nurbs::NurbsDataCurve2d
data;
429 for (
unsigned i = 0; i < inCloud->size(); i++) {
430 const PointInT &p = inCloud->at(i);
431 if (!std::isnan(p.x) && !std::isnan(p.y))
432 data.interior.push_back(Eigen::Vector2d(p.x, p.y));
436 curve = pcl::on_nurbs::FittingCurve2dSDM::initNurbsCurve2D(
437 order,
data.interior, controlPointsNum);
438 switch (fittingMethod) {
439 case CurveFittingMethod::PD: {
440 pcl::on_nurbs::FittingCurve2dPDM::Parameter curve_params;
441 curve_params.smoothness = smoothness;
442 curve_params.rScale = rScale;
444 pcl::on_nurbs::FittingCurve2dPDM fit(&
data, curve);
445 fit.assemble(curve_params);
451 pcl::on_nurbs::FittingCurve2dTDM::Parameter curve_params;
452 curve_params.smoothness = smoothness;
453 curve_params.rScale = rScale;
455 pcl::on_nurbs::FittingCurve2dTDM fit(&
data, curve);
456 fit.assemble(curve_params);
461 case CurveFittingMethod::SD: {
462 pcl::on_nurbs::FittingCurve2dSDM::Parameter curve_params;
463 curve_params.smoothness = smoothness;
464 curve_params.rScale = rScale;
466 pcl::on_nurbs::FittingCurve2dSDM fit(&
data, curve);
467 fit.assemble(curve_params);
472 case CurveFittingMethod::APD: {
473 pcl::on_nurbs::FittingCurve2dAPDM::Parameter curve_params;
474 curve_params.smoothness = smoothness;
475 curve_params.rScale = rScale;
477 pcl::on_nurbs::FittingCurve2dAPDM fit(&
data, curve);
478 fit.assemble(curve_params);
483 case CurveFittingMethod::ASD: {
484 pcl::on_nurbs::FittingCurve2dASDM::Parameter curve_params;
485 curve_params.smoothness = smoothness;
486 curve_params.rScale = rScale;
488 pcl::on_nurbs::FittingCurve2dASDM fit(&
data, curve);
489 fit.assemble(curve_params);
498 curve = pcl::on_nurbs::FittingCurve2d::initNurbsPCA(order, &
data,
500 pcl::on_nurbs::FittingCurve2d::Parameter curve_params;
501 curve_params.smoothness = smoothness;
502 curve_params.rScale = rScale;
503 pcl::on_nurbs::FittingCurve2d fit(&
data, curve);
505 fit.assemble(curve_params);
525 pcl::on_nurbs::Triangulation::convertCurve2PointCloud(nurbs, outCurve,
530 template <
typename Po
intInT>
531 int BSplineCurveFitting3D(
532 const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
533 PointCloudRGB::Ptr outCurve,
535 int controlPointsNum = 10,
536 unsigned curveResolution = 8,
537 double smoothness = 0.000001,
539 bool closed =
false) {
542 pcl::on_nurbs::NurbsDataCurve
data;
543 for (
unsigned i = 0; i < inCloud->size(); i++) {
544 const PointInT &p = inCloud->at(i);
545 if (!std::isnan(p.x) && !std::isnan(p.y) && !std::isnan(p.z)) {
546 data.interior.push_back(Eigen::Vector3d(p.x, p.y, p.z));
550 ON_NurbsCurve curve = pcl::on_nurbs::FittingCurve::initNurbsCurvePCA(
551 order,
data.interior, controlPointsNum);
552 pcl::on_nurbs::FittingCurve::Parameter curve_params;
553 curve_params.smoothness = smoothness;
555 pcl::on_nurbs::FittingCurve fit(&
data, curve);
556 fit.assemble(curve_params);
563 pcl::on_nurbs::Triangulation::convertCurve2PointCloud(
564 fit.m_nurbs, outCurve, curveResolution);
568 PCLModules::CurveFittingMethod fittingMethod =
569 PCLModules::CurveFittingMethod::PD;
570 if (!PCLModules::BSplineCurveFitting2D<PointInT>(
571 inCloud, fittingMethod, xoyCurve, order, controlPointsNum,
572 curveResolution, smoothness, rScale, closed) ||
573 xoyCurve->size() == 0) {
579 pcl::getMinMax3D<PointInT>(*inCloud, minPt, maxPt);
580 double dis_x = maxPt.x - minPt.x;
581 double dis_y = maxPt.y - minPt.y;
587 typename pcl::PointCloud<PointInT>::Ptr xozCloud(
588 new pcl::PointCloud<PointInT>);
589 SwapAxis<PointInT>(inCloud, xozCloud,
"xzy");
590 if (!BSplineCurveFitting2D<PointInT>(
591 xozCloud, fittingMethod, xozCurve, order,
592 controlPointsNum, curveResolution, smoothness, rScale,
594 xozCurve->size() == 0) {
597 if (xoyCurve->size() != xozCurve->size()) {
603 typename pcl::PointCloud<PointInT>::Ptr zoyCloud(
604 new pcl::PointCloud<PointInT>);
605 SwapAxis<PointInT>(inCloud, zoyCloud,
"zyx");
606 if (!BSplineCurveFitting2D<PointInT>(
607 zoyCloud, fittingMethod, zoyCurve, order,
608 controlPointsNum, curveResolution, smoothness, rScale,
610 zoyCurve->size() == 0) {
613 if (xoyCurve->size() != zoyCurve->size()) {
619 outCurve->resize(xoyCurve->size());
620 for (
unsigned i = 0; i < xoyCurve->size(); ++i) {
621 const PointRGB &xoy_p = xoyCurve->at(i);
622 if (!std::isnan(xoy_p.x) && !std::isnan(xoy_p.y)) {
623 outCurve->points[i].x = xoy_p.x;
624 outCurve->points[i].y = xoy_p.y;
626 const PointRGB &xoz_p = xozCurve->at(i);
627 outCurve->points[i].z = xoz_p.y;
629 const PointRGB &zoy_p = zoyCurve->at(i);
630 outCurve->points[i].z = zoy_p.x;
650 template <
typename Po
intInT,
typename Po
intOutT>
651 int EstimateSIFT(
const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
652 typename pcl::PointCloud<PointOutT>::Ptr outcloud,
655 int nr_scales_per_octave = 0,
656 float min_contrast = 0) {
657 typename pcl::SIFTKeypoint<PointInT, PointOutT> sift_detector;
658 typename pcl::search::KdTree<PointInT>::Ptr tree(
659 new pcl::search::KdTree<PointInT>());
660 sift_detector.setSearchMethod(tree);
662 if (nr_octaves != 0 && min_scale != 0 && nr_scales_per_octave != 0) {
663 sift_detector.setScales(min_scale, nr_octaves, nr_scales_per_octave);
667 sift_detector.setMinimumContrast(min_contrast > 0 ? min_contrast : 0);
669 sift_detector.setInputCloud(inCloud);
670 sift_detector.compute(*outcloud);
674 template <
typename PointInT,
676 typename DescriptorType = pcl::SHOT352>
677 int EstimateShot(
const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
678 const typename pcl::PointCloud<PointInT>::ConstPtr keyPoints,
679 const typename pcl::PointCloud<NormalType>::ConstPtr
normals,
680 typename pcl::PointCloud<DescriptorType>::Ptr outDescriptors,
681 float searchRadius = 0.03f,
682 int maxThreadCount = QThread::idealThreadCount()) {
683 pcl::SHOTEstimationOMP<PointInT, NormalType, DescriptorType> shot_detector;
684 shot_detector.setRadiusSearch(searchRadius);
685 shot_detector.setNumberOfThreads(maxThreadCount);
687 shot_detector.setInputCloud(keyPoints);
688 shot_detector.setSearchSurface(inCloud);
689 shot_detector.setInputNormals(
normals);
690 shot_detector.compute(*outDescriptors);
694 template <
typename Po
intInT>
696 const typename pcl::PointCloud<PointInT>::ConstPtr inCloud) {
699 std::vector<int> indices(2);
700 std::vector<float> sqr_distances(2);
703 typename pcl::search::Search<PointInT>::Ptr tree;
704 if (inCloud->isOrganized()) {
705 tree.reset(
new pcl::search::OrganizedNeighbor<PointInT>());
707 tree.reset(
new pcl::search::KdTree<PointInT>());
709 tree->setInputCloud(inCloud);
711 int size_cloud =
static_cast<int>(inCloud->size());
713 std::vector<float> nn_dis(size_cloud);
716 #pragma omp parallel for schedule(static)
718 for (
int i = 0; i < size_cloud; ++i) {
719 if (!std::isfinite((*inCloud)[i].
x)) {
724 nres = tree->nearestKSearch(i, 2, indices, sqr_distances);
726 nn_dis[i] = std::sqrt(sqr_distances[1]);
731 "[ComputeCloudResolution] Found a point without "
743 res = std::accumulate(std::begin(nn_dis), std::end(nn_dis), 0.0f) /
748 template <
typename Po
intOutT>
750 typename PointOutT::Ptr outCloud,
753 pcl::StatisticalOutlierRemoval<PointOutT> remover;
754 remover.setInputCloud(inCloud);
755 remover.setMeanK(knn);
756 remover.setStddevMulThresh(nSigma);
757 remover.filter(*outCloud);
761 template <
typename Po
intInT>
763 std::vector<pcl::PointIndices> &cluster_indices,
764 float clusterTolerance = 0.02f,
765 int minClusterSize = 100,
766 int maxClusterSize = 250000) {
768 typename pcl::search::KdTree<PointInT>::Ptr tree(
769 new pcl::search::KdTree<PointInT>);
770 tree->setInputCloud(inCloud);
772 pcl::EuclideanClusterExtraction<PointInT> ece;
773 ece.setClusterTolerance(clusterTolerance);
774 ece.setMinClusterSize(minClusterSize);
775 ece.setMaxClusterSize(maxClusterSize);
776 ece.setSearchMethod(tree);
777 ece.setInputCloud(inCloud);
778 ece.extract(cluster_indices);
783 template <
typename Po
intInT>
785 const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
786 pcl::PointIndicesPtr groundIndices,
787 int maxWindowSize = 20,
789 float initialDistance = 0.5f,
790 float maxDistance = 3.0f) {
792 pcl::ProgressiveMorphologicalFilter<PointInT> pmf;
793 pmf.setInputCloud(inCloud);
794 pmf.setMaxWindowSize(maxWindowSize);
796 pmf.setInitialDistance(initialDistance);
797 pmf.setMaxDistance(maxDistance);
798 pmf.extract(groundIndices->indices);
803 template <
typename Po
intInT,
typename NormalType,
typename Po
intOutT>
805 const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
806 const typename pcl::PointCloud<NormalType>::ConstPtr normalsLargeScale,
807 const typename pcl::PointCloud<NormalType>::ConstPtr normalsSmallScale,
808 typename pcl::PointCloud<PointOutT>::Ptr outCloud) {
810 pcl::DifferenceOfNormalsEstimation<PointInT, NormalType, PointOutT> don;
811 don.setInputCloud(inCloud);
812 don.setNormalScaleLarge(normalsLargeScale);
813 don.setNormalScaleSmall(normalsSmallScale);
815 if (!don.initCompute()) {
820 don.computeFeature(*outCloud);
824 template <
typename PointInT,
826 typename RFType = pcl::ReferenceFrame>
828 const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
829 const typename pcl::PointCloud<PointInT>::ConstPtr keyPoints,
830 const typename pcl::PointCloud<NormalType>::ConstPtr
normals,
831 typename pcl::PointCloud<RFType>::Ptr outRF,
832 float searchRadius = 0.015f) {
833 pcl::BOARDLocalReferenceFrameEstimation<PointInT, NormalType, RFType>
835 rf_detector.setRadiusSearch(searchRadius);
836 rf_detector.setFindHoles(
true);
837 rf_detector.setInputCloud(keyPoints);
838 rf_detector.setInputNormals(
normals);
839 rf_detector.setSearchSurface(inCloud);
840 rf_detector.compute(*outRF);
844 template <
typename PointModelT,
845 typename PointSceneT,
846 typename PointModelRfT = pcl::ReferenceFrame,
847 typename PointSceneRfT = pcl::ReferenceFrame>
849 const typename pcl::PointCloud<PointModelT>::ConstPtr modelKeypoints,
850 const typename pcl::PointCloud<PointSceneT>::ConstPtr sceneKeypoints,
851 const typename pcl::PointCloud<PointModelRfT>::ConstPtr modelRF,
852 const typename pcl::PointCloud<PointSceneRfT>::ConstPtr sceneRF,
853 const typename pcl::CorrespondencesConstPtr modelSceneCorrs,
854 std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f>>
856 std::vector<pcl::Correspondences> &clusteredCorrs,
857 float houghBinSize = 0.01f,
858 float houghThreshold = 5.0f) {
859 pcl::Hough3DGrouping<PointModelT, PointSceneT, PointModelRfT, PointSceneRfT>
861 clusterer.setHoughBinSize(houghBinSize);
862 clusterer.setHoughThreshold(houghThreshold);
863 clusterer.setUseInterpolation(
true);
864 clusterer.setUseDistanceWeight(
false);
866 clusterer.setInputCloud(modelKeypoints);
867 clusterer.setInputRf(modelRF);
868 clusterer.setSceneCloud(sceneKeypoints);
869 clusterer.setSceneRf(sceneRF);
870 clusterer.setModelSceneCorrespondences(modelSceneCorrs);
872 bool flag = clusterer.recognize(rotoTranslations, clusteredCorrs);
874 return flag ? 1 : -1;
877 template <
typename Po
intModelT,
typename Po
intSceneT>
879 const typename pcl::PointCloud<PointModelT>::ConstPtr modelKeypoints,
880 const typename pcl::PointCloud<PointSceneT>::ConstPtr sceneKeypoints,
881 const typename pcl::CorrespondencesConstPtr modelSceneCorrs,
882 std::vector<Eigen::Matrix4f, Eigen::aligned_allocator<Eigen::Matrix4f>>
884 std::vector<pcl::Correspondences> &clusteredCorrs,
885 float gcSize = 0.01f,
886 float gcThreshold = 20.0f) {
887 pcl::GeometricConsistencyGrouping<PointModelT, PointSceneT> gc_clusterer;
888 gc_clusterer.setGCSize(gcSize);
889 gc_clusterer.setGCThreshold(gcThreshold);
891 gc_clusterer.setInputCloud(modelKeypoints);
892 gc_clusterer.setSceneCloud(sceneKeypoints);
893 gc_clusterer.setModelSceneCorrespondences(modelSceneCorrs);
895 bool flag = gc_clusterer.recognize(rotoTranslations, clusteredCorrs);
897 return flag ? 1 : -1;
900 template <
typename Po
intInT>
902 pcl::PointCloud<pcl::PointXYZI>::Ptr outcloud,
903 float normalRadius = 0.1f,
904 float searchRadius = 0.1f) {
905 pcl::HarrisKeypoint3D<PointInT, pcl::PointXYZI, NormalT> harris_detector;
907 harris_detector.setRadius(normalRadius);
908 harris_detector.setRadiusSearch(searchRadius);
910 harris_detector.setInputCloud(inCloud);
911 harris_detector.compute(*outcloud);
915 template <
typename Po
intInOut>
917 const typename pcl::PointCloud<PointInOut>::ConstPtr inCloud,
918 typename pcl::PointCloud<PointInOut>::Ptr outcloud,
919 const float &searchRadius = -1.0f ) {
920 pcl::UniformSampling<PointInOut> uniform_sampling;
922 if (searchRadius < 0) {
923 float cloudResolution =
924 static_cast<float>(ComputeCloudResolution<PointInOut>(inCloud));
925 assert(cloudResolution);
926 uniform_sampling.setRadiusSearch(10 * cloudResolution);
928 uniform_sampling.setRadiusSearch(searchRadius);
931 uniform_sampling.setInputCloud(inCloud);
932 uniform_sampling.filter(*outcloud);
954 template <
typename Po
intInOut>
956 const typename pcl::PointCloud<PointInOut>::ConstPtr inCloud,
958 typename pcl::PointCloud<PointInOut>::Ptr outCloud,
959 bool keepOrganized =
false) {
960 typename pcl::ConditionBase<PointInOut>::Ptr condition;
962 case ConditionParameters::ConditionType::CONDITION_OR: {
964 typename pcl::ConditionOr<PointInOut>::Ptr range_cond(
965 new pcl::ConditionOr<PointInOut>());
966 condition = range_cond;
969 case ConditionParameters::ConditionType::CONDITION_AND: {
970 typename pcl::ConditionAnd<PointInOut>::Ptr range_cond(
971 new pcl::ConditionAnd<PointInOut>());
972 condition = range_cond;
981 pcl::ComparisonOps::CompareOp ops =
982 static_cast<pcl::ComparisonOps::CompareOp
>(
984 double threshod = 0.0;
985 if (pcl::ComparisonOps::CompareOp::GT == ops ||
986 pcl::ComparisonOps::CompareOp::GE == ops) {
988 }
else if (pcl::ComparisonOps::CompareOp::LT == ops ||
989 pcl::ComparisonOps::CompareOp::LE == ops) {
994 condition->addComparison(
995 typename pcl::FieldComparison<PointInOut>::ConstPtr(
996 new pcl::FieldComparison<PointInOut>(cp.
fieldName_, ops,
1000 if (!condition->isCapable()) {
1005 typename pcl::ConditionalRemoval<PointInOut> condrem(
false);
1006 condrem.setCondition(condition);
1007 condrem.setInputCloud(inCloud);
1008 condrem.setKeepOrganized(keepOrganized);
1010 condrem.filter(*outCloud);
1026 polynomial_fit_(false),
1028 sqr_gauss_param_(0),
1029 compute_normals_(false),
1030 upsample_method_(NONE),
1031 upsampling_radius_(0),
1032 upsampling_step_(0),
1033 step_point_density_(0),
1034 dilation_voxel_size_(0),
1035 dilation_iterations_(0) {}
1051 template <
typename Po
intInT,
typename Po
intOutT>
1052 int SmoothMls(
const typename pcl::PointCloud<PointInT>::ConstPtr &inCloud,
1054 typename pcl::PointCloud<PointOutT>::Ptr &outcloud
1055 #ifdef LP_PCL_PATCH_ENABLED
1057 pcl::PointIndicesPtr &mapping_ids
1060 typename pcl::search::KdTree<PointInT>::Ptr tree(
1061 new pcl::search::KdTree<PointInT>);
1064 pcl::MovingLeastSquares<PointInT, PointOutT> smoother;
1066 smoother.setNumberOfThreads(n_threads);
1068 smoother.setInputCloud(inCloud);
1069 smoother.setSearchMethod(tree);
1073 smoother.setPolynomialOrder(params.
order_);
1076 smoother.setPolynomialOrder(0);
1081 smoother.setUpsamplingMethod(
1082 pcl::MovingLeastSquares<PointInT, PointOutT>::NONE);
1088 smoother.setUpsamplingMethod(
1089 pcl::MovingLeastSquares<PointInT,
1090 PointOutT>::SAMPLE_LOCAL_PLANE);
1097 smoother.setUpsamplingMethod(
1098 pcl::MovingLeastSquares<PointInT,
1099 PointOutT>::RANDOM_UNIFORM_DENSITY);
1105 smoother.setUpsamplingMethod(
1106 pcl::MovingLeastSquares<PointInT,
1107 PointOutT>::VOXEL_GRID_DILATION);
1108 smoother.setDilationVoxelSize(
1115 smoother.process(*outcloud);
1117 #ifdef LP_PCL_PATCH_ENABLED
1118 mapping_ids = smoother.getCorrespondingIndices();
1124 template <
typename Po
intInT,
typename Po
intOutT>
1126 const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
1127 typename pcl::PointCloud<PointOutT>::Ptr outcloud,
1128 const float radius = -1.0f ,
1129 const bool useKnn =
true,
1130 bool normalConsistency =
false,
1131 int maxThreadCount = QThread::idealThreadCount()) {
1132 typename pcl::NormalEstimationOMP<PointInT, PointOutT> normal_estimator;
1135 typename pcl::search::Search<PointInT>::Ptr tree;
1136 if (inCloud->isOrganized()) {
1137 tree.reset(
new pcl::search::OrganizedNeighbor<PointInT>());
1139 tree.reset(
new pcl::search::KdTree<PointInT>());
1141 tree->setInputCloud(inCloud);
1143 normal_estimator.setSearchMethod(tree);
1147 int knn_radius =
static_cast<int>(radius);
1148 normal_estimator.setKSearch(knn_radius);
1152 float cloudResolution =
static_cast<float>(
1153 ComputeCloudResolution<PointInT>(inCloud));
1154 assert(cloudResolution);
1155 normal_estimator.setRadiusSearch(10 * cloudResolution);
1157 normal_estimator.setRadiusSearch(radius);
1161 if (normalConsistency) {
1166 normal_estimator.setViewPoint(std::numeric_limits<float>::max(),
1167 std::numeric_limits<float>::max(),
1168 std::numeric_limits<float>::max());
1171 normal_estimator.setInputCloud(inCloud);
1172 normal_estimator.setNumberOfThreads(maxThreadCount);
1173 normal_estimator.compute(*outcloud);
1178 template <
typename Po
intInOut>
1180 const typename pcl::PointCloud<PointInOut>::ConstPtr inCloud,
1181 typename pcl::PointCloud<PointInOut>::Ptr outcloud,
1182 const QString &filterFieldName =
"z",
1183 const float &limit_min = 0.1f,
1184 const float &limit_max = 1.1f) {
1185 pcl::PassThrough<PointInOut> pass;
1186 pass.setInputCloud(inCloud);
1187 pass.setFilterFieldName(filterFieldName.toStdString());
1188 pass.setFilterLimits(limit_min, limit_max);
1189 pass.filter(*outcloud);
1193 template <
typename Po
intInOut>
1195 const typename pcl::PointCloud<PointInOut>::ConstPtr inCloud,
1196 typename pcl::PointCloud<PointInOut>::Ptr outcloud,
1197 const float &leafSizeX = -0.01f,
1198 const float &leafSizeY = -0.01f,
1199 const float &leafSizeZ = -0.01f) {
1202 pcl::VoxelGrid<PointInOut> vg;
1203 vg.setInputCloud(inCloud);
1204 if (leafSizeX < 0 || leafSizeY < 0 || leafSizeZ < 0) {
1205 float cloudResolution =
1206 static_cast<float>(ComputeCloudResolution<PointInOut>(inCloud));
1207 assert(cloudResolution);
1208 float newLeafSize = 10 * cloudResolution;
1209 vg.setLeafSize(newLeafSize, newLeafSize, newLeafSize);
1211 vg.setLeafSize(leafSizeX, leafSizeY, leafSizeZ);
1214 vg.filter(*outcloud);
1215 if (outcloud->points.size() == inCloud->points.size()) {
1217 "[PCLModules::VoxelGridFilter] leaf size is too small, voxel "
1218 "grid filter failed!");
1220 CVLog::Print(QString(
"[PCLModules::VoxelGridFilter] Filter original "
1221 "size[%1] to size[%2]!")
1222 .arg(inCloud->size())
1223 .arg(outcloud->size()));
1228 template <
typename Po
intInOut>
1230 const typename pcl::PointCloud<PointInOut>::ConstPtr inCloud,
1231 const pcl::PointIndices::ConstPtr inliers,
1232 typename pcl::PointCloud<PointInOut>::Ptr outcloud =
nullptr,
1233 typename pcl::PointCloud<PointInOut>::Ptr outcloud2 =
nullptr) {
1234 pcl::ExtractIndices<PointInOut> extract;
1235 extract.setInputCloud(inCloud);
1236 extract.setIndices(inliers);
1239 extract.setNegative(
false);
1240 extract.filter(*outcloud);
1244 extract.setNegative(
true);
1245 extract.filter(*outcloud2);
1251 template <
typename Po
intInT>
1253 const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
1255 int dimension = 3) {
1256 pcl::ConvexHull<PointInT> hull;
1257 hull.setInputCloud(inCloud);
1258 hull.setDimension(dimension);
1260 typename pcl::PointCloud<PointInT>::Ptr surface_hull(
1261 new pcl::PointCloud<PointInT>());
1262 hull.reconstruct(*surface_hull, outMesh.polygons);
1264 CVLog::Print(QString(
"convex hull area [1%], convex hull volume [%2]")
1265 .arg(hull.getTotalArea())
1266 .arg(hull.getTotalVolume()));
1275 template <
typename Po
intInT>
1277 const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
1280 float alpha = 0.05f) {
1281 pcl::ConcaveHull<PointInT> chull;
1282 chull.setInputCloud(inCloud);
1283 chull.setAlpha(alpha);
1284 chull.setDimension(dimension);
1285 typename pcl::PointCloud<PointInT>::Ptr surface_hull(
1286 new pcl::PointCloud<PointInT>());
1287 chull.reconstruct(*surface_hull, outMesh.polygons);
1295 template <
typename Po
intInT>
1297 const PointCloudT::ConstPtr boundingBox,
1298 typename pcl::PointCloud<PointInT>::Ptr outCloud,
1299 int dimensions = 2) {
1307 pcl::CropHull<PointInT> bb_filter;
1308 bb_filter.setInputCloud(inCloud);
1309 bb_filter.setDim(dimensions);
1310 bb_filter.setHullIndices(mesh.polygons);
1311 typename pcl::PointCloud<PointInT>::Ptr surface_hull(
1312 new pcl::PointCloud<PointInT>);
1314 if (surface_hull->width * surface_hull->height == 0) {
1317 bb_filter.setHullCloud(surface_hull);
1318 bb_filter.filter(*outCloud);
1322 template <
typename Po
intInT>
1324 const typename pcl::PointCloud<PointInT>::ConstPtr inCloud,
1325 std::vector<pcl::PointIndices> &outClusters,
1326 PointCloudRGB::Ptr cloud_segmented,
1327 const PointInT foregroundPoint,
1328 int neighboursNumber = 14,
1329 float smoothSigma = 0.25f,
1330 float backWeightRadius = 0.8f,
1331 float foreWeight = 0.5f,
1332 const pcl::IndicesConstPtr indices =
nullptr) {
1333 typename pcl::MinCutSegmentation<PointInT> seg;
1334 seg.setInputCloud(inCloud);
1336 seg.setIndices(indices);
1339 typename pcl::PointCloud<PointInT>::Ptr foreground_points(
1340 new pcl::PointCloud<PointInT>());
1341 foreground_points->points.push_back(foregroundPoint);
1342 seg.setForegroundPoints(foreground_points);
1344 seg.setSigma(smoothSigma);
1345 seg.setRadius(backWeightRadius);
1346 seg.setNumberOfNeighbours(neighboursNumber);
1347 seg.setSourceWeight(foreWeight);
1348 seg.extract(outClusters);
1349 pcl::copyPointCloud(*seg.getColoredCloud(), *cloud_segmented);
1354 template <
typename Po
intInOut,
typename NormalType>
1356 const typename pcl::PointCloud<PointInOut>::ConstPtr inCloud,
1357 const typename pcl::PointCloud<NormalType>::ConstPtr
normals,
1358 typename pcl::PointCloud<PointInOut>::Ptr boundaryCloud,
1359 const float angleThreshold =
1361 const float radius =
1363 const bool useKnn =
true
1365 pcl::BoundaryEstimation<PointInOut, NormalType, pcl::Boundary> boundEst;
1366 pcl::PointCloud<pcl::Boundary> boundaries;
1367 boundEst.setInputCloud(inCloud);
1368 boundEst.setInputNormals(
normals);
1370 boundEst.setKSearch(
int(radius));
1374 float cloudResolution =
static_cast<float>(
1375 ComputeCloudResolution<PointInOut>(inCloud));
1376 assert(cloudResolution);
1377 boundEst.setRadiusSearch(10 * cloudResolution);
1379 boundEst.setRadiusSearch(radius);
1383 typename pcl::search::KdTree<PointInOut>::Ptr searchTree(
1384 new pcl::search::KdTree<PointInOut>());
1385 boundEst.setSearchMethod(searchTree);
1387 boundEst.compute(boundaries);
1389 boundaryCloud->clear();
1390 for (
size_t i = 0; i < inCloud->size(); i++) {
1391 if (boundaries[i].boundary_point > 0) {
1392 boundaryCloud->push_back(inCloud->points[i]);
1399 template <
typename Po
intInT,
typename Po
intOutT>
1401 const typename pcl::PointCloud<PointInT>::ConstPtr targetCloud,
1402 const typename pcl::PointCloud<PointOutT>::ConstPtr
sourceCloud,
1403 typename pcl::PointCloud<PointOutT>::Ptr outRegistered,
1404 int ipcMaxIterations = 5,
1405 float icpCorrDistance = 0.005f) {
1406 pcl::IterativeClosestPoint<PointInT, PointOutT> icp;
1407 icp.setMaximumIterations(ipcMaxIterations);
1408 icp.setMaxCorrespondenceDistance(icpCorrDistance);
1409 icp.setInputTarget(targetCloud);
1411 icp.align(*outRegistered);
1413 return icp.hasConverged();
1416 template <
typename Po
intSceneT,
typename Po
intModelT>
1417 int GetHypothesesVerification(
1418 const typename pcl::PointCloud<PointSceneT>::Ptr sceneCloud,
1419 std::vector<
typename pcl::PointCloud<PointModelT>::ConstPtr> modelClouds,
1420 std::vector<bool> &hypothesesMask,
1421 float clusterReg = 5.0f,
1422 float inlierThreshold = 0.005f,
1423 float occlusionThreshold = 0.01f,
1424 float radiusClutter = 0.03f,
1425 float regularizer = 3.0f,
1426 float radiusNormals = 0.05f,
1427 bool detectClutter =
true)
1429 pcl::GlobalHypothesesVerification<PointModelT, PointSceneT> GoHv;
1430 GoHv.setSceneCloud(sceneCloud);
1431 GoHv.addModels(modelClouds,
true);
1433 GoHv.setInlierThreshold(inlierThreshold);
1434 GoHv.setOcclusionThreshold(occlusionThreshold);
1435 GoHv.setRadiusClutter(radiusClutter);
1436 GoHv.setClutterRegularizer(clusterReg);
1437 GoHv.setRegularizer(regularizer);
1438 GoHv.setRadiusNormals(radiusNormals);
1439 GoHv.setDetectClutter(detectClutter);
1442 GoHv.getMask(hypothesesMask);
1463 m_featureRadius = featureRadius;
1466 m_maxThreadCount = maxThreadCount;
1476 void loadInputCloud(
const std::string &pcd_file);
1490 computeSurfaceNormals();
1491 computeLocalFeatures();
1495 void computeSurfaceNormals();
1498 void computeLocalFeatures();
1502 PointCloudT::Ptr m_xyz;
1503 SurfaceNormals::Ptr m_normals;
1504 LocalFeatures::Ptr m_features;
1505 SearchMethod::Ptr m_searchMethod;
1508 float m_normalRadius;
1509 float m_featureRadius;
1510 int m_maxThreadCount;
1525 m_minSampleDistance = minSampleDistance;
1528 m_maxCorrespondenceDistance = maxCorrespondenceDistance;
1531 m_nr_iterations = maxIterations;
1539 m_templates.push_back(template_cloud);
1544 if (
static_cast<size_t>(index) > m_templates.size())
return nullptr;
1545 return &m_templates[
static_cast<size_t>(index)];
1555 Eigen::aligned_allocator<Result>> &results);
1565 std::vector<FeatureCloud> m_templates;
1570 pcl::SampleConsensusInitialAlignment<PointT, PointT, pcl::FPFHSignature33>
1572 float m_minSampleDistance;
1573 float m_maxCorrespondenceDistance;
1574 int m_nr_iterations;
pcl::PointXYZRGB PointRGB
pcl::PointCloud< PointRGB > PointCloudRGB
static bool WarningDebug(const char *format,...)
Same as Warning, but works only in Debug mode.
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
static bool Print(const char *format,...)
Prints out a formatted message in console.
pcl::PointCloud< pcl::FPFHSignature33 > LocalFeatures
pcl::search::KdTree< PointT > SearchMethod
void setmaxThreadCount(int maxThreadCount)
pcl::PointCloud< NormalT > SurfaceNormals
void setNormalRadius(float normalRadius)
void setInputCloud(PointCloudT::Ptr xyz)
LocalFeatures::Ptr getLocalFeatures() const
SurfaceNormals::Ptr getSurfaceNormals() const
void setFeatureRadius(float featureRadius)
PointCloudT::Ptr getPointCloud() const
void addTemplateCloud(FeatureCloud &template_cloud)
void setminSampleDis(float minSampleDistance)
void setmaxCorrespondenceDis(float maxCorrespondenceDistance)
void setmaxIterations(int maxIterations)
FeatureCloud * getTemplateCloud(int index)
int GetConvexHullReconstruction(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, PCLMesh &outMesh, int dimension=3)
int GetGreedyTriangulation(const PointCloudNormal::ConstPtr &cloudWithNormals, PCLMesh &outMesh, int trigulationSearchRadius, float weightingFactor, int maxNearestNeighbors, int maxSurfaceAngle, int minAngle, int maxAngle, bool normalConsistency)
int EstimateGeometricConsistencyGrouping(const typename pcl::PointCloud< PointModelT >::ConstPtr modelKeypoints, const typename pcl::PointCloud< PointSceneT >::ConstPtr sceneKeypoints, const typename pcl::CorrespondencesConstPtr modelSceneCorrs, std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f >> &rotoTranslations, std::vector< pcl::Correspondences > &clusteredCorrs, float gcSize=0.01f, float gcThreshold=20.0f)
int GetUniformSampling(const typename pcl::PointCloud< PointInOut >::ConstPtr inCloud, typename pcl::PointCloud< PointInOut >::Ptr outcloud, const float &searchRadius=-1.0f)
int RemoveNaN(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, typename pcl::PointCloud< PointInT >::Ptr outcloud, std::vector< int > &index)
int GetRegionGrowingRGB(const PointCloudRGB::ConstPtr cloud, std::vector< pcl::PointIndices > &clusters, PointCloudRGB::Ptr cloud_segmented, int min_cluster_size, float neighbors_distance, float point_color_diff, float region_color_diff)
Color based Region Growing.
int EstimateHarris3D(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, pcl::PointCloud< pcl::PointXYZI >::Ptr outcloud, float normalRadius=0.1f, float searchRadius=0.1f)
int GetPoissonReconstruction(const PointCloudNormal::ConstPtr &cloudWithNormals, PCLMesh &outMesh, int degree, int treeDepth, int isoDivideDepth, int solverDivideDepth, float scale, float samplesPerNode, bool useConfidence, bool useManifold, bool outputPolygons)
int VoxelGridFilter(const typename pcl::PointCloud< PointInOut >::ConstPtr inCloud, typename pcl::PointCloud< PointInOut >::Ptr outcloud, const float &leafSizeX=-0.01f, const float &leafSizeY=-0.01f, const float &leafSizeZ=-0.01f)
int EstimateHough3DGrouping(const typename pcl::PointCloud< PointModelT >::ConstPtr modelKeypoints, const typename pcl::PointCloud< PointSceneT >::ConstPtr sceneKeypoints, const typename pcl::PointCloud< PointModelRfT >::ConstPtr modelRF, const typename pcl::PointCloud< PointSceneRfT >::ConstPtr sceneRF, const typename pcl::CorrespondencesConstPtr modelSceneCorrs, std::vector< Eigen::Matrix4f, Eigen::aligned_allocator< Eigen::Matrix4f >> &rotoTranslations, std::vector< pcl::Correspondences > &clusteredCorrs, float houghBinSize=0.01f, float houghThreshold=5.0f)
int GetRegionGrowing(const PointCloudT::ConstPtr cloud, std::vector< pcl::PointIndices > &clusters, PointCloudRGB::Ptr cloud_segmented, int k, int min_cluster_size, int max_cluster_size, unsigned int neighbour_number, float smoothness_theta, float curvature)
Basic Region Growing.
int GetSACSegmentation(const PointCloudT::ConstPtr cloud, pcl::PointIndices::Ptr inliers, pcl::ModelCoefficients::Ptr coefficients, const int &methodType, const int &modelType, float distanceThreshold, float probability, int maxIterations, float minRadiusLimits, float maxRadiusLimits, float normalDisWeight)
int RemoveOutliersStatistical(const typename PointOutT::ConstPtr inCloud, typename PointOutT::Ptr outCloud, int knn, double nSigma)
int CropHullFilter(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, const PointCloudT::ConstPtr boundingBox, typename pcl::PointCloud< PointInT >::Ptr outCloud, int dimensions=2)
int ProgressiveMpFilter(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, pcl::PointIndicesPtr groundIndices, int maxWindowSize=20, float slope=1.0f, float initialDistance=0.5f, float maxDistance=3.0f)
int ComputeNormals(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, typename pcl::PointCloud< PointOutT >::Ptr outcloud, const float radius=-1.0f, const bool useKnn=true, bool normalConsistency=false, int maxThreadCount=QThread::idealThreadCount())
int DONEstimation(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, const typename pcl::PointCloud< NormalType >::ConstPtr normalsLargeScale, const typename pcl::PointCloud< NormalType >::ConstPtr normalsSmallScale, typename pcl::PointCloud< PointOutT >::Ptr outCloud)
int ConditionalRemovalFilter(const typename pcl::PointCloud< PointInOut >::ConstPtr inCloud, const ConditionParameters ¶ms, typename pcl::PointCloud< PointInOut >::Ptr outCloud, bool keepOrganized=false)
int EstimateShot(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, const typename pcl::PointCloud< PointInT >::ConstPtr keyPoints, const typename pcl::PointCloud< NormalType >::ConstPtr normals, typename pcl::PointCloud< DescriptorType >::Ptr outDescriptors, float searchRadius=0.03f, int maxThreadCount=QThread::idealThreadCount())
int GetMarchingCubes(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, const MarchingMethod &marchingMethod, PCLMesh &outMesh, float epsilon=0.01f, float isoLevel=0.0f, float gridResolution=50, float percentageExtendGrid=0.0f)
int GridProjection(const PointCloudNormal::ConstPtr &cloudWithNormals, PCLMesh &outMesh, float resolution, int paddingSize, int maxSearchLevel)
int EuclideanCluster(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, std::vector< pcl::PointIndices > &cluster_indices, float clusterTolerance=0.02f, int minClusterSize=100, int maxClusterSize=250000)
int PassThroughFilter(const typename pcl::PointCloud< PointInOut >::ConstPtr inCloud, typename pcl::PointCloud< PointInOut >::Ptr outcloud, const QString &filterFieldName="z", const float &limit_min=0.1f, const float &limit_max=1.1f)
double ComputeCloudResolution(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud)
bool ICPRegistration(const typename pcl::PointCloud< PointInT >::ConstPtr targetCloud, const typename pcl::PointCloud< PointOutT >::ConstPtr sourceCloud, typename pcl::PointCloud< PointOutT >::Ptr outRegistered, int ipcMaxIterations=5, float icpCorrDistance=0.005f)
template int GetConvexHullReconstruction< PointT >(const PointCloudT::ConstPtr inCloud, PCLMesh &outMesh, int dimension)
int GetConcaveHullReconstruction(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, PCLMesh &outMesh, int dimension=3, float alpha=0.05f)
int SmoothMls(const typename pcl::PointCloud< PointInT >::ConstPtr &inCloud, const MLSParameters ¶ms, typename pcl::PointCloud< PointOutT >::Ptr &outcloud)
int GetProjection(const PointCloudT::ConstPtr &originCloud, PointCloudT::Ptr &projectedCloud, const pcl::ModelCoefficients::ConstPtr coefficients, const int &modelType)
int GetBoundaryCloud(const typename pcl::PointCloud< PointInOut >::ConstPtr inCloud, const typename pcl::PointCloud< NormalType >::ConstPtr normals, typename pcl::PointCloud< PointInOut >::Ptr boundaryCloud, const float angleThreshold=90.0f, const float radius=-1.0f, const bool useKnn=true)
int SwapAxis(const typename pcl::PointCloud< PointInOutT >::ConstPtr inCloud, typename pcl::PointCloud< PointInOutT >::Ptr outcloud, const std::string &flag)
int GetMinCutSegmentation(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, std::vector< pcl::PointIndices > &outClusters, PointCloudRGB::Ptr cloud_segmented, const PointInT foregroundPoint, int neighboursNumber=14, float smoothSigma=0.25f, float backWeightRadius=0.8f, float foreWeight=0.5f, const pcl::IndicesConstPtr indices=nullptr)
int EstimateLocalReferenceFrame(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, const typename pcl::PointCloud< PointInT >::ConstPtr keyPoints, const typename pcl::PointCloud< NormalType >::ConstPtr normals, typename pcl::PointCloud< RFType >::Ptr outRF, float searchRadius=0.015f)
int ExtractIndicesFilter(const typename pcl::PointCloud< PointInOut >::ConstPtr inCloud, const pcl::PointIndices::ConstPtr inliers, typename pcl::PointCloud< PointInOut >::Ptr outcloud=nullptr, typename pcl::PointCloud< PointInOut >::Ptr outcloud2=nullptr)
int EstimateSIFT(const typename pcl::PointCloud< PointInT >::ConstPtr inCloud, typename pcl::PointCloud< PointOutT >::Ptr outcloud, int nr_octaves=0, float min_scale=0, int nr_scales_per_octave=0, float min_contrast=0)
Extract SIFT keypoints.
int EstimateMaxThreads()
Estimate the maximum number of threads to be used in a parallel region.
float DegreesToRadians(int degrees)
Convert degrees to radians.
#define QPCL_ENGINE_LIB_API
ComparisonType comparison_type_
ConditionType
NOTE: DISTINCT CLOUD METHOD NOT IMPLEMENTED.
ConditionType condition_type_
std::vector< ComparisonParam > condition_params_
UpsamplingMethod upsample_method_
UpsamplingMethod
NOTE: DISTINCT CLOUD METHOD NOT IMPLEMENTED.
double upsampling_radius_
double dilation_voxel_size_
Eigen::Matrix4f final_transformation