From 08b77be05d8282b197f925db6567233cd651a352 Mon Sep 17 00:00:00 2001 From: asantamaria <asantamaria@iri.upc.edu> Date: Tue, 8 Aug 2017 14:18:02 +0200 Subject: [PATCH] added akaze and fixed problem with yaml --- src/CMakeLists.txt | 3 + src/descriptors/akaze/descriptor_akaze.cpp | 17 ++++ src/descriptors/akaze/descriptor_akaze.h | 79 +++++++++++++++++++ .../akaze/descriptor_akaze_load_yaml.cpp | 51 ++++++++++++ src/descriptors/brisk/descriptor_brisk.cpp | 2 +- .../brisk/descriptor_brisk_load_yaml.cpp | 2 +- src/descriptors/descriptor_base.cpp | 2 +- src/descriptors/kaze/descriptor_kaze.cpp | 2 +- .../kaze/descriptor_kaze_load_yaml.cpp | 2 +- src/descriptors/orb/descriptor_orb.cpp | 2 +- .../orb/descriptor_orb_load_yaml.cpp | 2 +- src/descriptors/sift/descriptor_sift.cpp | 2 +- .../sift/descriptor_sift_load_yaml.cpp | 4 +- src/descriptors/surf/descriptor_surf.cpp | 2 +- .../surf/descriptor_surf_load_yaml.cpp | 2 +- src/detectors/agast/detector_agast.cpp | 2 +- .../agast/detector_agast_load_yaml.cpp | 2 +- src/detectors/akaze/detector_akaze.cpp | 2 +- .../akaze/detector_akaze_load_yaml.cpp | 2 +- src/detectors/brisk/detector_brisk.cpp | 2 +- .../brisk/detector_brisk_load_yaml.cpp | 2 +- src/detectors/detector_base.cpp | 2 +- src/detectors/fast/detector_fast.cpp | 2 +- .../fast/detector_fast_load_yaml.cpp | 2 +- src/detectors/gftt/detector_gftt.cpp | 2 +- .../gftt/detector_gftt_load_yaml.cpp | 2 +- src/detectors/harris/detector_harris.cpp | 2 +- .../harris/detector_harris_load_yaml.cpp | 2 +- src/detectors/kaze/detector_kaze.cpp | 2 +- .../kaze/detector_kaze_load_yaml.cpp | 2 +- src/detectors/mser/detector_mser.cpp | 2 +- .../mser/detector_mser_load_yaml.cpp | 2 +- src/detectors/orb/detector_orb.cpp | 2 +- src/detectors/orb/detector_orb_load_yaml.cpp | 2 +- src/detectors/sbd/detector_sbd.cpp | 2 +- src/detectors/sbd/detector_sbd_load_yaml.cpp | 2 +- src/detectors/sift/detector_sift.cpp | 2 +- .../sift/detector_sift_load_yaml.cpp | 2 +- src/detectors/surf/detector_surf.cpp | 2 +- .../surf/detector_surf_load_yaml.cpp | 2 +- src/examples/test_descriptor.cpp | 56 ++++++------- src/examples/test_detector.cpp | 28 +++---- src/examples/test_factories.cpp | 12 +++ src/examples/test_sensor.cpp | 2 +- src/examples/yaml/AGAST.yaml | 2 +- src/examples/yaml/AKAZE.yaml | 13 ++- src/examples/yaml/BRISK.yaml | 4 +- src/examples/yaml/FAST.yaml | 2 +- src/examples/yaml/GFTT.yaml | 2 +- src/examples/yaml/HARRIS.yaml | 2 +- src/examples/yaml/KAZE.yaml | 4 +- 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 +- 58 files changed, 273 insertions(+), 100 deletions(-) create mode 100644 src/descriptors/akaze/descriptor_akaze.cpp create mode 100644 src/descriptors/akaze/descriptor_akaze.h create mode 100644 src/descriptors/akaze/descriptor_akaze_load_yaml.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 038bc46..780d6fe 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,6 +40,8 @@ SET(sources descriptors/brisk/descriptor_brisk_load_yaml.cpp descriptors/kaze/descriptor_kaze.cpp descriptors/kaze/descriptor_kaze_load_yaml.cpp + descriptors/akaze/descriptor_akaze.cpp + descriptors/akaze/descriptor_akaze_load_yaml.cpp matchers/matcher_base.cpp ) # application header files @@ -70,6 +72,7 @@ SET(headers descriptors/surf/descriptor_surf.h descriptors/brisk/descriptor_brisk.h descriptors/kaze/descriptor_kaze.h + descriptors/akaze/descriptor_akaze.h matchers/matcher_factory.h matchers/matcher_base.h) diff --git a/src/descriptors/akaze/descriptor_akaze.cpp b/src/descriptors/akaze/descriptor_akaze.cpp new file mode 100644 index 0000000..db9bdc6 --- /dev/null +++ b/src/descriptors/akaze/descriptor_akaze.cpp @@ -0,0 +1,17 @@ +#include "descriptor_akaze.h" + +namespace vision_utils { + +DescriptorAKAZE::DescriptorAKAZE(void) +{} + +DescriptorAKAZE::~DescriptorAKAZE(void) +{} + +} /* namespace vision_utils */ + +// Register in the DescriptorsFactory +namespace vision_utils +{ +VU_REGISTER_DESCRIPTOR("AKAZE", DescriptorAKAZE); +} /* namespace vision_utils */ diff --git a/src/descriptors/akaze/descriptor_akaze.h b/src/descriptors/akaze/descriptor_akaze.h new file mode 100644 index 0000000..11979d7 --- /dev/null +++ b/src/descriptors/akaze/descriptor_akaze.h @@ -0,0 +1,79 @@ +#ifndef _DESCRIPTOR_AKAZE_H_ +#define _DESCRIPTOR_AKAZE_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(DescriptorAKAZE); +VU_PTR_TYPEDEFS(DescriptorParamsAKAZE); + +/** \brief Class parameters + * + */ +struct DescriptorParamsAKAZE: public ParamsBase +{ + int descriptor_type = cv::AKAZE::DESCRIPTOR_MLDB; // Type of the extracted descriptor. DESCRIPTOR_KAZE_UPRIGHT=2, DESCRIPTOR_KAZE=3, DESCRIPTOR_MLDB_UPRIGHT=4, DESCRIPTOR_MLDB=5 + int descriptor_size = 0; // Size of the descriptor in bits. 0 -> Full size + int descriptor_channels = 3; // Number of channels in the descriptor (1, 2, 3) + 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=0, DIFF_PM_G2=1, DIFF_WEICKERT=2, DIFF_CHARBONNIER=3 +}; + +/** \brief DETECTOR class + * + */ +class DescriptorAKAZE : public DescriptorBase { + + public: + DescriptorAKAZE(); + virtual ~DescriptorAKAZE(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 DescriptorAKAZE::defineDescriptor(const ParamsBasePtr _params) +{ + DescriptorParamsAKAZEPtr params_ptr = std::static_pointer_cast<DescriptorParamsAKAZE>(_params); + + descriptor_ = cv::AKAZE::create(params_ptr->descriptor_type, + params_ptr->descriptor_size, + params_ptr->descriptor_channels, + params_ptr->threshold, + params_ptr->nOctaves, + params_ptr->nOctaveLayers, + params_ptr->diffusivity); +} + + +/* + * brief Create object in factory + */ +inline DescriptorBasePtr DescriptorAKAZE::create(const std::string& _unique_name, const ParamsBasePtr _params) +{ + DescriptorAKAZEPtr det_ptr = std::make_shared<DescriptorAKAZE>(); + det_ptr->setName(_unique_name); + det_ptr->defineDescriptor(_params); + return det_ptr; +} + +} /* namespace vision_utils */ + +#endif /* _DESCRIPTOR_AKAZE_H_ */ diff --git a/src/descriptors/akaze/descriptor_akaze_load_yaml.cpp b/src/descriptors/akaze/descriptor_akaze_load_yaml.cpp new file mode 100644 index 0000000..043ceb0 --- /dev/null +++ b/src/descriptors/akaze/descriptor_akaze_load_yaml.cpp @@ -0,0 +1,51 @@ +#include "descriptor_akaze.h" + +#ifdef USING_YAML + +// yaml-cpp library +#include <yaml-cpp/yaml.h> + +namespace vision_utils +{ + +namespace +{ + +static ParamsBasePtr createParamsAKAZEDescriptor(const std::string & _filename_dot_yaml) +{ + DescriptorParamsAKAZEPtr params_ptr = std::make_shared<DescriptorParamsAKAZE>(); + + 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>() == "AKAZE") + { + params_ptr->descriptor_type = d_yaml["descriptor_type"].as<int>(); + params_ptr->descriptor_size = d_yaml["descriptor_size"].as<int>(); + params_ptr->descriptor_channels = d_yaml["descriptor_channels"].as<int>(); + 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_desAKAZE_params = ParamsFactory::get().registerCreator("AKAZE DES", createParamsAKAZEDescriptor); + +} /* namespace [unnamed] */ + +} /* namespace vision_utils */ + +#endif /* IF USING_YAML */ + diff --git a/src/descriptors/brisk/descriptor_brisk.cpp b/src/descriptors/brisk/descriptor_brisk.cpp index 6cd02d5..55c9f5e 100644 --- a/src/descriptors/brisk/descriptor_brisk.cpp +++ b/src/descriptors/brisk/descriptor_brisk.cpp @@ -13,5 +13,5 @@ DescriptorBRISK::~DescriptorBRISK(void) // Register in the DescriptorsFactory namespace vision_utils { -VU_REGISTER_DESCRIPTOR("BRISK DES", DescriptorBRISK); +VU_REGISTER_DESCRIPTOR("BRISK", DescriptorBRISK); } /* namespace vision_utils */ diff --git a/src/descriptors/brisk/descriptor_brisk_load_yaml.cpp b/src/descriptors/brisk/descriptor_brisk_load_yaml.cpp index 2ba8d97..394084b 100644 --- a/src/descriptors/brisk/descriptor_brisk_load_yaml.cpp +++ b/src/descriptors/brisk/descriptor_brisk_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsBRISKDescriptor(const std::string & _filename_d if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["descriptor"]; - if(d_yaml["type"].as<string>() == "BRISK DES") + if(d_yaml["type"].as<string>() == "BRISK") { params_ptr->thresh = d_yaml["thresh"].as<int>(); params_ptr->octaves = d_yaml["octaves"].as<int>(); diff --git a/src/descriptors/descriptor_base.cpp b/src/descriptors/descriptor_base.cpp index 4af05ba..af91245 100644 --- a/src/descriptors/descriptor_base.cpp +++ b/src/descriptors/descriptor_base.cpp @@ -38,7 +38,7 @@ DescriptorBasePtr setupDescriptor(const std::string& _type, const std::string& _ #ifdef USING_YAML DescriptorBasePtr setupDescriptor(const std::string& _type, const std::string& _unique_name, const std::string& _filename_dot_yaml) { - ParamsBasePtr params_ptr = ParamsFactory::get().create(_type, _filename_dot_yaml); + ParamsBasePtr params_ptr = ParamsFactory::get().create(_type+" DES", _filename_dot_yaml); return setupDescriptor(_type, _unique_name, params_ptr); } #endif diff --git a/src/descriptors/kaze/descriptor_kaze.cpp b/src/descriptors/kaze/descriptor_kaze.cpp index 885cffe..2cd80cb 100644 --- a/src/descriptors/kaze/descriptor_kaze.cpp +++ b/src/descriptors/kaze/descriptor_kaze.cpp @@ -13,5 +13,5 @@ DescriptorKAZE::~DescriptorKAZE(void) // Register in the DescriptorsFactory namespace vision_utils { -VU_REGISTER_DESCRIPTOR("KAZE DES", DescriptorKAZE); +VU_REGISTER_DESCRIPTOR("KAZE", DescriptorKAZE); } /* namespace vision_utils */ diff --git a/src/descriptors/kaze/descriptor_kaze_load_yaml.cpp b/src/descriptors/kaze/descriptor_kaze_load_yaml.cpp index 28b39e2..63fd5ed 100644 --- a/src/descriptors/kaze/descriptor_kaze_load_yaml.cpp +++ b/src/descriptors/kaze/descriptor_kaze_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsKAZEDescriptor(const std::string & _filename_do if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["descriptor"]; - if(d_yaml["type"].as<string>() == "KAZE DES") + if(d_yaml["type"].as<string>() == "KAZE") { params_ptr->extended = d_yaml["extended"].as<bool>(); params_ptr->upright = d_yaml["upright"].as<bool>(); diff --git a/src/descriptors/orb/descriptor_orb.cpp b/src/descriptors/orb/descriptor_orb.cpp index 0fee089..88d2552 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 DES", DescriptorORB); +VU_REGISTER_DESCRIPTOR("ORB", 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 c8cc632..03b31f7 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 DES") + if(d_yaml["type"].as<string>() == "ORB") { params_ptr->nfeatures = d_yaml["nfeatures"].as<unsigned int>(); params_ptr->scaleFactor = d_yaml["scale factor"].as<float>(); diff --git a/src/descriptors/sift/descriptor_sift.cpp b/src/descriptors/sift/descriptor_sift.cpp index e14f8a6..905fc58 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 DES", DescriptorSIFT); +VU_REGISTER_DESCRIPTOR("SIFT", 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 0a0f202..d18646e 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 DES") + if(d_yaml["type"].as<string>() == "SIFT") { params_ptr->nfeatures = d_yaml["nfeatures"].as<int>(); params_ptr->nOctaveLayers = d_yaml["nOctaveLayers"].as<int>(); @@ -30,7 +30,7 @@ static ParamsBasePtr createParamsSIFTDescriptor(const std::string & _filename_do params_ptr->sigma = d_yaml["sigma"].as<double>(); }else { - std::cerr << "Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl; + std::cerr << "DESCRIPTOR Bad configuration file. Wrong type " << d_yaml["type"].as<string>() << std::endl; return nullptr; } } diff --git a/src/descriptors/surf/descriptor_surf.cpp b/src/descriptors/surf/descriptor_surf.cpp index ec6df82..6e7d7a4 100644 --- a/src/descriptors/surf/descriptor_surf.cpp +++ b/src/descriptors/surf/descriptor_surf.cpp @@ -13,5 +13,5 @@ DescriptorSURF::~DescriptorSURF(void) // Register in the DescriptorsFactory namespace vision_utils { -VU_REGISTER_DESCRIPTOR("SURF DES", DescriptorSURF); +VU_REGISTER_DESCRIPTOR("SURF", DescriptorSURF); } /* namespace vision_utils */ diff --git a/src/descriptors/surf/descriptor_surf_load_yaml.cpp b/src/descriptors/surf/descriptor_surf_load_yaml.cpp index dab0495..8cfb642 100644 --- a/src/descriptors/surf/descriptor_surf_load_yaml.cpp +++ b/src/descriptors/surf/descriptor_surf_load_yaml.cpp @@ -21,7 +21,7 @@ static ParamsBasePtr createParamsSURFDescriptor(const std::string & _filename_do if (!yaml_params.IsNull()) { Node d_yaml = yaml_params["descriptor"]; - if(d_yaml["type"].as<string>() == "SURF DES") + if(d_yaml["type"].as<string>() == "SURF") { params_ptr->hessianThreshold = d_yaml["hessianThreshold"].as<double>(); params_ptr->nOctaves = d_yaml["nOctaves"].as<int>(); diff --git a/src/detectors/agast/detector_agast.cpp b/src/detectors/agast/detector_agast.cpp index 6584395..9bcfbe1 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 DET", DetectorAGAST); +VU_REGISTER_DETECTOR("AGAST", 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 907b265..e07e117 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 DET") + if(d_yaml["type"].as<string>() == "AGAST") { params_ptr->threshold = d_yaml["threshold"].as<int>(); params_ptr->nonmaxSuppression = d_yaml["nonmaxSuppression"].as<bool>(); diff --git a/src/detectors/akaze/detector_akaze.cpp b/src/detectors/akaze/detector_akaze.cpp index f40a929..9b7e0aa 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 DET", DetectorAKAZE); +VU_REGISTER_DETECTOR("AKAZE", 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 0f4e9bd..1f41c7c 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 DET") + if(d_yaml["type"].as<string>() == "AKAZE") { params_ptr->descriptor_type = d_yaml["descriptor_type"].as<int>(); params_ptr->descriptor_size = d_yaml["descriptor_size"].as<int>(); diff --git a/src/detectors/brisk/detector_brisk.cpp b/src/detectors/brisk/detector_brisk.cpp index 875bc73..d7bfc3e 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 DET", DetectorBRISK); +VU_REGISTER_DETECTOR("BRISK", 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 e8766f6..dd4317c 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 DET") + if(d_yaml["type"].as<string>() == "BRISK") { params_ptr->thresh = d_yaml["thresh"].as<int>(); params_ptr->octaves = d_yaml["octaves"].as<int>(); diff --git a/src/detectors/detector_base.cpp b/src/detectors/detector_base.cpp index 45801e3..2b6e87e 100644 --- a/src/detectors/detector_base.cpp +++ b/src/detectors/detector_base.cpp @@ -41,7 +41,7 @@ DetectorBasePtr setupDetector(const std::string& _type, const std::string& _uniq #ifdef USING_YAML DetectorBasePtr setupDetector(const std::string& _type, const std::string& _unique_name, const std::string& _filename_dot_yaml) { - ParamsBasePtr params_ptr = ParamsFactory::get().create(_type, _filename_dot_yaml); + ParamsBasePtr params_ptr = ParamsFactory::get().create(_type+" DET", _filename_dot_yaml); return setupDetector(_type, _unique_name, params_ptr); } #endif diff --git a/src/detectors/fast/detector_fast.cpp b/src/detectors/fast/detector_fast.cpp index 380482f..5410bb6 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 DET", DetectorFAST); +VU_REGISTER_DETECTOR("FAST", 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 b84d355..130e717 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 DET") + if(d_yaml["type"].as<string>() == "FAST") { params_ptr->threshold = d_yaml["threshold"].as<int>(); params_ptr->nonmaxSuppression = d_yaml["nonmaxSuppression"].as<bool>(); diff --git a/src/detectors/gftt/detector_gftt.cpp b/src/detectors/gftt/detector_gftt.cpp index 6fdcf07..a00ba7d 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 DET", DetectorGFTT); +VU_REGISTER_DETECTOR("GFTT", 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 7e48ae4..1b09311 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 DET") + if(d_yaml["type"].as<string>() == "GFTT") { params_ptr->maxCorners = d_yaml["maxCorners"].as<int>(); params_ptr->qualityLevel = d_yaml["qualityLevel"].as<double>(); diff --git a/src/detectors/harris/detector_harris.cpp b/src/detectors/harris/detector_harris.cpp index 410189e..7af88f6 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 DET", DetectorHARRIS); +VU_REGISTER_DETECTOR("HARRIS", 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 a819993..4112727 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 DET") + if(d_yaml["type"].as<string>() == "HARRIS") { params_ptr->maxCorners = d_yaml["maxCorners"].as<int>(); params_ptr->qualityLevel = d_yaml["qualityLevel"].as<double>(); diff --git a/src/detectors/kaze/detector_kaze.cpp b/src/detectors/kaze/detector_kaze.cpp index cfbc23a..7154cbb 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 DET", DetectorKAZE); +VU_REGISTER_DETECTOR("KAZE", 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 8fd87c4..b53d642 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 DET") + if(d_yaml["type"].as<string>() == "KAZE") { params_ptr->extended = d_yaml["extended"].as<bool>(); params_ptr->upright = d_yaml["upright"].as<bool>(); diff --git a/src/detectors/mser/detector_mser.cpp b/src/detectors/mser/detector_mser.cpp index 2859f8a..98c0af8 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 DET", DetectorMSER); +VU_REGISTER_DETECTOR("MSER", 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 10642f7..bbe4960 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 DET") + if(d_yaml["type"].as<string>() == "MSER") { params_ptr->delta = d_yaml["delta"].as<int>(); params_ptr->min_area = d_yaml["min_area"].as<int>(); diff --git a/src/detectors/orb/detector_orb.cpp b/src/detectors/orb/detector_orb.cpp index 402dfb5..d30d133 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 DET", DetectorORB); +VU_REGISTER_DETECTOR("ORB", 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 485c9ee..84a5ba3 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 DET") + if(d_yaml["type"].as<string>() == "ORB") { params_ptr->nfeatures = d_yaml["nfeatures"].as<unsigned int>(); params_ptr->scaleFactor = d_yaml["scale factor"].as<float>(); diff --git a/src/detectors/sbd/detector_sbd.cpp b/src/detectors/sbd/detector_sbd.cpp index 5f80fea..8ec56fb 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 DET", DetectorSBD); +VU_REGISTER_DETECTOR("SBD", 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 adcbf8a..c0abc69 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 DET") + if(d_yaml["type"].as<string>() == "SBD") { params_ptr->cv_params.thresholdStep = d_yaml["thresholdStep"].as<float>(); params_ptr->cv_params.minThreshold = d_yaml["minThreshold"].as<float>(); diff --git a/src/detectors/sift/detector_sift.cpp b/src/detectors/sift/detector_sift.cpp index 770ca90..547ece8 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 DET", DetectorSIFT); +VU_REGISTER_DETECTOR("SIFT", 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 dce5b42..9e4f7b1 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 DET") + if(d_yaml["type"].as<string>() == "SIFT") { params_ptr->nfeatures = d_yaml["nfeatures"].as<int>(); params_ptr->nOctaveLayers = d_yaml["nOctaveLayers"].as<int>(); diff --git a/src/detectors/surf/detector_surf.cpp b/src/detectors/surf/detector_surf.cpp index ed7a435..65c5031 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 DET", DetectorSURF); +VU_REGISTER_DETECTOR("SURF", 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 4790706..1cd84e8 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 DET") + if(d_yaml["type"].as<string>() == "SURF") { params_ptr->hessianThreshold = d_yaml["hessianThreshold"].as<double>(); params_ptr->nOctaves = d_yaml["nOctaves"].as<int>(); diff --git a/src/examples/test_descriptor.cpp b/src/examples/test_descriptor.cpp index e169546..6a27f49 100644 --- a/src/examples/test_descriptor.cpp +++ b/src/examples/test_descriptor.cpp @@ -27,7 +27,7 @@ #include "../descriptors/surf/descriptor_surf.h" #include "../descriptors/brisk/descriptor_brisk.h" #include "../descriptors/kaze/descriptor_kaze.h" -//#include "../descriptors/akaze/descriptor_akaze.h" +#include "../descriptors/akaze/descriptor_akaze.h" //#include "../descriptors/latch/descriptor_latch.h" //#include "../descriptors/freak/descriptor_freak.h" //#include "../descriptors/brief/descriptor_brief.h" @@ -48,69 +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 DET"; + std::string def_detector = "ORB"; 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 DET") == 0) + if (det_name.compare("ORB") == 0) det_ptr = std::static_pointer_cast<DetectorORB>(det_ptr); - else if (det_name.compare("FAST DET") == 0) + else if (det_name.compare("FAST") == 0) det_ptr = std::static_pointer_cast<DetectorFAST>(det_ptr); - else if (det_name.compare("SIFT DET") == 0) + else if (det_name.compare("SIFT") == 0) det_ptr = std::static_pointer_cast<DetectorSIFT>(det_ptr); - else if (det_name.compare("SURF DET") == 0) + else if (det_name.compare("SURF") == 0) det_ptr = std::static_pointer_cast<DetectorSURF>(det_ptr); - else if (det_name.compare("BRISK DET") == 0) + else if (det_name.compare("BRISK") == 0) det_ptr = std::static_pointer_cast<DetectorBRISK>(det_ptr); - else if (det_name.compare("MSER DET") == 0) + else if (det_name.compare("MSER") == 0) det_ptr = std::static_pointer_cast<DetectorMSER>(det_ptr); - else if (det_name.compare("GFTT DET") == 0) + else if (det_name.compare("GFTT") == 0) det_ptr = std::static_pointer_cast<DetectorGFTT>(det_ptr); - else if (det_name.compare("HARRIS DET") == 0) + else if (det_name.compare("HARRIS") == 0) det_ptr = std::static_pointer_cast<DetectorHARRIS>(det_ptr); - else if (det_name.compare("SBD DET") == 0) + else if (det_name.compare("SBD") == 0) det_ptr = std::static_pointer_cast<DetectorSBD>(det_ptr); - else if (det_name.compare("KAZE DET") == 0) + else if (det_name.compare("KAZE") == 0) det_ptr = std::static_pointer_cast<DetectorKAZE>(det_ptr); - else if (det_name.compare("AKAZE DET") == 0) + else if (det_name.compare("AKAZE") == 0) det_ptr = std::static_pointer_cast<DetectorAKAZE>(det_ptr); - else if (det_name.compare("AGAST DET") == 0) + else if (det_name.compare("AGAST") == 0) det_ptr = std::static_pointer_cast<DetectorAGAST>(det_ptr); std::cout << "\n================ DESCRIPTOR TEST =================" << std::endl; - std::string def_descriptor = "ORB DES"; + std::string def_descriptor = "ORB"; 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 DES") == 0) + if (des_name.compare("ORB") == 0) des_ptr = std::static_pointer_cast<DescriptorORB>(des_ptr); - else if (des_name.compare("SIFT DES") == 0) + else if (des_name.compare("SIFT") == 0) des_ptr = std::static_pointer_cast<DescriptorSIFT>(des_ptr); - else if (des_name.compare("SURF DES") == 0) + else if (des_name.compare("SURF") == 0) des_ptr = std::static_pointer_cast<DescriptorSURF>(des_ptr); - else if (des_name.compare("BRISK DES") == 0) + else if (des_name.compare("BRISK") == 0) des_ptr = std::static_pointer_cast<DescriptorBRISK>(des_ptr); - else if (des_name.compare("KAZE DES") == 0) + else if (des_name.compare("KAZE") == 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 DES") == 0) + else if (des_name.compare("AKAZE") == 0) + des_ptr = std::static_pointer_cast<DescriptorAKAZE>(des_ptr); +// else if (des_name.compare("LATCH") == 0) // des_ptr = std::static_pointer_cast<DescriptorLATCH>(des_ptr); -// else if (des_name.compare("FREAK DES") == 0) +// else if (des_name.compare("FREAK") == 0) // des_ptr = std::static_pointer_cast<DescriptorFREAK>(des_ptr); -// else if (des_name.compare("BRIEF DES") == 0) +// else if (des_name.compare("BRIEF") == 0) // des_ptr = std::static_pointer_cast<DescriptorBRIEF>(des_ptr); -// else if (des_name.compare("DAISY DES") == 0) +// else if (des_name.compare("DAISY") == 0) // des_ptr = std::static_pointer_cast<DescriptorDAISY>(des_ptr); -// else if (des_name.compare("LUCID DES") == 0) +// else if (des_name.compare("LUCID") == 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 091f28d..517d0ca 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 DET"; + std::string def_detector = "ORB"; 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 DET") == 0) + if (det_name.compare("ORB") == 0) det_ptr = std::static_pointer_cast<DetectorORB>(det_ptr); - else if (det_name.compare("FAST DET") == 0) + else if (det_name.compare("FAST") == 0) det_ptr = std::static_pointer_cast<DetectorFAST>(det_ptr); - else if (det_name.compare("SIFT DET") == 0) + else if (det_name.compare("SIFT") == 0) det_ptr = std::static_pointer_cast<DetectorSIFT>(det_ptr); - else if (det_name.compare("SURF DET") == 0) + else if (det_name.compare("SURF") == 0) det_ptr = std::static_pointer_cast<DetectorSURF>(det_ptr); - else if (det_name.compare("BRISK DET") == 0) + else if (det_name.compare("BRISK") == 0) det_ptr = std::static_pointer_cast<DetectorBRISK>(det_ptr); - else if (det_name.compare("MSER DET") == 0) + else if (det_name.compare("MSER") == 0) det_ptr = std::static_pointer_cast<DetectorMSER>(det_ptr); - else if (det_name.compare("GFTT DET") == 0) + else if (det_name.compare("GFTT") == 0) det_ptr = std::static_pointer_cast<DetectorGFTT>(det_ptr); - else if (det_name.compare("HARRIS DET") == 0) + else if (det_name.compare("HARRIS") == 0) det_ptr = std::static_pointer_cast<DetectorHARRIS>(det_ptr); - else if (det_name.compare("SBD DET") == 0) + else if (det_name.compare("SBD") == 0) det_ptr = std::static_pointer_cast<DetectorSBD>(det_ptr); - else if (det_name.compare("KAZE DET") == 0) + else if (det_name.compare("KAZE") == 0) det_ptr = std::static_pointer_cast<DetectorKAZE>(det_ptr); - else if (det_name.compare("AKAZE DET") == 0) + else if (det_name.compare("AKAZE") == 0) det_ptr = std::static_pointer_cast<DetectorAKAZE>(det_ptr); - else if (det_name.compare("AGAST DET") == 0) + else if (det_name.compare("AGAST") == 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 33a30ad..2ad0f78 100644 --- a/src/examples/test_factories.cpp +++ b/src/examples/test_factories.cpp @@ -22,6 +22,18 @@ int main(void) "There is only one attempt per class, and it is successful!\n" "We do this by registering in the class\'s .cpp file.\n"; + // Root dir path + std::string vu_root = _VU_ROOT_DIR; + + std::string def_sensor = "USB_CAM"; + std::string sen_name = readFromUser(def_sensor); + + std::string file_dot_yaml = "/src/examples/yaml/FAST.yaml"; // Any yaml with sensor configured + + SensorBasePtr sen_b_ptr = setupSensor(sen_name, sen_name + "_test", vu_root + file_dot_yaml); + SensorCameraPtr usb_cam_ptr = std::static_pointer_cast<SensorCamera>(sen_b_ptr); + + return 0; } diff --git a/src/examples/test_sensor.cpp b/src/examples/test_sensor.cpp index f1235ef..e69f5eb 100644 --- a/src/examples/test_sensor.cpp +++ b/src/examples/test_sensor.cpp @@ -21,7 +21,7 @@ int main(void) std::cout << std::endl << "Which SENSOR do you want to test? Type one of the registered names [default: " << def_sensor << "]: "; std::string sen_name = readFromUser(def_sensor); - std::string file_dot_yaml = "/src/examples/yaml/example.yaml"; + std::string file_dot_yaml = "/src/examples/yaml/FAST.yaml"; // Any yaml with sensor configured SensorBasePtr sen_b_ptr = setupSensor(sen_name, sen_name + "_test", vu_root + file_dot_yaml); SensorCameraPtr usb_cam_ptr = std::static_pointer_cast<SensorCamera>(sen_b_ptr); diff --git a/src/examples/yaml/AGAST.yaml b/src/examples/yaml/AGAST.yaml index b9cc9fd..17a7b88 100644 --- a/src/examples/yaml/AGAST.yaml +++ b/src/examples/yaml/AGAST.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "AGAST DET" + type: "AGAST" 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 4f131ae..6dcd4ed 100644 --- a/src/examples/yaml/AKAZE.yaml +++ b/src/examples/yaml/AKAZE.yaml @@ -1,7 +1,18 @@ sensor: type: "USB_CAM" + detector: - type: "AKAZE DET" + type: "AKAZE" + 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 + 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: "AKAZE" 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 4bc3254..fa57fe1 100644 --- a/src/examples/yaml/BRISK.yaml +++ b/src/examples/yaml/BRISK.yaml @@ -2,13 +2,13 @@ sensor: type: "USB_CAM" detector: - type: "BRISK DET" + type: "BRISK" thresh: 30 octaves: 3 patternScale: 1.0 descriptor: - type: "BRISK DES" + type: "BRISK" 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 f27edcc..42f8f70 100644 --- a/src/examples/yaml/FAST.yaml +++ b/src/examples/yaml/FAST.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "FAST DET" + type: "FAST" 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 71bb32f..239fa22 100644 --- a/src/examples/yaml/GFTT.yaml +++ b/src/examples/yaml/GFTT.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "GFTT DET" + type: "GFTT" maxCorners: 1000 qualityLevel: 0.01 minDistance: 1.0 diff --git a/src/examples/yaml/HARRIS.yaml b/src/examples/yaml/HARRIS.yaml index 55f83b6..333ac86 100644 --- a/src/examples/yaml/HARRIS.yaml +++ b/src/examples/yaml/HARRIS.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "HARRIS DET" + type: "HARRIS" maxCorners: 1000 qualityLevel: 0.01 minDistance: 1.0 diff --git a/src/examples/yaml/KAZE.yaml b/src/examples/yaml/KAZE.yaml index 3b4918e..d9c0c8c 100644 --- a/src/examples/yaml/KAZE.yaml +++ b/src/examples/yaml/KAZE.yaml @@ -2,7 +2,7 @@ sensor: type: "USB_CAM" detector: - type: "KAZE DET" + type: "KAZE" extended: false upright: false threshold: 0.001 @@ -11,7 +11,7 @@ detector: diffusivity: 1 # Diffusivity type. DIFF_PM_G1=0, DIFF_PM_G2=1, DIFF_WEICKERT=2, DIFF_CHARBONNIER=3 descriptor: - type: "KAZE DES" + type: "KAZE" extended: false upright: false threshold: 0.001 diff --git a/src/examples/yaml/MSER.yaml b/src/examples/yaml/MSER.yaml index 0940d88..6a9ec2f 100644 --- a/src/examples/yaml/MSER.yaml +++ b/src/examples/yaml/MSER.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "MSER DET" + type: "MSER" delta: 5 min_area: 60 max_area: 14400 diff --git a/src/examples/yaml/ORB.yaml b/src/examples/yaml/ORB.yaml index ac01a46..a024608 100644 --- a/src/examples/yaml/ORB.yaml +++ b/src/examples/yaml/ORB.yaml @@ -2,7 +2,7 @@ sensor: type: "USB_CAM" detector: - type: "ORB DET" + type: "ORB" nfeatures: 100 scale factor: 2 nlevels: 8 @@ -13,7 +13,7 @@ detector: patch size: 15 # 31 descriptor: - type: "ORB DES" + type: "ORB" nfeatures: 100 scale factor: 2 nlevels: 8 diff --git a/src/examples/yaml/SBD.yaml b/src/examples/yaml/SBD.yaml index 2c30027..edfd8a5 100644 --- a/src/examples/yaml/SBD.yaml +++ b/src/examples/yaml/SBD.yaml @@ -1,7 +1,7 @@ sensor: type: "USB_CAM" detector: - type: "SBD DET" + type: "SBD" thresholdStep: 10.0 minThreshold: 50.0 maxThreshold: 220.0 diff --git a/src/examples/yaml/SIFT.yaml b/src/examples/yaml/SIFT.yaml index 739742f..9340432 100644 --- a/src/examples/yaml/SIFT.yaml +++ b/src/examples/yaml/SIFT.yaml @@ -2,7 +2,7 @@ sensor: type: "USB_CAM" detector: - type: "SIFT DET" + type: "SIFT" nfeatures: 0 nOctaveLayers: 3 contrastThreshold: 0.04 @@ -10,7 +10,7 @@ detector: sigma: 1.6 descriptor: - type: "SIFT DES" + type: "SIFT" nfeatures: 0 nOctaveLayers: 3 contrastThreshold: 0.04 diff --git a/src/examples/yaml/SURF.yaml b/src/examples/yaml/SURF.yaml index cb5cbff..69c61fe 100644 --- a/src/examples/yaml/SURF.yaml +++ b/src/examples/yaml/SURF.yaml @@ -2,7 +2,7 @@ sensor: type: "USB_CAM" detector: - type: "SURF DET" + type: "SURF" hessianThreshold: 400 nOctaves: 4 nOctaveLayers: 2 @@ -10,7 +10,7 @@ detector: upright: false descriptor: - type: "SURF DES" + type: "SURF" 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 3211684..235023f 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 b3fd58f..9fa57b2 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