From 67e3f479cf05715ec72d35a96eb26ee5e6223357 Mon Sep 17 00:00:00 2001 From: asantamaria <asantamaria@iri.upc.edu> Date: Tue, 8 Aug 2017 13:47:45 +0200 Subject: [PATCH] fixing yaml stuff --- src/CMakeLists.txt | 5 +- src/descriptors/brisk/descriptor_brisk.cpp | 17 ++++ src/descriptors/brisk/descriptor_brisk.h | 71 +++++++++++++++++ .../brisk/descriptor_brisk_load_yaml.cpp | 47 +++++++++++ src/descriptors/kaze/descriptor_kaze.cpp | 17 ++++ src/descriptors/kaze/descriptor_kaze.h | 77 +++++++++++++++++++ .../kaze/descriptor_kaze_load_yaml.cpp | 50 ++++++++++++ src/descriptors/orb/descriptor_orb.cpp | 2 +- .../orb/descriptor_orb_load_yaml.cpp | 4 +- src/descriptors/sift/descriptor_sift.cpp | 2 +- .../sift/descriptor_sift_load_yaml.cpp | 4 +- src/descriptors/surf/descriptor_surf.cpp | 17 ++++ src/descriptors/surf/descriptor_surf.h | 75 ++++++++++++++++++ .../surf/descriptor_surf_load_yaml.cpp | 49 ++++++++++++ src/detectors/agast/detector_agast.cpp | 2 +- .../agast/detector_agast_load_yaml.cpp | 4 +- src/detectors/akaze/detector_akaze.cpp | 2 +- .../akaze/detector_akaze_load_yaml.cpp | 4 +- src/detectors/brisk/detector_brisk.cpp | 2 +- .../brisk/detector_brisk_load_yaml.cpp | 4 +- src/detectors/fast/detector_fast.cpp | 2 +- .../fast/detector_fast_load_yaml.cpp | 4 +- src/detectors/gftt/detector_gftt.cpp | 2 +- .../gftt/detector_gftt_load_yaml.cpp | 4 +- src/detectors/harris/detector_harris.cpp | 2 +- .../harris/detector_harris_load_yaml.cpp | 4 +- src/detectors/kaze/detector_kaze.cpp | 2 +- .../kaze/detector_kaze_load_yaml.cpp | 4 +- src/detectors/mser/detector_mser.cpp | 2 +- .../mser/detector_mser_load_yaml.cpp | 4 +- src/detectors/orb/detector_orb.cpp | 2 +- src/detectors/orb/detector_orb_load_yaml.cpp | 4 +- src/detectors/sbd/detector_sbd.cpp | 2 +- src/detectors/sbd/detector_sbd_load_yaml.cpp | 4 +- src/detectors/sift/detector_sift.cpp | 2 +- .../sift/detector_sift_load_yaml.cpp | 4 +- src/detectors/surf/detector_surf.cpp | 2 +- .../surf/detector_surf_load_yaml.cpp | 4 +- src/examples/test_descriptor.cpp | 57 +++++++------- src/examples/test_detector.cpp | 28 +++---- src/examples/test_factories.cpp | 5 -- src/examples/yaml/AGAST.yaml | 2 +- src/examples/yaml/AKAZE.yaml | 2 +- src/examples/yaml/BRISK.yaml | 11 ++- src/examples/yaml/FAST.yaml | 2 +- src/examples/yaml/GFTT.yaml | 2 +- src/examples/yaml/HARRIS.yaml | 2 +- src/examples/yaml/KAZE.yaml | 13 +++- src/examples/yaml/MSER.yaml | 2 +- src/examples/yaml/ORB.yaml | 4 +- src/examples/yaml/SBD.yaml | 2 +- src/examples/yaml/SIFT.yaml | 4 +- src/examples/yaml/SURF.yaml | 4 +- src/sensors/usb_cam/usb_cam.cpp | 2 +- src/sensors/usb_cam/usb_cam_load_yaml.cpp | 4 +- 55 files changed, 545 insertions(+), 110 deletions(-) create mode 100644 src/descriptors/brisk/descriptor_brisk.cpp create mode 100644 src/descriptors/brisk/descriptor_brisk.h create mode 100644 src/descriptors/brisk/descriptor_brisk_load_yaml.cpp create mode 100644 src/descriptors/kaze/descriptor_kaze.cpp create mode 100644 src/descriptors/kaze/descriptor_kaze.h create mode 100644 src/descriptors/kaze/descriptor_kaze_load_yaml.cpp create mode 100644 src/descriptors/surf/descriptor_surf.cpp create mode 100644 src/descriptors/surf/descriptor_surf.h create mode 100644 src/descriptors/surf/descriptor_surf_load_yaml.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ee1cd2c..038bc46 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 0000000..6cd02d5 --- /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 0000000..59421a6 --- /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 0000000..2ba8d97 --- /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 0000000..885cffe --- /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 0000000..4b0a875 --- /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 0000000..28b39e2 --- /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 88d2552..0fee089 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 04887c8..c8cc632 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 905fc58..e14f8a6 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 0240307..0a0f202 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 0000000..ec6df82 --- /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 0000000..1917872 --- /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 0000000..dab0495 --- /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 9bcfbe1..6584395 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 9009872..907b265 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 9b7e0aa..f40a929 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 8acbe30..0f4e9bd 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 d7bfc3e..875bc73 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 3205e5f..e8766f6 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 5410bb6..380482f 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 aded625..b84d355 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 a00ba7d..6fdcf07 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 61f1377..7e48ae4 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 7af88f6..410189e 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 501654b..a819993 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 7154cbb..cfbc23a 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 be47539..8fd87c4 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 98c0af8..2859f8a 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 e9b89bc..10642f7 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 d30d133..402dfb5 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 4394a45..485c9ee 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 8ec56fb..5f80fea 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 26ffcc9..adcbf8a 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 547ece8..770ca90 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 55a202a..dce5b42 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 65c5031..ed7a435 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 eb47f3f..4790706 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 f892fe7..e169546 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 517d0ca..091f28d 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 e4d37f2..33a30ad 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 17a7b88..b9cc9fd 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 307941f..4f131ae 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 2b3ab56..4bc3254 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 42f8f70..f27edcc 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 239fa22..71bb32f 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 333ac86..55f83b6 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 dd659b4..3b4918e 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 6a9ec2f..0940d88 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 a024608..ac01a46 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 edfd8a5..2c30027 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 9340432..739742f 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 69c61fe..cb5cbff 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 235023f..3211684 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 9fa57b2..b3fd58f 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] */ -- GitLab