ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
CorrespondenceMatching.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "BasePclModule.h"
11 
12 // Qt
13 #include <QString>
14 
16 
19 public:
21  virtual ~CorrespondenceMatching();
22 
23  // inherited from BasePclModule
24  virtual int compute();
25 
26 protected:
27  // inherited from BasePclModule
28  virtual int checkSelected();
29  virtual int openInputDialog();
30  virtual void getParametersFromDialog();
31  virtual int checkParameters();
32  virtual QString getErrorMessage(int errorCode);
33 
34  void applyTransformation(ccHObject* entity, const ccGLMatrixd& mat);
35 
38 
39  float m_leafSize;
41  bool m_gcMode;
44 
49 
50  // GC
53 
54  // Hough
55  float m_lrfRadius;
58 
59  // ICP
62 
63  // Global Hypotheses Verification
64  float clusterReg = 5.0f;
65  float inlierThreshold = 0.005f;
66  float occlusionThreshold = 0.01f;
67  float radiusClutter = 0.03f;
68  float regularizer = 3.0f;
69  float radiusNormals = 0.05f;
70  bool detectClutter = true;
71 
72  std::vector<float> m_scales;
73  std::vector<ccPointCloud*> m_modelClouds;
74 };
CorrespondenceMatching::radiusNormals
float radiusNormals
Definition: CorrespondenceMatching.h:69
CorrespondenceMatching::m_sceneCloud
ccPointCloud * m_sceneCloud
Definition: CorrespondenceMatching.h:36
ecvMainAppInterface::dispToConsole
virtual void dispToConsole(QString message, ConsoleMessageLevel level=STD_CONSOLE_MESSAGE)=0
CorrespondenceMatching::getErrorMessage
virtual QString getErrorMessage(int errorCode)
Returns the error message corresponding to a given error code.
Definition: CorrespondenceMatching.cpp:497
ccHObject::getParent
ccHObject * getParent() const
Returns parent object.
Definition: ecvHObject.h:245
CorrespondenceMatchingDialog.h
CorrespondenceMatching.h
CorrespondenceMatching::m_verification
bool m_verification
Definition: CorrespondenceMatching.h:42
CorrespondenceMatchingDialog::getHoughBinSize
float getHoughBinSize() const
Definition: CorrespondenceMatchingDialog.cpp:150
CorrespondenceMatching::m_lrfRadius
float m_lrfRadius
Definition: CorrespondenceMatching.h:55
CorrespondenceMatching::regularizer
float regularizer
Definition: CorrespondenceMatching.h:68
CorrespondenceMatching::m_gcMinClusterSize
float m_gcMinClusterSize
Definition: CorrespondenceMatching.h:52
CorrespondenceMatching::clusterReg
float clusterReg
Definition: CorrespondenceMatching.h:64
ccDrawableObject::setGLTransformation
virtual void setGLTransformation(const ccGLMatrix &trans)
Associates entity with a GL transformation (rotation + translation)
Definition: ecvDrawableObject.cpp:54
ccGLMatrixd
Double version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:56
ccObject::setName
virtual void setName(const QString &name)
Sets object name.
Definition: ecvObject.h:75
CorrespondenceMatching::compute
virtual int compute()
Performs the actual filter job.
Definition: CorrespondenceMatching.cpp:137
ccShiftedObject::setGlobalScale
virtual void setGlobalScale(double scale)
Definition: ecvShiftedObject.cpp:33
CVLog::Print
static bool Print(const char *format,...)
Prints out a formatted message in console.
Definition: CVLog.cpp:113
PclModuleDescription
PCL filter description.
Definition: BasePclModule.h:26
CorrespondenceMatchingDialog::getScales
bool getScales(std::vector< float > &scales) const
Returns input scales.
Definition: CorrespondenceMatchingDialog.cpp:166
CorrespondenceMatchingDialog::isGCActivated
bool isGCActivated() const
Definition: CorrespondenceMatchingDialog.cpp:134
CorrespondenceMatching::~CorrespondenceMatching
virtual ~CorrespondenceMatching()
Definition: CorrespondenceMatching.cpp:53
CorrespondenceMatching::checkSelected
virtual int checkSelected()
Checks if current selection is compliant with the filter.
Definition: CorrespondenceMatching.cpp:58
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
CorrespondenceMatching::m_maxThreadCount
int m_maxThreadCount
Definition: CorrespondenceMatching.h:43
PCLModules.h
CorrespondenceMatching::m_modelClouds
std::vector< ccPointCloud * > m_modelClouds
Definition: CorrespondenceMatching.h:73
ecvMainAppInterface.h
CorrespondenceMatchingDialog::getModelCloudByIndex
ccPointCloud * getModelCloudByIndex(int index)
Definition: CorrespondenceMatchingDialog.cpp:228
CorrespondenceMatchingDialog::getGcConsensusSetResolution
float getGcConsensusSetResolution() const
Definition: CorrespondenceMatchingDialog.cpp:138
BasePclModule::isFirstSelectedCcPointCloud
int isFirstSelectedCcPointCloud()
Returns 1 if the first selected object is a ccPointCloud.
Definition: BasePclModule.cpp:358
CorrespondenceMatching::m_gcMode
bool m_gcMode
Definition: CorrespondenceMatching.h:41
CorrespondenceMatching::radiusClutter
float radiusClutter
Definition: CorrespondenceMatching.h:67
CorrespondenceMatching::m_useVoxelGrid
bool m_useVoxelGrid
Definition: CorrespondenceMatching.h:40
cc2sm.h
PCLCloud
pcl::PCLPointCloud2 PCLCloud
Definition: PCLCloud.h:34
CorrespondenceMatching::detectClutter
bool detectClutter
Definition: CorrespondenceMatching.h:70
CorrespondenceMatchingDialog::saveParamsToPersistentSettings
void saveParamsToPersistentSettings()
Saves parameters to persistent settings.
Definition: CorrespondenceMatchingDialog.cpp:286
CorrespondenceMatchingDialog::getHoughThreshold
float getHoughThreshold() const
Definition: CorrespondenceMatchingDialog.cpp:154
CorrespondenceMatching::m_houghThreshold
float m_houghThreshold
Definition: CorrespondenceMatching.h:57
ccDrawableObject::showColors
virtual void showColors(bool state)
Sets colors visibility.
Definition: ecvDrawableObject.h:84
size
int size
Definition: FileIOFactory.cpp:130
ccShiftedObject::getGlobalShift
virtual const CCVector3d & getGlobalShift() const
Returns the shift applied to original coordinates.
Definition: ecvShiftedObject.h:46
BasePclModule
Base abstract class for each implemented PCL filter.
Definition: BasePclModule.h:53
CorrespondenceMatchingDialog
CANUPO plugin's training dialog.
Definition: CorrespondenceMatchingDialog.h:20
NormalT
pcl::Normal NormalT
Definition: PCLCloud.h:26
pcl2cc::Convert
static ccMesh * Convert(PCLTextureMesh::ConstPtr textureMesh)
Converts a PCL point cloud to a ccPointCloud.
CorrespondenceMatching::getParametersFromDialog
virtual void getParametersFromDialog()
Collects parameters from the filter dialog (if openDialog is successful)
Definition: CorrespondenceMatching.cpp:78
CorrespondenceMatching::CorrespondenceMatching
CorrespondenceMatching()
Definition: CorrespondenceMatching.cpp:30
CorrespondenceMatchingDialog::getVerificationFlag
bool getVerificationFlag() const
Definition: CorrespondenceMatchingDialog.cpp:114
CorrespondenceMatching::m_icpMaxIterations
int m_icpMaxIterations
Definition: CorrespondenceMatching.h:60
ecvMainAppInterface::ERR_CONSOLE_MESSAGE
@ ERR_CONSOLE_MESSAGE
Definition: ecvMainAppInterface.h:119
CorrespondenceMatching::applyTransformation
void applyTransformation(ccHObject *entity, const ccGLMatrixd &mat)
Definition: CorrespondenceMatching.cpp:489
cc2smReader
CC to PCL cloud converter.
Definition: cc2sm.h:43
CorrespondenceMatching::m_icpCorrDistance
float m_icpCorrDistance
Definition: CorrespondenceMatching.h:61
ccHObject::applyGLTransformation_recursive
void applyGLTransformation_recursive(const ccGLMatrix *trans=nullptr)
Applies the active OpenGL transformation to the entity (recursive)
Definition: ecvHObject.cpp:948
CorrespondenceMatchingDialog::getNormalKSearch
float getNormalKSearch() const
Returns the normal KSearch.
Definition: CorrespondenceMatchingDialog.cpp:130
CorrespondenceMatching::m_leafSize
float m_leafSize
Definition: CorrespondenceMatching.h:39
ecvMesh.h
CorrespondenceMatching::m_sceneSearchRadius
float m_sceneSearchRadius
Definition: CorrespondenceMatching.h:46
PCLModules::EstimateGeometricConsistencyGrouping
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)
Definition: PCLModules.h:878
CorrespondenceMatching::m_normalKSearch
int m_normalKSearch
Definition: CorrespondenceMatching.h:48
BasePclModule::newEntity
void newEntity(ccHObject *)
Signal emitted when a new entity is created by the filter.
ccDrawableObject::showSF
virtual void showSF(bool state)
Sets active scalarfield visibility.
Definition: ecvDrawableObject.h:108
BasePclModule::m_app
ecvMainAppInterface * m_app
Associated application interface.
Definition: BasePclModule.h:296
CorrespondenceMatchingDialog::refreshCloudComboBox
void refreshCloudComboBox()
Definition: CorrespondenceMatchingDialog.cpp:50
PCLModules::EstimateLocalReferenceFrame
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)
Definition: PCLModules.h:827
ccDrawableObject::setVisible
virtual void setVisible(bool state)
Sets entity visibility.
Definition: ecvDrawableObject.h:40
CorrespondenceMatching
Correspondence Matching.
Definition: CorrespondenceMatching.h:18
CorrespondenceMatchingDialog::getHoughLRFRadius
float getHoughLRFRadius() const
Definition: CorrespondenceMatchingDialog.cpp:146
BasePclModule.h
CorrespondenceMatchingDialog::getShotDescriptorRadius
float getShotDescriptorRadius() const
Returns the Shot Descriptor Radius.
Definition: CorrespondenceMatchingDialog.cpp:126
ccHObject::getChildrenNumber
unsigned getChildrenNumber() const
Returns the number of children.
Definition: ecvHObject.h:312
ccGLMatrix
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19
CorrespondenceMatching::m_houghBinSize
float m_houghBinSize
Definition: CorrespondenceMatching.h:56
ccPointCloud::setRGBColor
bool setRGBColor(ColorCompType r, ColorCompType g, ColorCompType b)
Set a unique color for the whole cloud (shortcut)
Definition: ecvPointCloud.h:778
CorrespondenceMatchingDialog::getMaxThreadCount
int getMaxThreadCount() const
Returns the max number of threads to use.
Definition: CorrespondenceMatchingDialog.cpp:110
CorrespondenceMatching::m_dialog
CorrespondenceMatchingDialog * m_dialog
Definition: CorrespondenceMatching.h:37
ecvColor::RgbTpl
RGB color structure.
Definition: ecvColorTypes.h:49
CorrespondenceMatchingDialog::getSceneSearchRadius
float getSceneSearchRadius() const
Returns the Scene Search Radius.
Definition: CorrespondenceMatchingDialog.cpp:122
CorrespondenceMatching::m_scales
std::vector< float > m_scales
Definition: CorrespondenceMatching.h:72
ccShiftedObject::getGlobalScale
virtual double getGlobalScale() const
Returns the scale applied to original coordinates.
Definition: ecvShiftedObject.h:53
CorrespondenceMatchingDialog::getModelSearchRadius
float getModelSearchRadius() const
Returns the Model Search Radius.
Definition: CorrespondenceMatchingDialog.cpp:118
ccShiftedObject::setGlobalShift
virtual void setGlobalShift(double x, double y, double z)
Sets shift applied to original coordinates (information storage only)
Definition: ecvShiftedObject.h:33
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
CorrespondenceMatching::m_consensusResolution
float m_consensusResolution
Definition: CorrespondenceMatching.h:51
CorrespondenceMatching::m_shotDescriptorRadius
float m_shotDescriptorRadius
Definition: CorrespondenceMatching.h:47
ccObject::getName
virtual QString getName() const
Returns object name.
Definition: ecvObject.h:72
CorrespondenceMatchingDialog::getVoxelGridLeafSize
float getVoxelGridLeafSize() const
Definition: CorrespondenceMatchingDialog.cpp:158
ccGLMatrixTpl::data
T * data()
Returns a pointer to internal data.
Definition: ecvGLMatrixTpl.h:810
ecvColor::Generator::Random
static Rgb Random(bool lightOnly=true)
Generates a random color.
Definition: ecvColorTypes.cpp:84
TO_PCL_CLOUD
#define TO_PCL_CLOUD
Definition: PCLConv.h:12
CorrespondenceMatching::occlusionThreshold
float occlusionThreshold
Definition: CorrespondenceMatching.h:66
CorrespondenceMatching::m_modelSearchRadius
float m_modelSearchRadius
Definition: CorrespondenceMatching.h:45
PointT
pcl::PointXYZ PointT
Definition: PCLCloud.h:16
fgr::Correspondences
std::vector< Pair > Correspondences
Definition: FastGlobalRegistration.h:16
ccHObject::addChild
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
Definition: ecvHObject.cpp:534
CorrespondenceMatchingDialog::getEvaluationCloud
ccPointCloud * getEvaluationCloud()
Get evaluation point cloud.
Definition: CorrespondenceMatchingDialog.cpp:242
PCLModules::EstimateHough3DGrouping
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)
Definition: PCLModules.h:848
sm2cc.h
CorrespondenceMatchingDialog::getGcMinClusterSize
float getGcMinClusterSize() const
Definition: CorrespondenceMatchingDialog.cpp:142
ecvPointCloud.h
CorrespondenceMatching::checkParameters
virtual int checkParameters()
Definition: CorrespondenceMatching.cpp:130
BasePclModule::getErrorMessage
virtual QString getErrorMessage(int errorCode)
Returns the error message corresponding to a given error code.
Definition: BasePclModule.cpp:218
cc2smReader::getXYZ2
pcl::PointCloud< pcl::PointXYZ >::Ptr getXYZ2() const
Definition: cc2sm.cpp:218
CorrespondenceMatching::inlierThreshold
float inlierThreshold
Definition: CorrespondenceMatching.h:65
PointCloudT
pcl::PointCloud< PointT > PointCloudT
Definition: PCLCloud.h:17
CorrespondenceMatching::openInputDialog
virtual int openInputDialog()
Definition: CorrespondenceMatching.cpp:66