MeVisLab Toolbox Reference
mlPCLSampleConsensusModels.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code author="Wolf Spindler"
3//----------------------------------------------------------------------------------
5
12//----------------------------------------------------------------------------------
13#pragma once
14
16#include <mlPCLModule.h>
18#include <pcl/sample_consensus/sac_model.h>
20
21// Define this to compile the experimental output for the samples point cloud,
22// which, however, still does not work as expected.
23// #define _COMPILE_SAC_MODEL_PCL_SAMPLE_OUTPUT
24
25
26ML_START_NAMESPACE
27
28//----------------------------------------------------------------------------------
30//----------------------------------------------------------------------------------
32{
33public:
36
43 pcl::SampleConsensusModel<pcl::PointXYZ>::Ptr createModelT(pcl::PointCloud<pcl::PointXYZ>::Ptr &cloudPtr, std::string &msg);
44 pcl::SampleConsensusModel<pcl::PointXYZLNormal>::Ptr createModelT(pcl::PointCloud<pcl::PointXYZLNormal>::Ptr &cloudPtr, std::string &msg);
45 pcl::SampleConsensusModel<pcl::PointXYZRGBNormal>::Ptr createModelT(pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr &cloudPtr, std::string &msg);
46 pcl::SampleConsensusModel<pcl::PointXYZINormal>::Ptr createModelT(pcl::PointCloud<pcl::PointXYZINormal>::Ptr &cloudPtr, std::string &msg);
48
51
52protected:
54 void activateAttachments() override;
55
57 void handleNotification (Field* field) override;
58
59private:
60
66 template <typename POINT_CLOUD_TYPE_PTR>
67 typename pcl::SampleConsensusModel<typename POINT_CLOUD_TYPE_PTR::element_type::PointType>::Ptr
68 _createModelTWithNormals(POINT_CLOUD_TYPE_PTR &cloudPtr, std::string &msg);
69
76 template <typename POINT_CLOUD_TYPE_PTR>
77 typename pcl::SampleConsensusModel<typename POINT_CLOUD_TYPE_PTR::element_type::PointType>::Ptr
78 _createModelTWithoutNormals(POINT_CLOUD_TYPE_PTR &cloudPtr, std::string &msg);
79
85 template <typename POINT_CLOUD_TYPE_PTR>
86 typename pcl::SampleConsensusModel<typename POINT_CLOUD_TYPE_PTR::element_type::PointType>::Ptr
87 _createRegistrationModel(POINT_CLOUD_TYPE_PTR &cloudPtr,
88 std::string &msg);
89
91 DoubleField *_epsAngleFld;
92
94 DoubleField *_epsDistFld;
95
97 DoubleField *_normalDistanceWeightFld;
98
101 Vector3Field *_axisFld;
102
104 DoubleField *_minOpeningAngleFld;
105
107 DoubleField *_maxOpeningAngleFld;
108
110 EnumField *_modelTypeFld;
111
113 BaseField *_outputSacMLModuleBaseFld;
114
115#ifdef _COMPILE_SAC_MODEL_PCL_SAMPLE_OUTPUT
118 void _createSampleAndSetOutput();
119
121 template <typename POINT_CLOUD_PTR_TYPE>
122 void _createSampleAndSetOutputT(const POINT_CLOUD_PTR_TYPE /*inputPointCloudPtr*/);
123
125 IntField *_sampleXFld;
126
128 IntField *_sampleYFld;
129
131 IntField *_sampleZFld;
132
134 DoubleField *_distanceThresholdFld;
135
137 FloatField *_fillValueFld;
138
140 NotifyField *_createSampleModelFld;
141
143 EnumField *_outputPointCloudTypeFld;
144#endif
145
148
151};
152
153ML_END_NAMESPACE
154
Project global and OS specific declarations.
#define MLPCL_SampleConsensus_EXPORT
If included by external modules, exported symbols are declared as import symbols.
Disables warnings from PCL headers which otherwise cannot be avoided.
Restores disabled warnings from PCL headers which otherwise cannot be avoided.
PCLModule(int numImageInputs=0, int numImageOutputs=0, int numPCLInputs=0, int numPCLOutputs=0, bool createEnumAndNotify=false)
pcl::SampleConsensusModel< pcl::PointXYZ >::Ptr createModelT(pcl::PointCloud< pcl::PointXYZ >::Ptr &cloudPtr, std::string &msg)
pcl::SampleConsensusModel< pcl::PointXYZINormal >::Ptr createModelT(pcl::PointCloud< pcl::PointXYZINormal >::Ptr &cloudPtr, std::string &msg)
bool needsNormalsInPoints() const
Returns true if the currently selected model type needs normals in points, otherwise false.
void activateAttachments() override
Updates internal state after changes of fields without field notifications.
PCLSampleConsensusModels()
Initializes an ML module wrapping a pcl::SampleConsensusModel classes.
pcl::SampleConsensusModel< pcl::PointXYZRGBNormal >::Ptr createModelT(pcl::PointCloud< pcl::PointXYZRGBNormal >::Ptr &cloudPtr, std::string &msg)
pcl::SampleConsensusModel< pcl::PointXYZLNormal >::Ptr createModelT(pcl::PointCloud< pcl::PointXYZLNormal >::Ptr &cloudPtr, std::string &msg)
void handleNotification(Field *field) override
Handles field changes of the field field.
#define ML_MODULE_CLASS_HEADER(className)
ML Module base class for algorithms from the Point Cloud Library (PCL).
#define ML_PCL_TEST_INTERFACE(BASE_OBJECT_NAME)
Implements a dedicated interface for PCL related modules which is required in automatic tests.