diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ee1cd2c06dbf0bffb79b8c541c5f4b5f0cd7e719..038bc46ef2bbaae00cdf63086b38c19216d5dbc6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -37,7 +37,9 @@ SET(sources descriptors/surf/descriptor_surf.cpp descriptors/surf/descriptor_surf_load_yaml.cpp descriptors/brisk/descriptor_brisk.cpp - descriptors/brisk/descriptor_brisk_load_yaml.cpp + descriptors/brisk/descriptor_brisk_load_yaml.cpp + descriptors/kaze/descriptor_kaze.cpp + descriptors/kaze/descriptor_kaze_load_yaml.cpp matchers/matcher_base.cpp ) # application header files @@ -67,6 +69,7 @@ SET(headers descriptors/sift/descriptor_sift.h descriptors/surf/descriptor_surf.h descriptors/brisk/descriptor_brisk.h + descriptors/kaze/descriptor_kaze.h matchers/matcher_factory.h matchers/matcher_base.h) diff --git a/src/descriptors/brisk/descriptor_brisk.cpp b/src/descriptors/brisk/descriptor_brisk.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6cd02d5d33959dc349f107dbf0362476d4b5cd3d --- /dev/null +++ b/src/descriptors/brisk/descriptor_brisk.cpp @@ -0,0 +1,17 @@ +#include "descriptor_brisk.h" + +namespace vision_utils { + +DescriptorBRISK::DescriptorBRISK(void) +{} + +DescriptorBRISK::~DescriptorBRISK(void) +{} + +} /* namespace vision_utils */ + +// Register in the DescriptorsFactory +namespace vision_utils +{ +VU_REGISTER_DESCRIPTOR("BRISK DES", DescriptorBRISK); +} /* namespace vision_utils */ diff --git a/src/descriptors/brisk/descriptor_brisk.h b/src/descriptors/brisk/descriptor_brisk.h new file mode 100644 index 0000000000000000000000000000000000000000..59421a660f3b9b218f31e416693842e626a753f2 --- /dev/null +++ b/src/descriptors/brisk/descriptor_brisk.h @@ -0,0 +1,71 @@ +#ifndef _DESCRIPTOR_BRISK_H_ +#define _DESCRIPTOR_BRISK_H_ + +#include "../descriptor_base.h" +#include "../descriptor_factory.h" + +// yaml-cpp library +#ifdef USING_YAML + #include <yaml-cpp/yaml.h> +#endif + +namespace vision_utils { + +// Create all pointers +VU_PTR_TYPEDEFS(DescriptorBRISK); +VU_PTR_TYPEDEFS(DescriptorParamsBRISK); + +/** \brief Class parameters + * + */ +struct DescriptorParamsBRISK: public ParamsBase +{ + int thresh = 30; // FAST/AGAST detection threshold score. + int octaves = 3; // Detection octaves. Use 0 to do single scale. + float patternScale = 1.0f; // Apply this scale to the pattern used for sampling the neighbourhood of a keypoint. +}; + +/** \brief DETECTOR class + * + */ +class DescriptorBRISK : public DescriptorBase { + + public: + DescriptorBRISK(); + virtual ~DescriptorBRISK(void); + + // Factory method + static DescriptorBasePtr create(const std::string& _unique_name, const ParamsBasePtr _params); + + private: + + void defineDescriptor(const ParamsBasePtr _params); +}; + +/* + * brief Define detector + */ +inline void DescriptorBRISK::defineDescriptor(const ParamsBasePtr _params) +{ + DescriptorParamsBRISKPtr params_ptr = std::static_pointer_cast<DescriptorParamsBRISK>(_params); + + descriptor_ = cv::BRISK::create(params_ptr->thresh, + params_ptr->octaves, + params_ptr->patternScale); +} + + +/* + * brief Create object in factory + */ +inline DescriptorBasePtr DescriptorBRISK::create(const std::string& _unique_name, const ParamsBasePtr _params) +{ + DescriptorBRISKPtr det_ptr = std::make_shared<DescriptorBRISK>(); + det_ptr->setName(_unique_name); + det_ptr->defineDescriptor(_params); + return det_ptr; +} + +} /* namespace vision_utils */ + +#endif /* _DESCRIPTOR_BRISK_H_ */ diff --git a/src/descriptors/brisk/descriptor_brisk_load_yaml.cpp b/src/descriptors/brisk/descriptor_brisk_load_yaml.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2ba8d972e67fb7e567d182e57db41a83aa899ed6 --- /dev/null +++ b/src/descriptors/brisk/descriptor_brisk_load_yaml.cpp @@ -0,0 +1,47 @@ +#include "descriptor_brisk.h" + +#ifdef USING_YAML + +// yaml-cpp library +#include <yaml-cpp/yaml.h> + +namespace vision_utils +{ + +namespace +{ + +static ParamsBasePtr createParamsBRISKDescriptor(const std::string & _filename_dot_yaml) +{ + DescriptorParamsBRISKPtr params_ptr = std::make_shared<DescriptorParamsBRISK>(); + + using std::string; + using YAML::Node; + Node yaml_params = YAML::LoadFile(_filename_dot_yaml); + if (!yaml_params.IsNull()) + { + Node d_yaml = yaml_params["descriptor"]; + if(d_yaml["type"].as<string>() == "BRISK DES") + { + params_ptr->thresh = d_yaml["thresh"].as<int>(); + params_ptr->octaves = d_yaml["octaves"].as<int>(); + params_ptr->patternScale = d_yaml["patternScale"].as<float>(); + }else + { + std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl; + return nullptr; + } + } + + return params_ptr; +} + +// Register in the SensorFactory +const bool registered_desBRISK_params = ParamsFactory::get().registerCreator("BRISK DES", createParamsBRISKDescriptor); + +} /* namespace [unnamed] */ + +} /* namespace vision_utils */ + +#endif /* IF USING_YAML */ + diff --git a/src/descriptors/kaze/descriptor_kaze.cpp b/src/descriptors/kaze/descriptor_kaze.cpp new file mode 100644 index 0000000000000000000000000000000000000000..885cffe75ab704b211b01683a36e405eef1b405e --- /dev/null +++ b/src/descriptors/kaze/descriptor_kaze.cpp @@ -0,0 +1,17 @@ +#include "descriptor_kaze.h" + +namespace vision_utils { + +DescriptorKAZE::DescriptorKAZE(void) +{} + +DescriptorKAZE::~DescriptorKAZE(void) +{} + +} /* namespace vision_utils */ + +// Register in the DescriptorsFactory +namespace vision_utils +{ +VU_REGISTER_DESCRIPTOR("KAZE DES", DescriptorKAZE); +} /* namespace vision_utils */ diff --git a/src/descriptors/kaze/descriptor_kaze.h b/src/descriptors/kaze/descriptor_kaze.h new file mode 100644 index 0000000000000000000000000000000000000000..4b0a8758ca16363f69f342920c28fc828471cd75 --- /dev/null +++ b/src/descriptors/kaze/descriptor_kaze.h @@ -0,0 +1,77 @@ +#ifndef _DESCRIPTOR_KAZE_H_ +#define _DESCRIPTOR_KAZE_H_ + +#include "../descriptor_base.h" +#include "../descriptor_factory.h" + +// yaml-cpp library +#ifdef USING_YAML + #include <yaml-cpp/yaml.h> +#endif + +namespace vision_utils { + +// Create all pointers +VU_PTR_TYPEDEFS(DescriptorKAZE); +VU_PTR_TYPEDEFS(DescriptorParamsKAZE); + +/** \brief Class parameters + * + */ +struct DescriptorParamsKAZE: public ParamsBase +{ + bool extended = false; // Set to enable extraction of extended (128-byte) descriptor. + bool upright = false; // Set to enable use of upright descriptors (non rotation-invariant). + float threshold = 0.001f; // Descriptor response threshold to accept point + int nOctaves = 4; // Maximum octave evolution of the image + int nOctaveLayers = 4; // Default number of sublevels per scale level + int diffusivity = cv::KAZE::DIFF_PM_G2; // Diffusivity type. DIFF_PM_G1, DIFF_PM_G2, DIFF_WEICKERT or DIFF_CHARBONNIER +}; + +/** \brief DETECTOR class + * + */ +class DescriptorKAZE : public DescriptorBase { + + public: + DescriptorKAZE(); + virtual ~DescriptorKAZE(void); + + // Factory method + static DescriptorBasePtr create(const std::string& _unique_name, const ParamsBasePtr _params); + + private: + + void defineDescriptor(const ParamsBasePtr _params); +}; + +/* + * brief Define detector + */ +inline void DescriptorKAZE::defineDescriptor(const ParamsBasePtr _params) +{ + DescriptorParamsKAZEPtr params_ptr = std::static_pointer_cast<DescriptorParamsKAZE>(_params); + + descriptor_ = cv::KAZE::create(params_ptr->extended, + params_ptr->upright, + params_ptr->threshold, + params_ptr->nOctaves, + params_ptr->nOctaveLayers, + params_ptr->diffusivity); +} + + +/* + * brief Create object in factory + */ +inline DescriptorBasePtr DescriptorKAZE::create(const std::string& _unique_name, const ParamsBasePtr _params) +{ + DescriptorKAZEPtr det_ptr = std::make_shared<DescriptorKAZE>(); + det_ptr->setName(_unique_name); + det_ptr->defineDescriptor(_params); + return det_ptr; +} + +} /* namespace vision_utils */ + +#endif /* _DESCRIPTOR_KAZE_H_ */ diff --git a/src/descriptors/kaze/descriptor_kaze_load_yaml.cpp b/src/descriptors/kaze/descriptor_kaze_load_yaml.cpp new file mode 100644 index 0000000000000000000000000000000000000000..28b39e206540444d438cbe200b35cd7861da3c6b --- /dev/null +++ b/src/descriptors/kaze/descriptor_kaze_load_yaml.cpp @@ -0,0 +1,50 @@ +#include "descriptor_kaze.h" + +#ifdef USING_YAML + +// yaml-cpp library +#include <yaml-cpp/yaml.h> + +namespace vision_utils +{ + +namespace +{ + +static ParamsBasePtr createParamsKAZEDescriptor(const std::string & _filename_dot_yaml) +{ + DescriptorParamsKAZEPtr params_ptr = std::make_shared<DescriptorParamsKAZE>(); + + using std::string; + using YAML::Node; + Node yaml_params = YAML::LoadFile(_filename_dot_yaml); + if (!yaml_params.IsNull()) + { + Node d_yaml = yaml_params["descriptor"]; + if(d_yaml["type"].as<string>() == "KAZE DES") + { + params_ptr->extended = d_yaml["extended"].as<bool>(); + params_ptr->upright = d_yaml["upright"].as<bool>(); + params_ptr->threshold = d_yaml["threshold"].as<float>(); + params_ptr->nOctaves = d_yaml["nOctaves"].as<int>(); + params_ptr->nOctaveLayers = d_yaml["nOctaveLayers"].as<int>(); + params_ptr->diffusivity = d_yaml["diffusivity"].as<int>(); + }else + { + std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl; + return nullptr; + } + } + + return params_ptr; +} + +// Register in the SensorFactory +const bool registered_desKAZE_params = ParamsFactory::get().registerCreator("KAZE DES", createParamsKAZEDescriptor); + +} /* namespace [unnamed] */ + +} /* namespace vision_utils */ + +#endif /* IF USING_YAML */ + diff --git a/src/descriptors/orb/descriptor_orb.cpp b/src/descriptors/orb/descriptor_orb.cpp index 88d2552e5745281e4fc799dc7401eaa0b1ac8c51..0fee08919d8b5456079e06e0b507b68d5f6d8f33 100644 --- a/src/descriptors/orb/descriptor_orb.cpp +++ b/src/descriptors/orb/descriptor_orb.cpp @@ -13,5 +13,5 @@ DescriptorORB::~DescriptorORB(void) // Register in the DescriptorsFactory namespace vision_utils { -VU_REGISTER_DESCRIPTOR("ORB", DescriptorORB); +VU_REGISTER_DESCRIPTOR("ORB DES", DescriptorORB); } /* namespace vision_utils */ diff --git a/src/descriptors/orb/descriptor_orb_load_yaml.cpp b/src/descriptors/orb/descriptor_orb_load_yaml.cpp index 04887c8e0ec35f7acebd590d374d32947ccc5157..c8cc632996b202479488064c5da3a97470482e47 100644 --- a/src/descriptors/orb/descriptor_orb_load_yaml.cpp +++ b/src/descriptors/orb/descriptor_orb_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsORBDescriptor(const std::string & _filename_dot if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["descriptor"]; - if(d_yaml["type"].as<string>() == "ORB") + if(d_yaml["type"].as<string>() == "ORB DES") { params_ptr->nfeatures = d_yaml["nfeatures"].as<unsigned int>(); params_ptr->scaleFactor = d_yaml["scale factor"].as<float>(); @@ -42,7 +42,7 @@ static ParamsBasePtr createParamsORBDescriptor(const std::string & _filename_dot } // Register in the SensorFactory -const bool registered_detORB_params = ParamsFactory::get().registerCreator("ORB", createParamsORBDescriptor); +const bool registered_desORB_params = ParamsFactory::get().registerCreator("ORB DES", createParamsORBDescriptor); } /* namespace [unnamed] */ diff --git a/src/descriptors/sift/descriptor_sift.cpp b/src/descriptors/sift/descriptor_sift.cpp index 905fc58832237f3b46fb9f99d9bf498652b41c80..e14f8a6408718806d3950164239a83ca9a982e4a 100644 --- a/src/descriptors/sift/descriptor_sift.cpp +++ b/src/descriptors/sift/descriptor_sift.cpp @@ -13,5 +13,5 @@ DescriptorSIFT::~DescriptorSIFT(void) // Register in the DescriptorsFactory namespace vision_utils { -VU_REGISTER_DESCRIPTOR("SIFT", DescriptorSIFT); +VU_REGISTER_DESCRIPTOR("SIFT DES", DescriptorSIFT); } /* namespace vision_utils */ diff --git a/src/descriptors/sift/descriptor_sift_load_yaml.cpp b/src/descriptors/sift/descriptor_sift_load_yaml.cpp index 024030739feaecc0bf04aedcb8928f0ecf8eff8d..0a0f202ba38d418d75c2296c93020f270000f685 100644 --- a/src/descriptors/sift/descriptor_sift_load_yaml.cpp +++ b/src/descriptors/sift/descriptor_sift_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsSIFTDescriptor(const std::string & _filename_do if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["descriptor"]; - if(d_yaml["type"].as<string>() == "SIFT") + if(d_yaml["type"].as<string>() == "SIFT DES") { params_ptr->nfeatures = d_yaml["nfeatures"].as<int>(); params_ptr->nOctaveLayers = d_yaml["nOctaveLayers"].as<int>(); @@ -39,7 +39,7 @@ static ParamsBasePtr createParamsSIFTDescriptor(const std::string & _filename_do } // Register in the SensorFactory -const bool registered_detSIFT_params = ParamsFactory::get().registerCreator("SIFT", createParamsSIFTDescriptor); +const bool registered_desSIFT_params = ParamsFactory::get().registerCreator("SIFT DES", createParamsSIFTDescriptor); } /* namespace [unnamed] */ diff --git a/src/descriptors/surf/descriptor_surf.cpp b/src/descriptors/surf/descriptor_surf.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ec6df829331fa120f8f2800affdc690379e8d37b --- /dev/null +++ b/src/descriptors/surf/descriptor_surf.cpp @@ -0,0 +1,17 @@ +#include "descriptor_surf.h" + +namespace vision_utils { + +DescriptorSURF::DescriptorSURF(void) +{} + +DescriptorSURF::~DescriptorSURF(void) +{} + +} /* namespace vision_utils */ + +// Register in the DescriptorsFactory +namespace vision_utils +{ +VU_REGISTER_DESCRIPTOR("SURF DES", DescriptorSURF); +} /* namespace vision_utils */ diff --git a/src/descriptors/surf/descriptor_surf.h b/src/descriptors/surf/descriptor_surf.h new file mode 100644 index 0000000000000000000000000000000000000000..191787282a47182f11eca4dcbc4550e81d2a6fce --- /dev/null +++ b/src/descriptors/surf/descriptor_surf.h @@ -0,0 +1,75 @@ +#ifndef _DESCRIPTOR_SURF_H_ +#define _DESCRIPTOR_SURF_H_ + +#include "../descriptor_base.h" +#include "../descriptor_factory.h" + +// yaml-cpp library +#ifdef USING_YAML + #include <yaml-cpp/yaml.h> +#endif + +namespace vision_utils { + +// Create all pointers +VU_PTR_TYPEDEFS(DescriptorSURF); +VU_PTR_TYPEDEFS(DescriptorParamsSURF); + +/** \brief Class parameters + * + */ +struct DescriptorParamsSURF: public ParamsBase +{ + double hessianThreshold=400; // Threshold for hessian keypoint detector used in SURF. + int nOctaves=4; // Number of pyramid octaves the keypoint detector will use. + int nOctaveLayers=2; // Number of octave layers within each octave. + bool extended=true; // Extended descriptor flag (true - use extended 128-element descriptors; false - use 64-element descriptors). + bool upright=false; // Up-right or rotated features flag (true - do not compute orientation of features; false - compute orientation +}; + +/** \brief DETECTOR class + * + */ +class DescriptorSURF : public DescriptorBase { + + public: + DescriptorSURF(); + virtual ~DescriptorSURF(void); + + // Factory method + static DescriptorBasePtr create(const std::string& _unique_name, const ParamsBasePtr _params); + + private: + + void defineDescriptor(const ParamsBasePtr _params); +}; + +/* + * brief Define detector + */ +inline void DescriptorSURF::defineDescriptor(const ParamsBasePtr _params) +{ + DescriptorParamsSURFPtr params_ptr = std::static_pointer_cast<DescriptorParamsSURF>(_params); + + descriptor_ = cv::xfeatures2d::SURF::create(params_ptr->hessianThreshold, + params_ptr->nOctaves, + params_ptr->nOctaveLayers, + params_ptr->extended, + params_ptr->upright); +} + + +/* + * brief Create object in factory + */ +inline DescriptorBasePtr DescriptorSURF::create(const std::string& _unique_name, const ParamsBasePtr _params) +{ + DescriptorSURFPtr det_ptr = std::make_shared<DescriptorSURF>(); + det_ptr->setName(_unique_name); + det_ptr->defineDescriptor(_params); + return det_ptr; +} + +} /* namespace vision_utils */ + +#endif /* _DESCRIPTOR_SURF_H_ */ diff --git a/src/descriptors/surf/descriptor_surf_load_yaml.cpp b/src/descriptors/surf/descriptor_surf_load_yaml.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dab0495dec261360262254ecdf8d52d2e1049182 --- /dev/null +++ b/src/descriptors/surf/descriptor_surf_load_yaml.cpp @@ -0,0 +1,49 @@ +#include "descriptor_surf.h" + +#ifdef USING_YAML + +// yaml-cpp library +#include <yaml-cpp/yaml.h> + +namespace vision_utils +{ + +namespace +{ + +static ParamsBasePtr createParamsSURFDescriptor(const std::string & _filename_dot_yaml) +{ + DescriptorParamsSURFPtr params_ptr = std::make_shared<DescriptorParamsSURF>(); + + using std::string; + using YAML::Node; + Node yaml_params = YAML::LoadFile(_filename_dot_yaml); + if (!yaml_params.IsNull()) + { + Node d_yaml = yaml_params["descriptor"]; + if(d_yaml["type"].as<string>() == "SURF DES") + { + params_ptr->hessianThreshold = d_yaml["hessianThreshold"].as<double>(); + params_ptr->nOctaves = d_yaml["nOctaves"].as<int>(); + params_ptr->nOctaveLayers = d_yaml["nOctaveLayers"].as<int>(); + params_ptr->extended = d_yaml["extended"].as<bool>(); + params_ptr->upright = d_yaml["upright"].as<bool>(); + }else + { + std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl; + return nullptr; + } + } + + return params_ptr; +} + +// Register in the SensorFactory +const bool registered_desSURF_params = ParamsFactory::get().registerCreator("SURF DES", createParamsSURFDescriptor); + +} /* namespace [unnamed] */ + +} /* namespace vision_utils */ + +#endif /* IF USING_YAML */ + diff --git a/src/detectors/agast/detector_agast.cpp b/src/detectors/agast/detector_agast.cpp index 9bcfbe1cf487cf4ae681e4ecf74bdbc18ed440bc..658439519b3f38010ef313030437d1b1a49b076d 100644 --- a/src/detectors/agast/detector_agast.cpp +++ b/src/detectors/agast/detector_agast.cpp @@ -13,5 +13,5 @@ DetectorAGAST::~DetectorAGAST(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("AGAST", DetectorAGAST); +VU_REGISTER_DETECTOR("AGAST DET", DetectorAGAST); } /* namespace vision_utils */ diff --git a/src/detectors/agast/detector_agast_load_yaml.cpp b/src/detectors/agast/detector_agast_load_yaml.cpp index 900987296b0911424caaad567586db3732d8b87d..907b2650992fd0981d2d624d1f27edcc62985978 100644 --- a/src/detectors/agast/detector_agast_load_yaml.cpp +++ b/src/detectors/agast/detector_agast_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsAGASTDetector(const std::string & _filename_dot if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "AGAST") + if(d_yaml["type"].as<string>() == "AGAST DET") { params_ptr->threshold = d_yaml["threshold"].as<int>(); params_ptr->nonmaxSuppression = d_yaml["nonmaxSuppression"].as<bool>(); @@ -37,7 +37,7 @@ static ParamsBasePtr createParamsAGASTDetector(const std::string & _filename_dot } // Register in the SensorFactory -const bool registered_detAGAST_params = ParamsFactory::get().registerCreator("AGAST", createParamsAGASTDetector); +const bool registered_detAGAST_params = ParamsFactory::get().registerCreator("AGAST DET", createParamsAGASTDetector); } /* namespace [unnamed] */ diff --git a/src/detectors/akaze/detector_akaze.cpp b/src/detectors/akaze/detector_akaze.cpp index 9b7e0aaa9953816f0661ac9fd048d5807d2f2fdd..f40a9299774299d40ad6df675ec4664dd9ac031d 100644 --- a/src/detectors/akaze/detector_akaze.cpp +++ b/src/detectors/akaze/detector_akaze.cpp @@ -13,5 +13,5 @@ DetectorAKAZE::~DetectorAKAZE(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("AKAZE", DetectorAKAZE); +VU_REGISTER_DETECTOR("AKAZE DET", DetectorAKAZE); } /* namespace vision_utils */ diff --git a/src/detectors/akaze/detector_akaze_load_yaml.cpp b/src/detectors/akaze/detector_akaze_load_yaml.cpp index 8acbe302e68596df3f01b0dac3b34c55c2e7545c..0f4e9bd61c4846c2a06af84ccca9d804f84cc590 100644 --- a/src/detectors/akaze/detector_akaze_load_yaml.cpp +++ b/src/detectors/akaze/detector_akaze_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsAKAZEDetector(const std::string & _filename_dot if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "AKAZE") + if(d_yaml["type"].as<string>() == "AKAZE DET") { params_ptr->descriptor_type = d_yaml["descriptor_type"].as<int>(); params_ptr->descriptor_size = d_yaml["descriptor_size"].as<int>(); @@ -41,7 +41,7 @@ static ParamsBasePtr createParamsAKAZEDetector(const std::string & _filename_dot } // Register in the SensorFactory -const bool registered_detAKAZE_params = ParamsFactory::get().registerCreator("AKAZE", createParamsAKAZEDetector); +const bool registered_detAKAZE_params = ParamsFactory::get().registerCreator("AKAZE DET", createParamsAKAZEDetector); } /* namespace [unnamed] */ diff --git a/src/detectors/brisk/detector_brisk.cpp b/src/detectors/brisk/detector_brisk.cpp index d7bfc3ee2fb26e2904945fe0a53d873770beafc4..875bc73143b3635da10940f3cd640e349b84c960 100644 --- a/src/detectors/brisk/detector_brisk.cpp +++ b/src/detectors/brisk/detector_brisk.cpp @@ -13,5 +13,5 @@ DetectorBRISK::~DetectorBRISK(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("BRISK", DetectorBRISK); +VU_REGISTER_DETECTOR("BRISK DET", DetectorBRISK); } /* namespace vision_utils */ diff --git a/src/detectors/brisk/detector_brisk_load_yaml.cpp b/src/detectors/brisk/detector_brisk_load_yaml.cpp index 3205e5f1a834182ed04174ec017965674c2f5abe..e8766f6346ca4219e7905861da4fc2df7135ac4c 100644 --- a/src/detectors/brisk/detector_brisk_load_yaml.cpp +++ b/src/detectors/brisk/detector_brisk_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsBRISKDetector(const std::string & _filename_dot if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "BRISK") + if(d_yaml["type"].as<string>() == "BRISK DET") { params_ptr->thresh = d_yaml["thresh"].as<int>(); params_ptr->octaves = d_yaml["octaves"].as<int>(); @@ -37,7 +37,7 @@ static ParamsBasePtr createParamsBRISKDetector(const std::string & _filename_dot } // Register in the SensorFactory -const bool registered_detBRISK_params = ParamsFactory::get().registerCreator("BRISK", createParamsBRISKDetector); +const bool registered_detBRISK_params = ParamsFactory::get().registerCreator("BRISK DET", createParamsBRISKDetector); } /* namespace [unnamed] */ diff --git a/src/detectors/fast/detector_fast.cpp b/src/detectors/fast/detector_fast.cpp index 5410bb62c1f07889489d0f20337086916be119f4..380482f04ea161f71ee2182b1dd1c260dfa663c7 100644 --- a/src/detectors/fast/detector_fast.cpp +++ b/src/detectors/fast/detector_fast.cpp @@ -13,5 +13,5 @@ DetectorFAST::~DetectorFAST(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("FAST", DetectorFAST); +VU_REGISTER_DETECTOR("FAST DET", DetectorFAST); } /* namespace vision_utils */ diff --git a/src/detectors/fast/detector_fast_load_yaml.cpp b/src/detectors/fast/detector_fast_load_yaml.cpp index aded625ed8f1c25d1080065143ba7b5f1aa50b13..b84d355b16b15b9b236a7022b2cdf9aab52a349b 100644 --- a/src/detectors/fast/detector_fast_load_yaml.cpp +++ b/src/detectors/fast/detector_fast_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsFASTDetector(const std::string & _filename_dot_ if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "FAST") + if(d_yaml["type"].as<string>() == "FAST DET") { params_ptr->threshold = d_yaml["threshold"].as<int>(); params_ptr->nonmaxSuppression = d_yaml["nonmaxSuppression"].as<bool>(); @@ -37,7 +37,7 @@ static ParamsBasePtr createParamsFASTDetector(const std::string & _filename_dot_ } // Register in the SensorFactory -const bool registered_detfast_params = ParamsFactory::get().registerCreator("FAST", createParamsFASTDetector); +const bool registered_detfast_params = ParamsFactory::get().registerCreator("FAST DET", createParamsFASTDetector); } /* namespace [unnamed] */ diff --git a/src/detectors/gftt/detector_gftt.cpp b/src/detectors/gftt/detector_gftt.cpp index a00ba7debdfd38e696ae8a1764cf168e5aa790be..6fdcf07a8fdc312f136dc1565d6b2f09d45701e9 100644 --- a/src/detectors/gftt/detector_gftt.cpp +++ b/src/detectors/gftt/detector_gftt.cpp @@ -13,5 +13,5 @@ DetectorGFTT::~DetectorGFTT(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("GFTT", DetectorGFTT); +VU_REGISTER_DETECTOR("GFTT DET", DetectorGFTT); } /* namespace vision_utils */ diff --git a/src/detectors/gftt/detector_gftt_load_yaml.cpp b/src/detectors/gftt/detector_gftt_load_yaml.cpp index 61f13773c9c4f95b3ee8f707dbb9636751c84e27..7e48ae40cf1b690e72a7da770b06dd219b83b6ca 100644 --- a/src/detectors/gftt/detector_gftt_load_yaml.cpp +++ b/src/detectors/gftt/detector_gftt_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsGFTTDetector(const std::string & _filename_dot_ if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "GFTT") + if(d_yaml["type"].as<string>() == "GFTT DET") { params_ptr->maxCorners = d_yaml["maxCorners"].as<int>(); params_ptr->qualityLevel = d_yaml["qualityLevel"].as<double>(); @@ -39,7 +39,7 @@ static ParamsBasePtr createParamsGFTTDetector(const std::string & _filename_dot_ } // Register in the SensorFactory -const bool registered_detGFTT_params = ParamsFactory::get().registerCreator("GFTT", createParamsGFTTDetector); +const bool registered_detGFTT_params = ParamsFactory::get().registerCreator("GFTT DET", createParamsGFTTDetector); } /* namespace [unnamed] */ diff --git a/src/detectors/harris/detector_harris.cpp b/src/detectors/harris/detector_harris.cpp index 7af88f690e755f1bc2d4987ac57a8cb3c4c66271..410189edcba7b0557d4253ddf3f6e80bc589fa58 100644 --- a/src/detectors/harris/detector_harris.cpp +++ b/src/detectors/harris/detector_harris.cpp @@ -13,5 +13,5 @@ DetectorHARRIS::~DetectorHARRIS(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("HARRIS", DetectorHARRIS); +VU_REGISTER_DETECTOR("HARRIS DET", DetectorHARRIS); } /* namespace vision_utils */ diff --git a/src/detectors/harris/detector_harris_load_yaml.cpp b/src/detectors/harris/detector_harris_load_yaml.cpp index 501654b67e03ed665020ceda98252855c39765ee..a819993ccaa129e52adbcb51b59acec38f5489c6 100644 --- a/src/detectors/harris/detector_harris_load_yaml.cpp +++ b/src/detectors/harris/detector_harris_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsHARRISDetector(const std::string & _filename_do if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "HARRIS") + if(d_yaml["type"].as<string>() == "HARRIS DET") { params_ptr->maxCorners = d_yaml["maxCorners"].as<int>(); params_ptr->qualityLevel = d_yaml["qualityLevel"].as<double>(); @@ -39,7 +39,7 @@ static ParamsBasePtr createParamsHARRISDetector(const std::string & _filename_do } // Register in the SensorFactory -const bool registered_detHARRIS_params = ParamsFactory::get().registerCreator("HARRIS", createParamsHARRISDetector); +const bool registered_detHARRIS_params = ParamsFactory::get().registerCreator("HARRIS DET", createParamsHARRISDetector); } /* namespace [unnamed] */ diff --git a/src/detectors/kaze/detector_kaze.cpp b/src/detectors/kaze/detector_kaze.cpp index 7154cbb1b877e79be6ff296faf2fea4901548811..cfbc23abf5354cdf8cde5de89fb6ff948519a32e 100644 --- a/src/detectors/kaze/detector_kaze.cpp +++ b/src/detectors/kaze/detector_kaze.cpp @@ -13,5 +13,5 @@ DetectorKAZE::~DetectorKAZE(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("KAZE", DetectorKAZE); +VU_REGISTER_DETECTOR("KAZE DET", DetectorKAZE); } /* namespace vision_utils */ diff --git a/src/detectors/kaze/detector_kaze_load_yaml.cpp b/src/detectors/kaze/detector_kaze_load_yaml.cpp index be47539e49c0ef2e079384f0430e7093fa08b664..8fd87c424504ccb1c74b727cb7f9c750804e64ea 100644 --- a/src/detectors/kaze/detector_kaze_load_yaml.cpp +++ b/src/detectors/kaze/detector_kaze_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsKAZEDetector(const std::string & _filename_dot_ if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "KAZE") + if(d_yaml["type"].as<string>() == "KAZE DET") { params_ptr->extended = d_yaml["extended"].as<bool>(); params_ptr->upright = d_yaml["upright"].as<bool>(); @@ -40,7 +40,7 @@ static ParamsBasePtr createParamsKAZEDetector(const std::string & _filename_dot_ } // Register in the SensorFactory -const bool registered_detKAZE_params = ParamsFactory::get().registerCreator("KAZE", createParamsKAZEDetector); +const bool registered_detKAZE_params = ParamsFactory::get().registerCreator("KAZE DET", createParamsKAZEDetector); } /* namespace [unnamed] */ diff --git a/src/detectors/mser/detector_mser.cpp b/src/detectors/mser/detector_mser.cpp index 98c0af8f33f723b3e6f21053e24a566d08377054..2859f8a2cc459f43f4cd7a1c40758790f1c5127a 100644 --- a/src/detectors/mser/detector_mser.cpp +++ b/src/detectors/mser/detector_mser.cpp @@ -13,5 +13,5 @@ DetectorMSER::~DetectorMSER(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("MSER", DetectorMSER); +VU_REGISTER_DETECTOR("MSER DET", DetectorMSER); } /* namespace vision_utils */ diff --git a/src/detectors/mser/detector_mser_load_yaml.cpp b/src/detectors/mser/detector_mser_load_yaml.cpp index e9b89bc9b8078a30a79803b1a3e87691a786cbd3..10642f78e83137e67b3fc58a1bb13aeb85cb12b5 100644 --- a/src/detectors/mser/detector_mser_load_yaml.cpp +++ b/src/detectors/mser/detector_mser_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsMSERDetector(const std::string & _filename_dot_ if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "MSER") + if(d_yaml["type"].as<string>() == "MSER DET") { params_ptr->delta = d_yaml["delta"].as<int>(); params_ptr->min_area = d_yaml["min_area"].as<int>(); @@ -43,7 +43,7 @@ static ParamsBasePtr createParamsMSERDetector(const std::string & _filename_dot_ } // Register in the SensorFactory -const bool registered_detMSER_params = ParamsFactory::get().registerCreator("MSER", createParamsMSERDetector); +const bool registered_detMSER_params = ParamsFactory::get().registerCreator("MSER DET", createParamsMSERDetector); } /* namespace [unnamed] */ diff --git a/src/detectors/orb/detector_orb.cpp b/src/detectors/orb/detector_orb.cpp index d30d1331204e8621e173bde8a8a9c868cdc9c36d..402dfb5b2c852f24ec2da34431582bf5c1834337 100644 --- a/src/detectors/orb/detector_orb.cpp +++ b/src/detectors/orb/detector_orb.cpp @@ -13,5 +13,5 @@ DetectorORB::~DetectorORB(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("ORB", DetectorORB); +VU_REGISTER_DETECTOR("ORB DET", DetectorORB); } /* namespace vision_utils */ diff --git a/src/detectors/orb/detector_orb_load_yaml.cpp b/src/detectors/orb/detector_orb_load_yaml.cpp index 4394a4530ae9d8c594e2e6439236cb4bacac4247..485c9ee9e601b875ab31b403b281daa4df268b85 100644 --- a/src/detectors/orb/detector_orb_load_yaml.cpp +++ b/src/detectors/orb/detector_orb_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsORBDetector(const std::string & _filename_dot_y if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "ORB") + if(d_yaml["type"].as<string>() == "ORB DET") { params_ptr->nfeatures = d_yaml["nfeatures"].as<unsigned int>(); params_ptr->scaleFactor = d_yaml["scale factor"].as<float>(); @@ -42,7 +42,7 @@ static ParamsBasePtr createParamsORBDetector(const std::string & _filename_dot_y } // Register in the SensorFactory -const bool registered_detORB_params = ParamsFactory::get().registerCreator("ORB", createParamsORBDetector); +const bool registered_detORB_params = ParamsFactory::get().registerCreator("ORB DET", createParamsORBDetector); } /* namespace [unnamed] */ diff --git a/src/detectors/sbd/detector_sbd.cpp b/src/detectors/sbd/detector_sbd.cpp index 8ec56fb210b117d78af3af966fd274841b2cf71d..5f80fea0d1d6bcd6c0f62973aa80d0eb607f8982 100644 --- a/src/detectors/sbd/detector_sbd.cpp +++ b/src/detectors/sbd/detector_sbd.cpp @@ -13,5 +13,5 @@ DetectorSBD::~DetectorSBD(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("SBD", DetectorSBD); +VU_REGISTER_DETECTOR("SBD DET", DetectorSBD); } /* namespace vision_utils */ diff --git a/src/detectors/sbd/detector_sbd_load_yaml.cpp b/src/detectors/sbd/detector_sbd_load_yaml.cpp index 26ffcc92cc1c4b3ae680e79936e574f2b34ff49c..adcbf8a40d818dd8e127a29b7cefc2b367d4079e 100644 --- a/src/detectors/sbd/detector_sbd_load_yaml.cpp +++ b/src/detectors/sbd/detector_sbd_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsSBDDetector(const std::string & _filename_dot_y if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "SBD") + if(d_yaml["type"].as<string>() == "SBD DET") { params_ptr->cv_params.thresholdStep = d_yaml["thresholdStep"].as<float>(); params_ptr->cv_params.minThreshold = d_yaml["minThreshold"].as<float>(); @@ -57,7 +57,7 @@ static ParamsBasePtr createParamsSBDDetector(const std::string & _filename_dot_y } // Register in the SensorFactory -const bool registered_detSBD_params = ParamsFactory::get().registerCreator("SBD", createParamsSBDDetector); +const bool registered_detSBD_params = ParamsFactory::get().registerCreator("SBD DET", createParamsSBDDetector); } /* namespace [unnamed] */ diff --git a/src/detectors/sift/detector_sift.cpp b/src/detectors/sift/detector_sift.cpp index 547ece8bfd82907c0962aa2855dd243577de66b2..770ca9051d69f08caf706a8866641c56f71bcf81 100644 --- a/src/detectors/sift/detector_sift.cpp +++ b/src/detectors/sift/detector_sift.cpp @@ -13,5 +13,5 @@ DetectorSIFT::~DetectorSIFT(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("SIFT", DetectorSIFT); +VU_REGISTER_DETECTOR("SIFT DET", DetectorSIFT); } /* namespace vision_utils */ diff --git a/src/detectors/sift/detector_sift_load_yaml.cpp b/src/detectors/sift/detector_sift_load_yaml.cpp index 55a202aa76d8baf7ec90bcbc0af306ab2080119e..dce5b421a280e7a477a6f10eef404e61185a60a5 100644 --- a/src/detectors/sift/detector_sift_load_yaml.cpp +++ b/src/detectors/sift/detector_sift_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsSIFTDetector(const std::string & _filename_dot_ if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "SIFT") + if(d_yaml["type"].as<string>() == "SIFT DET") { params_ptr->nfeatures = d_yaml["nfeatures"].as<int>(); params_ptr->nOctaveLayers = d_yaml["nOctaveLayers"].as<int>(); @@ -39,7 +39,7 @@ static ParamsBasePtr createParamsSIFTDetector(const std::string & _filename_dot_ } // Register in the SensorFactory -const bool registered_detSIFT_params = ParamsFactory::get().registerCreator("SIFT", createParamsSIFTDetector); +const bool registered_detSIFT_params = ParamsFactory::get().registerCreator("SIFT DET", createParamsSIFTDetector); } /* namespace [unnamed] */ diff --git a/src/detectors/surf/detector_surf.cpp b/src/detectors/surf/detector_surf.cpp index 65c50310145d37429407059f8cbb64d87844f7da..ed7a4350e650614ff92b3a27fef54dd803282d7d 100644 --- a/src/detectors/surf/detector_surf.cpp +++ b/src/detectors/surf/detector_surf.cpp @@ -13,5 +13,5 @@ DetectorSURF::~DetectorSURF(void) // Register in the DetectorsFactory namespace vision_utils { -VU_REGISTER_DETECTOR("SURF", DetectorSURF); +VU_REGISTER_DETECTOR("SURF DET", DetectorSURF); } /* namespace vision_utils */ diff --git a/src/detectors/surf/detector_surf_load_yaml.cpp b/src/detectors/surf/detector_surf_load_yaml.cpp index eb47f3f229317e420c0a27299b622017f10db6ab..47907065a853b4f4f0a8154f85749eea57b7d841 100644 --- a/src/detectors/surf/detector_surf_load_yaml.cpp +++ b/src/detectors/surf/detector_surf_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsSURFDetector(const std::string & _filename_dot_ if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["detector"]; - if(d_yaml["type"].as<string>() == "SURF") + if(d_yaml["type"].as<string>() == "SURF DET") { params_ptr->hessianThreshold = d_yaml["hessianThreshold"].as<double>(); params_ptr->nOctaves = d_yaml["nOctaves"].as<int>(); @@ -39,7 +39,7 @@ static ParamsBasePtr createParamsSURFDetector(const std::string & _filename_dot_ } // Register in the SensorFactory -const bool registered_detSURF_params = ParamsFactory::get().registerCreator("SURF", createParamsSURFDetector); +const bool registered_detSURF_params = ParamsFactory::get().registerCreator("SURF DET", createParamsSURFDetector); } /* namespace [unnamed] */ diff --git a/src/examples/test_descriptor.cpp b/src/examples/test_descriptor.cpp index f892fe741b0188c99ac65bd7ad0add8230210f21..e1695463fce4c8c74232ebc88341d4b83cee27f9 100644 --- a/src/examples/test_descriptor.cpp +++ b/src/examples/test_descriptor.cpp @@ -26,7 +26,7 @@ #include "../descriptors/sift/descriptor_sift.h" #include "../descriptors/surf/descriptor_surf.h" #include "../descriptors/brisk/descriptor_brisk.h" -//#include "../descriptors/kaze/descriptor_kaze.h" +#include "../descriptors/kaze/descriptor_kaze.h" //#include "../descriptors/akaze/descriptor_akaze.h" //#include "../descriptors/latch/descriptor_latch.h" //#include "../descriptors/freak/descriptor_freak.h" @@ -48,70 +48,69 @@ int main(void) std::string vu_root = _VU_ROOT_DIR; // Setup camera sensor by default - SensorBasePtr sen_b_ptr = setupSensor("USB_CAM", "CAMERA_test", vu_root + path_yaml_file + "/FAST.yaml"); // Any YAML with sensor type setup correctly + SensorBasePtr sen_b_ptr = setupSensor("USB CAM", "CAMERA test", vu_root + path_yaml_file + "/FAST.yaml"); // Any YAML with sensor type setup correctly SensorCameraPtr sen_ptr = std::static_pointer_cast<SensorCamera>(sen_b_ptr); - std::string def_detector = "ORB"; + std::string def_detector = "ORB DET"; std::cout << std::endl << "Which DETECTOR do you want to test? Type one of the registered names [default: " << def_detector << "]: "; std::string det_name = readFromUser(def_detector); DetectorBasePtr det_ptr = setupDetector(det_name, det_name + " detector", vu_root + path_yaml_file + "/" + det_name + ".yaml"); - if (det_name.compare("ORB") == 0) + if (det_name.compare("ORB DET") == 0) det_ptr = std::static_pointer_cast<DetectorORB>(det_ptr); - else if (det_name.compare("FAST") == 0) + else if (det_name.compare("FAST DET") == 0) det_ptr = std::static_pointer_cast<DetectorFAST>(det_ptr); - else if (det_name.compare("SIFT") == 0) + else if (det_name.compare("SIFT DET") == 0) det_ptr = std::static_pointer_cast<DetectorSIFT>(det_ptr); - else if (det_name.compare("SURF") == 0) + else if (det_name.compare("SURF DET") == 0) det_ptr = std::static_pointer_cast<DetectorSURF>(det_ptr); - else if (det_name.compare("BRISK") == 0) + else if (det_name.compare("BRISK DET") == 0) det_ptr = std::static_pointer_cast<DetectorBRISK>(det_ptr); - else if (det_name.compare("MSER") == 0) + else if (det_name.compare("MSER DET") == 0) det_ptr = std::static_pointer_cast<DetectorMSER>(det_ptr); - else if (det_name.compare("GFTT") == 0) + else if (det_name.compare("GFTT DET") == 0) det_ptr = std::static_pointer_cast<DetectorGFTT>(det_ptr); - else if (det_name.compare("HARRIS") == 0) + else if (det_name.compare("HARRIS DET") == 0) det_ptr = std::static_pointer_cast<DetectorHARRIS>(det_ptr); - else if (det_name.compare("SBD") == 0) + else if (det_name.compare("SBD DET") == 0) det_ptr = std::static_pointer_cast<DetectorSBD>(det_ptr); - else if (det_name.compare("KAZE") == 0) + else if (det_name.compare("KAZE DET") == 0) det_ptr = std::static_pointer_cast<DetectorKAZE>(det_ptr); - else if (det_name.compare("AKAZE") == 0) + else if (det_name.compare("AKAZE DET") == 0) det_ptr = std::static_pointer_cast<DetectorAKAZE>(det_ptr); - else if (det_name.compare("AGAST") == 0) + else if (det_name.compare("AGAST DET") == 0) det_ptr = std::static_pointer_cast<DetectorAGAST>(det_ptr); - std::cout << "\n================ DESCRIPTOR TEST =================" << std::endl; - std::string def_descriptor = "ORB"; + std::string def_descriptor = "ORB DES"; std::cout << std::endl << "Which DESCRIPTOR do you want to test? Type one of the registered names [default: " << def_descriptor << "]: "; std::string des_name = readFromUser(def_descriptor); DescriptorBasePtr des_ptr = setupDescriptor(des_name, des_name + " descriptor", vu_root + path_yaml_file + "/" + des_name + ".yaml"); - if (des_name.compare("ORB") == 0) + if (des_name.compare("ORB DES") == 0) des_ptr = std::static_pointer_cast<DescriptorORB>(des_ptr); - else if (des_name.compare("SIFT") == 0) + else if (des_name.compare("SIFT DES") == 0) des_ptr = std::static_pointer_cast<DescriptorSIFT>(des_ptr); - else if (des_name.compare("SURF") == 0) + else if (des_name.compare("SURF DES") == 0) des_ptr = std::static_pointer_cast<DescriptorSURF>(des_ptr); - else if (des_name.compare("BRISK") == 0) + else if (des_name.compare("BRISK DES") == 0) des_ptr = std::static_pointer_cast<DescriptorBRISK>(des_ptr); -// else if (des_name.compare("KAZE") == 0) -// des_ptr = std::static_pointer_cast<DescriptorKAZE>(des_ptr); -// else if (des_name.compare("AKAZE") == 0) + else if (des_name.compare("KAZE DES") == 0) + des_ptr = std::static_pointer_cast<DescriptorKAZE>(des_ptr); +// else if (des_name.compare("AKAZE DES") == 0) // des_ptr = std::static_pointer_cast<DescriptorAKAZE>(des_ptr); -// else if (des_name.compare("LATCH") == 0) +// else if (des_name.compare("LATCH DES") == 0) // des_ptr = std::static_pointer_cast<DescriptorLATCH>(des_ptr); -// else if (des_name.compare("FREAK") == 0) +// else if (des_name.compare("FREAK DES") == 0) // des_ptr = std::static_pointer_cast<DescriptorFREAK>(des_ptr); -// else if (des_name.compare("BRIEF") == 0) +// else if (des_name.compare("BRIEF DES") == 0) // des_ptr = std::static_pointer_cast<DescriptorBRIEF>(des_ptr); -// else if (des_name.compare("DAISY") == 0) +// else if (des_name.compare("DAISY DES") == 0) // des_ptr = std::static_pointer_cast<DescriptorDAISY>(des_ptr); -// else if (des_name.compare("LUCID") == 0) +// else if (des_name.compare("LUCID DES") == 0) // des_ptr = std::static_pointer_cast<DescriptorLUCID>(des_ptr); std::cout << std::endl << "... Testing " << det_ptr->getName() << " with " << des_ptr->getName() << " ..." << std::endl; diff --git a/src/examples/test_detector.cpp b/src/examples/test_detector.cpp index 517d0ca4e2762bfd918bf7aa419f7bc054756176..091f28d6fc564f8143c2c9e65d308fb145f2bf40 100644 --- a/src/examples/test_detector.cpp +++ b/src/examples/test_detector.cpp @@ -35,40 +35,40 @@ int main(void) std::string vu_root = _VU_ROOT_DIR; // Setup camera sensor by default - SensorBasePtr sen_b_ptr = setupSensor("USB_CAM", "CAMERA_test", vu_root + path_yaml_file + "/FAST.yaml"); // Any YAML with sensor type setup correctly + SensorBasePtr sen_b_ptr = setupSensor("USB CAM", "CAMERA test", vu_root + path_yaml_file + "/FAST.yaml"); // Any YAML with sensor type setup correctly SensorCameraPtr sen_ptr = std::static_pointer_cast<SensorCamera>(sen_b_ptr); std::cout << "\n================ DETECTOR TEST =================" << std::endl; - std::string def_detector = "ORB"; + std::string def_detector = "ORB DET"; std::cout << std::endl << "Which DETECTOR do you want to test? Type one of the registered names [default: " << def_detector << "]: "; std::string det_name = readFromUser(def_detector); DetectorBasePtr det_ptr = setupDetector(det_name, det_name + " detector", vu_root + path_yaml_file + "/" + det_name + ".yaml"); - if (det_name.compare("ORB") == 0) + if (det_name.compare("ORB DET") == 0) det_ptr = std::static_pointer_cast<DetectorORB>(det_ptr); - else if (det_name.compare("FAST") == 0) + else if (det_name.compare("FAST DET") == 0) det_ptr = std::static_pointer_cast<DetectorFAST>(det_ptr); - else if (det_name.compare("SIFT") == 0) + else if (det_name.compare("SIFT DET") == 0) det_ptr = std::static_pointer_cast<DetectorSIFT>(det_ptr); - else if (det_name.compare("SURF") == 0) + else if (det_name.compare("SURF DET") == 0) det_ptr = std::static_pointer_cast<DetectorSURF>(det_ptr); - else if (det_name.compare("BRISK") == 0) + else if (det_name.compare("BRISK DET") == 0) det_ptr = std::static_pointer_cast<DetectorBRISK>(det_ptr); - else if (det_name.compare("MSER") == 0) + else if (det_name.compare("MSER DET") == 0) det_ptr = std::static_pointer_cast<DetectorMSER>(det_ptr); - else if (det_name.compare("GFTT") == 0) + else if (det_name.compare("GFTT DET") == 0) det_ptr = std::static_pointer_cast<DetectorGFTT>(det_ptr); - else if (det_name.compare("HARRIS") == 0) + else if (det_name.compare("HARRIS DET") == 0) det_ptr = std::static_pointer_cast<DetectorHARRIS>(det_ptr); - else if (det_name.compare("SBD") == 0) + else if (det_name.compare("SBD DET") == 0) det_ptr = std::static_pointer_cast<DetectorSBD>(det_ptr); - else if (det_name.compare("KAZE") == 0) + else if (det_name.compare("KAZE DET") == 0) det_ptr = std::static_pointer_cast<DetectorKAZE>(det_ptr); - else if (det_name.compare("AKAZE") == 0) + else if (det_name.compare("AKAZE DET") == 0) det_ptr = std::static_pointer_cast<DetectorAKAZE>(det_ptr); - else if (det_name.compare("AGAST") == 0) + else if (det_name.compare("AGAST DET") == 0) det_ptr = std::static_pointer_cast<DetectorAGAST>(det_ptr); std::cout << std::endl << "... Testing " << det_ptr->getName() << " ..." << std::endl; diff --git a/src/examples/test_factories.cpp b/src/examples/test_factories.cpp index e4d37f2f11c330f1aa7f8177691d597491d652ce..33a30adbc6758a021529b0444d8cf972525036d9 100644 --- a/src/examples/test_factories.cpp +++ b/src/examples/test_factories.cpp @@ -16,11 +16,6 @@ int main(void) using std::make_shared; using std::static_pointer_cast; - // Root dir path - std::string vu_root = _VU_ROOT_DIR; - - std::string file_dot_yaml = "/src/examples/yaml/detORB.yaml"; - std::cout << "\n====== Registering creators in the Factories =======" << std::endl; std::cout << "If you look above, you see the registered creators.\n" diff --git a/src/examples/yaml/AGAST.yaml b/src/examples/yaml/AGAST.yaml index 17a7b8875cf09afe1be1a2dd9896af8bdb137831..b9cc9fd9d6e62cb48b328e618bfc797295aacab2 100644 --- a/src/examples/yaml/AGAST.yaml +++ b/src/examples/yaml/AGAST.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "AGAST" + type: "AGAST DET" threshold: 10 nonmaxSuppression: true detection type: 3 # AGAST_5_8=0, AGAST_7_12d=1, AGAST_7_12s=2, OAST_9_16=3, THRESHOLD=10000, NONMAX_SUPPRESSION=10001 diff --git a/src/examples/yaml/AKAZE.yaml b/src/examples/yaml/AKAZE.yaml index 307941f1a702e1672fe684c2302779819d57c90a..4f131ae1fd62bec1e724ce9ad826863c63dc8035 100644 --- a/src/examples/yaml/AKAZE.yaml +++ b/src/examples/yaml/AKAZE.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "AKAZE" + type: "AKAZE DET" descriptor_type: 5 # Type of the extracted descriptor. DESCRIPTOR_KAZE_UPRIGHT=2, DESCRIPTOR_KAZE=3, DESCRIPTOR_MLDB_UPRIGHT=4, DESCRIPTOR_MLDB=5 descriptor_size: 0 descriptor_channels: 3 diff --git a/src/examples/yaml/BRISK.yaml b/src/examples/yaml/BRISK.yaml index 2b3ab56723994f3677cd0024c390e48bcc00d37a..4bc3254c856894d0a191a5a3b243bf94e0c8e8b5 100644 --- a/src/examples/yaml/BRISK.yaml +++ b/src/examples/yaml/BRISK.yaml @@ -1,7 +1,14 @@ sensor: type: "USB_CAM" + detector: - type: "BRISK" + type: "BRISK DET" thresh: 30 octaves: 3 - patternScale: 1.0 \ No newline at end of file + patternScale: 1.0 + +descriptor: + type: "BRISK DES" + thresh: 30 + octaves: 3 + patternScale: 1.0 \ No newline at end of file diff --git a/src/examples/yaml/FAST.yaml b/src/examples/yaml/FAST.yaml index 42f8f70ed783cc1fca0b9932fb0cc7fe12e190b1..f27edcc21ea175fc7045a39d7248ecfed60eba8f 100644 --- a/src/examples/yaml/FAST.yaml +++ b/src/examples/yaml/FAST.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "FAST" + type: "FAST DET" threshold: 10 nonmaxSuppression: true neighbor type: 0 #enum { TYPE_9_16=0, TYPE_7_12=1, TYPE_5_8=2 }; diff --git a/src/examples/yaml/GFTT.yaml b/src/examples/yaml/GFTT.yaml index 239fa22f2f5f046733bd3d4622b4c8255005ac4d..71bb32f5e16d8206a5a72cfaf864f0a445889253 100644 --- a/src/examples/yaml/GFTT.yaml +++ b/src/examples/yaml/GFTT.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "GFTT" + type: "GFTT DET" maxCorners: 1000 qualityLevel: 0.01 minDistance: 1.0 diff --git a/src/examples/yaml/HARRIS.yaml b/src/examples/yaml/HARRIS.yaml index 333ac86192f1a2246661e0b2b162b03c6ad4b367..55f83b6396b5baa5b44afc32cba3abc4faf280f1 100644 --- a/src/examples/yaml/HARRIS.yaml +++ b/src/examples/yaml/HARRIS.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "HARRIS" + type: "HARRIS DET" maxCorners: 1000 qualityLevel: 0.01 minDistance: 1.0 diff --git a/src/examples/yaml/KAZE.yaml b/src/examples/yaml/KAZE.yaml index dd659b4da703279d1b94923d05ad4657e7ef9d73..3b4918e1f4e0fa9ecfb316d467902b43316c6ced 100644 --- a/src/examples/yaml/KAZE.yaml +++ b/src/examples/yaml/KAZE.yaml @@ -1,10 +1,21 @@ sensor: type: "USB_CAM" + detector: - type: "KAZE" + type: "KAZE DET" extended: false upright: false threshold: 0.001 nOctaves: 4 nOctaveLayers: 4 diffusivity: 1 # Diffusivity type. DIFF_PM_G1=0, DIFF_PM_G2=1, DIFF_WEICKERT=2, DIFF_CHARBONNIER=3 + +descriptor: + type: "KAZE DES" + extended: false + upright: false + threshold: 0.001 + nOctaves: 4 + nOctaveLayers: 4 + diffusivity: 1 # Diffusivity type. DIFF_PM_G1=0, DIFF_PM_G2=1, DIFF_WEICKERT=2, DIFF_CHARBONNIER=3 + \ No newline at end of file diff --git a/src/examples/yaml/MSER.yaml b/src/examples/yaml/MSER.yaml index 6a9ec2f8d949e04c6b2790cafcaec7c2698096f0..0940d88cd46fbe6704a74ae8f1bd857460ade196 100644 --- a/src/examples/yaml/MSER.yaml +++ b/src/examples/yaml/MSER.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "MSER" + type: "MSER DET" delta: 5 min_area: 60 max_area: 14400 diff --git a/src/examples/yaml/ORB.yaml b/src/examples/yaml/ORB.yaml index a0246081df96fba0a69b4b03c1ab0acd9326ff48..ac01a4690c2250fd12c7a373c4f9c0289555d145 100644 --- a/src/examples/yaml/ORB.yaml +++ b/src/examples/yaml/ORB.yaml @@ -2,7 +2,7 @@ sensor: type: "USB_CAM" detector: - type: "ORB" + type: "ORB DET" nfeatures: 100 scale factor: 2 nlevels: 8 @@ -13,7 +13,7 @@ detector: patch size: 15 # 31 descriptor: - type: "ORB" + type: "ORB DES" nfeatures: 100 scale factor: 2 nlevels: 8 diff --git a/src/examples/yaml/SBD.yaml b/src/examples/yaml/SBD.yaml index edfd8a5ce5378aa93222cb92ffd743748b7c572c..2c30027994e18bb52de7239e2f9c997b3aa31072 100644 --- a/src/examples/yaml/SBD.yaml +++ b/src/examples/yaml/SBD.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "SBD" + type: "SBD DET" thresholdStep: 10.0 minThreshold: 50.0 maxThreshold: 220.0 diff --git a/src/examples/yaml/SIFT.yaml b/src/examples/yaml/SIFT.yaml index 93404329a5d7367839f7805e066a0dfc3306d166..739742f909e67a186b0cf5d2b083032587a385c2 100644 --- a/src/examples/yaml/SIFT.yaml +++ b/src/examples/yaml/SIFT.yaml @@ -2,7 +2,7 @@ sensor: type: "USB_CAM" detector: - type: "SIFT" + type: "SIFT DET" nfeatures: 0 nOctaveLayers: 3 contrastThreshold: 0.04 @@ -10,7 +10,7 @@ detector: sigma: 1.6 descriptor: - type: "SIFT" + type: "SIFT DES" nfeatures: 0 nOctaveLayers: 3 contrastThreshold: 0.04 diff --git a/src/examples/yaml/SURF.yaml b/src/examples/yaml/SURF.yaml index 69c61fec612b89cf3dba84c88f85c2ac9a58b152..cb5cbff28ffeea6cba2c0541931e6f8e4ae7c4aa 100644 --- a/src/examples/yaml/SURF.yaml +++ b/src/examples/yaml/SURF.yaml @@ -2,7 +2,7 @@ sensor: type: "USB_CAM" detector: - type: "SURF" + type: "SURF DET" hessianThreshold: 400 nOctaves: 4 nOctaveLayers: 2 @@ -10,7 +10,7 @@ detector: upright: false descriptor: - type: "SURF" + type: "SURF DES" hessianThreshold: 400 nOctaves: 4 nOctaveLayers: 2 diff --git a/src/sensors/usb_cam/usb_cam.cpp b/src/sensors/usb_cam/usb_cam.cpp index 235023fcfb202ca717d3ff30fc796e87a62f9a85..32116843a507f3638cf13c033b005ac4da9eaca1 100644 --- a/src/sensors/usb_cam/usb_cam.cpp +++ b/src/sensors/usb_cam/usb_cam.cpp @@ -14,5 +14,5 @@ SensorCamera::~SensorCamera(void) #include "../sensor_factory.h" namespace vision_utils { -VU_REGISTER_SENSOR("USB_CAM", SensorCamera); +VU_REGISTER_SENSOR("USB CAM", SensorCamera); } /* namespace vision_utils */ diff --git a/src/sensors/usb_cam/usb_cam_load_yaml.cpp b/src/sensors/usb_cam/usb_cam_load_yaml.cpp index 9fa57b2e3d2e7bd50e3a51110cfaaf3572502103..b3fd58f104313be8c957f3c7857fb973c03dddd2 100644 --- a/src/sensors/usb_cam/usb_cam_load_yaml.cpp +++ b/src/sensors/usb_cam/usb_cam_load_yaml.cpp @@ -22,7 +22,7 @@ static ParamsBasePtr createParamsUSBCAMSensor(const std::string & _filename_dot_ if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["sensor"]; - if(d_yaml["type"].as<string>() == "USB_CAM") + if(d_yaml["type"].as<string>() == "USB CAM") { // TODO: Load intrinsic parametes if any function needs them. }else @@ -35,7 +35,7 @@ static ParamsBasePtr createParamsUSBCAMSensor(const std::string & _filename_dot_ } // Register in the SensorFactory -const bool registered_usbcam_params = ParamsFactory::get().registerCreator("USB_CAM", createParamsUSBCAMSensor); +const bool registered_usbcam_params = ParamsFactory::get().registerCreator("USB CAM", createParamsUSBCAMSensor); } /* namespace [unnamed] */